Tracking Code Manager - Version 2.0.10

Version Description

Release Date - 2022-7-12

  • IWP-462 - Update select2 library
  • IWP-464 - Fix encoding of JavaScript operators after sanitization
Download this release

Release Info

Developer data443
Plugin Icon 128x128 Tracking Code Manager
Version 2.0.10
Comparing to
See all releases

Code changes from version 2.0.9 to 2.0.10

Files changed (127) hide show
  1. assets/deps/select2-3.5.2/.gitignore +0 -2
  2. assets/deps/select2-3.5.2/CONTRIBUTING.md +0 -107
  3. assets/deps/select2-3.5.2/LICENSE +0 -18
  4. assets/deps/select2-3.5.2/README.md +0 -114
  5. assets/deps/select2-3.5.2/bower.json +0 -8
  6. assets/deps/select2-3.5.2/component.json +0 -66
  7. assets/deps/select2-3.5.2/package.json +0 -20
  8. assets/deps/select2-3.5.2/select2-bootstrap.css +0 -87
  9. assets/deps/select2-3.5.2/select2-spinner.gif +0 -0
  10. assets/deps/select2-3.5.2/select2.css +0 -704
  11. assets/deps/select2-3.5.2/select2.jquery.json +0 -36
  12. assets/deps/select2-3.5.2/select2.js +0 -3541
  13. assets/deps/select2-3.5.2/select2.min.js +0 -23
  14. assets/deps/select2-3.5.2/select2.png +0 -0
  15. assets/deps/select2-3.5.2/select2_locale_ar.js +0 -19
  16. assets/deps/select2-3.5.2/select2_locale_az.js +0 -20
  17. assets/deps/select2-3.5.2/select2_locale_bg.js +0 -20
  18. assets/deps/select2-3.5.2/select2_locale_ca.js +0 -19
  19. assets/deps/select2-3.5.2/select2_locale_cs.js +0 -51
  20. assets/deps/select2-3.5.2/select2_locale_da.js +0 -19
  21. assets/deps/select2-3.5.2/select2_locale_de.js +0 -18
  22. assets/deps/select2-3.5.2/select2_locale_el.js +0 -19
  23. assets/deps/select2-3.5.2/select2_locale_en.js.template +0 -20
  24. assets/deps/select2-3.5.2/select2_locale_es.js +0 -19
  25. assets/deps/select2-3.5.2/select2_locale_et.js +0 -19
  26. assets/deps/select2-3.5.2/select2_locale_eu.js +0 -45
  27. assets/deps/select2-3.5.2/select2_locale_fa.js +0 -21
  28. assets/deps/select2-3.5.2/select2_locale_fi.js +0 -30
  29. assets/deps/select2-3.5.2/select2_locale_fr.js +0 -18
  30. assets/deps/select2-3.5.2/select2_locale_gl.js +0 -45
  31. assets/deps/select2-3.5.2/select2_locale_he.js +0 -19
  32. assets/deps/select2-3.5.2/select2_locale_hr.js +0 -24
  33. assets/deps/select2-3.5.2/select2_locale_hu.js +0 -17
  34. assets/deps/select2-3.5.2/select2_locale_id.js +0 -19
  35. assets/deps/select2-3.5.2/select2_locale_is.js +0 -17
  36. assets/deps/select2-3.5.2/select2_locale_it.js +0 -17
  37. assets/deps/select2-3.5.2/select2_locale_ja.js +0 -17
  38. assets/deps/select2-3.5.2/select2_locale_ka.js +0 -19
  39. assets/deps/select2-3.5.2/select2_locale_ko.js +0 -19
  40. assets/deps/select2-3.5.2/select2_locale_lt.js +0 -26
  41. assets/deps/select2-3.5.2/select2_locale_lv.js +0 -19
  42. assets/deps/select2-3.5.2/select2_locale_mk.js +0 -19
  43. assets/deps/select2-3.5.2/select2_locale_ms.js +0 -19
  44. assets/deps/select2-3.5.2/select2_locale_nb.js +0 -22
  45. assets/deps/select2-3.5.2/select2_locale_nl.js +0 -17
  46. assets/deps/select2-3.5.2/select2_locale_pl.js +0 -54
  47. assets/deps/select2-3.5.2/select2_locale_pt-BR.js +0 -18
  48. assets/deps/select2-3.5.2/select2_locale_pt-PT.js +0 -17
  49. assets/deps/select2-3.5.2/select2_locale_ro.js +0 -17
  50. assets/deps/select2-3.5.2/select2_locale_rs.js +0 -19
  51. assets/deps/select2-3.5.2/select2_locale_ru.js +0 -23
  52. assets/deps/select2-3.5.2/select2_locale_sk.js +0 -50
  53. assets/deps/select2-3.5.2/select2_locale_sv.js +0 -19
  54. assets/deps/select2-3.5.2/select2_locale_th.js +0 -19
  55. assets/deps/select2-3.5.2/select2_locale_tr.js +0 -19
  56. assets/deps/select2-3.5.2/select2_locale_ug-CN.js +0 -16
  57. assets/deps/select2-3.5.2/select2_locale_uk.js +0 -25
  58. assets/deps/select2-3.5.2/select2_locale_vi.js +0 -20
  59. assets/deps/select2-3.5.2/select2_locale_zh-CN.js +0 -16
  60. assets/deps/select2-3.5.2/select2_locale_zh-TW.js +0 -16
  61. assets/deps/select2-3.5.2/select2x2.png +0 -0
  62. assets/deps/select2-4.0.13/i18n/af.js +3 -0
  63. assets/deps/select2-4.0.13/i18n/ar.js +3 -0
  64. assets/deps/select2-4.0.13/i18n/az.js +3 -0
  65. assets/deps/select2-4.0.13/i18n/bg.js +3 -0
  66. assets/deps/select2-4.0.13/i18n/bn.js +3 -0
  67. assets/deps/select2-4.0.13/i18n/bs.js +3 -0
  68. assets/deps/select2-4.0.13/i18n/ca.js +3 -0
  69. assets/deps/select2-4.0.13/i18n/cs.js +3 -0
  70. assets/deps/select2-4.0.13/i18n/da.js +3 -0
  71. assets/deps/select2-4.0.13/i18n/de.js +3 -0
  72. assets/deps/select2-4.0.13/i18n/dsb.js +3 -0
  73. assets/deps/select2-4.0.13/i18n/el.js +3 -0
  74. assets/deps/select2-4.0.13/i18n/en.js +3 -0
  75. assets/deps/select2-4.0.13/i18n/es.js +3 -0
  76. assets/deps/select2-4.0.13/i18n/et.js +3 -0
  77. assets/deps/select2-4.0.13/i18n/eu.js +3 -0
  78. assets/deps/select2-4.0.13/i18n/fa.js +3 -0
  79. assets/deps/select2-4.0.13/i18n/fi.js +3 -0
  80. assets/deps/select2-4.0.13/i18n/fr.js +3 -0
  81. assets/deps/select2-4.0.13/i18n/gl.js +3 -0
  82. assets/deps/select2-4.0.13/i18n/he.js +3 -0
  83. assets/deps/select2-4.0.13/i18n/hi.js +3 -0
  84. assets/deps/select2-4.0.13/i18n/hr.js +3 -0
  85. assets/deps/select2-4.0.13/i18n/hsb.js +3 -0
  86. assets/deps/select2-4.0.13/i18n/hu.js +3 -0
  87. assets/deps/select2-4.0.13/i18n/hy.js +3 -0
  88. assets/deps/select2-4.0.13/i18n/id.js +3 -0
  89. assets/deps/select2-4.0.13/i18n/is.js +3 -0
  90. assets/deps/select2-4.0.13/i18n/it.js +3 -0
  91. assets/deps/select2-4.0.13/i18n/ja.js +3 -0
  92. assets/deps/select2-4.0.13/i18n/ka.js +3 -0
  93. assets/deps/select2-4.0.13/i18n/km.js +3 -0
  94. assets/deps/select2-4.0.13/i18n/ko.js +3 -0
  95. assets/deps/select2-4.0.13/i18n/lt.js +3 -0
  96. assets/deps/select2-4.0.13/i18n/lv.js +3 -0
  97. assets/deps/select2-4.0.13/i18n/mk.js +3 -0
  98. assets/deps/select2-4.0.13/i18n/ms.js +3 -0
  99. assets/deps/select2-4.0.13/i18n/nb.js +3 -0
  100. assets/deps/select2-4.0.13/i18n/ne.js +3 -0
  101. assets/deps/select2-4.0.13/i18n/nl.js +3 -0
  102. assets/deps/select2-4.0.13/i18n/pl.js +3 -0
  103. assets/deps/select2-4.0.13/i18n/ps.js +3 -0
  104. assets/deps/select2-4.0.13/i18n/pt-BR.js +3 -0
  105. assets/deps/select2-4.0.13/i18n/pt.js +3 -0
  106. assets/deps/select2-4.0.13/i18n/ro.js +3 -0
  107. assets/deps/select2-4.0.13/i18n/ru.js +3 -0
  108. assets/deps/select2-4.0.13/i18n/sk.js +3 -0
  109. assets/deps/select2-4.0.13/i18n/sl.js +3 -0
  110. assets/deps/select2-4.0.13/i18n/sq.js +3 -0
  111. assets/deps/select2-4.0.13/i18n/sr-Cyrl.js +3 -0
  112. assets/deps/select2-4.0.13/i18n/sr.js +3 -0
  113. assets/deps/select2-4.0.13/i18n/sv.js +3 -0
  114. assets/deps/select2-4.0.13/i18n/th.js +3 -0
  115. assets/deps/select2-4.0.13/i18n/tk.js +3 -0
  116. assets/deps/select2-4.0.13/i18n/tr.js +3 -0
  117. assets/deps/select2-4.0.13/i18n/uk.js +3 -0
  118. assets/deps/select2-4.0.13/i18n/vi.js +3 -0
  119. assets/deps/select2-4.0.13/i18n/zh-CN.js +3 -0
  120. assets/deps/select2-4.0.13/i18n/zh-TW.js +3 -0
  121. assets/deps/select2-4.0.13/select2.css +481 -0
  122. assets/deps/select2-4.0.13/select2.full.js +6820 -0
  123. includes/classes/core/Manager.php +10 -2
  124. includes/classes/ui/Tabs.php +2 -2
  125. includes/classes/utils/Options.php +1 -0
  126. index.php +38 -30
  127. readme.txt +7 -1
assets/deps/select2-3.5.2/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- .idea
2
-
 
 
assets/deps/select2-3.5.2/CONTRIBUTING.md DELETED
@@ -1,107 +0,0 @@
1
- Contributing to Select2
2
- =======================
3
- Looking to contribute something to Select2? **Here's how you can help.**
4
-
5
- Please take a moment to review this document in order to make the contribution
6
- process easy and effective for everyone involved.
7
-
8
- Following these guidelines helps to communicate that you respect the time of
9
- the developers managing and developing this open source project. In return,
10
- they should reciprocate that respect in addressing your issue or assessing
11
- patches and features.
12
-
13
- Using the issue tracker
14
- -----------------------
15
- When [reporting bugs][reporting-bugs] or
16
- [requesting features][requesting-features], the
17
- [issue tracker on GitHub][issue-tracker] is the recommended channel to use.
18
-
19
- The issue tracker **is not** a place for support requests. The
20
- [mailing list][mailing-list] or [IRC channel][irc-channel] are better places to
21
- get help.
22
-
23
- Reporting bugs with Select2
24
- ---------------------------
25
- We really appreciate clear bug reports that _consistently_ show an issue
26
- _within Select2_.
27
-
28
- The ideal bug report follows these guidelines:
29
-
30
- 1. **Use the [GitHub issue search][issue-search]** — Check if the issue
31
- has already been reported.
32
- 2. **Check if the issue has been fixed** — Try to reproduce the problem
33
- using the code in the `master` branch.
34
- 3. **Isolate the problem** — Try to create an
35
- [isolated test case][isolated-case] that consistently reproduces the problem.
36
-
37
- Please try to be as detailed as possible in your bug report, especially if an
38
- isolated test case cannot be made. Some useful questions to include the answer
39
- to are:
40
-
41
- - What steps can be used to reproduce the issue?
42
- - What is the bug and what is the expected outcome?
43
- - What browser(s) and Operating System have you tested with?
44
- - Does the bug happen consistently across all tested browsers?
45
- - What version of jQuery are you using? And what version of Select2?
46
- - Are you using Select2 with other plugins?
47
-
48
- All of these questions will help people fix and identify any potential bugs.
49
-
50
- Requesting features in Select2
51
- ------------------------------
52
- Select2 is a large library that carries with it a lot of functionality. Because
53
- of this, many feature requests will not be implemented in the core library.
54
-
55
- Before starting work on a major feature for Select2, **contact the
56
- [community][community] first** or you may risk spending a considerable amount of
57
- time on something which the project developers are not interested in bringing
58
- into the project.
59
-
60
- ### Select2 4.0
61
-
62
- Many feature requests will be closed off until 4.0, where Select2 plans to adopt
63
- a more flexible API. If you are interested in helping with the development of
64
- the next major Select2 release, please send a message to the
65
- [mailing list][mailing-list] or [irc channel][irc-channel] for more information.
66
-
67
- Triaging issues and pull requests
68
- ---------------------------------
69
- Anyone can help the project maintainers triage issues and review pull requests.
70
-
71
- ### Handling new issues
72
-
73
- Select2 regularly receives new issues which need to be tested and organized.
74
-
75
- When a new issue that comes in that is similar to another existing issue, it
76
- should be checked to make sure it is not a duplicate. Duplicates issues should
77
- be marked by replying to the issue with "Duplicate of #[issue number]" where
78
- `[issue number]` is the url or issue number for the existing issue. This will
79
- allow the project maintainers to quickly close off additional issues and keep
80
- the discussion focused within a single issue.
81
-
82
- If you can test issues that are reported to Select2 that contain test cases and
83
- confirm under what conditions bugs happen, that will allow others to identify
84
- what causes a bug quicker.
85
-
86
- ### Reviewing pull requests
87
-
88
- It is very common for pull requests to be opened for issues that contain a clear
89
- solution to the problem. These pull requests should be rigorously reviewed by
90
- the community before being accepted. If you are not sure about a piece of
91
- submitted code, or know of a better way to do something, do not hesitate to make
92
- a comment on the pull request.
93
-
94
- It should also be made clear that **all code contributed to Select** must be
95
- licensable under the [Apache 2 or GPL 2 licenses][licensing]. Code that cannot
96
- be released under either of these licenses **cannot be accepted** into the
97
- project.
98
-
99
- [community]: https://github.com/ivaynberg/select2#community
100
- [reporting-bugs]: #reporting-bugs-with-select2
101
- [requesting-features]: #requesting-features-in-select2
102
- [issue-tracker]: https://github.com/ivaynberg/select2/issues
103
- [mailing-list]: https://github.com/ivaynberg/select2#mailing-list
104
- [irc-channel]: https://github.com/ivaynberg/select2#irc-channel
105
- [issue-search]: https://github.com/ivaynberg/select2/search?q=&type=Issues
106
- [isolated-case]: http://css-tricks.com/6263-reduced-test-cases/
107
- [licensing]: https://github.com/ivaynberg/select2#copyright-and-license
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/LICENSE DELETED
@@ -1,18 +0,0 @@
1
- Copyright 2014 Igor Vaynberg
2
-
3
- Version: @@ver@@ Timestamp: @@timestamp@@
4
-
5
- This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
6
- General Public License version 2 (the "GPL License"). You may choose either license to govern your
7
- use of this software only upon the condition that you accept all of the terms of either the Apache
8
- License or the GPL License.
9
-
10
- You may obtain a copy of the Apache License and the GPL License at:
11
-
12
- http://www.apache.org/licenses/LICENSE-2.0
13
- http://www.gnu.org/licenses/gpl-2.0.html
14
-
15
- Unless required by applicable law or agreed to in writing, software distributed under the Apache License
16
- or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17
- either express or implied. See the Apache License and the GPL License for the specific language governing
18
- permissions and limitations under the Apache License and the GPL License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/README.md DELETED
@@ -1,114 +0,0 @@
1
- Select2
2
- =======
3
-
4
- Select2 is a jQuery-based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
5
-
6
- To get started, checkout examples and documentation at http://ivaynberg.github.com/select2
7
-
8
- Use cases
9
- ---------
10
-
11
- * Enhancing native selects with search.
12
- * Enhancing native selects with a better multi-select interface.
13
- * Loading data from JavaScript: easily load items via ajax and have them searchable.
14
- * Nesting optgroups: native selects only support one level of nested. Select2 does not have this restriction.
15
- * Tagging: ability to add new items on the fly.
16
- * Working with large, remote datasets: ability to partially load a dataset based on the search term.
17
- * Paging of large datasets: easy support for loading more pages when the results are scrolled to the end.
18
- * Templating: support for custom rendering of results and selections.
19
-
20
- Browser compatibility
21
- ---------------------
22
- * IE 8+
23
- * Chrome 8+
24
- * Firefox 10+
25
- * Safari 3+
26
- * Opera 10.6+
27
-
28
- Usage
29
- -----
30
- You can source Select2 directly from a CDN like [JSDliver](http://www.jsdelivr.com/#!select2) or [CDNJS](http://www.cdnjs.com/libraries/select2), [download it from this GitHub repo](https://github.com/ivaynberg/select2/tags), or use one of the integrations below.
31
-
32
- Integrations
33
- ------------
34
-
35
- * [Wicket-Select2](https://github.com/ivaynberg/wicket-select2) (Java / [Apache Wicket](http://wicket.apache.org))
36
- * [select2-rails](https://github.com/argerim/select2-rails) (Ruby on Rails)
37
- * [AngularUI](http://angular-ui.github.io/#ui-select) ([AngularJS](https://angularjs.org/))
38
- * [Django](https://github.com/applegrew/django-select2)
39
- * [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
40
- * [Symfony2](https://github.com/avocode/FormExtensions)
41
- * [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins)
42
- * [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/))
43
- * [Meteor](https://jquery-select2.meteor.com)
44
- * [Yii 2.x](http://demos.krajee.com/widgets#select2)
45
- * [Yii 1.x](https://github.com/tonybolzan/yii-select2)
46
- * [AtmosphereJS](https://atmospherejs.com/package/jquery-select2)
47
-
48
- ### Example Integrations
49
-
50
- * [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration)
51
- * [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration)
52
- * [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example)
53
- * [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example)
54
-
55
- Internationalization (i18n)
56
- ---------------------------
57
-
58
- Select2 supports multiple languages by simply including the right language JS
59
- file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
60
-
61
- Missing a language? Just copy `select2_locale_en.js.template`, translate
62
- it, and make a pull request back to Select2 here on GitHub.
63
-
64
- Documentation
65
- -------------
66
-
67
- The documentation for Select2 is available [through GitHub Pages](https://ivaynberg.github.io/select2/) and is located within this repository in the [`gh-pages` branch](https://github.com/ivaynberg/select2/tree/gh-pages).
68
-
69
- Community
70
- ---------
71
-
72
- ### Bug tracker
73
-
74
- Have a bug? Please create an issue here on GitHub!
75
-
76
- https://github.com/ivaynberg/select2/issues
77
-
78
- ### Mailing list
79
-
80
- Have a question? Ask on our mailing list!
81
-
82
- select2@googlegroups.com
83
-
84
- https://groups.google.com/d/forum/select2
85
-
86
- ### IRC channel
87
-
88
- Need help implementing Select2 in your project? Ask in our IRC channel!
89
-
90
- **Network:** [Freenode](https://freenode.net/) (`chat.freenode.net`)
91
-
92
- **Channel:** `#select2`
93
-
94
- **Web access:** https://webchat.freenode.net/?channels=select2
95
-
96
- Copyright and license
97
- ---------------------
98
-
99
- Copyright 2012 Igor Vaynberg
100
-
101
- This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
102
- General Public License version 2 (the "GPL License"). You may choose either license to govern your
103
- use of this software only upon the condition that you accept all of the terms of either the Apache
104
- License or the GPL License.
105
-
106
- You may obtain a copy of the Apache License and the GPL License in the LICENSE file, or at:
107
-
108
- http://www.apache.org/licenses/LICENSE-2.0
109
- http://www.gnu.org/licenses/gpl-2.0.html
110
-
111
- Unless required by applicable law or agreed to in writing, software distributed under the Apache License
112
- or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
113
- either express or implied. See the Apache License and the GPL License for the specific language governing
114
- permissions and limitations under the Apache License and the GPL License.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/bower.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "name": "select2",
3
- "version": "3.5.2",
4
- "main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
5
- "dependencies": {
6
- "jquery": ">= 1.7.1"
7
- }
8
- }
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/component.json DELETED
@@ -1,66 +0,0 @@
1
- {
2
- "name": "select2",
3
- "repo": "ivaynberg/select2",
4
- "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
5
- "version": "3.5.2",
6
- "demo": "http://ivaynberg.github.io/select2/",
7
- "keywords": [
8
- "jquery"
9
- ],
10
- "main": "select2.js",
11
- "styles": [
12
- "select2.css",
13
- "select2-bootstrap.css"
14
- ],
15
- "scripts": [
16
- "select2.js",
17
- "select2_locale_ar.js",
18
- "select2_locale_bg.js",
19
- "select2_locale_ca.js",
20
- "select2_locale_cs.js",
21
- "select2_locale_da.js",
22
- "select2_locale_de.js",
23
- "select2_locale_el.js",
24
- "select2_locale_es.js",
25
- "select2_locale_et.js",
26
- "select2_locale_eu.js",
27
- "select2_locale_fa.js",
28
- "select2_locale_fi.js",
29
- "select2_locale_fr.js",
30
- "select2_locale_gl.js",
31
- "select2_locale_he.js",
32
- "select2_locale_hr.js",
33
- "select2_locale_hu.js",
34
- "select2_locale_id.js",
35
- "select2_locale_is.js",
36
- "select2_locale_it.js",
37
- "select2_locale_ja.js",
38
- "select2_locale_ka.js",
39
- "select2_locale_ko.js",
40
- "select2_locale_lt.js",
41
- "select2_locale_lv.js",
42
- "select2_locale_mk.js",
43
- "select2_locale_ms.js",
44
- "select2_locale_nl.js",
45
- "select2_locale_no.js",
46
- "select2_locale_pl.js",
47
- "select2_locale_pt-BR.js",
48
- "select2_locale_pt-PT.js",
49
- "select2_locale_ro.js",
50
- "select2_locale_ru.js",
51
- "select2_locale_sk.js",
52
- "select2_locale_sv.js",
53
- "select2_locale_th.js",
54
- "select2_locale_tr.js",
55
- "select2_locale_uk.js",
56
- "select2_locale_vi.js",
57
- "select2_locale_zh-CN.js",
58
- "select2_locale_zh-TW.js"
59
- ],
60
- "images": [
61
- "select2-spinner.gif",
62
- "select2.png",
63
- "select2x2.png"
64
- ],
65
- "license": "MIT"
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/package.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "name" : "Select2",
3
- "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
4
- "homepage": "http://ivaynberg.github.io/select2",
5
- "author": "Igor Vaynberg",
6
- "repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"},
7
- "main": "select2.js",
8
- "version": "3.5.2",
9
- "jspm": {
10
- "main": "select2",
11
- "files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"],
12
- "shim": {
13
- "select2": {
14
- "imports": ["jquery", "./select2.css!"],
15
- "exports": "$"
16
- }
17
- },
18
- "buildConfig": { "uglify": true }
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2-bootstrap.css DELETED
@@ -1,87 +0,0 @@
1
- .form-control .select2-choice {
2
- border: 0;
3
- border-radius: 2px;
4
- }
5
-
6
- .form-control .select2-choice .select2-arrow {
7
- border-radius: 0 2px 2px 0;
8
- }
9
-
10
- .form-control.select2-container {
11
- height: auto !important;
12
- padding: 0;
13
- }
14
-
15
- .form-control.select2-container.select2-dropdown-open {
16
- border-color: #5897FB;
17
- border-radius: 3px 3px 0 0;
18
- }
19
-
20
- .form-control .select2-container.select2-dropdown-open .select2-choices {
21
- border-radius: 3px 3px 0 0;
22
- }
23
-
24
- .form-control.select2-container .select2-choices {
25
- border: 0 !important;
26
- border-radius: 3px;
27
- }
28
-
29
- .control-group.warning .select2-container .select2-choice,
30
- .control-group.warning .select2-container .select2-choices,
31
- .control-group.warning .select2-container-active .select2-choice,
32
- .control-group.warning .select2-container-active .select2-choices,
33
- .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
34
- .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
35
- .control-group.warning .select2-container-multi.select2-container-active .select2-choices {
36
- border: 1px solid #C09853 !important;
37
- }
38
-
39
- .control-group.warning .select2-container .select2-choice div {
40
- border-left: 1px solid #C09853 !important;
41
- background: #FCF8E3 !important;
42
- }
43
-
44
- .control-group.error .select2-container .select2-choice,
45
- .control-group.error .select2-container .select2-choices,
46
- .control-group.error .select2-container-active .select2-choice,
47
- .control-group.error .select2-container-active .select2-choices,
48
- .control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
49
- .control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
50
- .control-group.error .select2-container-multi.select2-container-active .select2-choices {
51
- border: 1px solid #B94A48 !important;
52
- }
53
-
54
- .control-group.error .select2-container .select2-choice div {
55
- border-left: 1px solid #B94A48 !important;
56
- background: #F2DEDE !important;
57
- }
58
-
59
- .control-group.info .select2-container .select2-choice,
60
- .control-group.info .select2-container .select2-choices,
61
- .control-group.info .select2-container-active .select2-choice,
62
- .control-group.info .select2-container-active .select2-choices,
63
- .control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
64
- .control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
65
- .control-group.info .select2-container-multi.select2-container-active .select2-choices {
66
- border: 1px solid #3A87AD !important;
67
- }
68
-
69
- .control-group.info .select2-container .select2-choice div {
70
- border-left: 1px solid #3A87AD !important;
71
- background: #D9EDF7 !important;
72
- }
73
-
74
- .control-group.success .select2-container .select2-choice,
75
- .control-group.success .select2-container .select2-choices,
76
- .control-group.success .select2-container-active .select2-choice,
77
- .control-group.success .select2-container-active .select2-choices,
78
- .control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
79
- .control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
80
- .control-group.success .select2-container-multi.select2-container-active .select2-choices {
81
- border: 1px solid #468847 !important;
82
- }
83
-
84
- .control-group.success .select2-container .select2-choice div {
85
- border-left: 1px solid #468847 !important;
86
- background: #DFF0D8 !important;
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2-spinner.gif DELETED
Binary file
assets/deps/select2-3.5.2/select2.css DELETED
@@ -1,704 +0,0 @@
1
- /*
2
- Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
3
- */
4
- .select2-container {
5
- margin: 0;
6
- position: relative;
7
- display: inline-block;
8
- /* inline-block for ie7 */
9
- zoom: 1;
10
- *display: inline;
11
- vertical-align: middle;
12
- }
13
-
14
- .select2-container,
15
- .select2-drop,
16
- .select2-search,
17
- .select2-search input {
18
- /*
19
- Force border-box so that % widths fit the parent
20
- container without overlap because of margin/padding.
21
- More Info : http://www.quirksmode.org/css/box.html
22
- */
23
- -webkit-box-sizing: border-box; /* webkit */
24
- -moz-box-sizing: border-box; /* firefox */
25
- box-sizing: border-box; /* css3 */
26
- }
27
-
28
- .select2-container .select2-choice {
29
- display: block;
30
- height: 26px;
31
- padding: 0 0 0 8px;
32
- overflow: hidden;
33
- position: relative;
34
-
35
- border: 1px solid #aaa;
36
- white-space: nowrap;
37
- line-height: 26px;
38
- color: #444;
39
- text-decoration: none;
40
-
41
- border-radius: 4px;
42
-
43
- background-clip: padding-box;
44
-
45
- -webkit-touch-callout: none;
46
- -webkit-user-select: none;
47
- -moz-user-select: none;
48
- -ms-user-select: none;
49
- user-select: none;
50
-
51
- background-color: #fff;
52
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
53
- background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
54
- background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
55
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
56
- background-image: linear-gradient(to top, #eee 0%, #fff 50%);
57
- }
58
-
59
- html[dir="rtl"] .select2-container .select2-choice {
60
- padding: 0 8px 0 0;
61
- }
62
-
63
- .select2-container.select2-drop-above .select2-choice {
64
- border-bottom-color: #aaa;
65
-
66
- border-radius: 0 0 4px 4px;
67
-
68
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
69
- background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
70
- background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
71
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
72
- background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
73
- }
74
-
75
- .select2-container.select2-allowclear .select2-choice .select2-chosen {
76
- margin-right: 42px;
77
- }
78
-
79
- .select2-container .select2-choice > .select2-chosen {
80
- margin-right: 26px;
81
- display: block;
82
- overflow: hidden;
83
-
84
- white-space: nowrap;
85
-
86
- text-overflow: ellipsis;
87
- float: none;
88
- width: auto;
89
- }
90
-
91
- html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
92
- margin-left: 26px;
93
- margin-right: 0;
94
- }
95
-
96
- .select2-container .select2-choice abbr {
97
- display: none;
98
- width: 12px;
99
- height: 12px;
100
- position: absolute;
101
- right: 24px;
102
- top: 8px;
103
-
104
- font-size: 1px;
105
- text-decoration: none;
106
-
107
- border: 0;
108
- background: url('select2.png') right top no-repeat;
109
- cursor: pointer;
110
- outline: 0;
111
- }
112
-
113
- .select2-container.select2-allowclear .select2-choice abbr {
114
- display: inline-block;
115
- }
116
-
117
- .select2-container .select2-choice abbr:hover {
118
- background-position: right -11px;
119
- cursor: pointer;
120
- }
121
-
122
- .select2-drop-mask {
123
- border: 0;
124
- margin: 0;
125
- padding: 0;
126
- position: fixed;
127
- left: 0;
128
- top: 0;
129
- min-height: 100%;
130
- min-width: 100%;
131
- height: auto;
132
- width: auto;
133
- opacity: 0;
134
- z-index: 9998;
135
- /* styles required for IE to work */
136
- background-color: #fff;
137
- filter: alpha(opacity=0);
138
- }
139
-
140
- .select2-drop {
141
- width: 100%;
142
- margin-top: -1px;
143
- position: absolute;
144
- z-index: 9999;
145
- top: 100%;
146
-
147
- background: #fff;
148
- color: #000;
149
- border: 1px solid #aaa;
150
- border-top: 0;
151
-
152
- border-radius: 0 0 4px 4px;
153
-
154
- -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
155
- box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
156
- }
157
-
158
- .select2-drop.select2-drop-above {
159
- margin-top: 1px;
160
- border-top: 1px solid #aaa;
161
- border-bottom: 0;
162
-
163
- border-radius: 4px 4px 0 0;
164
-
165
- -webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
166
- box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
167
- }
168
-
169
- .select2-drop-active {
170
- border: 1px solid #5897fb;
171
- border-top: none;
172
- }
173
-
174
- .select2-drop.select2-drop-above.select2-drop-active {
175
- border-top: 1px solid #5897fb;
176
- }
177
-
178
- .select2-drop-auto-width {
179
- border-top: 1px solid #aaa;
180
- width: auto;
181
- }
182
-
183
- .select2-drop-auto-width .select2-search {
184
- padding-top: 4px;
185
- }
186
-
187
- .select2-container .select2-choice .select2-arrow {
188
- display: inline-block;
189
- width: 18px;
190
- height: 100%;
191
- position: absolute;
192
- right: 0;
193
- top: 0;
194
-
195
- border-left: 1px solid #aaa;
196
- border-radius: 0 4px 4px 0;
197
-
198
- background-clip: padding-box;
199
-
200
- background: #ccc;
201
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
202
- background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
203
- background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
204
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc', GradientType = 0);
205
- background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
206
- }
207
-
208
- html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
209
- left: 0;
210
- right: auto;
211
-
212
- border-left: none;
213
- border-right: 1px solid #aaa;
214
- border-radius: 4px 0 0 4px;
215
- }
216
-
217
- .select2-container .select2-choice .select2-arrow b {
218
- display: block;
219
- width: 100%;
220
- height: 100%;
221
- background: url('select2.png') no-repeat 0 1px;
222
- }
223
-
224
- html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
225
- background-position: 2px 1px;
226
- }
227
-
228
- .select2-search {
229
- display: inline-block;
230
- width: 100%;
231
- min-height: 26px;
232
- margin: 0;
233
- padding-left: 4px;
234
- padding-right: 4px;
235
-
236
- position: relative;
237
- z-index: 10000;
238
-
239
- white-space: nowrap;
240
- }
241
-
242
- .select2-search input {
243
- width: 100%;
244
- height: auto !important;
245
- min-height: 26px;
246
- padding: 4px 20px 4px 5px;
247
- margin: 0;
248
-
249
- outline: 0;
250
- font-family: sans-serif;
251
- font-size: 1em;
252
-
253
- border: 1px solid #aaa;
254
- border-radius: 0;
255
-
256
- -webkit-box-shadow: none;
257
- box-shadow: none;
258
-
259
- background: #fff url('select2.png') no-repeat 100% -22px;
260
- background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
261
- background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
262
- background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
263
- background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
264
- }
265
-
266
- html[dir="rtl"] .select2-search input {
267
- padding: 4px 5px 4px 20px;
268
-
269
- background: #fff url('select2.png') no-repeat -37px -22px;
270
- background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
271
- background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
272
- background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
273
- background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
274
- }
275
-
276
- .select2-drop.select2-drop-above .select2-search input {
277
- margin-top: 4px;
278
- }
279
-
280
- .select2-search input.select2-active {
281
- background: #fff url('select2-spinner.gif') no-repeat 100%;
282
- background: url('select2-spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
283
- background: url('select2-spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
284
- background: url('select2-spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
285
- background: url('select2-spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
286
- }
287
-
288
- .select2-container-active .select2-choice,
289
- .select2-container-active .select2-choices {
290
- border: 1px solid #5897fb;
291
- outline: none;
292
-
293
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
294
- box-shadow: 0 0 5px rgba(0, 0, 0, .3);
295
- }
296
-
297
- .select2-dropdown-open .select2-choice {
298
- border-bottom-color: transparent;
299
- -webkit-box-shadow: 0 1px 0 #fff inset;
300
- box-shadow: 0 1px 0 #fff inset;
301
-
302
- border-bottom-left-radius: 0;
303
- border-bottom-right-radius: 0;
304
-
305
- background-color: #eee;
306
- background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #fff), color-stop(0.5, #eee));
307
- background-image: -webkit-linear-gradient(center bottom, #fff 0%, #eee 50%);
308
- background-image: -moz-linear-gradient(center bottom, #fff 0%, #eee 50%);
309
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
310
- background-image: linear-gradient(to top, #fff 0%, #eee 50%);
311
- }
312
-
313
- .select2-dropdown-open.select2-drop-above .select2-choice,
314
- .select2-dropdown-open.select2-drop-above .select2-choices {
315
- border: 1px solid #5897fb;
316
- border-top-color: transparent;
317
-
318
- background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(0.5, #eee));
319
- background-image: -webkit-linear-gradient(center top, #fff 0%, #eee 50%);
320
- background-image: -moz-linear-gradient(center top, #fff 0%, #eee 50%);
321
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
322
- background-image: linear-gradient(to bottom, #fff 0%, #eee 50%);
323
- }
324
-
325
- .select2-dropdown-open .select2-choice .select2-arrow {
326
- background: transparent;
327
- border-left: none;
328
- filter: none;
329
- }
330
- html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
331
- border-right: none;
332
- }
333
-
334
- .select2-dropdown-open .select2-choice .select2-arrow b {
335
- background-position: -18px 1px;
336
- }
337
-
338
- html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
339
- background-position: -16px 1px;
340
- }
341
-
342
- .select2-hidden-accessible {
343
- border: 0;
344
- clip: rect(0 0 0 0);
345
- height: 1px;
346
- margin: -1px;
347
- overflow: hidden;
348
- padding: 0;
349
- position: absolute;
350
- width: 1px;
351
- }
352
-
353
- /* results */
354
- .select2-results {
355
- max-height: 200px;
356
- padding: 0 0 0 4px;
357
- margin: 4px 4px 4px 0;
358
- position: relative;
359
- overflow-x: hidden;
360
- overflow-y: auto;
361
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
362
- }
363
-
364
- html[dir="rtl"] .select2-results {
365
- padding: 0 4px 0 0;
366
- margin: 4px 0 4px 4px;
367
- }
368
-
369
- .select2-results ul.select2-result-sub {
370
- margin: 0;
371
- padding-left: 0;
372
- }
373
-
374
- .select2-results li {
375
- list-style: none;
376
- display: list-item;
377
- background-image: none;
378
- }
379
-
380
- .select2-results li.select2-result-with-children > .select2-result-label {
381
- font-weight: bold;
382
- }
383
-
384
- .select2-results .select2-result-label {
385
- padding: 3px 7px 4px;
386
- margin: 0;
387
- cursor: pointer;
388
-
389
- min-height: 1em;
390
-
391
- -webkit-touch-callout: none;
392
- -webkit-user-select: none;
393
- -moz-user-select: none;
394
- -ms-user-select: none;
395
- user-select: none;
396
- }
397
-
398
- .select2-results-dept-1 .select2-result-label { padding-left: 20px }
399
- .select2-results-dept-2 .select2-result-label { padding-left: 40px }
400
- .select2-results-dept-3 .select2-result-label { padding-left: 60px }
401
- .select2-results-dept-4 .select2-result-label { padding-left: 80px }
402
- .select2-results-dept-5 .select2-result-label { padding-left: 100px }
403
- .select2-results-dept-6 .select2-result-label { padding-left: 110px }
404
- .select2-results-dept-7 .select2-result-label { padding-left: 120px }
405
-
406
- .select2-results .select2-highlighted {
407
- background: #3875d7;
408
- color: #fff;
409
- }
410
-
411
- .select2-results li em {
412
- background: #feffde;
413
- font-style: normal;
414
- }
415
-
416
- .select2-results .select2-highlighted em {
417
- background: transparent;
418
- }
419
-
420
- .select2-results .select2-highlighted ul {
421
- background: #fff;
422
- color: #000;
423
- }
424
-
425
- .select2-results .select2-no-results,
426
- .select2-results .select2-searching,
427
- .select2-results .select2-ajax-error,
428
- .select2-results .select2-selection-limit {
429
- background: #f4f4f4;
430
- display: list-item;
431
- padding-left: 5px;
432
- }
433
-
434
- /*
435
- disabled look for disabled choices in the results dropdown
436
- */
437
- .select2-results .select2-disabled.select2-highlighted {
438
- color: #666;
439
- background: #f4f4f4;
440
- display: list-item;
441
- cursor: default;
442
- }
443
- .select2-results .select2-disabled {
444
- background: #f4f4f4;
445
- display: list-item;
446
- cursor: default;
447
- }
448
-
449
- .select2-results .select2-selected {
450
- display: none;
451
- }
452
-
453
- .select2-more-results.select2-active {
454
- background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
455
- }
456
-
457
- .select2-results .select2-ajax-error {
458
- background: rgba(255, 50, 50, .2);
459
- }
460
-
461
- .select2-more-results {
462
- background: #f4f4f4;
463
- display: list-item;
464
- }
465
-
466
- /* disabled styles */
467
-
468
- .select2-container.select2-container-disabled .select2-choice {
469
- background-color: #f4f4f4;
470
- background-image: none;
471
- border: 1px solid #ddd;
472
- cursor: default;
473
- }
474
-
475
- .select2-container.select2-container-disabled .select2-choice .select2-arrow {
476
- background-color: #f4f4f4;
477
- background-image: none;
478
- border-left: 0;
479
- }
480
-
481
- .select2-container.select2-container-disabled .select2-choice abbr {
482
- display: none;
483
- }
484
-
485
-
486
- /* multiselect */
487
-
488
- .select2-container-multi .select2-choices {
489
- height: auto !important;
490
- height: 1%;
491
- margin: 0;
492
- padding: 0 5px 0 0;
493
- position: relative;
494
-
495
- border: 1px solid #aaa;
496
- cursor: text;
497
- overflow: hidden;
498
-
499
- background-color: #fff;
500
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eee), color-stop(15%, #fff));
501
- background-image: -webkit-linear-gradient(top, #eee 1%, #fff 15%);
502
- background-image: -moz-linear-gradient(top, #eee 1%, #fff 15%);
503
- background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
504
- }
505
-
506
- html[dir="rtl"] .select2-container-multi .select2-choices {
507
- padding: 0 0 0 5px;
508
- }
509
-
510
- .select2-locked {
511
- padding: 3px 5px 3px 5px !important;
512
- }
513
-
514
- .select2-container-multi .select2-choices {
515
- min-height: 26px;
516
- }
517
-
518
- .select2-container-multi.select2-container-active .select2-choices {
519
- border: 1px solid #5897fb;
520
- outline: none;
521
-
522
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
523
- box-shadow: 0 0 5px rgba(0, 0, 0, .3);
524
- }
525
- .select2-container-multi .select2-choices li {
526
- float: left;
527
- list-style: none;
528
- }
529
- html[dir="rtl"] .select2-container-multi .select2-choices li
530
- {
531
- float: right;
532
- }
533
- .select2-container-multi .select2-choices .select2-search-field {
534
- margin: 0;
535
- padding: 0;
536
- white-space: nowrap;
537
- }
538
-
539
- .select2-container-multi .select2-choices .select2-search-field input {
540
- padding: 5px;
541
- margin: 1px 0;
542
-
543
- font-family: sans-serif;
544
- font-size: 100%;
545
- color: #666;
546
- outline: 0;
547
- border: 0;
548
- -webkit-box-shadow: none;
549
- box-shadow: none;
550
- background: transparent !important;
551
- }
552
-
553
- .select2-container-multi .select2-choices .select2-search-field input.select2-active {
554
- background: #fff url('select2-spinner.gif') no-repeat 100% !important;
555
- }
556
-
557
- .select2-default {
558
- color: #999 !important;
559
- }
560
-
561
- .select2-container-multi .select2-choices .select2-search-choice {
562
- padding: 3px 5px 3px 18px;
563
- margin: 3px 0 3px 5px;
564
- position: relative;
565
-
566
- line-height: 13px;
567
- color: #333;
568
- cursor: default;
569
- border: 1px solid #aaaaaa;
570
-
571
- border-radius: 3px;
572
-
573
- -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
574
- box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
575
-
576
- background-clip: padding-box;
577
-
578
- -webkit-touch-callout: none;
579
- -webkit-user-select: none;
580
- -moz-user-select: none;
581
- -ms-user-select: none;
582
- user-select: none;
583
-
584
- background-color: #e4e4e4;
585
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#f4f4f4', GradientType=0);
586
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
587
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
588
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
589
- background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
590
- }
591
- html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
592
- {
593
- margin: 3px 5px 3px 0;
594
- padding: 3px 18px 3px 5px;
595
- }
596
- .select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
597
- cursor: default;
598
- }
599
- .select2-container-multi .select2-choices .select2-search-choice-focus {
600
- background: #d4d4d4;
601
- }
602
-
603
- .select2-search-choice-close {
604
- display: block;
605
- width: 12px;
606
- height: 13px;
607
- position: absolute;
608
- right: 3px;
609
- top: 4px;
610
-
611
- font-size: 1px;
612
- outline: none;
613
- background: url('select2.png') right top no-repeat;
614
- }
615
- html[dir="rtl"] .select2-search-choice-close {
616
- right: auto;
617
- left: 3px;
618
- }
619
-
620
- .select2-container-multi .select2-search-choice-close {
621
- left: 3px;
622
- }
623
-
624
- html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
625
- left: auto;
626
- right: 2px;
627
- }
628
-
629
- .select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
630
- background-position: right -11px;
631
- }
632
- .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
633
- background-position: right -11px;
634
- }
635
-
636
- /* disabled styles */
637
- .select2-container-multi.select2-container-disabled .select2-choices {
638
- background-color: #f4f4f4;
639
- background-image: none;
640
- border: 1px solid #ddd;
641
- cursor: default;
642
- }
643
-
644
- .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
645
- padding: 3px 5px 3px 5px;
646
- border: 1px solid #ddd;
647
- background-image: none;
648
- background-color: #f4f4f4;
649
- }
650
-
651
- .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close { display: none;
652
- background: none;
653
- }
654
- /* end multiselect */
655
-
656
-
657
- .select2-result-selectable .select2-match,
658
- .select2-result-unselectable .select2-match {
659
- text-decoration: underline;
660
- }
661
-
662
- .select2-offscreen, .select2-offscreen:focus {
663
- clip: rect(0 0 0 0) !important;
664
- width: 1px !important;
665
- height: 1px !important;
666
- border: 0 !important;
667
- margin: 0 !important;
668
- padding: 0 !important;
669
- overflow: hidden !important;
670
- position: absolute !important;
671
- outline: 0 !important;
672
- left: 0px !important;
673
- top: 0px !important;
674
- }
675
-
676
- .select2-display-none {
677
- display: none;
678
- }
679
-
680
- .select2-measure-scrollbar {
681
- position: absolute;
682
- top: -10000px;
683
- left: -10000px;
684
- width: 100px;
685
- height: 100px;
686
- overflow: scroll;
687
- }
688
-
689
- /* Retina-ize icons */
690
-
691
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 2dppx) {
692
- .select2-search input,
693
- .select2-search-choice-close,
694
- .select2-container .select2-choice abbr,
695
- .select2-container .select2-choice .select2-arrow b {
696
- background-image: url('select2x2.png') !important;
697
- background-repeat: no-repeat !important;
698
- background-size: 60px 40px !important;
699
- }
700
-
701
- .select2-search input {
702
- background-position: 100% -21px !important;
703
- }
704
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2.jquery.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "name": "select2",
3
- "title": "Select2",
4
- "description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
5
- "keywords": [
6
- "select",
7
- "autocomplete",
8
- "typeahead",
9
- "dropdown",
10
- "multiselect",
11
- "tag",
12
- "tagging"
13
- ],
14
- "version": "3.5.2",
15
- "author": {
16
- "name": "Igor Vaynberg",
17
- "url": "https://github.com/ivaynberg"
18
- },
19
- "licenses": [
20
- {
21
- "type": "Apache",
22
- "url": "http://www.apache.org/licenses/LICENSE-2.0"
23
- },
24
- {
25
- "type": "GPL v2",
26
- "url": "http://www.gnu.org/licenses/gpl-2.0.html"
27
- }
28
- ],
29
- "bugs": "https://github.com/ivaynberg/select2/issues",
30
- "homepage": "http://ivaynberg.github.com/select2",
31
- "docs": "http://ivaynberg.github.com/select2/",
32
- "download": "https://github.com/ivaynberg/select2/tags",
33
- "dependencies": {
34
- "jquery": ">=1.7.1"
35
- }
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2.js DELETED
@@ -1,3541 +0,0 @@
1
- /*
2
- Copyright 2012 Igor Vaynberg
3
-
4
- Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
5
-
6
- This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
7
- General Public License version 2 (the "GPL License"). You may choose either license to govern your
8
- use of this software only upon the condition that you accept all of the terms of either the Apache
9
- License or the GPL License.
10
-
11
- You may obtain a copy of the Apache License and the GPL License at:
12
-
13
- http://www.apache.org/licenses/LICENSE-2.0
14
- http://www.gnu.org/licenses/gpl-2.0.html
15
-
16
- Unless required by applicable law or agreed to in writing, software distributed under the
17
- Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
18
- CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
19
- the specific language governing permissions and limitations under the Apache License and the GPL License.
20
- */
21
- (function ($) {
22
- if(typeof $.fn.each2 == "undefined") {
23
- $.extend($.fn, {
24
- /*
25
- * 4-10 times faster .each replacement
26
- * use it carefully, as it overrides jQuery context of element on each iteration
27
- */
28
- each2 : function (c) {
29
- var j = $([0]), i = -1, l = this.length;
30
- while (
31
- ++i < l
32
- && (j.context = j[0] = this[i])
33
- && c.call(j[0], i, j) !== false //"this"=DOM, i=index, j=jQuery object
34
- );
35
- return this;
36
- }
37
- });
38
- }
39
- })(jQuery);
40
-
41
- (function ($, undefined) {
42
- "use strict";
43
- /*global document, window, jQuery, console */
44
-
45
- if (window.Select2 !== undefined) {
46
- return;
47
- }
48
-
49
- var AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
50
- lastMousePosition={x:0,y:0}, $document, scrollBarDimensions,
51
-
52
- KEY = {
53
- TAB: 9,
54
- ENTER: 13,
55
- ESC: 27,
56
- SPACE: 32,
57
- LEFT: 37,
58
- UP: 38,
59
- RIGHT: 39,
60
- DOWN: 40,
61
- SHIFT: 16,
62
- CTRL: 17,
63
- ALT: 18,
64
- PAGE_UP: 33,
65
- PAGE_DOWN: 34,
66
- HOME: 36,
67
- END: 35,
68
- BACKSPACE: 8,
69
- DELETE: 46,
70
- isArrow: function (k) {
71
- k = k.which ? k.which : k;
72
- switch (k) {
73
- case KEY.LEFT:
74
- case KEY.RIGHT:
75
- case KEY.UP:
76
- case KEY.DOWN:
77
- return true;
78
- }
79
- return false;
80
- },
81
- isControl: function (e) {
82
- var k = e.which;
83
- switch (k) {
84
- case KEY.SHIFT:
85
- case KEY.CTRL:
86
- case KEY.ALT:
87
- return true;
88
- }
89
-
90
- if (e.metaKey) return true;
91
-
92
- return false;
93
- },
94
- isFunctionKey: function (k) {
95
- k = k.which ? k.which : k;
96
- return k >= 112 && k <= 123;
97
- }
98
- },
99
- MEASURE_SCROLLBAR_TEMPLATE = "<div class='select2-measure-scrollbar'></div>",
100
-
101
- DIACRITICS = {"\u24B6":"A","\uFF21":"A","\u00C0":"A","\u00C1":"A","\u00C2":"A","\u1EA6":"A","\u1EA4":"A","\u1EAA":"A","\u1EA8":"A","\u00C3":"A","\u0100":"A","\u0102":"A","\u1EB0":"A","\u1EAE":"A","\u1EB4":"A","\u1EB2":"A","\u0226":"A","\u01E0":"A","\u00C4":"A","\u01DE":"A","\u1EA2":"A","\u00C5":"A","\u01FA":"A","\u01CD":"A","\u0200":"A","\u0202":"A","\u1EA0":"A","\u1EAC":"A","\u1EB6":"A","\u1E00":"A","\u0104":"A","\u023A":"A","\u2C6F":"A","\uA732":"AA","\u00C6":"AE","\u01FC":"AE","\u01E2":"AE","\uA734":"AO","\uA736":"AU","\uA738":"AV","\uA73A":"AV","\uA73C":"AY","\u24B7":"B","\uFF22":"B","\u1E02":"B","\u1E04":"B","\u1E06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24B8":"C","\uFF23":"C","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u00C7":"C","\u1E08":"C","\u0187":"C","\u023B":"C","\uA73E":"C","\u24B9":"D","\uFF24":"D","\u1E0A":"D","\u010E":"D","\u1E0C":"D","\u1E10":"D","\u1E12":"D","\u1E0E":"D","\u0110":"D","\u018B":"D","\u018A":"D","\u0189":"D","\uA779":"D","\u01F1":"DZ","\u01C4":"DZ","\u01F2":"Dz","\u01C5":"Dz","\u24BA":"E","\uFF25":"E","\u00C8":"E","\u00C9":"E","\u00CA":"E","\u1EC0":"E","\u1EBE":"E","\u1EC4":"E","\u1EC2":"E","\u1EBC":"E","\u0112":"E","\u1E14":"E","\u1E16":"E","\u0114":"E","\u0116":"E","\u00CB":"E","\u1EBA":"E","\u011A":"E","\u0204":"E","\u0206":"E","\u1EB8":"E","\u1EC6":"E","\u0228":"E","\u1E1C":"E","\u0118":"E","\u1E18":"E","\u1E1A":"E","\u0190":"E","\u018E":"E","\u24BB":"F","\uFF26":"F","\u1E1E":"F","\u0191":"F","\uA77B":"F","\u24BC":"G","\uFF27":"G","\u01F4":"G","\u011C":"G","\u1E20":"G","\u011E":"G","\u0120":"G","\u01E6":"G","\u0122":"G","\u01E4":"G","\u0193":"G","\uA7A0":"G","\uA77D":"G","\uA77E":"G","\u24BD":"H","\uFF28":"H","\u0124":"H","\u1E22":"H","\u1E26":"H","\u021E":"H","\u1E24":"H","\u1E28":"H","\u1E2A":"H","\u0126":"H","\u2C67":"H","\u2C75":"H","\uA78D":"H","\u24BE":"I","\uFF29":"I","\u00CC":"I","\u00CD":"I","\u00CE":"I","\u0128":"I","\u012A":"I","\u012C":"I","\u0130":"I","\u00CF":"I","\u1E2E":"I","\u1EC8":"I","\u01CF":"I","\u0208":"I","\u020A":"I","\u1ECA":"I","\u012E":"I","\u1E2C":"I","\u0197":"I","\u24BF":"J","\uFF2A":"J","\u0134":"J","\u0248":"J","\u24C0":"K","\uFF2B":"K","\u1E30":"K","\u01E8":"K","\u1E32":"K","\u0136":"K","\u1E34":"K","\u0198":"K","\u2C69":"K","\uA740":"K","\uA742":"K","\uA744":"K","\uA7A2":"K","\u24C1":"L","\uFF2C":"L","\u013F":"L","\u0139":"L","\u013D":"L","\u1E36":"L","\u1E38":"L","\u013B":"L","\u1E3C":"L","\u1E3A":"L","\u0141":"L","\u023D":"L","\u2C62":"L","\u2C60":"L","\uA748":"L","\uA746":"L","\uA780":"L","\u01C7":"LJ","\u01C8":"Lj","\u24C2":"M","\uFF2D":"M","\u1E3E":"M","\u1E40":"M","\u1E42":"M","\u2C6E":"M","\u019C":"M","\u24C3":"N","\uFF2E":"N","\u01F8":"N","\u0143":"N","\u00D1":"N","\u1E44":"N","\u0147":"N","\u1E46":"N","\u0145":"N","\u1E4A":"N","\u1E48":"N","\u0220":"N","\u019D":"N","\uA790":"N","\uA7A4":"N","\u01CA":"NJ","\u01CB":"Nj","\u24C4":"O","\uFF2F":"O","\u00D2":"O","\u00D3":"O","\u00D4":"O","\u1ED2":"O","\u1ED0":"O","\u1ED6":"O","\u1ED4":"O","\u00D5":"O","\u1E4C":"O","\u022C":"O","\u1E4E":"O","\u014C":"O","\u1E50":"O","\u1E52":"O","\u014E":"O","\u022E":"O","\u0230":"O","\u00D6":"O","\u022A":"O","\u1ECE":"O","\u0150":"O","\u01D1":"O","\u020C":"O","\u020E":"O","\u01A0":"O","\u1EDC":"O","\u1EDA":"O","\u1EE0":"O","\u1EDE":"O","\u1EE2":"O","\u1ECC":"O","\u1ED8":"O","\u01EA":"O","\u01EC":"O","\u00D8":"O","\u01FE":"O","\u0186":"O","\u019F":"O","\uA74A":"O","\uA74C":"O","\u01A2":"OI","\uA74E":"OO","\u0222":"OU","\u24C5":"P","\uFF30":"P","\u1E54":"P","\u1E56":"P","\u01A4":"P","\u2C63":"P","\uA750":"P","\uA752":"P","\uA754":"P","\u24C6":"Q","\uFF31":"Q","\uA756":"Q","\uA758":"Q","\u024A":"Q","\u24C7":"R","\uFF32":"R","\u0154":"R","\u1E58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1E5A":"R","\u1E5C":"R","\u0156":"R","\u1E5E":"R","\u024C":"R","\u2C64":"R","\uA75A":"R","\uA7A6":"R","\uA782":"R","\u24C8":"S","\uFF33":"S","\u1E9E":"S","\u015A":"S","\u1E64":"S","\u015C":"S","\u1E60":"S","\u0160":"S","\u1E66":"S","\u1E62":"S","\u1E68":"S","\u0218":"S","\u015E":"S","\u2C7E":"S","\uA7A8":"S","\uA784":"S","\u24C9":"T","\uFF34":"T","\u1E6A":"T","\u0164":"T","\u1E6C":"T","\u021A":"T","\u0162":"T","\u1E70":"T","\u1E6E":"T","\u0166":"T","\u01AC":"T","\u01AE":"T","\u023E":"T","\uA786":"T","\uA728":"TZ","\u24CA":"U","\uFF35":"U","\u00D9":"U","\u00DA":"U","\u00DB":"U","\u0168":"U","\u1E78":"U","\u016A":"U","\u1E7A":"U","\u016C":"U","\u00DC":"U","\u01DB":"U","\u01D7":"U","\u01D5":"U","\u01D9":"U","\u1EE6":"U","\u016E":"U","\u0170":"U","\u01D3":"U","\u0214":"U","\u0216":"U","\u01AF":"U","\u1EEA":"U","\u1EE8":"U","\u1EEE":"U","\u1EEC":"U","\u1EF0":"U","\u1EE4":"U","\u1E72":"U","\u0172":"U","\u1E76":"U","\u1E74":"U","\u0244":"U","\u24CB":"V","\uFF36":"V","\u1E7C":"V","\u1E7E":"V","\u01B2":"V","\uA75E":"V","\u0245":"V","\uA760":"VY","\u24CC":"W","\uFF37":"W","\u1E80":"W","\u1E82":"W","\u0174":"W","\u1E86":"W","\u1E84":"W","\u1E88":"W","\u2C72":"W","\u24CD":"X","\uFF38":"X","\u1E8A":"X","\u1E8C":"X","\u24CE":"Y","\uFF39":"Y","\u1EF2":"Y","\u00DD":"Y","\u0176":"Y","\u1EF8":"Y","\u0232":"Y","\u1E8E":"Y","\u0178":"Y","\u1EF6":"Y","\u1EF4":"Y","\u01B3":"Y","\u024E":"Y","\u1EFE":"Y","\u24CF":"Z","\uFF3A":"Z","\u0179":"Z","\u1E90":"Z","\u017B":"Z","\u017D":"Z","\u1E92":"Z","\u1E94":"Z","\u01B5":"Z","\u0224":"Z","\u2C7F":"Z","\u2C6B":"Z","\uA762":"Z","\u24D0":"a","\uFF41":"a","\u1E9A":"a","\u00E0":"a","\u00E1":"a","\u00E2":"a","\u1EA7":"a","\u1EA5":"a","\u1EAB":"a","\u1EA9":"a","\u00E3":"a","\u0101":"a","\u0103":"a","\u1EB1":"a","\u1EAF":"a","\u1EB5":"a","\u1EB3":"a","\u0227":"a","\u01E1":"a","\u00E4":"a","\u01DF":"a","\u1EA3":"a","\u00E5":"a","\u01FB":"a","\u01CE":"a","\u0201":"a","\u0203":"a","\u1EA1":"a","\u1EAD":"a","\u1EB7":"a","\u1E01":"a","\u0105":"a","\u2C65":"a","\u0250":"a","\uA733":"aa","\u00E6":"ae","\u01FD":"ae","\u01E3":"ae","\uA735":"ao","\uA737":"au","\uA739":"av","\uA73B":"av","\uA73D":"ay","\u24D1":"b","\uFF42":"b","\u1E03":"b","\u1E05":"b","\u1E07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24D2":"c","\uFF43":"c","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u00E7":"c","\u1E09":"c","\u0188":"c","\u023C":"c","\uA73F":"c","\u2184":"c","\u24D3":"d","\uFF44":"d","\u1E0B":"d","\u010F":"d","\u1E0D":"d","\u1E11":"d","\u1E13":"d","\u1E0F":"d","\u0111":"d","\u018C":"d","\u0256":"d","\u0257":"d","\uA77A":"d","\u01F3":"dz","\u01C6":"dz","\u24D4":"e","\uFF45":"e","\u00E8":"e","\u00E9":"e","\u00EA":"e","\u1EC1":"e","\u1EBF":"e","\u1EC5":"e","\u1EC3":"e","\u1EBD":"e","\u0113":"e","\u1E15":"e","\u1E17":"e","\u0115":"e","\u0117":"e","\u00EB":"e","\u1EBB":"e","\u011B":"e","\u0205":"e","\u0207":"e","\u1EB9":"e","\u1EC7":"e","\u0229":"e","\u1E1D":"e","\u0119":"e","\u1E19":"e","\u1E1B":"e","\u0247":"e","\u025B":"e","\u01DD":"e","\u24D5":"f","\uFF46":"f","\u1E1F":"f","\u0192":"f","\uA77C":"f","\u24D6":"g","\uFF47":"g","\u01F5":"g","\u011D":"g","\u1E21":"g","\u011F":"g","\u0121":"g","\u01E7":"g","\u0123":"g","\u01E5":"g","\u0260":"g","\uA7A1":"g","\u1D79":"g","\uA77F":"g","\u24D7":"h","\uFF48":"h","\u0125":"h","\u1E23":"h","\u1E27":"h","\u021F":"h","\u1E25":"h","\u1E29":"h","\u1E2B":"h","\u1E96":"h","\u0127":"h","\u2C68":"h","\u2C76":"h","\u0265":"h","\u0195":"hv","\u24D8":"i","\uFF49":"i","\u00EC":"i","\u00ED":"i","\u00EE":"i","\u0129":"i","\u012B":"i","\u012D":"i","\u00EF":"i","\u1E2F":"i","\u1EC9":"i","\u01D0":"i","\u0209":"i","\u020B":"i","\u1ECB":"i","\u012F":"i","\u1E2D":"i","\u0268":"i","\u0131":"i","\u24D9":"j","\uFF4A":"j","\u0135":"j","\u01F0":"j","\u0249":"j","\u24DA":"k","\uFF4B":"k","\u1E31":"k","\u01E9":"k","\u1E33":"k","\u0137":"k","\u1E35":"k","\u0199":"k","\u2C6A":"k","\uA741":"k","\uA743":"k","\uA745":"k","\uA7A3":"k","\u24DB":"l","\uFF4C":"l","\u0140":"l","\u013A":"l","\u013E":"l","\u1E37":"l","\u1E39":"l","\u013C":"l","\u1E3D":"l","\u1E3B":"l","\u017F":"l","\u0142":"l","\u019A":"l","\u026B":"l","\u2C61":"l","\uA749":"l","\uA781":"l","\uA747":"l","\u01C9":"lj","\u24DC":"m","\uFF4D":"m","\u1E3F":"m","\u1E41":"m","\u1E43":"m","\u0271":"m","\u026F":"m","\u24DD":"n","\uFF4E":"n","\u01F9":"n","\u0144":"n","\u00F1":"n","\u1E45":"n","\u0148":"n","\u1E47":"n","\u0146":"n","\u1E4B":"n","\u1E49":"n","\u019E":"n","\u0272":"n","\u0149":"n","\uA791":"n","\uA7A5":"n","\u01CC":"nj","\u24DE":"o","\uFF4F":"o","\u00F2":"o","\u00F3":"o","\u00F4":"o","\u1ED3":"o","\u1ED1":"o","\u1ED7":"o","\u1ED5":"o","\u00F5":"o","\u1E4D":"o","\u022D":"o","\u1E4F":"o","\u014D":"o","\u1E51":"o","\u1E53":"o","\u014F":"o","\u022F":"o","\u0231":"o","\u00F6":"o","\u022B":"o","\u1ECF":"o","\u0151":"o","\u01D2":"o","\u020D":"o","\u020F":"o","\u01A1":"o","\u1EDD":"o","\u1EDB":"o","\u1EE1":"o","\u1EDF":"o","\u1EE3":"o","\u1ECD":"o","\u1ED9":"o","\u01EB":"o","\u01ED":"o","\u00F8":"o","\u01FF":"o","\u0254":"o","\uA74B":"o","\uA74D":"o","\u0275":"o","\u01A3":"oi","\u0223":"ou","\uA74F":"oo","\u24DF":"p","\uFF50":"p","\u1E55":"p","\u1E57":"p","\u01A5":"p","\u1D7D":"p","\uA751":"p","\uA753":"p","\uA755":"p","\u24E0":"q","\uFF51":"q","\u024B":"q","\uA757":"q","\uA759":"q","\u24E1":"r","\uFF52":"r","\u0155":"r","\u1E59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1E5B":"r","\u1E5D":"r","\u0157":"r","\u1E5F":"r","\u024D":"r","\u027D":"r","\uA75B":"r","\uA7A7":"r","\uA783":"r","\u24E2":"s","\uFF53":"s","\u00DF":"s","\u015B":"s","\u1E65":"s","\u015D":"s","\u1E61":"s","\u0161":"s","\u1E67":"s","\u1E63":"s","\u1E69":"s","\u0219":"s","\u015F":"s","\u023F":"s","\uA7A9":"s","\uA785":"s","\u1E9B":"s","\u24E3":"t","\uFF54":"t","\u1E6B":"t","\u1E97":"t","\u0165":"t","\u1E6D":"t","\u021B":"t","\u0163":"t","\u1E71":"t","\u1E6F":"t","\u0167":"t","\u01AD":"t","\u0288":"t","\u2C66":"t","\uA787":"t","\uA729":"tz","\u24E4":"u","\uFF55":"u","\u00F9":"u","\u00FA":"u","\u00FB":"u","\u0169":"u","\u1E79":"u","\u016B":"u","\u1E7B":"u","\u016D":"u","\u00FC":"u","\u01DC":"u","\u01D8":"u","\u01D6":"u","\u01DA":"u","\u1EE7":"u","\u016F":"u","\u0171":"u","\u01D4":"u","\u0215":"u","\u0217":"u","\u01B0":"u","\u1EEB":"u","\u1EE9":"u","\u1EEF":"u","\u1EED":"u","\u1EF1":"u","\u1EE5":"u","\u1E73":"u","\u0173":"u","\u1E77":"u","\u1E75":"u","\u0289":"u","\u24E5":"v","\uFF56":"v","\u1E7D":"v","\u1E7F":"v","\u028B":"v","\uA75F":"v","\u028C":"v","\uA761":"vy","\u24E6":"w","\uFF57":"w","\u1E81":"w","\u1E83":"w","\u0175":"w","\u1E87":"w","\u1E85":"w","\u1E98":"w","\u1E89":"w","\u2C73":"w","\u24E7":"x","\uFF58":"x","\u1E8B":"x","\u1E8D":"x","\u24E8":"y","\uFF59":"y","\u1EF3":"y","\u00FD":"y","\u0177":"y","\u1EF9":"y","\u0233":"y","\u1E8F":"y","\u00FF":"y","\u1EF7":"y","\u1E99":"y","\u1EF5":"y","\u01B4":"y","\u024F":"y","\u1EFF":"y","\u24E9":"z","\uFF5A":"z","\u017A":"z","\u1E91":"z","\u017C":"z","\u017E":"z","\u1E93":"z","\u1E95":"z","\u01B6":"z","\u0225":"z","\u0240":"z","\u2C6C":"z","\uA763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038A":"\u0399","\u03AA":"\u0399","\u038C":"\u039F","\u038E":"\u03A5","\u03AB":"\u03A5","\u038F":"\u03A9","\u03AC":"\u03B1","\u03AD":"\u03B5","\u03AE":"\u03B7","\u03AF":"\u03B9","\u03CA":"\u03B9","\u0390":"\u03B9","\u03CC":"\u03BF","\u03CD":"\u03C5","\u03CB":"\u03C5","\u03B0":"\u03C5","\u03C9":"\u03C9","\u03C2":"\u03C3"};
102
-
103
- $document = $(document);
104
-
105
- nextUid=(function() { var counter=1; return function() { return counter++; }; }());
106
-
107
-
108
- function reinsertElement(element) {
109
- var placeholder = $(document.createTextNode(''));
110
-
111
- element.before(placeholder);
112
- placeholder.before(element);
113
- placeholder.remove();
114
- }
115
-
116
- function stripDiacritics(str) {
117
- // Used 'uni range + named function' from http://jsperf.com/diacritics/18
118
- function match(a) {
119
- return DIACRITICS[a] || a;
120
- }
121
-
122
- return str.replace(/[^\u0000-\u007E]/g, match);
123
- }
124
-
125
- function indexOf(value, array) {
126
- var i = 0, l = array.length;
127
- for (; i < l; i = i + 1) {
128
- if (equal(value, array[i])) return i;
129
- }
130
- return -1;
131
- }
132
-
133
- function measureScrollbar () {
134
- var $template = $( MEASURE_SCROLLBAR_TEMPLATE );
135
- $template.appendTo(document.body);
136
-
137
- var dim = {
138
- width: $template.width() - $template[0].clientWidth,
139
- height: $template.height() - $template[0].clientHeight
140
- };
141
- $template.remove();
142
-
143
- return dim;
144
- }
145
-
146
- /**
147
- * Compares equality of a and b
148
- * @param a
149
- * @param b
150
- */
151
- function equal(a, b) {
152
- if (a === b) return true;
153
- if (a === undefined || b === undefined) return false;
154
- if (a === null || b === null) return false;
155
- // Check whether 'a' or 'b' is a string (primitive or object).
156
- // The concatenation of an empty string (+'') converts its argument to a string's primitive.
157
- if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object
158
- if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object
159
- return false;
160
- }
161
-
162
- /**
163
- * Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty
164
- * strings
165
- * @param string
166
- * @param separator
167
- */
168
- function splitVal(string, separator, transform) {
169
- var val, i, l;
170
- if (string === null || string.length < 1) return [];
171
- val = string.split(separator);
172
- for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]);
173
- return val;
174
- }
175
-
176
- function getSideBorderPadding(element) {
177
- return element.outerWidth(false) - element.width();
178
- }
179
-
180
- function installKeyUpChangeEvent(element) {
181
- var key="keyup-change-value";
182
- element.on("keydown", function () {
183
- if ($.data(element, key) === undefined) {
184
- $.data(element, key, element.val());
185
- }
186
- });
187
- element.on("keyup", function () {
188
- var val= $.data(element, key);
189
- if (val !== undefined && element.val() !== val) {
190
- $.removeData(element, key);
191
- element.trigger("keyup-change");
192
- }
193
- });
194
- }
195
-
196
-
197
- /**
198
- * filters mouse events so an event is fired only if the mouse moved.
199
- *
200
- * filters out mouse events that occur when mouse is stationary but
201
- * the elements under the pointer are scrolled.
202
- */
203
- function installFilteredMouseMove(element) {
204
- element.on("mousemove", function (e) {
205
- var lastpos = lastMousePosition;
206
- if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
207
- $(e.target).trigger("mousemove-filtered", e);
208
- }
209
- });
210
- }
211
-
212
- /**
213
- * Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
214
- * within the last quietMillis milliseconds.
215
- *
216
- * @param quietMillis number of milliseconds to wait before invoking fn
217
- * @param fn function to be debounced
218
- * @param ctx object to be used as this reference within fn
219
- * @return debounced version of fn
220
- */
221
- function debounce(quietMillis, fn, ctx) {
222
- ctx = ctx || undefined;
223
- var timeout;
224
- return function () {
225
- var args = arguments;
226
- window.clearTimeout(timeout);
227
- timeout = window.setTimeout(function() {
228
- fn.apply(ctx, args);
229
- }, quietMillis);
230
- };
231
- }
232
-
233
- function installDebouncedScroll(threshold, element) {
234
- var notify = debounce(threshold, function (e) { element.trigger("scroll-debounced", e);});
235
- element.on("scroll", function (e) {
236
- if (indexOf(e.target, element.get()) >= 0) notify(e);
237
- });
238
- }
239
-
240
- function focus($el) {
241
- if ($el[0] === document.activeElement) return;
242
-
243
- /* set the focus in a 0 timeout - that way the focus is set after the processing
244
- of the current event has finished - which seems like the only reliable way
245
- to set focus */
246
- window.setTimeout(function() {
247
- var el=$el[0], pos=$el.val().length, range;
248
-
249
- $el.focus();
250
-
251
- /* make sure el received focus so we do not error out when trying to manipulate the caret.
252
- sometimes modals or others listeners may steal it after its set */
253
- var isVisible = (el.offsetWidth > 0 || el.offsetHeight > 0);
254
- if (isVisible && el === document.activeElement) {
255
-
256
- /* after the focus is set move the caret to the end, necessary when we val()
257
- just before setting focus */
258
- if(el.setSelectionRange)
259
- {
260
- el.setSelectionRange(pos, pos);
261
- }
262
- else if (el.createTextRange) {
263
- range = el.createTextRange();
264
- range.collapse(false);
265
- range.select();
266
- }
267
- }
268
- }, 0);
269
- }
270
-
271
- function getCursorInfo(el) {
272
- el = $(el)[0];
273
- var offset = 0;
274
- var length = 0;
275
- if ('selectionStart' in el) {
276
- offset = el.selectionStart;
277
- length = el.selectionEnd - offset;
278
- } else if ('selection' in document) {
279
- el.focus();
280
- var sel = document.selection.createRange();
281
- length = document.selection.createRange().text.length;
282
- sel.moveStart('character', -el.value.length);
283
- offset = sel.text.length - length;
284
- }
285
- return { offset: offset, length: length };
286
- }
287
-
288
- function killEvent(event) {
289
- event.preventDefault();
290
- event.stopPropagation();
291
- }
292
- function killEventImmediately(event) {
293
- event.preventDefault();
294
- event.stopImmediatePropagation();
295
- }
296
-
297
- function measureTextWidth(e) {
298
- if (!sizer){
299
- var style = e[0].currentStyle || window.getComputedStyle(e[0], null);
300
- sizer = $(document.createElement("div")).css({
301
- position: "absolute",
302
- left: "-10000px",
303
- top: "-10000px",
304
- display: "none",
305
- fontSize: style.fontSize,
306
- fontFamily: style.fontFamily,
307
- fontStyle: style.fontStyle,
308
- fontWeight: style.fontWeight,
309
- letterSpacing: style.letterSpacing,
310
- textTransform: style.textTransform,
311
- whiteSpace: "nowrap"
312
- });
313
- sizer.attr("class","select2-sizer");
314
- $(document.body).append(sizer);
315
- }
316
- sizer.text(e.val());
317
- return sizer.width();
318
- }
319
-
320
- function syncCssClasses(dest, src, adapter) {
321
- var classes, replacements = [], adapted;
322
-
323
- classes = $.trim(dest.attr("class"));
324
-
325
- if (classes) {
326
- classes = '' + classes; // for IE which returns object
327
-
328
- $(classes.split(/\s+/)).each2(function() {
329
- if (this.indexOf("select2-") === 0) {
330
- replacements.push(this);
331
- }
332
- });
333
- }
334
-
335
- classes = $.trim(src.attr("class"));
336
-
337
- if (classes) {
338
- classes = '' + classes; // for IE which returns object
339
-
340
- $(classes.split(/\s+/)).each2(function() {
341
- if (this.indexOf("select2-") !== 0) {
342
- adapted = adapter(this);
343
-
344
- if (adapted) {
345
- replacements.push(adapted);
346
- }
347
- }
348
- });
349
- }
350
-
351
- dest.attr("class", replacements.join(" "));
352
- }
353
-
354
-
355
- function markMatch(text, term, markup, escapeMarkup) {
356
- var match=stripDiacritics(text.toUpperCase()).indexOf(stripDiacritics(term.toUpperCase())),
357
- tl=term.length;
358
-
359
- if (match<0) {
360
- markup.push(escapeMarkup(text));
361
- return;
362
- }
363
-
364
- markup.push(escapeMarkup(text.substring(0, match)));
365
- markup.push("<span class='select2-match'>");
366
- markup.push(escapeMarkup(text.substring(match, match + tl)));
367
- markup.push("</span>");
368
- markup.push(escapeMarkup(text.substring(match + tl, text.length)));
369
- }
370
-
371
- function defaultEscapeMarkup(markup) {
372
- var replace_map = {
373
- '\\': '&#92;',
374
- '&': '&amp;',
375
- '<': '&lt;',
376
- '>': '&gt;',
377
- '"': '&quot;',
378
- "'": '&#39;',
379
- "/": '&#47;'
380
- };
381
-
382
- return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
383
- return replace_map[match];
384
- });
385
- }
386
-
387
- /**
388
- * Produces an ajax-based query function
389
- *
390
- * @param options object containing configuration parameters
391
- * @param options.params parameter map for the transport ajax call, can contain such options as cache, jsonpCallback, etc. see $.ajax
392
- * @param options.transport function that will be used to execute the ajax request. must be compatible with parameters supported by $.ajax
393
- * @param options.url url for the data
394
- * @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url.
395
- * @param options.dataType request data type: ajax, jsonp, other datatypes supported by jQuery's $.ajax function or the transport function if specified
396
- * @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often
397
- * @param options.results a function(remoteData, pageNumber, query) that converts data returned form the remote request to the format expected by Select2.
398
- * The expected format is an object containing the following keys:
399
- * results array of objects that will be used as choices
400
- * more (optional) boolean indicating whether there are more results available
401
- * Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
402
- */
403
- function ajax(options) {
404
- var timeout, // current scheduled but not yet executed request
405
- handler = null,
406
- quietMillis = options.quietMillis || 100,
407
- ajaxUrl = options.url,
408
- self = this;
409
-
410
- return function (query) {
411
- window.clearTimeout(timeout);
412
- timeout = window.setTimeout(function () {
413
- var data = options.data, // ajax data function
414
- url = ajaxUrl, // ajax url string or function
415
- transport = options.transport || $.fn.select2.ajaxDefaults.transport,
416
- // deprecated - to be removed in 4.0 - use params instead
417
- deprecated = {
418
- type: options.type || 'GET', // set type of request (GET or POST)
419
- cache: options.cache || false,
420
- jsonpCallback: options.jsonpCallback||undefined,
421
- dataType: options.dataType||"json"
422
- },
423
- params = $.extend({}, $.fn.select2.ajaxDefaults.params, deprecated);
424
-
425
- data = data ? data.call(self, query.term, query.page, query.context) : null;
426
- url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
427
-
428
- if (handler && typeof handler.abort === "function") { handler.abort(); }
429
-
430
- if (options.params) {
431
- if ($.isFunction(options.params)) {
432
- $.extend(params, options.params.call(self));
433
- } else {
434
- $.extend(params, options.params);
435
- }
436
- }
437
-
438
- $.extend(params, {
439
- url: url,
440
- dataType: options.dataType,
441
- data: data,
442
- success: function (data) {
443
- // TODO - replace query.page with query so users have access to term, page, etc.
444
- // added query as third paramter to keep backwards compatibility
445
- var results = options.results(data, query.page, query);
446
- query.callback(results);
447
- },
448
- error: function(jqXHR, textStatus, errorThrown){
449
- var results = {
450
- hasError: true,
451
- jqXHR: jqXHR,
452
- textStatus: textStatus,
453
- errorThrown: errorThrown
454
- };
455
-
456
- query.callback(results);
457
- }
458
- });
459
- handler = transport.call(self, params);
460
- }, quietMillis);
461
- };
462
- }
463
-
464
- /**
465
- * Produces a query function that works with a local array
466
- *
467
- * @param options object containing configuration parameters. The options parameter can either be an array or an
468
- * object.
469
- *
470
- * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
471
- *
472
- * If the object form is used it is assumed that it contains 'data' and 'text' keys. The 'data' key should contain
473
- * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text'
474
- * key can either be a String in which case it is expected that each element in the 'data' array has a key with the
475
- * value of 'text' which will be used to match choices. Alternatively, text can be a function(item) that can extract
476
- * the text.
477
- */
478
- function local(options) {
479
- var data = options, // data elements
480
- dataText,
481
- tmp,
482
- text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
483
-
484
- if ($.isArray(data)) {
485
- tmp = data;
486
- data = { results: tmp };
487
- }
488
-
489
- if ($.isFunction(data) === false) {
490
- tmp = data;
491
- data = function() { return tmp; };
492
- }
493
-
494
- var dataItem = data();
495
- if (dataItem.text) {
496
- text = dataItem.text;
497
- // if text is not a function we assume it to be a key name
498
- if (!$.isFunction(text)) {
499
- dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
500
- text = function (item) { return item[dataText]; };
501
- }
502
- }
503
-
504
- return function (query) {
505
- var t = query.term, filtered = { results: [] }, process;
506
- if (t === "") {
507
- query.callback(data());
508
- return;
509
- }
510
-
511
- process = function(datum, collection) {
512
- var group, attr;
513
- datum = datum[0];
514
- if (datum.children) {
515
- group = {};
516
- for (attr in datum) {
517
- if (datum.hasOwnProperty(attr)) group[attr]=datum[attr];
518
- }
519
- group.children=[];
520
- $(datum.children).each2(function(i, childDatum) { process(childDatum, group.children); });
521
- if (group.children.length || query.matcher(t, text(group), datum)) {
522
- collection.push(group);
523
- }
524
- } else {
525
- if (query.matcher(t, text(datum), datum)) {
526
- collection.push(datum);
527
- }
528
- }
529
- };
530
-
531
- $(data().results).each2(function(i, datum) { process(datum, filtered.results); });
532
- query.callback(filtered);
533
- };
534
- }
535
-
536
- // TODO javadoc
537
- function tags(data) {
538
- var isFunc = $.isFunction(data);
539
- return function (query) {
540
- var t = query.term, filtered = {results: []};
541
- var result = isFunc ? data(query) : data;
542
- if ($.isArray(result)) {
543
- $(result).each(function () {
544
- var isObject = this.text !== undefined,
545
- text = isObject ? this.text : this;
546
- if (t === "" || query.matcher(t, text)) {
547
- filtered.results.push(isObject ? this : {id: this, text: this});
548
- }
549
- });
550
- query.callback(filtered);
551
- }
552
- };
553
- }
554
-
555
- /**
556
- * Checks if the formatter function should be used.
557
- *
558
- * Throws an error if it is not a function. Returns true if it should be used,
559
- * false if no formatting should be performed.
560
- *
561
- * @param formatter
562
- */
563
- function checkFormatter(formatter, formatterName) {
564
- if ($.isFunction(formatter)) return true;
565
- if (!formatter) return false;
566
- if (typeof(formatter) === 'string') return true;
567
- throw new Error(formatterName +" must be a string, function, or falsy value");
568
- }
569
-
570
- /**
571
- * Returns a given value
572
- * If given a function, returns its output
573
- *
574
- * @param val string|function
575
- * @param context value of "this" to be passed to function
576
- * @returns {*}
577
- */
578
- function evaluate(val, context) {
579
- if ($.isFunction(val)) {
580
- var args = Array.prototype.slice.call(arguments, 2);
581
- return val.apply(context, args);
582
- }
583
- return val;
584
- }
585
-
586
- function countResults(results) {
587
- var count = 0;
588
- $.each(results, function(i, item) {
589
- if (item.children) {
590
- count += countResults(item.children);
591
- } else {
592
- count++;
593
- }
594
- });
595
- return count;
596
- }
597
-
598
- /**
599
- * Default tokenizer. This function uses breaks the input on substring match of any string from the
600
- * opts.tokenSeparators array and uses opts.createSearchChoice to create the choice object. Both of those
601
- * two options have to be defined in order for the tokenizer to work.
602
- *
603
- * @param input text user has typed so far or pasted into the search field
604
- * @param selection currently selected choices
605
- * @param selectCallback function(choice) callback tho add the choice to selection
606
- * @param opts select2's opts
607
- * @return undefined/null to leave the current input unchanged, or a string to change the input to the returned value
608
- */
609
- function defaultTokenizer(input, selection, selectCallback, opts) {
610
- var original = input, // store the original so we can compare and know if we need to tell the search to update its text
611
- dupe = false, // check for whether a token we extracted represents a duplicate selected choice
612
- token, // token
613
- index, // position at which the separator was found
614
- i, l, // looping variables
615
- separator; // the matched separator
616
-
617
- if (!opts.createSearchChoice || !opts.tokenSeparators || opts.tokenSeparators.length < 1) return undefined;
618
-
619
- while (true) {
620
- index = -1;
621
-
622
- for (i = 0, l = opts.tokenSeparators.length; i < l; i++) {
623
- separator = opts.tokenSeparators[i];
624
- index = input.indexOf(separator);
625
- if (index >= 0) break;
626
- }
627
-
628
- if (index < 0) break; // did not find any token separator in the input string, bail
629
-
630
- token = input.substring(0, index);
631
- input = input.substring(index + separator.length);
632
-
633
- if (token.length > 0) {
634
- token = opts.createSearchChoice.call(this, token, selection);
635
- if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
636
- dupe = false;
637
- for (i = 0, l = selection.length; i < l; i++) {
638
- if (equal(opts.id(token), opts.id(selection[i]))) {
639
- dupe = true; break;
640
- }
641
- }
642
-
643
- if (!dupe) selectCallback(token);
644
- }
645
- }
646
- }
647
-
648
- if (original!==input) return input;
649
- }
650
-
651
- function cleanupJQueryElements() {
652
- var self = this;
653
-
654
- $.each(arguments, function (i, element) {
655
- self[element].remove();
656
- self[element] = null;
657
- });
658
- }
659
-
660
- /**
661
- * Creates a new class
662
- *
663
- * @param superClass
664
- * @param methods
665
- */
666
- function clazz(SuperClass, methods) {
667
- var constructor = function () {};
668
- constructor.prototype = new SuperClass;
669
- constructor.prototype.constructor = constructor;
670
- constructor.prototype.parent = SuperClass.prototype;
671
- constructor.prototype = $.extend(constructor.prototype, methods);
672
- return constructor;
673
- }
674
-
675
- AbstractSelect2 = clazz(Object, {
676
-
677
- // abstract
678
- bind: function (func) {
679
- var self = this;
680
- return function () {
681
- func.apply(self, arguments);
682
- };
683
- },
684
-
685
- // abstract
686
- init: function (opts) {
687
- var results, search, resultsSelector = ".select2-results";
688
-
689
- // prepare options
690
- this.opts = opts = this.prepareOpts(opts);
691
-
692
- this.id=opts.id;
693
-
694
- // destroy if called on an existing component
695
- if (opts.element.data("select2") !== undefined &&
696
- opts.element.data("select2") !== null) {
697
- opts.element.data("select2").destroy();
698
- }
699
-
700
- this.container = this.createContainer();
701
-
702
- this.liveRegion = $('.select2-hidden-accessible');
703
- if (this.liveRegion.length == 0) {
704
- this.liveRegion = $("<span>", {
705
- role: "status",
706
- "aria-live": "polite"
707
- })
708
- .addClass("select2-hidden-accessible")
709
- .appendTo(document.body);
710
- }
711
-
712
- this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
713
- this.containerEventName= this.containerId
714
- .replace(/([.])/g, '_')
715
- .replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
716
- this.container.attr("id", this.containerId);
717
-
718
- this.container.attr("title", opts.element.attr("title"));
719
-
720
- this.body = $(document.body);
721
-
722
- syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
723
-
724
- this.container.attr("style", opts.element.attr("style"));
725
- this.container.css(evaluate(opts.containerCss, this.opts.element));
726
- this.container.addClass(evaluate(opts.containerCssClass, this.opts.element));
727
-
728
- this.elementTabIndex = this.opts.element.attr("tabindex");
729
-
730
- // swap container for the element
731
- this.opts.element
732
- .data("select2", this)
733
- .attr("tabindex", "-1")
734
- .before(this.container)
735
- .on("click.select2", killEvent); // do not leak click events
736
-
737
- this.container.data("select2", this);
738
-
739
- this.dropdown = this.container.find(".select2-drop");
740
-
741
- syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
742
-
743
- this.dropdown.addClass(evaluate(opts.dropdownCssClass, this.opts.element));
744
- this.dropdown.data("select2", this);
745
- this.dropdown.on("click", killEvent);
746
-
747
- this.results = results = this.container.find(resultsSelector);
748
- this.search = search = this.container.find("input.select2-input");
749
-
750
- this.queryCount = 0;
751
- this.resultsPage = 0;
752
- this.context = null;
753
-
754
- // initialize the container
755
- this.initContainer();
756
-
757
- this.container.on("click", killEvent);
758
-
759
- installFilteredMouseMove(this.results);
760
-
761
- this.dropdown.on("mousemove-filtered", resultsSelector, this.bind(this.highlightUnderEvent));
762
- this.dropdown.on("touchstart touchmove touchend", resultsSelector, this.bind(function (event) {
763
- this._touchEvent = true;
764
- this.highlightUnderEvent(event);
765
- }));
766
- this.dropdown.on("touchmove", resultsSelector, this.bind(this.touchMoved));
767
- this.dropdown.on("touchstart touchend", resultsSelector, this.bind(this.clearTouchMoved));
768
-
769
- // Waiting for a click event on touch devices to select option and hide dropdown
770
- // otherwise click will be triggered on an underlying element
771
- this.dropdown.on('click', this.bind(function (event) {
772
- if (this._touchEvent) {
773
- this._touchEvent = false;
774
- this.selectHighlighted();
775
- }
776
- }));
777
-
778
- installDebouncedScroll(80, this.results);
779
- this.dropdown.on("scroll-debounced", resultsSelector, this.bind(this.loadMoreIfNeeded));
780
-
781
- // do not propagate change event from the search field out of the component
782
- $(this.container).on("change", ".select2-input", function(e) {e.stopPropagation();});
783
- $(this.dropdown).on("change", ".select2-input", function(e) {e.stopPropagation();});
784
-
785
- // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
786
- if ($.fn.mousewheel) {
787
- results.mousewheel(function (e, delta, deltaX, deltaY) {
788
- var top = results.scrollTop();
789
- if (deltaY > 0 && top - deltaY <= 0) {
790
- results.scrollTop(0);
791
- killEvent(e);
792
- } else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
793
- results.scrollTop(results.get(0).scrollHeight - results.height());
794
- killEvent(e);
795
- }
796
- });
797
- }
798
-
799
- installKeyUpChangeEvent(search);
800
- search.on("keyup-change input paste", this.bind(this.updateResults));
801
- search.on("focus", function () { search.addClass("select2-focused"); });
802
- search.on("blur", function () { search.removeClass("select2-focused");});
803
-
804
- this.dropdown.on("mouseup", resultsSelector, this.bind(function (e) {
805
- if ($(e.target).closest(".select2-result-selectable").length > 0) {
806
- this.highlightUnderEvent(e);
807
- this.selectHighlighted(e);
808
- }
809
- }));
810
-
811
- // trap all mouse events from leaving the dropdown. sometimes there may be a modal that is listening
812
- // for mouse events outside of itself so it can close itself. since the dropdown is now outside the select2's
813
- // dom it will trigger the popup close, which is not what we want
814
- // focusin can cause focus wars between modals and select2 since the dropdown is outside the modal.
815
- this.dropdown.on("click mouseup mousedown touchstart touchend focusin", function (e) { e.stopPropagation(); });
816
-
817
- this.nextSearchTerm = undefined;
818
-
819
- if ($.isFunction(this.opts.initSelection)) {
820
- // initialize selection based on the current value of the source element
821
- this.initSelection();
822
-
823
- // if the user has provided a function that can set selection based on the value of the source element
824
- // we monitor the change event on the element and trigger it, allowing for two way synchronization
825
- this.monitorSource();
826
- }
827
-
828
- if (opts.maximumInputLength !== null) {
829
- this.search.attr("maxlength", opts.maximumInputLength);
830
- }
831
-
832
- var disabled = opts.element.prop("disabled");
833
- if (disabled === undefined) disabled = false;
834
- this.enable(!disabled);
835
-
836
- var readonly = opts.element.prop("readonly");
837
- if (readonly === undefined) readonly = false;
838
- this.readonly(readonly);
839
-
840
- // Calculate size of scrollbar
841
- scrollBarDimensions = scrollBarDimensions || measureScrollbar();
842
-
843
- this.autofocus = opts.element.prop("autofocus");
844
- opts.element.prop("autofocus", false);
845
- if (this.autofocus) this.focus();
846
-
847
- this.search.attr("placeholder", opts.searchInputPlaceholder);
848
- },
849
-
850
- // abstract
851
- destroy: function () {
852
- var element=this.opts.element, select2 = element.data("select2"), self = this;
853
-
854
- this.close();
855
-
856
- if (element.length && element[0].detachEvent && self._sync) {
857
- element.each(function () {
858
- if (self._sync) {
859
- this.detachEvent("onpropertychange", self._sync);
860
- }
861
- });
862
- }
863
- if (this.propertyObserver) {
864
- this.propertyObserver.disconnect();
865
- this.propertyObserver = null;
866
- }
867
- this._sync = null;
868
-
869
- if (select2 !== undefined) {
870
- select2.container.remove();
871
- select2.liveRegion.remove();
872
- select2.dropdown.remove();
873
- element
874
- .show()
875
- .removeData("select2")
876
- .off(".select2")
877
- .prop("autofocus", this.autofocus || false);
878
- if (this.elementTabIndex) {
879
- element.attr({tabindex: this.elementTabIndex});
880
- } else {
881
- element.removeAttr("tabindex");
882
- }
883
- element.show();
884
- }
885
-
886
- cleanupJQueryElements.call(this,
887
- "container",
888
- "liveRegion",
889
- "dropdown",
890
- "results",
891
- "search"
892
- );
893
- },
894
-
895
- // abstract
896
- optionToData: function(element) {
897
- if (element.is("option")) {
898
- return {
899
- id:element.prop("value"),
900
- text:element.text(),
901
- element: element.get(),
902
- css: element.attr("class"),
903
- disabled: element.prop("disabled"),
904
- locked: equal(element.attr("locked"), "locked") || equal(element.data("locked"), true)
905
- };
906
- } else if (element.is("optgroup")) {
907
- return {
908
- text:element.attr("label"),
909
- children:[],
910
- element: element.get(),
911
- css: element.attr("class")
912
- };
913
- }
914
- },
915
-
916
- // abstract
917
- prepareOpts: function (opts) {
918
- var element, select, idKey, ajaxUrl, self = this;
919
-
920
- element = opts.element;
921
-
922
- if (element.get(0).tagName.toLowerCase() === "select") {
923
- this.select = select = opts.element;
924
- }
925
-
926
- if (select) {
927
- // these options are not allowed when attached to a select because they are picked up off the element itself
928
- $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
929
- if (this in opts) {
930
- throw new Error("Option '" + this + "' is not allowed for Select2 when attached to a <select> element.");
931
- }
932
- });
933
- }
934
-
935
- opts = $.extend({}, {
936
- populateResults: function(container, results, query) {
937
- var populate, id=this.opts.id, liveRegion=this.liveRegion;
938
-
939
- populate=function(results, container, depth) {
940
-
941
- var i, l, result, selectable, disabled, compound, node, label, innerContainer, formatted;
942
-
943
- results = opts.sortResults(results, container, query);
944
-
945
- // collect the created nodes for bulk append
946
- var nodes = [];
947
- for (i = 0, l = results.length; i < l; i = i + 1) {
948
-
949
- result=results[i];
950
-
951
- disabled = (result.disabled === true);
952
- selectable = (!disabled) && (id(result) !== undefined);
953
-
954
- compound=result.children && result.children.length > 0;
955
-
956
- node=$("<li></li>");
957
- node.addClass("select2-results-dept-"+depth);
958
- node.addClass("select2-result");
959
- node.addClass(selectable ? "select2-result-selectable" : "select2-result-unselectable");
960
- if (disabled) { node.addClass("select2-disabled"); }
961
- if (compound) { node.addClass("select2-result-with-children"); }
962
- node.addClass(self.opts.formatResultCssClass(result));
963
- node.attr("role", "presentation");
964
-
965
- label=$(document.createElement("div"));
966
- label.addClass("select2-result-label");
967
- label.attr("id", "select2-result-label-" + nextUid());
968
- label.attr("role", "option");
969
-
970
- formatted=opts.formatResult(result, label, query, self.opts.escapeMarkup);
971
- if (formatted!==undefined) {
972
- label.html(formatted);
973
- node.append(label);
974
- }
975
-
976
-
977
- if (compound) {
978
-
979
- innerContainer=$("<ul></ul>");
980
- innerContainer.addClass("select2-result-sub");
981
- populate(result.children, innerContainer, depth+1);
982
- node.append(innerContainer);
983
- }
984
-
985
- node.data("select2-data", result);
986
- nodes.push(node[0]);
987
- }
988
-
989
- // bulk append the created nodes
990
- container.append(nodes);
991
- liveRegion.text(opts.formatMatches(results.length));
992
- };
993
-
994
- populate(results, container, 0);
995
- }
996
- }, $.fn.select2.defaults, opts);
997
-
998
- if (typeof(opts.id) !== "function") {
999
- idKey = opts.id;
1000
- opts.id = function (e) { return e[idKey]; };
1001
- }
1002
-
1003
- if ($.isArray(opts.element.data("select2Tags"))) {
1004
- if ("tags" in opts) {
1005
- throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
1006
- }
1007
- opts.tags=opts.element.data("select2Tags");
1008
- }
1009
-
1010
- if (select) {
1011
- opts.query = this.bind(function (query) {
1012
- var data = { results: [], more: false },
1013
- term = query.term,
1014
- children, placeholderOption, process;
1015
-
1016
- process=function(element, collection) {
1017
- var group;
1018
- if (element.is("option")) {
1019
- if (query.matcher(term, element.text(), element)) {
1020
- collection.push(self.optionToData(element));
1021
- }
1022
- } else if (element.is("optgroup")) {
1023
- group=self.optionToData(element);
1024
- element.children().each2(function(i, elm) { process(elm, group.children); });
1025
- if (group.children.length>0) {
1026
- collection.push(group);
1027
- }
1028
- }
1029
- };
1030
-
1031
- children=element.children();
1032
-
1033
- // ignore the placeholder option if there is one
1034
- if (this.getPlaceholder() !== undefined && children.length > 0) {
1035
- placeholderOption = this.getPlaceholderOption();
1036
- if (placeholderOption) {
1037
- children=children.not(placeholderOption);
1038
- }
1039
- }
1040
-
1041
- children.each2(function(i, elm) { process(elm, data.results); });
1042
-
1043
- query.callback(data);
1044
- });
1045
- // this is needed because inside val() we construct choices from options and their id is hardcoded
1046
- opts.id=function(e) { return e.id; };
1047
- } else {
1048
- if (!("query" in opts)) {
1049
-
1050
- if ("ajax" in opts) {
1051
- ajaxUrl = opts.element.data("ajax-url");
1052
- if (ajaxUrl && ajaxUrl.length > 0) {
1053
- opts.ajax.url = ajaxUrl;
1054
- }
1055
- opts.query = ajax.call(opts.element, opts.ajax);
1056
- } else if ("data" in opts) {
1057
- opts.query = local(opts.data);
1058
- } else if ("tags" in opts) {
1059
- opts.query = tags(opts.tags);
1060
- if (opts.createSearchChoice === undefined) {
1061
- opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
1062
- }
1063
- if (opts.initSelection === undefined) {
1064
- opts.initSelection = function (element, callback) {
1065
- var data = [];
1066
- $(splitVal(element.val(), opts.separator, opts.transformVal)).each(function () {
1067
- var obj = { id: this, text: this },
1068
- tags = opts.tags;
1069
- if ($.isFunction(tags)) tags=tags();
1070
- $(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } });
1071
- data.push(obj);
1072
- });
1073
-
1074
- callback(data);
1075
- };
1076
- }
1077
- }
1078
- }
1079
- }
1080
- if (typeof(opts.query) !== "function") {
1081
- throw "query function not defined for Select2 " + opts.element.attr("id");
1082
- }
1083
-
1084
- if (opts.createSearchChoicePosition === 'top') {
1085
- opts.createSearchChoicePosition = function(list, item) { list.unshift(item); };
1086
- }
1087
- else if (opts.createSearchChoicePosition === 'bottom') {
1088
- opts.createSearchChoicePosition = function(list, item) { list.push(item); };
1089
- }
1090
- else if (typeof(opts.createSearchChoicePosition) !== "function") {
1091
- throw "invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";
1092
- }
1093
-
1094
- return opts;
1095
- },
1096
-
1097
- /**
1098
- * Monitor the original element for changes and update select2 accordingly
1099
- */
1100
- // abstract
1101
- monitorSource: function () {
1102
- var el = this.opts.element, observer, self = this;
1103
-
1104
- el.on("change.select2", this.bind(function (e) {
1105
- if (this.opts.element.data("select2-change-triggered") !== true) {
1106
- this.initSelection();
1107
- }
1108
- }));
1109
-
1110
- this._sync = this.bind(function () {
1111
-
1112
- // sync enabled state
1113
- var disabled = el.prop("disabled");
1114
- if (disabled === undefined) disabled = false;
1115
- this.enable(!disabled);
1116
-
1117
- var readonly = el.prop("readonly");
1118
- if (readonly === undefined) readonly = false;
1119
- this.readonly(readonly);
1120
-
1121
- if (this.container) {
1122
- syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
1123
- this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));
1124
- }
1125
-
1126
- if (this.dropdown) {
1127
- syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
1128
- this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));
1129
- }
1130
-
1131
- });
1132
-
1133
- // IE8-10 (IE9/10 won't fire propertyChange via attachEventListener)
1134
- if (el.length && el[0].attachEvent) {
1135
- el.each(function() {
1136
- this.attachEvent("onpropertychange", self._sync);
1137
- });
1138
- }
1139
-
1140
- // safari, chrome, firefox, IE11
1141
- observer = window.MutationObserver || window.WebKitMutationObserver|| window.MozMutationObserver;
1142
- if (observer !== undefined) {
1143
- if (this.propertyObserver) { delete this.propertyObserver; this.propertyObserver = null; }
1144
- this.propertyObserver = new observer(function (mutations) {
1145
- $.each(mutations, self._sync);
1146
- });
1147
- this.propertyObserver.observe(el.get(0), { attributes:true, subtree:false });
1148
- }
1149
- },
1150
-
1151
- // abstract
1152
- triggerSelect: function(data) {
1153
- var evt = $.Event("select2-selecting", { val: this.id(data), object: data, choice: data });
1154
- this.opts.element.trigger(evt);
1155
- return !evt.isDefaultPrevented();
1156
- },
1157
-
1158
- /**
1159
- * Triggers the change event on the source element
1160
- */
1161
- // abstract
1162
- triggerChange: function (details) {
1163
-
1164
- details = details || {};
1165
- details= $.extend({}, details, { type: "change", val: this.val() });
1166
- // prevents recursive triggering
1167
- this.opts.element.data("select2-change-triggered", true);
1168
- this.opts.element.trigger(details);
1169
- this.opts.element.data("select2-change-triggered", false);
1170
-
1171
- // some validation frameworks ignore the change event and listen instead to keyup, click for selects
1172
- // so here we trigger the click event manually
1173
- this.opts.element.click();
1174
-
1175
- // ValidationEngine ignores the change event and listens instead to blur
1176
- // so here we trigger the blur event manually if so desired
1177
- if (this.opts.blurOnChange)
1178
- this.opts.element.blur();
1179
- },
1180
-
1181
- //abstract
1182
- isInterfaceEnabled: function()
1183
- {
1184
- return this.enabledInterface === true;
1185
- },
1186
-
1187
- // abstract
1188
- enableInterface: function() {
1189
- var enabled = this._enabled && !this._readonly,
1190
- disabled = !enabled;
1191
-
1192
- if (enabled === this.enabledInterface) return false;
1193
-
1194
- this.container.toggleClass("select2-container-disabled", disabled);
1195
- this.close();
1196
- this.enabledInterface = enabled;
1197
-
1198
- return true;
1199
- },
1200
-
1201
- // abstract
1202
- enable: function(enabled) {
1203
- if (enabled === undefined) enabled = true;
1204
- if (this._enabled === enabled) return;
1205
- this._enabled = enabled;
1206
-
1207
- this.opts.element.prop("disabled", !enabled);
1208
- this.enableInterface();
1209
- },
1210
-
1211
- // abstract
1212
- disable: function() {
1213
- this.enable(false);
1214
- },
1215
-
1216
- // abstract
1217
- readonly: function(enabled) {
1218
- if (enabled === undefined) enabled = false;
1219
- if (this._readonly === enabled) return;
1220
- this._readonly = enabled;
1221
-
1222
- this.opts.element.prop("readonly", enabled);
1223
- this.enableInterface();
1224
- },
1225
-
1226
- // abstract
1227
- opened: function () {
1228
- return (this.container) ? this.container.hasClass("select2-dropdown-open") : false;
1229
- },
1230
-
1231
- // abstract
1232
- positionDropdown: function() {
1233
- var $dropdown = this.dropdown,
1234
- container = this.container,
1235
- offset = container.offset(),
1236
- height = container.outerHeight(false),
1237
- width = container.outerWidth(false),
1238
- dropHeight = $dropdown.outerHeight(false),
1239
- $window = $(window),
1240
- windowWidth = $window.width(),
1241
- windowHeight = $window.height(),
1242
- viewPortRight = $window.scrollLeft() + windowWidth,
1243
- viewportBottom = $window.scrollTop() + windowHeight,
1244
- dropTop = offset.top + height,
1245
- dropLeft = offset.left,
1246
- enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
1247
- enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(),
1248
- dropWidth = $dropdown.outerWidth(false),
1249
- enoughRoomOnRight = function() {
1250
- return dropLeft + dropWidth <= viewPortRight;
1251
- },
1252
- enoughRoomOnLeft = function() {
1253
- return offset.left + viewPortRight + container.outerWidth(false) > dropWidth;
1254
- },
1255
- aboveNow = $dropdown.hasClass("select2-drop-above"),
1256
- bodyOffset,
1257
- above,
1258
- changeDirection,
1259
- css,
1260
- resultsListNode;
1261
-
1262
- // always prefer the current above/below alignment, unless there is not enough room
1263
- if (aboveNow) {
1264
- above = true;
1265
- if (!enoughRoomAbove && enoughRoomBelow) {
1266
- changeDirection = true;
1267
- above = false;
1268
- }
1269
- } else {
1270
- above = false;
1271
- if (!enoughRoomBelow && enoughRoomAbove) {
1272
- changeDirection = true;
1273
- above = true;
1274
- }
1275
- }
1276
-
1277
- //if we are changing direction we need to get positions when dropdown is hidden;
1278
- if (changeDirection) {
1279
- $dropdown.hide();
1280
- offset = this.container.offset();
1281
- height = this.container.outerHeight(false);
1282
- width = this.container.outerWidth(false);
1283
- dropHeight = $dropdown.outerHeight(false);
1284
- viewPortRight = $window.scrollLeft() + windowWidth;
1285
- viewportBottom = $window.scrollTop() + windowHeight;
1286
- dropTop = offset.top + height;
1287
- dropLeft = offset.left;
1288
- dropWidth = $dropdown.outerWidth(false);
1289
- $dropdown.show();
1290
-
1291
- // fix so the cursor does not move to the left within the search-textbox in IE
1292
- this.focusSearch();
1293
- }
1294
-
1295
- if (this.opts.dropdownAutoWidth) {
1296
- resultsListNode = $('.select2-results', $dropdown)[0];
1297
- $dropdown.addClass('select2-drop-auto-width');
1298
- $dropdown.css('width', '');
1299
- // Add scrollbar width to dropdown if vertical scrollbar is present
1300
- dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width);
1301
- dropWidth > width ? width = dropWidth : dropWidth = width;
1302
- dropHeight = $dropdown.outerHeight(false);
1303
- }
1304
- else {
1305
- this.container.removeClass('select2-drop-auto-width');
1306
- }
1307
-
1308
- //console.log("below/ droptop:", dropTop, "dropHeight", dropHeight, "sum", (dropTop+dropHeight)+" viewport bottom", viewportBottom, "enough?", enoughRoomBelow);
1309
- //console.log("above/ offset.top", offset.top, "dropHeight", dropHeight, "top", (offset.top-dropHeight), "scrollTop", this.body.scrollTop(), "enough?", enoughRoomAbove);
1310
-
1311
- // fix positioning when body has an offset and is not position: static
1312
- if (this.body.css('position') !== 'static') {
1313
- bodyOffset = this.body.offset();
1314
- dropTop -= bodyOffset.top;
1315
- dropLeft -= bodyOffset.left;
1316
- }
1317
-
1318
- if (!enoughRoomOnRight() && enoughRoomOnLeft()) {
1319
- dropLeft = offset.left + this.container.outerWidth(false) - dropWidth;
1320
- }
1321
-
1322
- css = {
1323
- left: dropLeft,
1324
- width: width
1325
- };
1326
-
1327
- if (above) {
1328
- css.top = offset.top - dropHeight;
1329
- css.bottom = 'auto';
1330
- this.container.addClass("select2-drop-above");
1331
- $dropdown.addClass("select2-drop-above");
1332
- }
1333
- else {
1334
- css.top = dropTop;
1335
- css.bottom = 'auto';
1336
- this.container.removeClass("select2-drop-above");
1337
- $dropdown.removeClass("select2-drop-above");
1338
- }
1339
- css = $.extend(css, evaluate(this.opts.dropdownCss, this.opts.element));
1340
-
1341
- $dropdown.css(css);
1342
- },
1343
-
1344
- // abstract
1345
- shouldOpen: function() {
1346
- var event;
1347
-
1348
- if (this.opened()) return false;
1349
-
1350
- if (this._enabled === false || this._readonly === true) return false;
1351
-
1352
- event = $.Event("select2-opening");
1353
- this.opts.element.trigger(event);
1354
- return !event.isDefaultPrevented();
1355
- },
1356
-
1357
- // abstract
1358
- clearDropdownAlignmentPreference: function() {
1359
- // clear the classes used to figure out the preference of where the dropdown should be opened
1360
- this.container.removeClass("select2-drop-above");
1361
- this.dropdown.removeClass("select2-drop-above");
1362
- },
1363
-
1364
- /**
1365
- * Opens the dropdown
1366
- *
1367
- * @return {Boolean} whether or not dropdown was opened. This method will return false if, for example,
1368
- * the dropdown is already open, or if the 'open' event listener on the element called preventDefault().
1369
- */
1370
- // abstract
1371
- open: function () {
1372
-
1373
- if (!this.shouldOpen()) return false;
1374
-
1375
- this.opening();
1376
-
1377
- // Only bind the document mousemove when the dropdown is visible
1378
- $document.on("mousemove.select2Event", function (e) {
1379
- lastMousePosition.x = e.pageX;
1380
- lastMousePosition.y = e.pageY;
1381
- });
1382
-
1383
- return true;
1384
- },
1385
-
1386
- /**
1387
- * Performs the opening of the dropdown
1388
- */
1389
- // abstract
1390
- opening: function() {
1391
- var cid = this.containerEventName,
1392
- scroll = "scroll." + cid,
1393
- resize = "resize."+cid,
1394
- orient = "orientationchange."+cid,
1395
- mask;
1396
-
1397
- this.container.addClass("select2-dropdown-open").addClass("select2-container-active");
1398
-
1399
- this.clearDropdownAlignmentPreference();
1400
-
1401
- if(this.dropdown[0] !== this.body.children().last()[0]) {
1402
- this.dropdown.detach().appendTo(this.body);
1403
- }
1404
-
1405
- // create the dropdown mask if doesn't already exist
1406
- mask = $("#select2-drop-mask");
1407
- if (mask.length === 0) {
1408
- mask = $(document.createElement("div"));
1409
- mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
1410
- mask.hide();
1411
- mask.appendTo(this.body);
1412
- mask.on("mousedown touchstart click", function (e) {
1413
- // Prevent IE from generating a click event on the body
1414
- reinsertElement(mask);
1415
-
1416
- var dropdown = $("#select2-drop"), self;
1417
- if (dropdown.length > 0) {
1418
- self=dropdown.data("select2");
1419
- if (self.opts.selectOnBlur) {
1420
- self.selectHighlighted({noFocus: true});
1421
- }
1422
- self.close();
1423
- e.preventDefault();
1424
- e.stopPropagation();
1425
- }
1426
- });
1427
- }
1428
-
1429
- // ensure the mask is always right before the dropdown
1430
- if (this.dropdown.prev()[0] !== mask[0]) {
1431
- this.dropdown.before(mask);
1432
- }
1433
-
1434
- // move the global id to the correct dropdown
1435
- $("#select2-drop").removeAttr("id");
1436
- this.dropdown.attr("id", "select2-drop");
1437
-
1438
- // show the elements
1439
- mask.show();
1440
-
1441
- this.positionDropdown();
1442
- this.dropdown.show();
1443
- this.positionDropdown();
1444
-
1445
- this.dropdown.addClass("select2-drop-active");
1446
-
1447
- // attach listeners to events that can change the position of the container and thus require
1448
- // the position of the dropdown to be updated as well so it does not come unglued from the container
1449
- var that = this;
1450
- this.container.parents().add(window).each(function () {
1451
- $(this).on(resize+" "+scroll+" "+orient, function (e) {
1452
- if (that.opened()) that.positionDropdown();
1453
- });
1454
- });
1455
-
1456
-
1457
- },
1458
-
1459
- // abstract
1460
- close: function () {
1461
- if (!this.opened()) return;
1462
-
1463
- var cid = this.containerEventName,
1464
- scroll = "scroll." + cid,
1465
- resize = "resize."+cid,
1466
- orient = "orientationchange."+cid;
1467
-
1468
- // unbind event listeners
1469
- this.container.parents().add(window).each(function () { $(this).off(scroll).off(resize).off(orient); });
1470
-
1471
- this.clearDropdownAlignmentPreference();
1472
-
1473
- $("#select2-drop-mask").hide();
1474
- this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id
1475
- this.dropdown.hide();
1476
- this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");
1477
- this.results.empty();
1478
-
1479
- // Now that the dropdown is closed, unbind the global document mousemove event
1480
- $document.off("mousemove.select2Event");
1481
-
1482
- this.clearSearch();
1483
- this.search.removeClass("select2-active");
1484
- this.opts.element.trigger($.Event("select2-close"));
1485
- },
1486
-
1487
- /**
1488
- * Opens control, sets input value, and updates results.
1489
- */
1490
- // abstract
1491
- externalSearch: function (term) {
1492
- this.open();
1493
- this.search.val(term);
1494
- this.updateResults(false);
1495
- },
1496
-
1497
- // abstract
1498
- clearSearch: function () {
1499
-
1500
- },
1501
-
1502
- //abstract
1503
- getMaximumSelectionSize: function() {
1504
- return evaluate(this.opts.maximumSelectionSize, this.opts.element);
1505
- },
1506
-
1507
- // abstract
1508
- ensureHighlightVisible: function () {
1509
- var results = this.results, children, index, child, hb, rb, y, more, topOffset;
1510
-
1511
- index = this.highlight();
1512
-
1513
- if (index < 0) return;
1514
-
1515
- if (index == 0) {
1516
-
1517
- // if the first element is highlighted scroll all the way to the top,
1518
- // that way any unselectable headers above it will also be scrolled
1519
- // into view
1520
-
1521
- results.scrollTop(0);
1522
- return;
1523
- }
1524
-
1525
- children = this.findHighlightableChoices().find('.select2-result-label');
1526
-
1527
- child = $(children[index]);
1528
-
1529
- topOffset = (child.offset() || {}).top || 0;
1530
-
1531
- hb = topOffset + child.outerHeight(true);
1532
-
1533
- // if this is the last child lets also make sure select2-more-results is visible
1534
- if (index === children.length - 1) {
1535
- more = results.find("li.select2-more-results");
1536
- if (more.length > 0) {
1537
- hb = more.offset().top + more.outerHeight(true);
1538
- }
1539
- }
1540
-
1541
- rb = results.offset().top + results.outerHeight(false);
1542
- if (hb > rb) {
1543
- results.scrollTop(results.scrollTop() + (hb - rb));
1544
- }
1545
- y = topOffset - results.offset().top;
1546
-
1547
- // make sure the top of the element is visible
1548
- if (y < 0 && child.css('display') != 'none' ) {
1549
- results.scrollTop(results.scrollTop() + y); // y is negative
1550
- }
1551
- },
1552
-
1553
- // abstract
1554
- findHighlightableChoices: function() {
1555
- return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
1556
- },
1557
-
1558
- // abstract
1559
- moveHighlight: function (delta) {
1560
- var choices = this.findHighlightableChoices(),
1561
- index = this.highlight();
1562
-
1563
- while (index > -1 && index < choices.length) {
1564
- index += delta;
1565
- var choice = $(choices[index]);
1566
- if (choice.hasClass("select2-result-selectable") && !choice.hasClass("select2-disabled") && !choice.hasClass("select2-selected")) {
1567
- this.highlight(index);
1568
- break;
1569
- }
1570
- }
1571
- },
1572
-
1573
- // abstract
1574
- highlight: function (index) {
1575
- var choices = this.findHighlightableChoices(),
1576
- choice,
1577
- data;
1578
-
1579
- if (arguments.length === 0) {
1580
- return indexOf(choices.filter(".select2-highlighted")[0], choices.get());
1581
- }
1582
-
1583
- if (index >= choices.length) index = choices.length - 1;
1584
- if (index < 0) index = 0;
1585
-
1586
- this.removeHighlight();
1587
-
1588
- choice = $(choices[index]);
1589
- choice.addClass("select2-highlighted");
1590
-
1591
- // ensure assistive technology can determine the active choice
1592
- this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
1593
-
1594
- this.ensureHighlightVisible();
1595
-
1596
- this.liveRegion.text(choice.text());
1597
-
1598
- data = choice.data("select2-data");
1599
- if (data) {
1600
- this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
1601
- }
1602
- },
1603
-
1604
- removeHighlight: function() {
1605
- this.results.find(".select2-highlighted").removeClass("select2-highlighted");
1606
- },
1607
-
1608
- touchMoved: function() {
1609
- this._touchMoved = true;
1610
- },
1611
-
1612
- clearTouchMoved: function() {
1613
- this._touchMoved = false;
1614
- },
1615
-
1616
- // abstract
1617
- countSelectableResults: function() {
1618
- return this.findHighlightableChoices().length;
1619
- },
1620
-
1621
- // abstract
1622
- highlightUnderEvent: function (event) {
1623
- var el = $(event.target).closest(".select2-result-selectable");
1624
- if (el.length > 0 && !el.is(".select2-highlighted")) {
1625
- var choices = this.findHighlightableChoices();
1626
- this.highlight(choices.index(el));
1627
- } else if (el.length == 0) {
1628
- // if we are over an unselectable item remove all highlights
1629
- this.removeHighlight();
1630
- }
1631
- },
1632
-
1633
- // abstract
1634
- loadMoreIfNeeded: function () {
1635
- var results = this.results,
1636
- more = results.find("li.select2-more-results"),
1637
- below, // pixels the element is below the scroll fold, below==0 is when the element is starting to be visible
1638
- page = this.resultsPage + 1,
1639
- self=this,
1640
- term=this.search.val(),
1641
- context=this.context;
1642
-
1643
- if (more.length === 0) return;
1644
- below = more.offset().top - results.offset().top - results.height();
1645
-
1646
- if (below <= this.opts.loadMorePadding) {
1647
- more.addClass("select2-active");
1648
- this.opts.query({
1649
- element: this.opts.element,
1650
- term: term,
1651
- page: page,
1652
- context: context,
1653
- matcher: this.opts.matcher,
1654
- callback: this.bind(function (data) {
1655
-
1656
- // ignore a response if the select2 has been closed before it was received
1657
- if (!self.opened()) return;
1658
-
1659
-
1660
- self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
1661
- self.postprocessResults(data, false, false);
1662
-
1663
- if (data.more===true) {
1664
- more.detach().appendTo(results).html(self.opts.escapeMarkup(evaluate(self.opts.formatLoadMore, self.opts.element, page+1)));
1665
- window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
1666
- } else {
1667
- more.remove();
1668
- }
1669
- self.positionDropdown();
1670
- self.resultsPage = page;
1671
- self.context = data.context;
1672
- this.opts.element.trigger({ type: "select2-loaded", items: data });
1673
- })});
1674
- }
1675
- },
1676
-
1677
- /**
1678
- * Default tokenizer function which does nothing
1679
- */
1680
- tokenize: function() {
1681
-
1682
- },
1683
-
1684
- /**
1685
- * @param initial whether or not this is the call to this method right after the dropdown has been opened
1686
- */
1687
- // abstract
1688
- updateResults: function (initial) {
1689
- var search = this.search,
1690
- results = this.results,
1691
- opts = this.opts,
1692
- data,
1693
- self = this,
1694
- input,
1695
- term = search.val(),
1696
- lastTerm = $.data(this.container, "select2-last-term"),
1697
- // sequence number used to drop out-of-order responses
1698
- queryNumber;
1699
-
1700
- // prevent duplicate queries against the same term
1701
- if (initial !== true && lastTerm && equal(term, lastTerm)) return;
1702
-
1703
- $.data(this.container, "select2-last-term", term);
1704
-
1705
- // if the search is currently hidden we do not alter the results
1706
- if (initial !== true && (this.showSearchInput === false || !this.opened())) {
1707
- return;
1708
- }
1709
-
1710
- function postRender() {
1711
- search.removeClass("select2-active");
1712
- self.positionDropdown();
1713
- if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) {
1714
- self.liveRegion.text(results.text());
1715
- }
1716
- else {
1717
- self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable:not(".select2-selected")').length));
1718
- }
1719
- }
1720
-
1721
- function render(html) {
1722
- results.html(html);
1723
- postRender();
1724
- }
1725
-
1726
- queryNumber = ++this.queryCount;
1727
-
1728
- var maxSelSize = this.getMaximumSelectionSize();
1729
- if (maxSelSize >=1) {
1730
- data = this.data();
1731
- if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
1732
- render("<li class='select2-selection-limit'>" + evaluate(opts.formatSelectionTooBig, opts.element, maxSelSize) + "</li>");
1733
- return;
1734
- }
1735
- }
1736
-
1737
- if (search.val().length < opts.minimumInputLength) {
1738
- if (checkFormatter(opts.formatInputTooShort, "formatInputTooShort")) {
1739
- render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, opts.element, search.val(), opts.minimumInputLength) + "</li>");
1740
- } else {
1741
- render("");
1742
- }
1743
- if (initial && this.showSearch) this.showSearch(true);
1744
- return;
1745
- }
1746
-
1747
- if (opts.maximumInputLength && search.val().length > opts.maximumInputLength) {
1748
- if (checkFormatter(opts.formatInputTooLong, "formatInputTooLong")) {
1749
- render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, opts.element, search.val(), opts.maximumInputLength) + "</li>");
1750
- } else {
1751
- render("");
1752
- }
1753
- return;
1754
- }
1755
-
1756
- if (opts.formatSearching && this.findHighlightableChoices().length === 0) {
1757
- render("<li class='select2-searching'>" + evaluate(opts.formatSearching, opts.element) + "</li>");
1758
- }
1759
-
1760
- search.addClass("select2-active");
1761
-
1762
- this.removeHighlight();
1763
-
1764
- // give the tokenizer a chance to pre-process the input
1765
- input = this.tokenize();
1766
- if (input != undefined && input != null) {
1767
- search.val(input);
1768
- }
1769
-
1770
- this.resultsPage = 1;
1771
-
1772
- opts.query({
1773
- element: opts.element,
1774
- term: search.val(),
1775
- page: this.resultsPage,
1776
- context: null,
1777
- matcher: opts.matcher,
1778
- callback: this.bind(function (data) {
1779
- var def; // default choice
1780
-
1781
- // ignore old responses
1782
- if (queryNumber != this.queryCount) {
1783
- return;
1784
- }
1785
-
1786
- // ignore a response if the select2 has been closed before it was received
1787
- if (!this.opened()) {
1788
- this.search.removeClass("select2-active");
1789
- return;
1790
- }
1791
-
1792
- // handle ajax error
1793
- if(data.hasError !== undefined && checkFormatter(opts.formatAjaxError, "formatAjaxError")) {
1794
- render("<li class='select2-ajax-error'>" + evaluate(opts.formatAjaxError, opts.element, data.jqXHR, data.textStatus, data.errorThrown) + "</li>");
1795
- return;
1796
- }
1797
-
1798
- // save context, if any
1799
- this.context = (data.context===undefined) ? null : data.context;
1800
- // create a default choice and prepend it to the list
1801
- if (this.opts.createSearchChoice && search.val() !== "") {
1802
- def = this.opts.createSearchChoice.call(self, search.val(), data.results);
1803
- if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
1804
- if ($(data.results).filter(
1805
- function () {
1806
- return equal(self.id(this), self.id(def));
1807
- }).length === 0) {
1808
- this.opts.createSearchChoicePosition(data.results, def);
1809
- }
1810
- }
1811
- }
1812
-
1813
- if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
1814
- render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, opts.element, search.val()) + "</li>");
1815
- return;
1816
- }
1817
-
1818
- results.empty();
1819
- self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
1820
-
1821
- if (data.more === true && checkFormatter(opts.formatLoadMore, "formatLoadMore")) {
1822
- results.append("<li class='select2-more-results'>" + opts.escapeMarkup(evaluate(opts.formatLoadMore, opts.element, this.resultsPage)) + "</li>");
1823
- window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
1824
- }
1825
-
1826
- this.postprocessResults(data, initial);
1827
-
1828
- postRender();
1829
-
1830
- this.opts.element.trigger({ type: "select2-loaded", items: data });
1831
- })});
1832
- },
1833
-
1834
- // abstract
1835
- cancel: function () {
1836
- this.close();
1837
- },
1838
-
1839
- // abstract
1840
- blur: function () {
1841
- // if selectOnBlur == true, select the currently highlighted option
1842
- if (this.opts.selectOnBlur)
1843
- this.selectHighlighted({noFocus: true});
1844
-
1845
- this.close();
1846
- this.container.removeClass("select2-container-active");
1847
- // synonymous to .is(':focus'), which is available in jquery >= 1.6
1848
- if (this.search[0] === document.activeElement) { this.search.blur(); }
1849
- this.clearSearch();
1850
- this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
1851
- },
1852
-
1853
- // abstract
1854
- focusSearch: function () {
1855
- focus(this.search);
1856
- },
1857
-
1858
- // abstract
1859
- selectHighlighted: function (options) {
1860
- if (this._touchMoved) {
1861
- this.clearTouchMoved();
1862
- return;
1863
- }
1864
- var index=this.highlight(),
1865
- highlighted=this.results.find(".select2-highlighted"),
1866
- data = highlighted.closest('.select2-result').data("select2-data");
1867
-
1868
- if (data) {
1869
- this.highlight(index);
1870
- this.onSelect(data, options);
1871
- } else if (options && options.noFocus) {
1872
- this.close();
1873
- }
1874
- },
1875
-
1876
- // abstract
1877
- getPlaceholder: function () {
1878
- var placeholderOption;
1879
- return this.opts.element.attr("placeholder") ||
1880
- this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
1881
- this.opts.element.data("placeholder") ||
1882
- this.opts.placeholder ||
1883
- ((placeholderOption = this.getPlaceholderOption()) !== undefined ? placeholderOption.text() : undefined);
1884
- },
1885
-
1886
- // abstract
1887
- getPlaceholderOption: function() {
1888
- if (this.select) {
1889
- var firstOption = this.select.children('option').first();
1890
- if (this.opts.placeholderOption !== undefined ) {
1891
- //Determine the placeholder option based on the specified placeholderOption setting
1892
- return (this.opts.placeholderOption === "first" && firstOption) ||
1893
- (typeof this.opts.placeholderOption === "function" && this.opts.placeholderOption(this.select));
1894
- } else if ($.trim(firstOption.text()) === "" && firstOption.val() === "") {
1895
- //No explicit placeholder option specified, use the first if it's blank
1896
- return firstOption;
1897
- }
1898
- }
1899
- },
1900
-
1901
- /**
1902
- * Get the desired width for the container element. This is
1903
- * derived first from option `width` passed to select2, then
1904
- * the inline 'style' on the original element, and finally
1905
- * falls back to the jQuery calculated element width.
1906
- */
1907
- // abstract
1908
- initContainerWidth: function () {
1909
- function resolveContainerWidth() {
1910
- var style, attrs, matches, i, l, attr;
1911
-
1912
- if (this.opts.width === "off") {
1913
- return null;
1914
- } else if (this.opts.width === "element"){
1915
- return this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px';
1916
- } else if (this.opts.width === "copy" || this.opts.width === "resolve") {
1917
- // check if there is inline style on the element that contains width
1918
- style = this.opts.element.attr('style');
1919
- if (style !== undefined) {
1920
- attrs = style.split(';');
1921
- for (i = 0, l = attrs.length; i < l; i = i + 1) {
1922
- attr = attrs[i].replace(/\s/g, '');
1923
- matches = attr.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);
1924
- if (matches !== null && matches.length >= 1)
1925
- return matches[1];
1926
- }
1927
- }
1928
-
1929
- if (this.opts.width === "resolve") {
1930
- // next check if css('width') can resolve a width that is percent based, this is sometimes possible
1931
- // when attached to input type=hidden or elements hidden via css
1932
- style = this.opts.element.css('width');
1933
- if (style.indexOf("%") > 0) return style;
1934
-
1935
- // finally, fallback on the calculated width of the element
1936
- return (this.opts.element.outerWidth(false) === 0 ? 'auto' : this.opts.element.outerWidth(false) + 'px');
1937
- }
1938
-
1939
- return null;
1940
- } else if ($.isFunction(this.opts.width)) {
1941
- return this.opts.width();
1942
- } else {
1943
- return this.opts.width;
1944
- }
1945
- };
1946
-
1947
- var width = resolveContainerWidth.call(this);
1948
- if (width !== null) {
1949
- this.container.css("width", width);
1950
- }
1951
- }
1952
- });
1953
-
1954
- SingleSelect2 = clazz(AbstractSelect2, {
1955
-
1956
- // single
1957
-
1958
- createContainer: function () {
1959
- var container = $(document.createElement("div")).attr({
1960
- "class": "select2-container"
1961
- }).html([
1962
- "<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>",
1963
- " <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>",
1964
- " <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>",
1965
- "</a>",
1966
- "<label for='' class='select2-offscreen'></label>",
1967
- "<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />",
1968
- "<div class='select2-drop select2-display-none'>",
1969
- " <div class='select2-search'>",
1970
- " <label for='' class='select2-offscreen'></label>",
1971
- " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'",
1972
- " aria-autocomplete='list' />",
1973
- " </div>",
1974
- " <ul class='select2-results' role='listbox'>",
1975
- " </ul>",
1976
- "</div>"].join(""));
1977
- return container;
1978
- },
1979
-
1980
- // single
1981
- enableInterface: function() {
1982
- if (this.parent.enableInterface.apply(this, arguments)) {
1983
- this.focusser.prop("disabled", !this.isInterfaceEnabled());
1984
- }
1985
- },
1986
-
1987
- // single
1988
- opening: function () {
1989
- var el, range, len;
1990
-
1991
- if (this.opts.minimumResultsForSearch >= 0) {
1992
- this.showSearch(true);
1993
- }
1994
-
1995
- this.parent.opening.apply(this, arguments);
1996
-
1997
- if (this.showSearchInput !== false) {
1998
- // IE appends focusser.val() at the end of field :/ so we manually insert it at the beginning using a range
1999
- // all other browsers handle this just fine
2000
-
2001
- this.search.val(this.focusser.val());
2002
- }
2003
- if (this.opts.shouldFocusInput(this)) {
2004
- this.search.focus();
2005
- // move the cursor to the end after focussing, otherwise it will be at the beginning and
2006
- // new text will appear *before* focusser.val()
2007
- el = this.search.get(0);
2008
- if (el.createTextRange) {
2009
- range = el.createTextRange();
2010
- range.collapse(false);
2011
- range.select();
2012
- } else if (el.setSelectionRange) {
2013
- len = this.search.val().length;
2014
- el.setSelectionRange(len, len);
2015
- }
2016
- }
2017
-
2018
- // initializes search's value with nextSearchTerm (if defined by user)
2019
- // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2020
- if(this.search.val() === "") {
2021
- if(this.nextSearchTerm != undefined){
2022
- this.search.val(this.nextSearchTerm);
2023
- this.search.select();
2024
- }
2025
- }
2026
-
2027
- this.focusser.prop("disabled", true).val("");
2028
- this.updateResults(true);
2029
- this.opts.element.trigger($.Event("select2-open"));
2030
- },
2031
-
2032
- // single
2033
- close: function () {
2034
- if (!this.opened()) return;
2035
- this.parent.close.apply(this, arguments);
2036
-
2037
- this.focusser.prop("disabled", false);
2038
-
2039
- if (this.opts.shouldFocusInput(this)) {
2040
- this.focusser.focus();
2041
- }
2042
- },
2043
-
2044
- // single
2045
- focus: function () {
2046
- if (this.opened()) {
2047
- this.close();
2048
- } else {
2049
- this.focusser.prop("disabled", false);
2050
- if (this.opts.shouldFocusInput(this)) {
2051
- this.focusser.focus();
2052
- }
2053
- }
2054
- },
2055
-
2056
- // single
2057
- isFocused: function () {
2058
- return this.container.hasClass("select2-container-active");
2059
- },
2060
-
2061
- // single
2062
- cancel: function () {
2063
- this.parent.cancel.apply(this, arguments);
2064
- this.focusser.prop("disabled", false);
2065
-
2066
- if (this.opts.shouldFocusInput(this)) {
2067
- this.focusser.focus();
2068
- }
2069
- },
2070
-
2071
- // single
2072
- destroy: function() {
2073
- $("label[for='" + this.focusser.attr('id') + "']")
2074
- .attr('for', this.opts.element.attr("id"));
2075
- this.parent.destroy.apply(this, arguments);
2076
-
2077
- cleanupJQueryElements.call(this,
2078
- "selection",
2079
- "focusser"
2080
- );
2081
- },
2082
-
2083
- // single
2084
- initContainer: function () {
2085
-
2086
- var selection,
2087
- container = this.container,
2088
- dropdown = this.dropdown,
2089
- idSuffix = nextUid(),
2090
- elementLabel;
2091
-
2092
- if (this.opts.minimumResultsForSearch < 0) {
2093
- this.showSearch(false);
2094
- } else {
2095
- this.showSearch(true);
2096
- }
2097
-
2098
- this.selection = selection = container.find(".select2-choice");
2099
-
2100
- this.focusser = container.find(".select2-focusser");
2101
-
2102
- // add aria associations
2103
- selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix);
2104
- this.focusser.attr("aria-labelledby", "select2-chosen-"+idSuffix);
2105
- this.results.attr("id", "select2-results-"+idSuffix);
2106
- this.search.attr("aria-owns", "select2-results-"+idSuffix);
2107
-
2108
- // rewrite labels from original element to focusser
2109
- this.focusser.attr("id", "s2id_autogen"+idSuffix);
2110
-
2111
- elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2112
- this.opts.element.focus(this.bind(function () { this.focus(); }));
2113
-
2114
- this.focusser.prev()
2115
- .text(elementLabel.text())
2116
- .attr('for', this.focusser.attr('id'));
2117
-
2118
- // Ensure the original element retains an accessible name
2119
- var originalTitle = this.opts.element.attr("title");
2120
- this.opts.element.attr("title", (originalTitle || elementLabel.text()));
2121
-
2122
- this.focusser.attr("tabindex", this.elementTabIndex);
2123
-
2124
- // write label for search field using the label from the focusser element
2125
- this.search.attr("id", this.focusser.attr('id') + '_search');
2126
-
2127
- this.search.prev()
2128
- .text($("label[for='" + this.focusser.attr('id') + "']").text())
2129
- .attr('for', this.search.attr('id'));
2130
-
2131
- this.search.on("keydown", this.bind(function (e) {
2132
- if (!this.isInterfaceEnabled()) return;
2133
-
2134
- // filter 229 keyCodes (input method editor is processing key input)
2135
- if (229 == e.keyCode) return;
2136
-
2137
- if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
2138
- // prevent the page from scrolling
2139
- killEvent(e);
2140
- return;
2141
- }
2142
-
2143
- switch (e.which) {
2144
- case KEY.UP:
2145
- case KEY.DOWN:
2146
- this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
2147
- killEvent(e);
2148
- return;
2149
- case KEY.ENTER:
2150
- this.selectHighlighted();
2151
- killEvent(e);
2152
- return;
2153
- case KEY.TAB:
2154
- this.selectHighlighted({noFocus: true});
2155
- return;
2156
- case KEY.ESC:
2157
- this.cancel(e);
2158
- killEvent(e);
2159
- return;
2160
- }
2161
- }));
2162
-
2163
- this.search.on("blur", this.bind(function(e) {
2164
- // a workaround for chrome to keep the search field focussed when the scroll bar is used to scroll the dropdown.
2165
- // without this the search field loses focus which is annoying
2166
- if (document.activeElement === this.body.get(0)) {
2167
- window.setTimeout(this.bind(function() {
2168
- if (this.opened()) {
2169
- this.search.focus();
2170
- }
2171
- }), 0);
2172
- }
2173
- }));
2174
-
2175
- this.focusser.on("keydown", this.bind(function (e) {
2176
- if (!this.isInterfaceEnabled()) return;
2177
-
2178
- if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e) || e.which === KEY.ESC) {
2179
- return;
2180
- }
2181
-
2182
- if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
2183
- killEvent(e);
2184
- return;
2185
- }
2186
-
2187
- if (e.which == KEY.DOWN || e.which == KEY.UP
2188
- || (e.which == KEY.ENTER && this.opts.openOnEnter)) {
2189
-
2190
- if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) return;
2191
-
2192
- this.open();
2193
- killEvent(e);
2194
- return;
2195
- }
2196
-
2197
- if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE) {
2198
- if (this.opts.allowClear) {
2199
- this.clear();
2200
- }
2201
- killEvent(e);
2202
- return;
2203
- }
2204
- }));
2205
-
2206
-
2207
- installKeyUpChangeEvent(this.focusser);
2208
- this.focusser.on("keyup-change input", this.bind(function(e) {
2209
- if (this.opts.minimumResultsForSearch >= 0) {
2210
- e.stopPropagation();
2211
- if (this.opened()) return;
2212
- this.open();
2213
- }
2214
- }));
2215
-
2216
- selection.on("mousedown touchstart", "abbr", this.bind(function (e) {
2217
- if (!this.isInterfaceEnabled()) {
2218
- return;
2219
- }
2220
-
2221
- this.clear();
2222
- killEventImmediately(e);
2223
- this.close();
2224
-
2225
- if (this.selection) {
2226
- this.selection.focus();
2227
- }
2228
- }));
2229
-
2230
- selection.on("mousedown touchstart", this.bind(function (e) {
2231
- // Prevent IE from generating a click event on the body
2232
- reinsertElement(selection);
2233
-
2234
- if (!this.container.hasClass("select2-container-active")) {
2235
- this.opts.element.trigger($.Event("select2-focus"));
2236
- }
2237
-
2238
- if (this.opened()) {
2239
- this.close();
2240
- } else if (this.isInterfaceEnabled()) {
2241
- this.open();
2242
- }
2243
-
2244
- killEvent(e);
2245
- }));
2246
-
2247
- dropdown.on("mousedown touchstart", this.bind(function() {
2248
- if (this.opts.shouldFocusInput(this)) {
2249
- this.search.focus();
2250
- }
2251
- }));
2252
-
2253
- selection.on("focus", this.bind(function(e) {
2254
- killEvent(e);
2255
- }));
2256
-
2257
- this.focusser.on("focus", this.bind(function(){
2258
- if (!this.container.hasClass("select2-container-active")) {
2259
- this.opts.element.trigger($.Event("select2-focus"));
2260
- }
2261
- this.container.addClass("select2-container-active");
2262
- })).on("blur", this.bind(function() {
2263
- if (!this.opened()) {
2264
- this.container.removeClass("select2-container-active");
2265
- this.opts.element.trigger($.Event("select2-blur"));
2266
- }
2267
- }));
2268
- this.search.on("focus", this.bind(function(){
2269
- if (!this.container.hasClass("select2-container-active")) {
2270
- this.opts.element.trigger($.Event("select2-focus"));
2271
- }
2272
- this.container.addClass("select2-container-active");
2273
- }));
2274
-
2275
- this.initContainerWidth();
2276
- this.opts.element.hide();
2277
- this.setPlaceholder();
2278
-
2279
- },
2280
-
2281
- // single
2282
- clear: function(triggerChange) {
2283
- var data=this.selection.data("select2-data");
2284
- if (data) { // guard against queued quick consecutive clicks
2285
- var evt = $.Event("select2-clearing");
2286
- this.opts.element.trigger(evt);
2287
- if (evt.isDefaultPrevented()) {
2288
- return;
2289
- }
2290
- var placeholderOption = this.getPlaceholderOption();
2291
- this.opts.element.val(placeholderOption ? placeholderOption.val() : "");
2292
- this.selection.find(".select2-chosen").empty();
2293
- this.selection.removeData("select2-data");
2294
- this.setPlaceholder();
2295
-
2296
- if (triggerChange !== false){
2297
- this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
2298
- this.triggerChange({removed:data});
2299
- }
2300
- }
2301
- },
2302
-
2303
- /**
2304
- * Sets selection based on source element's value
2305
- */
2306
- // single
2307
- initSelection: function () {
2308
- var selected;
2309
- if (this.isPlaceholderOptionSelected()) {
2310
- this.updateSelection(null);
2311
- this.close();
2312
- this.setPlaceholder();
2313
- } else {
2314
- var self = this;
2315
- this.opts.initSelection.call(null, this.opts.element, function(selected){
2316
- if (selected !== undefined && selected !== null) {
2317
- self.updateSelection(selected);
2318
- self.close();
2319
- self.setPlaceholder();
2320
- self.nextSearchTerm = self.opts.nextSearchTerm(selected, self.search.val());
2321
- }
2322
- });
2323
- }
2324
- },
2325
-
2326
- isPlaceholderOptionSelected: function() {
2327
- var placeholderOption;
2328
- if (this.getPlaceholder() === undefined) return false; // no placeholder specified so no option should be considered
2329
- return ((placeholderOption = this.getPlaceholderOption()) !== undefined && placeholderOption.prop("selected"))
2330
- || (this.opts.element.val() === "")
2331
- || (this.opts.element.val() === undefined)
2332
- || (this.opts.element.val() === null);
2333
- },
2334
-
2335
- // single
2336
- prepareOpts: function () {
2337
- var opts = this.parent.prepareOpts.apply(this, arguments),
2338
- self=this;
2339
-
2340
- if (opts.element.get(0).tagName.toLowerCase() === "select") {
2341
- // install the selection initializer
2342
- opts.initSelection = function (element, callback) {
2343
- var selected = element.find("option").filter(function() { return this.selected && !this.disabled });
2344
- // a single select box always has a value, no need to null check 'selected'
2345
- callback(self.optionToData(selected));
2346
- };
2347
- } else if ("data" in opts) {
2348
- // install default initSelection when applied to hidden input and data is local
2349
- opts.initSelection = opts.initSelection || function (element, callback) {
2350
- var id = element.val();
2351
- //search in data by id, storing the actual matching item
2352
- var match = null;
2353
- opts.query({
2354
- matcher: function(term, text, el){
2355
- var is_match = equal(id, opts.id(el));
2356
- if (is_match) {
2357
- match = el;
2358
- }
2359
- return is_match;
2360
- },
2361
- callback: !$.isFunction(callback) ? $.noop : function() {
2362
- callback(match);
2363
- }
2364
- });
2365
- };
2366
- }
2367
-
2368
- return opts;
2369
- },
2370
-
2371
- // single
2372
- getPlaceholder: function() {
2373
- // if a placeholder is specified on a single select without a valid placeholder option ignore it
2374
- if (this.select) {
2375
- if (this.getPlaceholderOption() === undefined) {
2376
- return undefined;
2377
- }
2378
- }
2379
-
2380
- return this.parent.getPlaceholder.apply(this, arguments);
2381
- },
2382
-
2383
- // single
2384
- setPlaceholder: function () {
2385
- var placeholder = this.getPlaceholder();
2386
-
2387
- if (this.isPlaceholderOptionSelected() && placeholder !== undefined) {
2388
-
2389
- // check for a placeholder option if attached to a select
2390
- if (this.select && this.getPlaceholderOption() === undefined) return;
2391
-
2392
- this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(placeholder));
2393
-
2394
- this.selection.addClass("select2-default");
2395
-
2396
- this.container.removeClass("select2-allowclear");
2397
- }
2398
- },
2399
-
2400
- // single
2401
- postprocessResults: function (data, initial, noHighlightUpdate) {
2402
- var selected = 0, self = this, showSearchInput = true;
2403
-
2404
- // find the selected element in the result list
2405
-
2406
- this.findHighlightableChoices().each2(function (i, elm) {
2407
- if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
2408
- selected = i;
2409
- return false;
2410
- }
2411
- });
2412
-
2413
- // and highlight it
2414
- if (noHighlightUpdate !== false) {
2415
- if (initial === true && selected >= 0) {
2416
- this.highlight(selected);
2417
- } else {
2418
- this.highlight(0);
2419
- }
2420
- }
2421
-
2422
- // hide the search box if this is the first we got the results and there are enough of them for search
2423
-
2424
- if (initial === true) {
2425
- var min = this.opts.minimumResultsForSearch;
2426
- if (min >= 0) {
2427
- this.showSearch(countResults(data.results) >= min);
2428
- }
2429
- }
2430
- },
2431
-
2432
- // single
2433
- showSearch: function(showSearchInput) {
2434
- if (this.showSearchInput === showSearchInput) return;
2435
-
2436
- this.showSearchInput = showSearchInput;
2437
-
2438
- this.dropdown.find(".select2-search").toggleClass("select2-search-hidden", !showSearchInput);
2439
- this.dropdown.find(".select2-search").toggleClass("select2-offscreen", !showSearchInput);
2440
- //add "select2-with-searchbox" to the container if search box is shown
2441
- $(this.dropdown, this.container).toggleClass("select2-with-searchbox", showSearchInput);
2442
- },
2443
-
2444
- // single
2445
- onSelect: function (data, options) {
2446
-
2447
- if (!this.triggerSelect(data)) { return; }
2448
-
2449
- var old = this.opts.element.val(),
2450
- oldData = this.data();
2451
-
2452
- this.opts.element.val(this.id(data));
2453
- this.updateSelection(data);
2454
-
2455
- this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
2456
-
2457
- this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
2458
- this.close();
2459
-
2460
- if ((!options || !options.noFocus) && this.opts.shouldFocusInput(this)) {
2461
- this.focusser.focus();
2462
- }
2463
-
2464
- if (!equal(old, this.id(data))) {
2465
- this.triggerChange({ added: data, removed: oldData });
2466
- }
2467
- },
2468
-
2469
- // single
2470
- updateSelection: function (data) {
2471
-
2472
- var container=this.selection.find(".select2-chosen"), formatted, cssClass;
2473
-
2474
- this.selection.data("select2-data", data);
2475
-
2476
- container.empty();
2477
- if (data !== null) {
2478
- formatted=this.opts.formatSelection(data, container, this.opts.escapeMarkup);
2479
- }
2480
- if (formatted !== undefined) {
2481
- container.append(formatted);
2482
- }
2483
- cssClass=this.opts.formatSelectionCssClass(data, container);
2484
- if (cssClass !== undefined) {
2485
- container.addClass(cssClass);
2486
- }
2487
-
2488
- this.selection.removeClass("select2-default");
2489
-
2490
- if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
2491
- this.container.addClass("select2-allowclear");
2492
- }
2493
- },
2494
-
2495
- // single
2496
- val: function () {
2497
- var val,
2498
- triggerChange = false,
2499
- data = null,
2500
- self = this,
2501
- oldData = this.data();
2502
-
2503
- if (arguments.length === 0) {
2504
- return this.opts.element.val();
2505
- }
2506
-
2507
- val = arguments[0];
2508
-
2509
- if (arguments.length > 1) {
2510
- triggerChange = arguments[1];
2511
- }
2512
-
2513
- if (this.select) {
2514
- this.select
2515
- .val(val)
2516
- .find("option").filter(function() { return this.selected }).each2(function (i, elm) {
2517
- data = self.optionToData(elm);
2518
- return false;
2519
- });
2520
- this.updateSelection(data);
2521
- this.setPlaceholder();
2522
- if (triggerChange) {
2523
- this.triggerChange({added: data, removed:oldData});
2524
- }
2525
- } else {
2526
- // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
2527
- if (!val && val !== 0) {
2528
- this.clear(triggerChange);
2529
- return;
2530
- }
2531
- if (this.opts.initSelection === undefined) {
2532
- throw new Error("cannot call val() if initSelection() is not defined");
2533
- }
2534
- this.opts.element.val(val);
2535
- this.opts.initSelection(this.opts.element, function(data){
2536
- self.opts.element.val(!data ? "" : self.id(data));
2537
- self.updateSelection(data);
2538
- self.setPlaceholder();
2539
- if (triggerChange) {
2540
- self.triggerChange({added: data, removed:oldData});
2541
- }
2542
- });
2543
- }
2544
- },
2545
-
2546
- // single
2547
- clearSearch: function () {
2548
- this.search.val("");
2549
- this.focusser.val("");
2550
- },
2551
-
2552
- // single
2553
- data: function(value) {
2554
- var data,
2555
- triggerChange = false;
2556
-
2557
- if (arguments.length === 0) {
2558
- data = this.selection.data("select2-data");
2559
- if (data == undefined) data = null;
2560
- return data;
2561
- } else {
2562
- if (arguments.length > 1) {
2563
- triggerChange = arguments[1];
2564
- }
2565
- if (!value) {
2566
- this.clear(triggerChange);
2567
- } else {
2568
- data = this.data();
2569
- this.opts.element.val(!value ? "" : this.id(value));
2570
- this.updateSelection(value);
2571
- if (triggerChange) {
2572
- this.triggerChange({added: value, removed:data});
2573
- }
2574
- }
2575
- }
2576
- }
2577
- });
2578
-
2579
- MultiSelect2 = clazz(AbstractSelect2, {
2580
-
2581
- // multi
2582
- createContainer: function () {
2583
- var container = $(document.createElement("div")).attr({
2584
- "class": "select2-container select2-container-multi"
2585
- }).html([
2586
- "<ul class='select2-choices'>",
2587
- " <li class='select2-search-field'>",
2588
- " <label for='' class='select2-offscreen'></label>",
2589
- " <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>",
2590
- " </li>",
2591
- "</ul>",
2592
- "<div class='select2-drop select2-drop-multi select2-display-none'>",
2593
- " <ul class='select2-results'>",
2594
- " </ul>",
2595
- "</div>"].join(""));
2596
- return container;
2597
- },
2598
-
2599
- // multi
2600
- prepareOpts: function () {
2601
- var opts = this.parent.prepareOpts.apply(this, arguments),
2602
- self=this;
2603
-
2604
- // TODO validate placeholder is a string if specified
2605
- if (opts.element.get(0).tagName.toLowerCase() === "select") {
2606
- // install the selection initializer
2607
- opts.initSelection = function (element, callback) {
2608
-
2609
- var data = [];
2610
-
2611
- element.find("option").filter(function() { return this.selected && !this.disabled }).each2(function (i, elm) {
2612
- data.push(self.optionToData(elm));
2613
- });
2614
- callback(data);
2615
- };
2616
- } else if ("data" in opts) {
2617
- // install default initSelection when applied to hidden input and data is local
2618
- opts.initSelection = opts.initSelection || function (element, callback) {
2619
- var ids = splitVal(element.val(), opts.separator, opts.transformVal);
2620
- //search in data by array of ids, storing matching items in a list
2621
- var matches = [];
2622
- opts.query({
2623
- matcher: function(term, text, el){
2624
- var is_match = $.grep(ids, function(id) {
2625
- return equal(id, opts.id(el));
2626
- }).length;
2627
- if (is_match) {
2628
- matches.push(el);
2629
- }
2630
- return is_match;
2631
- },
2632
- callback: !$.isFunction(callback) ? $.noop : function() {
2633
- // reorder matches based on the order they appear in the ids array because right now
2634
- // they are in the order in which they appear in data array
2635
- var ordered = [];
2636
- for (var i = 0; i < ids.length; i++) {
2637
- var id = ids[i];
2638
- for (var j = 0; j < matches.length; j++) {
2639
- var match = matches[j];
2640
- if (equal(id, opts.id(match))) {
2641
- ordered.push(match);
2642
- matches.splice(j, 1);
2643
- break;
2644
- }
2645
- }
2646
- }
2647
- callback(ordered);
2648
- }
2649
- });
2650
- };
2651
- }
2652
-
2653
- return opts;
2654
- },
2655
-
2656
- // multi
2657
- selectChoice: function (choice) {
2658
-
2659
- var selected = this.container.find(".select2-search-choice-focus");
2660
- if (selected.length && choice && choice[0] == selected[0]) {
2661
-
2662
- } else {
2663
- if (selected.length) {
2664
- this.opts.element.trigger("choice-deselected", selected);
2665
- }
2666
- selected.removeClass("select2-search-choice-focus");
2667
- if (choice && choice.length) {
2668
- this.close();
2669
- choice.addClass("select2-search-choice-focus");
2670
- this.opts.element.trigger("choice-selected", choice);
2671
- }
2672
- }
2673
- },
2674
-
2675
- // multi
2676
- destroy: function() {
2677
- $("label[for='" + this.search.attr('id') + "']")
2678
- .attr('for', this.opts.element.attr("id"));
2679
- this.parent.destroy.apply(this, arguments);
2680
-
2681
- cleanupJQueryElements.call(this,
2682
- "searchContainer",
2683
- "selection"
2684
- );
2685
- },
2686
-
2687
- // multi
2688
- initContainer: function () {
2689
-
2690
- var selector = ".select2-choices", selection;
2691
-
2692
- this.searchContainer = this.container.find(".select2-search-field");
2693
- this.selection = selection = this.container.find(selector);
2694
-
2695
- var _this = this;
2696
- this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) {
2697
- _this.search[0].focus();
2698
- _this.selectChoice($(this));
2699
- });
2700
-
2701
- // rewrite labels from original element to focusser
2702
- this.search.attr("id", "s2id_autogen"+nextUid());
2703
-
2704
- this.search.prev()
2705
- .text($("label[for='" + this.opts.element.attr("id") + "']").text())
2706
- .attr('for', this.search.attr('id'));
2707
- this.opts.element.focus(this.bind(function () { this.focus(); }));
2708
-
2709
- this.search.on("input paste", this.bind(function() {
2710
- if (this.search.attr('placeholder') && this.search.val().length == 0) return;
2711
- if (!this.isInterfaceEnabled()) return;
2712
- if (!this.opened()) {
2713
- this.open();
2714
- }
2715
- }));
2716
-
2717
- this.search.attr("tabindex", this.elementTabIndex);
2718
-
2719
- this.keydowns = 0;
2720
- this.search.on("keydown", this.bind(function (e) {
2721
- if (!this.isInterfaceEnabled()) return;
2722
-
2723
- ++this.keydowns;
2724
- var selected = selection.find(".select2-search-choice-focus");
2725
- var prev = selected.prev(".select2-search-choice:not(.select2-locked)");
2726
- var next = selected.next(".select2-search-choice:not(.select2-locked)");
2727
- var pos = getCursorInfo(this.search);
2728
-
2729
- if (selected.length &&
2730
- (e.which == KEY.LEFT || e.which == KEY.RIGHT || e.which == KEY.BACKSPACE || e.which == KEY.DELETE || e.which == KEY.ENTER)) {
2731
- var selectedChoice = selected;
2732
- if (e.which == KEY.LEFT && prev.length) {
2733
- selectedChoice = prev;
2734
- }
2735
- else if (e.which == KEY.RIGHT) {
2736
- selectedChoice = next.length ? next : null;
2737
- }
2738
- else if (e.which === KEY.BACKSPACE) {
2739
- if (this.unselect(selected.first())) {
2740
- this.search.width(10);
2741
- selectedChoice = prev.length ? prev : next;
2742
- }
2743
- } else if (e.which == KEY.DELETE) {
2744
- if (this.unselect(selected.first())) {
2745
- this.search.width(10);
2746
- selectedChoice = next.length ? next : null;
2747
- }
2748
- } else if (e.which == KEY.ENTER) {
2749
- selectedChoice = null;
2750
- }
2751
-
2752
- this.selectChoice(selectedChoice);
2753
- killEvent(e);
2754
- if (!selectedChoice || !selectedChoice.length) {
2755
- this.open();
2756
- }
2757
- return;
2758
- } else if (((e.which === KEY.BACKSPACE && this.keydowns == 1)
2759
- || e.which == KEY.LEFT) && (pos.offset == 0 && !pos.length)) {
2760
-
2761
- this.selectChoice(selection.find(".select2-search-choice:not(.select2-locked)").last());
2762
- killEvent(e);
2763
- return;
2764
- } else {
2765
- this.selectChoice(null);
2766
- }
2767
-
2768
- if (this.opened()) {
2769
- switch (e.which) {
2770
- case KEY.UP:
2771
- case KEY.DOWN:
2772
- this.moveHighlight((e.which === KEY.UP) ? -1 : 1);
2773
- killEvent(e);
2774
- return;
2775
- case KEY.ENTER:
2776
- this.selectHighlighted();
2777
- killEvent(e);
2778
- return;
2779
- case KEY.TAB:
2780
- this.selectHighlighted({noFocus:true});
2781
- this.close();
2782
- return;
2783
- case KEY.ESC:
2784
- this.cancel(e);
2785
- killEvent(e);
2786
- return;
2787
- }
2788
- }
2789
-
2790
- if (e.which === KEY.TAB || KEY.isControl(e) || KEY.isFunctionKey(e)
2791
- || e.which === KEY.BACKSPACE || e.which === KEY.ESC) {
2792
- return;
2793
- }
2794
-
2795
- if (e.which === KEY.ENTER) {
2796
- if (this.opts.openOnEnter === false) {
2797
- return;
2798
- } else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
2799
- return;
2800
- }
2801
- }
2802
-
2803
- this.open();
2804
-
2805
- if (e.which === KEY.PAGE_UP || e.which === KEY.PAGE_DOWN) {
2806
- // prevent the page from scrolling
2807
- killEvent(e);
2808
- }
2809
-
2810
- if (e.which === KEY.ENTER) {
2811
- // prevent form from being submitted
2812
- killEvent(e);
2813
- }
2814
-
2815
- }));
2816
-
2817
- this.search.on("keyup", this.bind(function (e) {
2818
- this.keydowns = 0;
2819
- this.resizeSearch();
2820
- })
2821
- );
2822
-
2823
- this.search.on("blur", this.bind(function(e) {
2824
- this.container.removeClass("select2-container-active");
2825
- this.search.removeClass("select2-focused");
2826
- this.selectChoice(null);
2827
- if (!this.opened()) this.clearSearch();
2828
- e.stopImmediatePropagation();
2829
- this.opts.element.trigger($.Event("select2-blur"));
2830
- }));
2831
-
2832
- this.container.on("click", selector, this.bind(function (e) {
2833
- if (!this.isInterfaceEnabled()) return;
2834
- if ($(e.target).closest(".select2-search-choice").length > 0) {
2835
- // clicked inside a select2 search choice, do not open
2836
- return;
2837
- }
2838
- this.selectChoice(null);
2839
- this.clearPlaceholder();
2840
- if (!this.container.hasClass("select2-container-active")) {
2841
- this.opts.element.trigger($.Event("select2-focus"));
2842
- }
2843
- this.open();
2844
- this.focusSearch();
2845
- e.preventDefault();
2846
- }));
2847
-
2848
- this.container.on("focus", selector, this.bind(function () {
2849
- if (!this.isInterfaceEnabled()) return;
2850
- if (!this.container.hasClass("select2-container-active")) {
2851
- this.opts.element.trigger($.Event("select2-focus"));
2852
- }
2853
- this.container.addClass("select2-container-active");
2854
- this.dropdown.addClass("select2-drop-active");
2855
- this.clearPlaceholder();
2856
- }));
2857
-
2858
- this.initContainerWidth();
2859
- this.opts.element.hide();
2860
-
2861
- // set the placeholder if necessary
2862
- this.clearSearch();
2863
- },
2864
-
2865
- // multi
2866
- enableInterface: function() {
2867
- if (this.parent.enableInterface.apply(this, arguments)) {
2868
- this.search.prop("disabled", !this.isInterfaceEnabled());
2869
- }
2870
- },
2871
-
2872
- // multi
2873
- initSelection: function () {
2874
- var data;
2875
- if (this.opts.element.val() === "" && this.opts.element.text() === "") {
2876
- this.updateSelection([]);
2877
- this.close();
2878
- // set the placeholder if necessary
2879
- this.clearSearch();
2880
- }
2881
- if (this.select || this.opts.element.val() !== "") {
2882
- var self = this;
2883
- this.opts.initSelection.call(null, this.opts.element, function(data){
2884
- if (data !== undefined && data !== null) {
2885
- self.updateSelection(data);
2886
- self.close();
2887
- // set the placeholder if necessary
2888
- self.clearSearch();
2889
- }
2890
- });
2891
- }
2892
- },
2893
-
2894
- // multi
2895
- clearSearch: function () {
2896
- var placeholder = this.getPlaceholder(),
2897
- maxWidth = this.getMaxSearchWidth();
2898
-
2899
- if (placeholder !== undefined && this.getVal().length === 0 && this.search.hasClass("select2-focused") === false) {
2900
- this.search.val(placeholder).addClass("select2-default");
2901
- // stretch the search box to full width of the container so as much of the placeholder is visible as possible
2902
- // we could call this.resizeSearch(), but we do not because that requires a sizer and we do not want to create one so early because of a firefox bug, see #944
2903
- this.search.width(maxWidth > 0 ? maxWidth : this.container.css("width"));
2904
- } else {
2905
- this.search.val("").width(10);
2906
- }
2907
- },
2908
-
2909
- // multi
2910
- clearPlaceholder: function () {
2911
- if (this.search.hasClass("select2-default")) {
2912
- this.search.val("").removeClass("select2-default");
2913
- }
2914
- },
2915
-
2916
- // multi
2917
- opening: function () {
2918
- this.clearPlaceholder(); // should be done before super so placeholder is not used to search
2919
- this.resizeSearch();
2920
-
2921
- this.parent.opening.apply(this, arguments);
2922
-
2923
- this.focusSearch();
2924
-
2925
- // initializes search's value with nextSearchTerm (if defined by user)
2926
- // ignore nextSearchTerm if the dropdown is opened by the user pressing a letter
2927
- if(this.search.val() === "") {
2928
- if(this.nextSearchTerm != undefined){
2929
- this.search.val(this.nextSearchTerm);
2930
- this.search.select();
2931
- }
2932
- }
2933
-
2934
- this.updateResults(true);
2935
- if (this.opts.shouldFocusInput(this)) {
2936
- this.search.focus();
2937
- }
2938
- this.opts.element.trigger($.Event("select2-open"));
2939
- },
2940
-
2941
- // multi
2942
- close: function () {
2943
- if (!this.opened()) return;
2944
- this.parent.close.apply(this, arguments);
2945
- },
2946
-
2947
- // multi
2948
- focus: function () {
2949
- this.close();
2950
- this.search.focus();
2951
- },
2952
-
2953
- // multi
2954
- isFocused: function () {
2955
- return this.search.hasClass("select2-focused");
2956
- },
2957
-
2958
- // multi
2959
- updateSelection: function (data) {
2960
- var ids = [], filtered = [], self = this;
2961
-
2962
- // filter out duplicates
2963
- $(data).each(function () {
2964
- if (indexOf(self.id(this), ids) < 0) {
2965
- ids.push(self.id(this));
2966
- filtered.push(this);
2967
- }
2968
- });
2969
- data = filtered;
2970
-
2971
- this.selection.find(".select2-search-choice").remove();
2972
- $(data).each(function () {
2973
- self.addSelectedChoice(this);
2974
- });
2975
- self.postprocessResults();
2976
- },
2977
-
2978
- // multi
2979
- tokenize: function() {
2980
- var input = this.search.val();
2981
- input = this.opts.tokenizer.call(this, input, this.data(), this.bind(this.onSelect), this.opts);
2982
- if (input != null && input != undefined) {
2983
- this.search.val(input);
2984
- if (input.length > 0) {
2985
- this.open();
2986
- }
2987
- }
2988
-
2989
- },
2990
-
2991
- // multi
2992
- onSelect: function (data, options) {
2993
-
2994
- if (!this.triggerSelect(data) || data.text === "") { return; }
2995
-
2996
- this.addSelectedChoice(data);
2997
-
2998
- this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
2999
-
3000
- // keep track of the search's value before it gets cleared
3001
- this.nextSearchTerm = this.opts.nextSearchTerm(data, this.search.val());
3002
-
3003
- this.clearSearch();
3004
- this.updateResults();
3005
-
3006
- if (this.select || !this.opts.closeOnSelect) this.postprocessResults(data, false, this.opts.closeOnSelect===true);
3007
-
3008
- if (this.opts.closeOnSelect) {
3009
- this.close();
3010
- this.search.width(10);
3011
- } else {
3012
- if (this.countSelectableResults()>0) {
3013
- this.search.width(10);
3014
- this.resizeSearch();
3015
- if (this.getMaximumSelectionSize() > 0 && this.val().length >= this.getMaximumSelectionSize()) {
3016
- // if we reached max selection size repaint the results so choices
3017
- // are replaced with the max selection reached message
3018
- this.updateResults(true);
3019
- } else {
3020
- // initializes search's value with nextSearchTerm and update search result
3021
- if(this.nextSearchTerm != undefined){
3022
- this.search.val(this.nextSearchTerm);
3023
- this.updateResults();
3024
- this.search.select();
3025
- }
3026
- }
3027
- this.positionDropdown();
3028
- } else {
3029
- // if nothing left to select close
3030
- this.close();
3031
- this.search.width(10);
3032
- }
3033
- }
3034
-
3035
- // since its not possible to select an element that has already been
3036
- // added we do not need to check if this is a new element before firing change
3037
- this.triggerChange({ added: data });
3038
-
3039
- if (!options || !options.noFocus)
3040
- this.focusSearch();
3041
- },
3042
-
3043
- // multi
3044
- cancel: function () {
3045
- this.close();
3046
- this.focusSearch();
3047
- },
3048
-
3049
- addSelectedChoice: function (data) {
3050
- var enableChoice = !data.locked,
3051
- enabledItem = $(
3052
- "<li class='select2-search-choice'>" +
3053
- " <div></div>" +
3054
- " <a href='#' class='select2-search-choice-close' tabindex='-1'></a>" +
3055
- "</li>"),
3056
- disabledItem = $(
3057
- "<li class='select2-search-choice select2-locked'>" +
3058
- "<div></div>" +
3059
- "</li>");
3060
- var choice = enableChoice ? enabledItem : disabledItem,
3061
- id = this.id(data),
3062
- val = this.getVal(),
3063
- formatted,
3064
- cssClass;
3065
-
3066
- formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
3067
- if (formatted != undefined) {
3068
- choice.find("div").replaceWith($("<div></div>").html(formatted));
3069
- }
3070
- cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
3071
- if (cssClass != undefined) {
3072
- choice.addClass(cssClass);
3073
- }
3074
-
3075
- if(enableChoice){
3076
- choice.find(".select2-search-choice-close")
3077
- .on("mousedown", killEvent)
3078
- .on("click dblclick", this.bind(function (e) {
3079
- if (!this.isInterfaceEnabled()) return;
3080
-
3081
- this.unselect($(e.target));
3082
- this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
3083
- killEvent(e);
3084
- this.close();
3085
- this.focusSearch();
3086
- })).on("focus", this.bind(function () {
3087
- if (!this.isInterfaceEnabled()) return;
3088
- this.container.addClass("select2-container-active");
3089
- this.dropdown.addClass("select2-drop-active");
3090
- }));
3091
- }
3092
-
3093
- choice.data("select2-data", data);
3094
- choice.insertBefore(this.searchContainer);
3095
-
3096
- val.push(id);
3097
- this.setVal(val);
3098
- },
3099
-
3100
- // multi
3101
- unselect: function (selected) {
3102
- var val = this.getVal(),
3103
- data,
3104
- index;
3105
- selected = selected.closest(".select2-search-choice");
3106
-
3107
- if (selected.length === 0) {
3108
- throw "Invalid argument: " + selected + ". Must be .select2-search-choice";
3109
- }
3110
-
3111
- data = selected.data("select2-data");
3112
-
3113
- if (!data) {
3114
- // prevent a race condition when the 'x' is clicked really fast repeatedly the event can be queued
3115
- // and invoked on an element already removed
3116
- return;
3117
- }
3118
-
3119
- var evt = $.Event("select2-removing");
3120
- evt.val = this.id(data);
3121
- evt.choice = data;
3122
- this.opts.element.trigger(evt);
3123
-
3124
- if (evt.isDefaultPrevented()) {
3125
- return false;
3126
- }
3127
-
3128
- while((index = indexOf(this.id(data), val)) >= 0) {
3129
- val.splice(index, 1);
3130
- this.setVal(val);
3131
- if (this.select) this.postprocessResults();
3132
- }
3133
-
3134
- selected.remove();
3135
-
3136
- this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
3137
- this.triggerChange({ removed: data });
3138
-
3139
- return true;
3140
- },
3141
-
3142
- // multi
3143
- postprocessResults: function (data, initial, noHighlightUpdate) {
3144
- var val = this.getVal(),
3145
- choices = this.results.find(".select2-result"),
3146
- compound = this.results.find(".select2-result-with-children"),
3147
- self = this;
3148
-
3149
- choices.each2(function (i, choice) {
3150
- var id = self.id(choice.data("select2-data"));
3151
- if (indexOf(id, val) >= 0) {
3152
- choice.addClass("select2-selected");
3153
- // mark all children of the selected parent as selected
3154
- choice.find(".select2-result-selectable").addClass("select2-selected");
3155
- }
3156
- });
3157
-
3158
- compound.each2(function(i, choice) {
3159
- // hide an optgroup if it doesn't have any selectable children
3160
- if (!choice.is('.select2-result-selectable')
3161
- && choice.find(".select2-result-selectable:not(.select2-selected)").length === 0) {
3162
- choice.addClass("select2-selected");
3163
- }
3164
- });
3165
-
3166
- if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){
3167
- self.highlight(0);
3168
- }
3169
-
3170
- //If all results are chosen render formatNoMatches
3171
- if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
3172
- if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) {
3173
- if (checkFormatter(self.opts.formatNoMatches, "formatNoMatches")) {
3174
- this.results.append("<li class='select2-no-results'>" + evaluate(self.opts.formatNoMatches, self.opts.element, self.search.val()) + "</li>");
3175
- }
3176
- }
3177
- }
3178
-
3179
- },
3180
-
3181
- // multi
3182
- getMaxSearchWidth: function() {
3183
- return this.selection.width() - getSideBorderPadding(this.search);
3184
- },
3185
-
3186
- // multi
3187
- resizeSearch: function () {
3188
- var minimumWidth, left, maxWidth, containerLeft, searchWidth,
3189
- sideBorderPadding = getSideBorderPadding(this.search);
3190
-
3191
- minimumWidth = measureTextWidth(this.search) + 10;
3192
-
3193
- left = this.search.offset().left;
3194
-
3195
- maxWidth = this.selection.width();
3196
- containerLeft = this.selection.offset().left;
3197
-
3198
- searchWidth = maxWidth - (left - containerLeft) - sideBorderPadding;
3199
-
3200
- if (searchWidth < minimumWidth) {
3201
- searchWidth = maxWidth - sideBorderPadding;
3202
- }
3203
-
3204
- if (searchWidth < 40) {
3205
- searchWidth = maxWidth - sideBorderPadding;
3206
- }
3207
-
3208
- if (searchWidth <= 0) {
3209
- searchWidth = minimumWidth;
3210
- }
3211
-
3212
- this.search.width(Math.floor(searchWidth));
3213
- },
3214
-
3215
- // multi
3216
- getVal: function () {
3217
- var val;
3218
- if (this.select) {
3219
- val = this.select.val();
3220
- return val === null ? [] : val;
3221
- } else {
3222
- val = this.opts.element.val();
3223
- return splitVal(val, this.opts.separator, this.opts.transformVal);
3224
- }
3225
- },
3226
-
3227
- // multi
3228
- setVal: function (val) {
3229
- var unique;
3230
- if (this.select) {
3231
- this.select.val(val);
3232
- } else {
3233
- unique = [];
3234
- // filter out duplicates
3235
- $(val).each(function () {
3236
- if (indexOf(this, unique) < 0) unique.push(this);
3237
- });
3238
- this.opts.element.val(unique.length === 0 ? "" : unique.join(this.opts.separator));
3239
- }
3240
- },
3241
-
3242
- // multi
3243
- buildChangeDetails: function (old, current) {
3244
- var current = current.slice(0),
3245
- old = old.slice(0);
3246
-
3247
- // remove intersection from each array
3248
- for (var i = 0; i < current.length; i++) {
3249
- for (var j = 0; j < old.length; j++) {
3250
- if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
3251
- current.splice(i, 1);
3252
- if(i>0){
3253
- i--;
3254
- }
3255
- old.splice(j, 1);
3256
- j--;
3257
- }
3258
- }
3259
- }
3260
-
3261
- return {added: current, removed: old};
3262
- },
3263
-
3264
-
3265
- // multi
3266
- val: function (val, triggerChange) {
3267
- var oldData, self=this;
3268
-
3269
- if (arguments.length === 0) {
3270
- return this.getVal();
3271
- }
3272
-
3273
- oldData=this.data();
3274
- if (!oldData.length) oldData=[];
3275
-
3276
- // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
3277
- if (!val && val !== 0) {
3278
- this.opts.element.val("");
3279
- this.updateSelection([]);
3280
- this.clearSearch();
3281
- if (triggerChange) {
3282
- this.triggerChange({added: this.data(), removed: oldData});
3283
- }
3284
- return;
3285
- }
3286
-
3287
- // val is a list of ids
3288
- this.setVal(val);
3289
-
3290
- if (this.select) {
3291
- this.opts.initSelection(this.select, this.bind(this.updateSelection));
3292
- if (triggerChange) {
3293
- this.triggerChange(this.buildChangeDetails(oldData, this.data()));
3294
- }
3295
- } else {
3296
- if (this.opts.initSelection === undefined) {
3297
- throw new Error("val() cannot be called if initSelection() is not defined");
3298
- }
3299
-
3300
- this.opts.initSelection(this.opts.element, function(data){
3301
- var ids=$.map(data, self.id);
3302
- self.setVal(ids);
3303
- self.updateSelection(data);
3304
- self.clearSearch();
3305
- if (triggerChange) {
3306
- self.triggerChange(self.buildChangeDetails(oldData, self.data()));
3307
- }
3308
- });
3309
- }
3310
- this.clearSearch();
3311
- },
3312
-
3313
- // multi
3314
- onSortStart: function() {
3315
- if (this.select) {
3316
- throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");
3317
- }
3318
-
3319
- // collapse search field into 0 width so its container can be collapsed as well
3320
- this.search.width(0);
3321
- // hide the container
3322
- this.searchContainer.hide();
3323
- },
3324
-
3325
- // multi
3326
- onSortEnd:function() {
3327
-
3328
- var val=[], self=this;
3329
-
3330
- // show search and move it to the end of the list
3331
- this.searchContainer.show();
3332
- // make sure the search container is the last item in the list
3333
- this.searchContainer.appendTo(this.searchContainer.parent());
3334
- // since we collapsed the width in dragStarted, we resize it here
3335
- this.resizeSearch();
3336
-
3337
- // update selection
3338
- this.selection.find(".select2-search-choice").each(function() {
3339
- val.push(self.opts.id($(this).data("select2-data")));
3340
- });
3341
- this.setVal(val);
3342
- this.triggerChange();
3343
- },
3344
-
3345
- // multi
3346
- data: function(values, triggerChange) {
3347
- var self=this, ids, old;
3348
- if (arguments.length === 0) {
3349
- return this.selection
3350
- .children(".select2-search-choice")
3351
- .map(function() { return $(this).data("select2-data"); })
3352
- .get();
3353
- } else {
3354
- old = this.data();
3355
- if (!values) { values = []; }
3356
- ids = $.map(values, function(e) { return self.opts.id(e); });
3357
- this.setVal(ids);
3358
- this.updateSelection(values);
3359
- this.clearSearch();
3360
- if (triggerChange) {
3361
- this.triggerChange(this.buildChangeDetails(old, this.data()));
3362
- }
3363
- }
3364
- }
3365
- });
3366
-
3367
- $.fn.select2 = function () {
3368
-
3369
- var args = Array.prototype.slice.call(arguments, 0),
3370
- opts,
3371
- select2,
3372
- method, value, multiple,
3373
- allowedMethods = ["val", "destroy", "opened", "open", "close", "focus", "isFocused", "container", "dropdown", "onSortStart", "onSortEnd", "enable", "disable", "readonly", "positionDropdown", "data", "search"],
3374
- valueMethods = ["opened", "isFocused", "container", "dropdown"],
3375
- propertyMethods = ["val", "data"],
3376
- methodsMap = { search: "externalSearch" };
3377
-
3378
- this.each(function () {
3379
- if (args.length === 0 || typeof(args[0]) === "object") {
3380
- opts = args.length === 0 ? {} : $.extend({}, args[0]);
3381
- opts.element = $(this);
3382
-
3383
- if (opts.element.get(0).tagName.toLowerCase() === "select") {
3384
- multiple = opts.element.prop("multiple");
3385
- } else {
3386
- multiple = opts.multiple || false;
3387
- if ("tags" in opts) {opts.multiple = multiple = true;}
3388
- }
3389
-
3390
- select2 = multiple ? new window.Select2["class"].multi() : new window.Select2["class"].single();
3391
- select2.init(opts);
3392
- } else if (typeof(args[0]) === "string") {
3393
-
3394
- if (indexOf(args[0], allowedMethods) < 0) {
3395
- throw "Unknown method: " + args[0];
3396
- }
3397
-
3398
- value = undefined;
3399
- select2 = $(this).data("select2");
3400
- if (select2 === undefined) return;
3401
-
3402
- method=args[0];
3403
-
3404
- if (method === "container") {
3405
- value = select2.container;
3406
- } else if (method === "dropdown") {
3407
- value = select2.dropdown;
3408
- } else {
3409
- if (methodsMap[method]) method = methodsMap[method];
3410
-
3411
- value = select2[method].apply(select2, args.slice(1));
3412
- }
3413
- if (indexOf(args[0], valueMethods) >= 0
3414
- || (indexOf(args[0], propertyMethods) >= 0 && args.length == 1)) {
3415
- return false; // abort the iteration, ready to return first matched value
3416
- }
3417
- } else {
3418
- throw "Invalid arguments to select2 plugin: " + args;
3419
- }
3420
- });
3421
- return (value === undefined) ? this : value;
3422
- };
3423
-
3424
- // plugin defaults, accessible to users
3425
- $.fn.select2.defaults = {
3426
- width: "copy",
3427
- loadMorePadding: 0,
3428
- closeOnSelect: true,
3429
- openOnEnter: true,
3430
- containerCss: {},
3431
- dropdownCss: {},
3432
- containerCssClass: "",
3433
- dropdownCssClass: "",
3434
- formatResult: function(result, container, query, escapeMarkup) {
3435
- var markup=[];
3436
- markMatch(this.text(result), query.term, markup, escapeMarkup);
3437
- return markup.join("");
3438
- },
3439
- transformVal: function(val) {
3440
- return $.trim(val);
3441
- },
3442
- formatSelection: function (data, container, escapeMarkup) {
3443
- return data ? escapeMarkup(this.text(data)) : undefined;
3444
- },
3445
- sortResults: function (results, container, query) {
3446
- return results;
3447
- },
3448
- formatResultCssClass: function(data) {return data.css;},
3449
- formatSelectionCssClass: function(data, container) {return undefined;},
3450
- minimumResultsForSearch: 0,
3451
- minimumInputLength: 0,
3452
- maximumInputLength: null,
3453
- maximumSelectionSize: 0,
3454
- id: function (e) { return e == undefined ? null : e.id; },
3455
- text: function (e) {
3456
- if (e && this.data && this.data.text) {
3457
- if ($.isFunction(this.data.text)) {
3458
- return this.data.text(e);
3459
- } else {
3460
- return e[this.data.text];
3461
- }
3462
- } else {
3463
- return e.text;
3464
- }
3465
- },
3466
- matcher: function(term, text) {
3467
- return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0;
3468
- },
3469
- separator: ",",
3470
- tokenSeparators: [],
3471
- tokenizer: defaultTokenizer,
3472
- escapeMarkup: defaultEscapeMarkup,
3473
- blurOnChange: false,
3474
- selectOnBlur: false,
3475
- adaptContainerCssClass: function(c) { return c; },
3476
- adaptDropdownCssClass: function(c) { return null; },
3477
- nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; },
3478
- searchInputPlaceholder: '',
3479
- createSearchChoicePosition: 'top',
3480
- shouldFocusInput: function (instance) {
3481
- // Attempt to detect touch devices
3482
- var supportsTouchEvents = (('ontouchstart' in window) ||
3483
- (navigator.msMaxTouchPoints > 0));
3484
-
3485
- // Only devices which support touch events should be special cased
3486
- if (!supportsTouchEvents) {
3487
- return true;
3488
- }
3489
-
3490
- // Never focus the input if search is disabled
3491
- if (instance.opts.minimumResultsForSearch < 0) {
3492
- return false;
3493
- }
3494
-
3495
- return true;
3496
- }
3497
- };
3498
-
3499
- $.fn.select2.locales = [];
3500
-
3501
- $.fn.select2.locales['en'] = {
3502
- formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
3503
- formatNoMatches: function () { return "No matches found"; },
3504
- formatAjaxError: function (jqXHR, textStatus, errorThrown) { return "Loading failed"; },
3505
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
3506
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
3507
- formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
3508
- formatLoadMore: function (pageNumber) { return "Loading more results…"; },
3509
- formatSearching: function () { return "Searching…"; }
3510
- };
3511
-
3512
- $.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
3513
-
3514
- $.fn.select2.ajaxDefaults = {
3515
- transport: $.ajax,
3516
- params: {
3517
- type: "GET",
3518
- cache: false,
3519
- dataType: "json"
3520
- }
3521
- };
3522
-
3523
- // exports
3524
- window.Select2 = {
3525
- query: {
3526
- ajax: ajax,
3527
- local: local,
3528
- tags: tags
3529
- }, util: {
3530
- debounce: debounce,
3531
- markMatch: markMatch,
3532
- escapeMarkup: defaultEscapeMarkup,
3533
- stripDiacritics: stripDiacritics
3534
- }, "class": {
3535
- "abstract": AbstractSelect2,
3536
- "single": SingleSelect2,
3537
- "multi": MultiSelect2
3538
- }
3539
- };
3540
-
3541
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2.min.js DELETED
@@ -1,23 +0,0 @@
1
- /*
2
- Copyright 2014 Igor Vaynberg
3
-
4
- Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
5
-
6
- This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
7
- General Public License version 2 (the "GPL License"). You may choose either license to govern your
8
- use of this software only upon the condition that you accept all of the terms of either the Apache
9
- License or the GPL License.
10
-
11
- You may obtain a copy of the Apache License and the GPL License at:
12
-
13
- http://www.apache.org/licenses/LICENSE-2.0
14
- http://www.gnu.org/licenses/gpl-2.0.html
15
-
16
- Unless required by applicable law or agreed to in writing, software distributed under the Apache License
17
- or the GPL Licesnse is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
18
- either express or implied. See the Apache License and the GPL License for the specific language governing
19
- permissions and limitations under the Apache License and the GPL License.
20
- */
21
- !function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++d<e&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})}(jQuery),function(a,b){"use strict";function n(b){var c=a(document.createTextNode(""));b.before(c),c.before(b),c.remove()}function o(a){function b(a){return m[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function p(a,b){for(var c=0,d=b.length;d>c;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo(document.body);var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(a,b,c){var d,e,f;if(null===a||a.length<1)return[];for(d=a.split(b),e=0,f=d.length;f>e;e+=1)d[e]=c(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=h;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!g){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);g=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),g.attr("class","select2-sizer"),a(document.body).append(g)}return g.text(b.val()),g.width()}function D(b,c,d){var e,g,f=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push("<span class='select2-match'>"),c.push(d(a.substring(e,e+f))),c.push("</span>"),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,i,j,h={x:0,y:0},k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="<div class='select2-measure-scrollbar'></div>",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};i=a(document),f=function(){var a=1;return function(){return a++}}(),c=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=a("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+f()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a(document.body),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss,this.opts.element)),this.container.addClass(K(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(g),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",g,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",g,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",g,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",g,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),j=j||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&d._sync&&a.each(function(){d._sync&&this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,g,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{populateResults:function(d,e,g){var h,j=this.opts.id,k=this.liveRegion;h=function(d,e,l){var m,n,o,p,q,r,s,t,u,v;d=c.sortResults(d,e,g);var w=[];for(m=0,n=d.length;n>m;m+=1)o=d[m],q=o.disabled===!0,p=!q&&j(o)!==b,r=o.children&&o.children.length>0,s=a("<li></li>"),s.addClass("select2-results-dept-"+l),s.addClass("select2-result"),s.addClass(p?"select2-result-selectable":"select2-result-unselectable"),q&&s.addClass("select2-disabled"),r&&s.addClass("select2-result-with-children"),s.addClass(i.opts.formatResultCssClass(o)),s.attr("role","presentation"),t=a(document.createElement("div")),t.addClass("select2-result-label"),t.attr("id","select2-result-label-"+f()),t.attr("role","option"),v=c.formatResult(o,t,g,i.opts.escapeMarkup),v!==b&&(t.html(v),s.append(t)),r&&(u=a("<ul></ul>"),u.addClass("select2-result-sub"),h(o.children,u,l+1),s.append(u)),s.data("select2-data",o),w.push(s[0]);e.append(w),k.text(c.formatMatches(d.length))},h(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(g=c.id,c.id=function(a){return a[g]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var f,g,h,c={results:[],more:!1},e=a.term;h=function(b,c){var d;b.is("option")?a.matcher(e,b.text(),b)&&c.push(i.optionToData(b)):b.is("optgroup")&&(d=i.optionToData(b),b.children().each2(function(a,b){h(b,d.children)}),d.children.length>0&&c.push(d))},f=d.children(),this.getPlaceholder()!==b&&f.length>0&&(g=this.getPlaceholderOption(),g&&(f=f.not(g))),f.each2(function(a,b){h(b,c.results)}),a.callback(c)}),c.id=function(a){return a.id}):"query"in c||("ajax"in c?(h=c.element.data("ajax-url"),h&&h.length>0&&(c.ajax.url=h),c.query=G.call(c.element,c.ajax)):"data"in c?c.query=H(c.data):"tags"in c&&(c.query=I(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{id:a.trim(b),text:a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(s(b.val(),c.separator,c.transformVal)).each(function(){var b={id:this,text:this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return r(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");if("top"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.unshift(b)};else if("bottom"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.push(b)};else if("function"!=typeof c.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return c},monitorSource:function(){var d,c=this.opts.element,e=this;c.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),this._sync=this.bind(function(){var a=c.prop("disabled");a===b&&(a=!1),this.enable(!a);var d=c.prop("readonly");d===b&&(d=!1),this.readonly(d),this.container&&(D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(K(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(this.opts.dropdownCssClass,this.opts.element)))}),c.length&&c[0].attachEvent&&c.each(function(){this.attachEvent("onpropertychange",e._sync)}),d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,d!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new d(function(b){a.each(b,e._sync)}),this.propertyObserver.observe(c.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b,choice:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){a===b&&(a=!1),this._readonly!==a&&(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface())},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):!1},positionDropdown:function(){var v,w,x,y,z,b=this.dropdown,c=this.container,d=c.offset(),e=c.outerHeight(!1),f=c.outerWidth(!1),g=b.outerHeight(!1),h=a(window),i=h.width(),k=h.height(),l=h.scrollLeft()+i,m=h.scrollTop()+k,n=d.top+e,o=d.left,p=m>=n+g,q=d.top-g>=h.scrollTop(),r=b.outerWidth(!1),s=function(){return l>=o+r},t=function(){return d.left+l+c.outerWidth(!1)>r},u=b.hasClass("select2-drop-above");u?(w=!0,!q&&p&&(x=!0,w=!1)):(w=!1,!p&&q&&(x=!0,w=!0)),x&&(b.hide(),d=this.container.offset(),e=this.container.outerHeight(!1),f=this.container.outerWidth(!1),g=b.outerHeight(!1),l=h.scrollLeft()+i,m=h.scrollTop()+k,n=d.top+e,o=d.left,r=b.outerWidth(!1),b.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(z=a(".select2-results",b)[0],b.addClass("select2-drop-auto-width"),b.css("width",""),r=b.outerWidth(!1)+(z.scrollHeight===z.clientHeight?0:j.width),r>f?f=r:r=f,g=b.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(v=this.body.offset(),n-=v.top,o-=v.left),!s()&&t()&&(o=d.left+this.container.outerWidth(!1)-r),y={left:o,width:f},w?(y.top=d.top-g,y.bottom="auto",this.container.addClass("select2-drop-above"),b.addClass("select2-drop-above")):(y.top=n,y.bottom="auto",this.container.removeClass("select2-drop-above"),b.removeClass("select2-drop-above")),y=a.extend(y,K(this.opts.dropdownCss,this.opts.element)),b.css(y)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),i.on("mousemove.select2Event",function(a){h.x=a.pageX,h.y=a.pageY}),!0):!1},opening:function(){var f,b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),f=a("#select2-drop-mask"),0===f.length&&(f=a(document.createElement("div")),f.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),f.hide(),f.appendTo(this.body),f.on("mousedown touchstart click",function(b){n(f);var d,c=a("#select2-drop");c.length>0&&(d=c.data("select2"),d.opts.selectOnBlur&&d.selectHighlighted({noFocus:!0}),d.close(),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==f[0]&&this.dropdown.before(f),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),f.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var g=this;this.container.parents().add(window).each(function(){a(this).on(d+" "+c+" "+e,function(){g.opened()&&g.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),i.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return K(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var c,d,e,f,g,h,i,j,b=this.results;if(d=this.highlight(),!(0>d)){if(0==d)return b.scrollTop(0),void 0;c=this.findHighlightableChoices().find(".select2-result-label"),e=a(c[d]),j=(e.offset()||{}).top||0,f=j+e.outerHeight(!0),d===c.length-1&&(i=b.find("li.select2-more-results"),i.length>0&&(f=i.offset().top+i.outerHeight(!0))),g=b.offset().top+b.outerHeight(!1),f>g&&b.scrollTop(b.scrollTop()+(f-g)),h=j-b.offset().top,0>h&&"none"!=e.css("display")&&b.scrollTop(b.scrollTop()+h)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d<c.length;){d+=b;
22
- var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},highlight:function(b){var d,e,c=this.findHighlightableChoices();return 0===arguments.length?p(c.filter(".select2-highlighted")[0],c.get()):(b>=c.length&&(b=c.length-1),0>b&&(b=0),this.removeHighlight(),d=a(c[b]),d.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",d.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(d.text()),e=d.data("select2-data"),e&&this.opts.element.trigger({type:"select2-highlight",val:this.id(e),choice:e}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var c,a=this.results,b=a.find("li.select2-more-results"),d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-a.height(),c<=this.opts.loadMorePadding&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),e.postprocessResults(c,!1,!1),c.more===!0?(b.detach().appendTo(a).html(e.opts.escapeMarkup(K(e.opts.formatLoadMore,e.opts.element,d+1))),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d,e.context=c.context,this.opts.element.trigger({type:"select2-loaded",items:c}))})})))},tokenize:function(){},updateResults:function(c){function m(){d.removeClass("select2-active"),h.positionDropdown(),e.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(e.text()):h.liveRegion.text(h.opts.formatMatches(e.find('.select2-result-selectable:not(".select2-selected")').length))}function n(a){e.html(a),m()}var g,i,l,d=this.search,e=this.results,f=this.opts,h=this,j=d.val(),k=a.data(this.container,"select2-last-term");if((c===!0||!k||!r(j,k))&&(a.data(this.container,"select2-last-term",j),c===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var o=this.getMaximumSelectionSize();if(o>=1&&(g=this.data(),a.isArray(g)&&g.length>=o&&J(f.formatSelectionTooBig,"formatSelectionTooBig")))return n("<li class='select2-selection-limit'>"+K(f.formatSelectionTooBig,f.element,o)+"</li>"),void 0;if(d.val().length<f.minimumInputLength)return J(f.formatInputTooShort,"formatInputTooShort")?n("<li class='select2-no-results'>"+K(f.formatInputTooShort,f.element,d.val(),f.minimumInputLength)+"</li>"):n(""),c&&this.showSearch&&this.showSearch(!0),void 0;if(f.maximumInputLength&&d.val().length>f.maximumInputLength)return J(f.formatInputTooLong,"formatInputTooLong")?n("<li class='select2-no-results'>"+K(f.formatInputTooLong,f.element,d.val(),f.maximumInputLength)+"</li>"):n(""),void 0;f.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+K(f.formatSearching,f.element)+"</li>"),d.addClass("select2-active"),this.removeHighlight(),i=this.tokenize(),i!=b&&null!=i&&d.val(i),this.resultsPage=1,f.query({element:f.element,term:d.val(),page:this.resultsPage,context:null,matcher:f.matcher,callback:this.bind(function(g){var i;if(l==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(g.hasError!==b&&J(f.formatAjaxError,"formatAjaxError"))return n("<li class='select2-ajax-error'>"+K(f.formatAjaxError,f.element,g.jqXHR,g.textStatus,g.errorThrown)+"</li>"),void 0;if(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==d.val()&&(i=this.opts.createSearchChoice.call(h,d.val(),g.results),i!==b&&null!==i&&h.id(i)!==b&&null!==h.id(i)&&0===a(g.results).filter(function(){return r(h.id(this),h.id(i))}).length&&this.opts.createSearchChoicePosition(g.results,i)),0===g.results.length&&J(f.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+K(f.formatNoMatches,f.element,d.val())+"</li>"),void 0;e.empty(),h.opts.populateResults.call(this,e,g.results,{term:d.val(),page:this.resultsPage,context:null}),g.more===!0&&J(f.formatLoadMore,"formatLoadMore")&&(e.append("<li class='select2-more-results'>"+f.escapeMarkup(K(f.formatLoadMore,f.element,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),m(),this.opts.element.trigger({type:"select2-loaded",items:g})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){y(this.search)},selectHighlighted:function(a){if(this._touchMoved)return this.clearTouchMoved(),void 0;var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var c=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&c||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.trim(c.text())&&""===c.val())return c}},initContainerWidth:function(){function c(){var c,d,e,f,g,h;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(h=d[f].replace(/\s/g,""),e=h.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),d=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,g,c=this.container,d=this.dropdown,e=f();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=c.find(".select2-choice"),this.focusser=c.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+e),this.focusser.attr("aria-labelledby","select2-chosen-"+e),this.results.attr("id","select2-results-"+e),this.search.attr("aria-owns","select2-results-"+e),this.focusser.attr("id","s2id_autogen"+e),g=a("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(g.text()).attr("for",this.focusser.attr("id"));var h=this.opts.element.attr("title");this.opts.element.attr("title",h||g.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)return A(a),void 0;switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case k.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.ESC){if(this.opts.openOnEnter===!1&&a.which===k.ENTER)return A(a),void 0;if(a.which==k.DOWN||a.which==k.UP||a.which==k.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==k.DELETE||a.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection&&this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),d.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.nextSearchTerm=c.opts.nextSearchTerm(a,c.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),e=O(c,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator,b.transformVal),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c<e.length;c++)for(var g=e[c],h=0;h<f.length;h++){var i=f[h];if(r(g,b.id(i))){a.push(i),f.splice(h,1);break}}d(a)}:a.noop})}),b},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},destroy:function(){a("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"searchContainer","selection")},initContainer:function(){var c,b=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=c=this.container.find(b);var d=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(){d.search[0].focus(),d.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+f()),this.search.prev().text(a("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.focus(this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var b=c.find(".select2-search-choice-focus"),d=b.prev(".select2-search-choice:not(.select2-locked)"),e=b.next(".select2-search-choice:not(.select2-locked)"),f=z(this.search);if(b.length&&(a.which==k.LEFT||a.which==k.RIGHT||a.which==k.BACKSPACE||a.which==k.DELETE||a.which==k.ENTER)){var g=b;return a.which==k.LEFT&&d.length?g=d:a.which==k.RIGHT?g=e.length?e:null:a.which===k.BACKSPACE?this.unselect(b.first())&&(this.search.width(10),g=d.length?d:e):a.which==k.DELETE?this.unselect(b.first())&&(this.search.width(10),g=e.length?e:null):a.which==k.ENTER&&(g=null),this.selectChoice(g),A(a),g&&g.length||this.open(),void 0}if((a.which===k.BACKSPACE&&1==this.keydowns||a.which==k.LEFT)&&0==f.offset&&!f.length)return this.selectChoice(c.find(".select2-search-choice:not(.select2-locked)").last()),A(a),void 0;if(this.selectChoice(null),this.opened())switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),A(a),void 0;case k.ENTER:return this.selectHighlighted(),A(a),void 0;case k.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),void 0;case k.ESC:return this.cancel(a),A(a),void 0}if(a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.BACKSPACE&&a.which!==k.ESC){if(a.which===k.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)&&A(a),a.which===k.ENTER&&A(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",b,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){p(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),f=a("<li class='select2-search-choice select2-locked'><div></div></li>"),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith(a("<div></div>").html(j)),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&this.opts.closeOnSelect===!0&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+K(g.opts.formatNoMatches,g.opts.element,g.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator,this.opts.transformVal))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){p(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)r(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c>0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(this.text(a),c.term,e,d),e.join("")},transformVal:function(b){return a.trim(b)},formatSelection:function(a,c,d){return a?d(this.text(a)):b},sortResults:function(a){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},text:function(b){return b&&this.data&&this.data.text?a.isFunction(this.data.text)?this.data.text(b):b[this.data.text]:b.text
23
- },matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b?a.opts.minimumResultsForSearch<0?!1:!0:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:w,markMatch:E,escapeMarkup:F,stripDiacritics:o},"class":{"abstract":c,single:d,multi:e}}}}(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2.png DELETED
Binary file
assets/deps/select2-3.5.2/select2_locale_ar.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Arabic translation.
3
- *
4
- * Author: Adel KEDJOUR <adel@kedjour.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['ar'] = {
10
- formatNoMatches: function () { return "لم يتم العثور على مطابقات"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; },
13
- formatSelectionTooBig: function (limit) { if (limit == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return limit == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + limit + " إختيارات فقط"; },
14
- formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; },
15
- formatSearching: function () { return "البحث…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ar']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_az.js DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Select2 Azerbaijani translation.
3
- *
4
- * Author: Farhad Safarov <farhad.safarov@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['az'] = {
10
- formatMatches: function (matches) { return matches + " nəticə mövcuddur, hərəkət etdirmək üçün yuxarı və aşağı düymələrindən istifadə edin."; },
11
- formatNoMatches: function () { return "Nəticə tapılmadı"; },
12
- formatInputTooShort: function (input, min) { var n = min - input.length; return n + " simvol daxil edin"; },
13
- formatInputTooLong: function (input, max) { var n = input.length - max; return n + " simvol silin"; },
14
- formatSelectionTooBig: function (limit) { return "Sadəcə " + limit + " element seçə bilərsiniz"; },
15
- formatLoadMore: function (pageNumber) { return "Daha çox nəticə yüklənir…"; },
16
- formatSearching: function () { return "Axtarılır…"; }
17
- };
18
-
19
- $.extend($.fn.select2.defaults, $.fn.select2.locales['az']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_bg.js DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Select2 Bulgarian translation.
3
- *
4
- * @author Lubomir Vikev <lubomirvikev@gmail.com>
5
- * @author Uriy Efremochkin <efremochkin@uriy.me>
6
- */
7
- (function ($) {
8
- "use strict";
9
-
10
- $.fn.select2.locales['bg'] = {
11
- formatNoMatches: function () { return "Няма намерени съвпадения"; },
12
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Моля въведете още " + n + " символ" + (n > 1 ? "а" : ""); },
13
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Моля въведете с " + n + " по-малко символ" + (n > 1 ? "а" : ""); },
14
- formatSelectionTooBig: function (limit) { return "Можете да направите до " + limit + (limit > 1 ? " избора" : " избор"); },
15
- formatLoadMore: function (pageNumber) { return "Зареждат се още…"; },
16
- formatSearching: function () { return "Търсене…"; }
17
- };
18
-
19
- $.extend($.fn.select2.defaults, $.fn.select2.locales['bg']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ca.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Catalan translation.
3
- *
4
- * Author: David Planella <david.planella@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['ca'] = {
10
- formatNoMatches: function () { return "No s'ha trobat cap coincidència"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduïu " + n + " caràcter" + (n == 1 ? "" : "s") + " més"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Introduïu " + n + " caràcter" + (n == 1? "" : "s") + "menys"; },
13
- formatSelectionTooBig: function (limit) { return "Només podeu seleccionar " + limit + " element" + (limit == 1 ? "" : "s"); },
14
- formatLoadMore: function (pageNumber) { return "S'estan carregant més resultats…"; },
15
- formatSearching: function () { return "S'està cercant…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ca']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_cs.js DELETED
@@ -1,51 +0,0 @@
1
- /**
2
- * Select2 Czech translation.
3
- *
4
- * Author: Michal Marek <ahoj@michal-marek.cz>
5
- * Author - sklonovani: David Vallner <david@vallner.net>
6
- */
7
- (function ($) {
8
- "use strict";
9
- // use text for the numbers 2 through 4
10
- var smallNumbers = {
11
- 2: function(masc) { return (masc ? "dva" : "dvě"); },
12
- 3: function() { return "tři"; },
13
- 4: function() { return "čtyři"; }
14
- }
15
- $.fn.select2.locales['cs'] = {
16
- formatNoMatches: function () { return "Nenalezeny žádné položky"; },
17
- formatInputTooShort: function (input, min) {
18
- var n = min - input.length;
19
- if (n == 1) {
20
- return "Prosím zadejte ještě jeden znak";
21
- } else if (n <= 4) {
22
- return "Prosím zadejte ještě další "+smallNumbers[n](true)+" znaky";
23
- } else {
24
- return "Prosím zadejte ještě dalších "+n+" znaků";
25
- }
26
- },
27
- formatInputTooLong: function (input, max) {
28
- var n = input.length - max;
29
- if (n == 1) {
30
- return "Prosím zadejte o jeden znak méně";
31
- } else if (n <= 4) {
32
- return "Prosím zadejte o "+smallNumbers[n](true)+" znaky méně";
33
- } else {
34
- return "Prosím zadejte o "+n+" znaků méně";
35
- }
36
- },
37
- formatSelectionTooBig: function (limit) {
38
- if (limit == 1) {
39
- return "Můžete zvolit jen jednu položku";
40
- } else if (limit <= 4) {
41
- return "Můžete zvolit maximálně "+smallNumbers[limit](false)+" položky";
42
- } else {
43
- return "Můžete zvolit maximálně "+limit+" položek";
44
- }
45
- },
46
- formatLoadMore: function (pageNumber) { return "Načítají se další výsledky…"; },
47
- formatSearching: function () { return "Vyhledávání…"; }
48
- };
49
-
50
- $.extend($.fn.select2.defaults, $.fn.select2.locales['cs']);
51
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_da.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Danish translation.
3
- *
4
- * Author: Anders Jenbo <anders@jenbo.dk>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['da'] = {
10
- formatNoMatches: function () { return "Ingen resultater fundet"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Angiv venligst " + n + " tegn mere"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Angiv venligst " + n + " tegn mindre"; },
13
- formatSelectionTooBig: function (limit) { return "Du kan kun vælge " + limit + " emne" + (limit === 1 ? "" : "r"); },
14
- formatLoadMore: function (pageNumber) { return "Indlæser flere resultater…"; },
15
- formatSearching: function () { return "Søger…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['da']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_de.js DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * Select2 German translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['de'] = {
8
- formatNoMatches: function () { return "Keine Übereinstimmungen gefunden"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Bitte " + n + " Zeichen mehr eingeben"; },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Bitte " + n + " Zeichen weniger eingeben"; },
11
- formatSelectionTooBig: function (limit) { return "Sie können nur " + limit + " Eintr" + (limit === 1 ? "ag" : "äge") + " auswählen"; },
12
- formatLoadMore: function (pageNumber) { return "Lade mehr Ergebnisse…"; },
13
- formatSearching: function () { return "Suche…"; },
14
- formatMatches: function (matches) { return matches + " Ergebnis " + (matches > 1 ? "se" : "") + " verfügbar, zum Navigieren die Hoch-/Runter-Pfeiltasten verwenden."; }
15
- };
16
-
17
- $.extend($.fn.select2.defaults, $.fn.select2.locales['de']);
18
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_el.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Greek translation.
3
- *
4
- * @author Uriy Efremochkin <efremochkin@uriy.me>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['el'] = {
10
- formatNoMatches: function () { return "Δεν βρέθηκαν αποτελέσματα"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Παρακαλούμε εισάγετε " + n + " περισσότερο" + (n > 1 ? "υς" : "") + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Παρακαλούμε διαγράψτε " + n + " χαρακτήρ" + (n > 1 ? "ες" : "α"); },
13
- formatSelectionTooBig: function (limit) { return "Μπορείτε να επιλέξετε μόνο " + limit + " αντικείμεν" + (limit > 1 ? "α" : "ο"); },
14
- formatLoadMore: function (pageNumber) { return "Φόρτωση περισσότερων…"; },
15
- formatSearching: function () { return "Αναζήτηση…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['el']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_en.js.template DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Select2 <Language> translation.
3
- *
4
- * Author: Your Name <your@email>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['en'] = {
10
- formatMatches: function (matches) { if (matches === 1) { return "One result is available, press enter to select it."; } return matches + " results are available, use up and down arrow keys to navigate."; },
11
- formatNoMatches: function () { return "No matches found"; },
12
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " or more character" + (n == 1 ? "" : "s"); },
13
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
14
- formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
15
- formatLoadMore: function (pageNumber) { return "Loading more results…"; },
16
- formatSearching: function () { return "Searching…"; }
17
- };
18
-
19
- $.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
20
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_es.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Spanish translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['es'] = {
8
- formatMatches: function (matches) { if (matches === 1) { return "Un resultado disponible, presione enter para seleccionarlo."; } return matches + " resultados disponibles, use las teclas de dirección para navegar."; },
9
- formatNoMatches: function () { return "No se encontraron resultados"; },
10
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); },
11
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); },
12
- formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
13
- formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; },
14
- formatSearching: function () { return "Buscando…"; },
15
- formatAjaxError: function() { return "La carga falló"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['es']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_et.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Estonian translation.
3
- *
4
- * Author: Kuldar Kalvik <kuldar@kalvik.ee>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['et'] = {
10
- formatNoMatches: function () { return "Tulemused puuduvad"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Sisesta " + n + " täht" + (n == 1 ? "" : "e") + " rohkem"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Sisesta " + n + " täht" + (n == 1? "" : "e") + " vähem"; },
13
- formatSelectionTooBig: function (limit) { return "Saad vaid " + limit + " tulemus" + (limit == 1 ? "e" : "t") + " valida"; },
14
- formatLoadMore: function (pageNumber) { return "Laen tulemusi.."; },
15
- formatSearching: function () { return "Otsin.."; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['et']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_eu.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * Select2 Basque translation.
3
- *
4
- * Author: Julen Ruiz Aizpuru <julenx at gmail dot com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['eu'] = {
10
- formatNoMatches: function () {
11
- return "Ez da bat datorrenik aurkitu";
12
- },
13
- formatInputTooShort: function (input, min) {
14
- var n = min - input.length;
15
- if (n === 1) {
16
- return "Idatzi karaktere bat gehiago";
17
- } else {
18
- return "Idatzi " + n + " karaktere gehiago";
19
- }
20
- },
21
- formatInputTooLong: function (input, max) {
22
- var n = input.length - max;
23
- if (n === 1) {
24
- return "Idatzi karaktere bat gutxiago";
25
- } else {
26
- return "Idatzi " + n + " karaktere gutxiago";
27
- }
28
- },
29
- formatSelectionTooBig: function (limit) {
30
- if (limit === 1 ) {
31
- return "Elementu bakarra hauta dezakezu";
32
- } else {
33
- return limit + " elementu hauta ditzakezu soilik";
34
- }
35
- },
36
- formatLoadMore: function (pageNumber) {
37
- return "Emaitza gehiago kargatzen…";
38
- },
39
- formatSearching: function () {
40
- return "Bilatzen…";
41
- }
42
- };
43
-
44
- $.extend($.fn.select2.defaults, $.fn.select2.locales['eu']);
45
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_fa.js DELETED
@@ -1,21 +0,0 @@
1
- /**
2
- * Select2 Persian translation.
3
- *
4
- * Author: Ali Choopan <choopan@arsh.co>
5
- * Author: Ebrahim Byagowi <ebrahim@gnu.org>
6
- */
7
- (function ($) {
8
- "use strict";
9
-
10
- $.fn.select2.locales['fa'] = {
11
- formatMatches: function (matches) { return matches + " نتیجه موجود است، کلیدهای جهت بالا و پایین را برای گشتن استفاده کنید."; },
12
- formatNoMatches: function () { return "نتیجه‌ای یافت نشد."; },
13
- formatInputTooShort: function (input, min) { var n = min - input.length; return "لطفاً " + n + " نویسه بیشتر وارد نمایید"; },
14
- formatInputTooLong: function (input, max) { var n = input.length - max; return "لطفاً " + n + " نویسه را حذف کنید."; },
15
- formatSelectionTooBig: function (limit) { return "شما فقط می‌توانید " + limit + " مورد را انتخاب کنید"; },
16
- formatLoadMore: function (pageNumber) { return "در حال بارگیری موارد بیشتر…"; },
17
- formatSearching: function () { return "در حال جستجو…"; }
18
- };
19
-
20
- $.extend($.fn.select2.defaults, $.fn.select2.locales['fa']);
21
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_fi.js DELETED
@@ -1,30 +0,0 @@
1
- /**
2
- * Select2 Finnish translation
3
- */
4
- (function ($) {
5
- "use strict";
6
- $.fn.select2.locales['fi'] = {
7
- formatNoMatches: function () {
8
- return "Ei tuloksia";
9
- },
10
- formatInputTooShort: function (input, min) {
11
- var n = min - input.length;
12
- return "Ole hyvä ja anna " + n + " merkkiä lisää";
13
- },
14
- formatInputTooLong: function (input, max) {
15
- var n = input.length - max;
16
- return "Ole hyvä ja anna " + n + " merkkiä vähemmän";
17
- },
18
- formatSelectionTooBig: function (limit) {
19
- return "Voit valita ainoastaan " + limit + " kpl";
20
- },
21
- formatLoadMore: function (pageNumber) {
22
- return "Ladataan lisää tuloksia…";
23
- },
24
- formatSearching: function () {
25
- return "Etsitään…";
26
- }
27
- };
28
-
29
- $.extend($.fn.select2.defaults, $.fn.select2.locales['fi']);
30
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_fr.js DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * Select2 French translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['fr'] = {
8
- formatMatches: function (matches) { return matches + " résultats sont disponibles, utilisez les flèches haut et bas pour naviguer."; },
9
- formatNoMatches: function () { return "Aucun résultat trouvé"; },
10
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Saisissez " + n + " caractère" + (n == 1? "" : "s") + " supplémentaire" + (n == 1? "" : "s") ; },
11
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Supprimez " + n + " caractère" + (n == 1? "" : "s"); },
12
- formatSelectionTooBig: function (limit) { return "Vous pouvez seulement sélectionner " + limit + " élément" + (limit == 1 ? "" : "s"); },
13
- formatLoadMore: function (pageNumber) { return "Chargement de résultats supplémentaires…"; },
14
- formatSearching: function () { return "Recherche en cours…"; }
15
- };
16
-
17
- $.extend($.fn.select2.defaults, $.fn.select2.locales['fr']);
18
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_gl.js DELETED
@@ -1,45 +0,0 @@
1
- /**
2
- * Select2 Galician translation
3
- *
4
- * Author: Leandro Regueiro <leandro.regueiro@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['gl'] = {
10
- formatNoMatches: function () {
11
- return "Non se atoparon resultados";
12
- },
13
- formatInputTooShort: function (input, min) {
14
- var n = min - input.length;
15
- if (n === 1) {
16
- return "Engada un carácter";
17
- } else {
18
- return "Engada " + n + " caracteres";
19
- }
20
- },
21
- formatInputTooLong: function (input, max) {
22
- var n = input.length - max;
23
- if (n === 1) {
24
- return "Elimine un carácter";
25
- } else {
26
- return "Elimine " + n + " caracteres";
27
- }
28
- },
29
- formatSelectionTooBig: function (limit) {
30
- if (limit === 1 ) {
31
- return "Só pode seleccionar un elemento";
32
- } else {
33
- return "Só pode seleccionar " + limit + " elementos";
34
- }
35
- },
36
- formatLoadMore: function (pageNumber) {
37
- return "Cargando máis resultados…";
38
- },
39
- formatSearching: function () {
40
- return "Buscando…";
41
- }
42
- };
43
-
44
- $.extend($.fn.select2.defaults, $.fn.select2.locales['gl']);
45
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_he.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Hebrew translation.
3
- *
4
- * Author: Yakir Sitbon <http://www.yakirs.net/>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['he'] = {
10
- formatNoMatches: function () { return "לא נמצאו התאמות"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "נא להזין עוד " + n + " תווים נוספים"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "נא להזין פחות " + n + " תווים"; },
13
- formatSelectionTooBig: function (limit) { return "ניתן לבחור " + limit + " פריטים"; },
14
- formatLoadMore: function (pageNumber) { return "טוען תוצאות נוספות…"; },
15
- formatSearching: function () { return "מחפש…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['he']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_hr.js DELETED
@@ -1,24 +0,0 @@
1
- /**
2
- * Select2 Croatian translation.
3
- *
4
- * @author Edi Modrić <edi.modric@gmail.com>
5
- * @author Uriy Efremochkin <efremochkin@uriy.me>
6
- */
7
- (function ($) {
8
- "use strict";
9
-
10
- $.fn.select2.locales['hr'] = {
11
- formatNoMatches: function () { return "Nema rezultata"; },
12
- formatInputTooShort: function (input, min) { return "Unesite još" + character(min - input.length); },
13
- formatInputTooLong: function (input, max) { return "Unesite" + character(input.length - max) + " manje"; },
14
- formatSelectionTooBig: function (limit) { return "Maksimalan broj odabranih stavki je " + limit; },
15
- formatLoadMore: function (pageNumber) { return "Učitavanje rezultata…"; },
16
- formatSearching: function () { return "Pretraga…"; }
17
- };
18
-
19
- $.extend($.fn.select2.defaults, $.fn.select2.locales['hr']);
20
-
21
- function character (n) {
22
- return " " + n + " znak" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "a" : "" : "ova");
23
- }
24
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_hu.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Hungarian translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['hu'] = {
8
- formatNoMatches: function () { return "Nincs találat."; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Túl rövid. Még " + n + " karakter hiányzik."; },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Túl hosszú. " + n + " karakterrel több, mint kellene."; },
11
- formatSelectionTooBig: function (limit) { return "Csak " + limit + " elemet lehet kiválasztani."; },
12
- formatLoadMore: function (pageNumber) { return "Töltés…"; },
13
- formatSearching: function () { return "Keresés…"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['hu']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_id.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Indonesian translation.
3
- *
4
- * Author: Ibrahim Yusuf <ibrahim7usuf@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['id'] = {
10
- formatNoMatches: function () { return "Tidak ada data yang sesuai"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Masukkan " + n + " huruf lagi" + (n == 1 ? "" : "s"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Hapus " + n + " huruf" + (n == 1 ? "" : "s"); },
13
- formatSelectionTooBig: function (limit) { return "Anda hanya dapat memilih " + limit + " pilihan" + (limit == 1 ? "" : "s"); },
14
- formatLoadMore: function (pageNumber) { return "Mengambil data…"; },
15
- formatSearching: function () { return "Mencari…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['id']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_is.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Icelandic translation.
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['is'] = {
8
- formatNoMatches: function () { return "Ekkert fannst"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Vinsamlegast skrifið " + n + " staf" + (n > 1 ? "i" : "") + " í viðbót"; },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Vinsamlegast styttið texta um " + n + " staf" + (n > 1 ? "i" : ""); },
11
- formatSelectionTooBig: function (limit) { return "Þú getur aðeins valið " + limit + " atriði"; },
12
- formatLoadMore: function (pageNumber) { return "Sæki fleiri niðurstöður…"; },
13
- formatSearching: function () { return "Leita…"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['is']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_it.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Italian translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['it'] = {
8
- formatNoMatches: function () { return "Nessuna corrispondenza trovata"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; },
11
- formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); },
12
- formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; },
13
- formatSearching: function () { return "Ricerca…"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['it']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ja.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Japanese translation.
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['ja'] = {
8
- formatNoMatches: function () { return "該当なし"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "後" + n + "文字入れてください"; },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "検索文字列が" + n + "文字長すぎます"; },
11
- formatSelectionTooBig: function (limit) { return "最多で" + limit + "項目までしか選択できません"; },
12
- formatLoadMore: function (pageNumber) { return "読込中・・・"; },
13
- formatSearching: function () { return "検索中・・・"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ja']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ka.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Georgian (Kartuli) translation.
3
- *
4
- * Author: Dimitri Kurashvili dimakura@gmail.com
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['ka'] = {
10
- formatNoMatches: function () { return "ვერ მოიძებნა"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "გთხოვთ შეიყვანოთ კიდევ " + n + " სიმბოლო"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "გთხოვთ წაშალოთ " + n + " სიმბოლო"; },
13
- formatSelectionTooBig: function (limit) { return "თქვენ შეგიძლიათ მხოლოდ " + limit + " ჩანაწერის მონიშვნა"; },
14
- formatLoadMore: function (pageNumber) { return "შედეგის ჩატვირთვა…"; },
15
- formatSearching: function () { return "ძებნა…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ka']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ko.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Korean translation.
3
- *
4
- * @author Swen Mun <longfinfunnel@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['ko'] = {
10
- formatNoMatches: function () { return "결과 없음"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "너무 짧습니다. "+n+"글자 더 입력해주세요."; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "너무 깁니다. "+n+"글자 지워주세요."; },
13
- formatSelectionTooBig: function (limit) { return "최대 "+limit+"개까지만 선택하실 수 있습니다."; },
14
- formatLoadMore: function (pageNumber) { return "불러오는 중…"; },
15
- formatSearching: function () { return "검색 중…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ko']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_lt.js DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * Select2 Lithuanian translation.
3
- *
4
- * @author CRONUS Karmalakas <cronus dot karmalakas at gmail dot com>
5
- * @author Uriy Efremochkin <efremochkin@uriy.me>
6
- */
7
- (function ($) {
8
- "use strict";
9
-
10
- $.fn.select2.locales['lt'] = {
11
- formatNoMatches: function () { return "Atitikmenų nerasta"; },
12
- formatInputTooShort: function (input, min) { return "Įrašykite dar" + character(min - input.length); },
13
- formatInputTooLong: function (input, max) { return "Pašalinkite" + character(input.length - max); },
14
- formatSelectionTooBig: function (limit) {
15
- return "Jūs galite pasirinkti tik " + limit + " element" + ((limit%100 > 9 && limit%100 < 21) || limit%10 == 0 ? "ų" : limit%10 > 1 ? "us" : "ą");
16
- },
17
- formatLoadMore: function (pageNumber) { return "Kraunama daugiau rezultatų…"; },
18
- formatSearching: function () { return "Ieškoma…"; }
19
- };
20
-
21
- $.extend($.fn.select2.defaults, $.fn.select2.locales['lt']);
22
-
23
- function character (n) {
24
- return " " + n + " simbol" + ((n%100 > 9 && n%100 < 21) || n%10 == 0 ? "ių" : n%10 > 1 ? "ius" : "į");
25
- }
26
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_lv.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Latvian translation.
3
- *
4
- * @author Uriy Efremochkin <efremochkin@uriy.me>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['lv'] = {
10
- formatNoMatches: function () { return "Sakritību nav"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Lūdzu ievadiet vēl " + n + " simbol" + (n == 11 ? "us" : n%10 == 1 ? "u" : "us"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Lūdzu ievadiet par " + n + " simbol" + (n == 11 ? "iem" : n%10 == 1 ? "u" : "iem") + " mazāk"; },
13
- formatSelectionTooBig: function (limit) { return "Jūs varat izvēlēties ne vairāk kā " + limit + " element" + (limit == 11 ? "us" : limit%10 == 1 ? "u" : "us"); },
14
- formatLoadMore: function (pageNumber) { return "Datu ielāde…"; },
15
- formatSearching: function () { return "Meklēšana…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['lv']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_mk.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Macedonian translation.
3
- *
4
- * Author: Marko Aleksic <psybaron@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['mk'] = {
10
- formatNoMatches: function () { return "Нема пронајдено совпаѓања"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Ве молиме внесете уште " + n + " карактер" + (n == 1 ? "" : "и"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Ве молиме внесете " + n + " помалку карактер" + (n == 1? "" : "и"); },
13
- formatSelectionTooBig: function (limit) { return "Можете да изберете само " + limit + " ставк" + (limit == 1 ? "а" : "и"); },
14
- formatLoadMore: function (pageNumber) { return "Вчитување резултати…"; },
15
- formatSearching: function () { return "Пребарување…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['mk']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ms.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Malay translation.
3
- *
4
- * Author: Kepoweran <kepoweran@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['ms'] = {
10
- formatNoMatches: function () { return "Tiada padanan yang ditemui"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Sila masukkan " + n + " aksara lagi"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Sila hapuskan " + n + " aksara"; },
13
- formatSelectionTooBig: function (limit) { return "Anda hanya boleh memilih " + limit + " pilihan"; },
14
- formatLoadMore: function (pageNumber) { return "Sedang memuatkan keputusan…"; },
15
- formatSearching: function () { return "Mencari…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ms']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_nb.js DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * Select2 Norwegian Bokmål translation.
3
- *
4
- * Author: Torgeir Veimo <torgeir.veimo@gmail.com>
5
- * Author: Bjørn Johansen <post@bjornjohansen.no>
6
- */
7
- (function ($) {
8
- "use strict";
9
-
10
- $.fn.select2.locales['nb'] = {
11
- formatMatches: function (matches) { if (matches === 1) { return "Ett resultat er tilgjengelig, trykk enter for å velge det."; } return matches + " resultater er tilgjengelig. Bruk piltastene opp og ned for å navigere."; },
12
- formatNoMatches: function () { return "Ingen treff"; },
13
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); },
14
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; },
15
- formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; },
16
- formatLoadMore: function (pageNumber) { return "Laster flere resultater …"; },
17
- formatSearching: function () { return "Søker …"; }
18
- };
19
-
20
- $.extend($.fn.select2.defaults, $.fn.select2.locales['no']);
21
- })(jQuery);
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_nl.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Dutch translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['nl'] = {
8
- formatNoMatches: function () { return "Geen resultaten gevonden"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Vul nog " + n + " karakter" + (n == 1? "" : "s") + " in"; },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Haal " + n + " karakter" + (n == 1? "" : "s") + " weg"; },
11
- formatSelectionTooBig: function (limit) { return "Maximaal " + limit + " item" + (limit == 1 ? "" : "s") + " toegestaan"; },
12
- formatLoadMore: function (pageNumber) { return "Meer resultaten laden…"; },
13
- formatSearching: function () { return "Zoeken…"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['nl']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_pl.js DELETED
@@ -1,54 +0,0 @@
1
- /**
2
- * Select2 Polish translation.
3
- *
4
- * @author Jan Kondratowicz <jan@kondratowicz.pl>
5
- * @author Uriy Efremochkin <efremochkin@uriy.me>
6
- * @author Michał Połtyn <mike@poltyn.com>
7
- * @author Damian Zajkowski <damian.zajkowski@gmail.com>
8
- */
9
- (function($) {
10
- "use strict";
11
-
12
- $.fn.select2.locales['pl'] = {
13
- formatNoMatches: function() {
14
- return "Brak wyników";
15
- },
16
- formatInputTooShort: function(input, min) {
17
- return "Wpisz co najmniej" + character(min - input.length, "znak", "i");
18
- },
19
- formatInputTooLong: function(input, max) {
20
- return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i");
21
- },
22
- formatSelectionTooBig: function(limit) {
23
- return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y");
24
- },
25
- formatLoadMore: function(pageNumber) {
26
- return "Ładowanie wyników…";
27
- },
28
- formatSearching: function() {
29
- return "Szukanie…";
30
- }
31
- };
32
-
33
- $.extend($.fn.select2.defaults, $.fn.select2.locales['pl']);
34
-
35
- function character(n, word, pluralSuffix) {
36
- //Liczba pojedyncza - brak suffiksu
37
- //jeden znak
38
- //jeden element
39
- var suffix = '';
40
- if (n > 1 && n < 5) {
41
- //Liczaba mnoga ilość od 2 do 4 - własny suffiks
42
- //Dwa znaki, trzy znaki, cztery znaki.
43
- //Dwa elementy, trzy elementy, cztery elementy
44
- suffix = pluralSuffix;
45
- } else if (n == 0 || n >= 5) {
46
- //Ilość 0 suffiks ów
47
- //Liczaba mnoga w ilości 5 i więcej - suffiks ów (nie poprawny dla wszystkich wyrazów, np. 100 wiadomości)
48
- //Zero znaków, Pięć znaków, sześć znaków, siedem znaków, osiem znaków.
49
- //Zero elementów Pięć elementów, sześć elementów, siedem elementów, osiem elementów.
50
- suffix = 'ów';
51
- }
52
- return " " + n + " " + word + suffix;
53
- }
54
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_pt-BR.js DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * Select2 Brazilian Portuguese translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['pt-BR'] = {
8
- formatNoMatches: function () { return "Nenhum resultado encontrado"; },
9
- formatAjaxError: function () { return "Erro na busca"; },
10
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite " + (min == 1 ? "" : "mais") + " " + n + " caracter" + (n == 1? "" : "es"); },
11
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); },
12
- formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
13
- formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; },
14
- formatSearching: function () { return "Buscando…"; }
15
- };
16
-
17
- $.extend($.fn.select2.defaults, $.fn.select2.locales['pt-BR']);
18
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_pt-PT.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Portuguese (Portugal) translation
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['pt-PT'] = {
8
- formatNoMatches: function () { return "Nenhum resultado encontrado"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Introduza " + n + " car" + (n == 1 ? "ácter" : "acteres"); },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " car" + (n == 1 ? "ácter" : "acteres"); },
11
- formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
12
- formatLoadMore: function (pageNumber) { return "A carregar mais resultados…"; },
13
- formatSearching: function () { return "A pesquisar…"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['pt-PT']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ro.js DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Select2 Romanian translation.
3
- */
4
- (function ($) {
5
- "use strict";
6
-
7
- $.fn.select2.locales['ro'] = {
8
- formatNoMatches: function () { return "Nu a fost găsit nimic"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Vă rugăm să introduceți incă " + n + " caracter" + (n == 1 ? "" : "e"); },
10
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Vă rugăm să introduceți mai puțin de " + n + " caracter" + (n == 1? "" : "e"); },
11
- formatSelectionTooBig: function (limit) { return "Aveți voie să selectați cel mult " + limit + " element" + (limit == 1 ? "" : "e"); },
12
- formatLoadMore: function (pageNumber) { return "Se încarcă…"; },
13
- formatSearching: function () { return "Căutare…"; }
14
- };
15
-
16
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ro']);
17
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_rs.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Serbian translation.
3
- *
4
- * @author Limon Monte <limon.monte@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['rs'] = {
10
- formatNoMatches: function () { return "Ništa nije pronađeno"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Ukucajte bar još " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Obrišite " + n + " simbol" + (n % 10 == 1 && n % 100 != 11 ? "" : "a"); },
13
- formatSelectionTooBig: function (limit) { return "Možete izabrati samo " + limit + " stavk" + (limit % 10 == 1 && limit % 100 != 11 ? "u" : (limit % 10 >= 2 && limit % 10 <= 4 && (limit % 100 < 12 || limit % 100 > 14)? "e" : "i")); },
14
- formatLoadMore: function (pageNumber) { return "Preuzimanje još rezultata…"; },
15
- formatSearching: function () { return "Pretraga…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['rs']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ru.js DELETED
@@ -1,23 +0,0 @@
1
- /**
2
- * Select2 Russian translation.
3
- *
4
- * @author Uriy Efremochkin <efremochkin@uriy.me>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['ru'] = {
10
- formatNoMatches: function () { return "Совпадений не найдено"; },
11
- formatInputTooShort: function (input, min) { return "Пожалуйста, введите еще хотя бы" + character(min - input.length); },
12
- formatInputTooLong: function (input, max) { return "Пожалуйста, введите на" + character(input.length - max) + " меньше"; },
13
- formatSelectionTooBig: function (limit) { return "Вы можете выбрать не более " + limit + " элемент" + (limit%10 == 1 && limit%100 != 11 ? "а" : "ов"); },
14
- formatLoadMore: function (pageNumber) { return "Загрузка данных…"; },
15
- formatSearching: function () { return "Поиск…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ru']);
19
-
20
- function character (n) {
21
- return " " + n + " символ" + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 20) ? n%10 > 1 ? "a" : "" : "ов");
22
- }
23
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_sk.js DELETED
@@ -1,50 +0,0 @@
1
- /**
2
- * Select2 Slovak translation.
3
- *
4
- * Author: David Vallner <david@vallner.net>
5
- */
6
- (function ($) {
7
- "use strict";
8
- // use text for the numbers 2 through 4
9
- var smallNumbers = {
10
- 2: function(masc) { return (masc ? "dva" : "dve"); },
11
- 3: function() { return "tri"; },
12
- 4: function() { return "štyri"; }
13
- };
14
- $.fn.select2.locales['sk'] = {
15
- formatNoMatches: function () { return "Nenašli sa žiadne položky"; },
16
- formatInputTooShort: function (input, min) {
17
- var n = min - input.length;
18
- if (n == 1) {
19
- return "Prosím, zadajte ešte jeden znak";
20
- } else if (n <= 4) {
21
- return "Prosím, zadajte ešte ďalšie "+smallNumbers[n](true)+" znaky";
22
- } else {
23
- return "Prosím, zadajte ešte ďalších "+n+" znakov";
24
- }
25
- },
26
- formatInputTooLong: function (input, max) {
27
- var n = input.length - max;
28
- if (n == 1) {
29
- return "Prosím, zadajte o jeden znak menej";
30
- } else if (n >= 2 && n <= 4) {
31
- return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej";
32
- } else {
33
- return "Prosím, zadajte o "+n+" znakov menej";
34
- }
35
- },
36
- formatSelectionTooBig: function (limit) {
37
- if (limit == 1) {
38
- return "Môžete zvoliť len jednu položku";
39
- } else if (limit >= 2 && limit <= 4) {
40
- return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
41
- } else {
42
- return "Môžete zvoliť najviac "+limit+" položiek";
43
- }
44
- },
45
- formatLoadMore: function (pageNumber) { return "Načítavajú sa ďalšie výsledky…"; },
46
- formatSearching: function () { return "Vyhľadávanie…"; }
47
- };
48
-
49
- $.extend($.fn.select2.defaults, $.fn.select2.locales['sk']);
50
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_sv.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Swedish translation.
3
- *
4
- * Author: Jens Rantil <jens.rantil@telavox.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['sv'] = {
10
- formatNoMatches: function () { return "Inga träffar"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Var god skriv in " + n + (n>1 ? " till tecken" : " tecken till"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Var god sudda ut " + n + " tecken"; },
13
- formatSelectionTooBig: function (limit) { return "Du kan max välja " + limit + " element"; },
14
- formatLoadMore: function (pageNumber) { return "Laddar fler resultat…"; },
15
- formatSearching: function () { return "Söker…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['sv']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_th.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Thai translation.
3
- *
4
- * Author: Atsawin Chaowanakritsanakul <joke@nakhon.net>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['th'] = {
10
- formatNoMatches: function () { return "ไม่พบข้อมูล"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "โปรดพิมพ์เพิ่มอีก " + n + " ตัวอักษร"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "โปรดลบออก " + n + " ตัวอักษร"; },
13
- formatSelectionTooBig: function (limit) { return "คุณสามารถเลือกได้ไม่เกิน " + limit + " รายการ"; },
14
- formatLoadMore: function (pageNumber) { return "กำลังค้นข้อมูลเพิ่ม…"; },
15
- formatSearching: function () { return "กำลังค้นข้อมูล…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['th']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_tr.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * Select2 Turkish translation.
3
- *
4
- * Author: Salim KAYABAŞI <salim.kayabasi@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['tr'] = {
10
- formatNoMatches: function () { return "Sonuç bulunamadı"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "En az " + n + " karakter daha girmelisiniz"; },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return n + " karakter azaltmalısınız"; },
13
- formatSelectionTooBig: function (limit) { return "Sadece " + limit + " seçim yapabilirsiniz"; },
14
- formatLoadMore: function (pageNumber) { return "Daha fazla…"; },
15
- formatSearching: function () { return "Aranıyor…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['tr']);
19
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_ug-CN.js DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * Select2 Uyghur translation
3
- */
4
- (function ($) {
5
- "use strict";
6
- $.fn.select2.locales['ug-CN'] = {
7
- formatNoMatches: function () { return "ماس كېلىدىغان ئۇچۇر تېپىلمىدى"; },
8
- formatInputTooShort: function (input, min) { var n = min - input.length; return "يەنە " + n + " ھەرپ كىرگۈزۈڭ";},
9
- formatInputTooLong: function (input, max) { var n = input.length - max; return "" + n + "ھەرپ ئۆچۈرۈڭ";},
10
- formatSelectionTooBig: function (limit) { return "ئەڭ كۆپ بولغاندا" + limit + " تال ئۇچۇر تاللىيالايسىز"; },
11
- formatLoadMore: function (pageNumber) { return "ئۇچۇرلار ئوقۇلىۋاتىدۇ…"; },
12
- formatSearching: function () { return "ئىزدەۋاتىدۇ…"; }
13
- };
14
-
15
- $.extend($.fn.select2.defaults, $.fn.select2.locales['ug-CN']);
16
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_uk.js DELETED
@@ -1,25 +0,0 @@
1
- /**
2
- * Select2 Ukrainian translation.
3
- *
4
- * @author bigmihail <bigmihail@bigmir.net>
5
- * @author Uriy Efremochkin <efremochkin@uriy.me>
6
- */
7
- (function ($) {
8
- "use strict";
9
-
10
- $.fn.select2.locales['uk'] = {
11
- formatMatches: function (matches) { return character(matches, "результат") + " знайдено, використовуйте клавіші зі стрілками вверх та вниз для навігації."; },
12
- formatNoMatches: function () { return "Нічого не знайдено"; },
13
- formatInputTooShort: function (input, min) { return "Введіть буль ласка ще " + character(min - input.length, "символ"); },
14
- formatInputTooLong: function (input, max) { return "Введіть буль ласка на " + character(input.length - max, "символ") + " менше"; },
15
- formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише " + character(limit, "елемент"); },
16
- formatLoadMore: function (pageNumber) { return "Завантаження даних…"; },
17
- formatSearching: function () { return "Пошук…"; }
18
- };
19
-
20
- $.extend($.fn.select2.defaults, $.fn.select2.locales['uk']);
21
-
22
- function character (n, word) {
23
- return n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів");
24
- }
25
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_vi.js DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * Select2 Vietnamese translation.
3
- *
4
- * Author: Long Nguyen <olragon@gmail.com>
5
- */
6
- (function ($) {
7
- "use strict";
8
-
9
- $.fn.select2.locales['vi'] = {
10
- formatNoMatches: function () { return "Không tìm thấy kết quả"; },
11
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Vui lòng nhập nhiều hơn " + n + " ký tự" + (n == 1 ? "" : "s"); },
12
- formatInputTooLong: function (input, max) { var n = input.length - max; return "Vui lòng nhập ít hơn " + n + " ký tự" + (n == 1? "" : "s"); },
13
- formatSelectionTooBig: function (limit) { return "Chỉ có thể chọn được " + limit + " tùy chọn" + (limit == 1 ? "" : "s"); },
14
- formatLoadMore: function (pageNumber) { return "Đang lấy thêm kết quả…"; },
15
- formatSearching: function () { return "Đang tìm…"; }
16
- };
17
-
18
- $.extend($.fn.select2.defaults, $.fn.select2.locales['vi']);
19
- })(jQuery);
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_zh-CN.js DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * Select2 Chinese translation
3
- */
4
- (function ($) {
5
- "use strict";
6
- $.fn.select2.locales['zh-CN'] = {
7
- formatNoMatches: function () { return "没有找到匹配项"; },
8
- formatInputTooShort: function (input, min) { var n = min - input.length; return "请再输入" + n + "个字符";},
9
- formatInputTooLong: function (input, max) { var n = input.length - max; return "请删掉" + n + "个字符";},
10
- formatSelectionTooBig: function (limit) { return "你只能选择最多" + limit + "项"; },
11
- formatLoadMore: function (pageNumber) { return "加载结果中…"; },
12
- formatSearching: function () { return "搜索中…"; }
13
- };
14
-
15
- $.extend($.fn.select2.defaults, $.fn.select2.locales['zh-CN']);
16
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2_locale_zh-TW.js DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * Select2 Traditional Chinese translation
3
- */
4
- (function ($) {
5
- "use strict";
6
- $.fn.select2.locales['zh-TW'] = {
7
- formatNoMatches: function () { return "沒有找到相符的項目"; },
8
- formatInputTooShort: function (input, min) { var n = min - input.length; return "請再輸入" + n + "個字元";},
9
- formatInputTooLong: function (input, max) { var n = input.length - max; return "請刪掉" + n + "個字元";},
10
- formatSelectionTooBig: function (limit) { return "你只能選擇最多" + limit + "項"; },
11
- formatLoadMore: function (pageNumber) { return "載入中…"; },
12
- formatSearching: function () { return "搜尋中…"; }
13
- };
14
-
15
- $.extend($.fn.select2.defaults, $.fn.select2.locales['zh-TW']);
16
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/deps/select2-3.5.2/select2x2.png DELETED
Binary file
assets/deps/select2-4.0.13/i18n/af.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Verwyders asseblief "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Voer asseblief "+(e.minimum-e.input.length)+" of meer karakters"},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var n="Kies asseblief net "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"},removeAllItems:function(){return"Verwyder alle items"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/ar.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(n){return"الرجاء حذف "+(n.input.length-n.maximum)+" عناصر"},inputTooShort:function(n){return"الرجاء إضافة "+(n.minimum-n.input.length)+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(n){return"تستطيع إختيار "+n.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"},removeAllItems:function(){return"قم بإزالة كل العناصر"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/az.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/az",[],function(){return{inputTooLong:function(n){return n.input.length-n.maximum+" simvol silin"},inputTooShort:function(n){return n.minimum-n.input.length+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(n){return"Sadəcə "+n.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"},removeAllItems:function(){return"Bütün elementləri sil"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/bg.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/bg",[],function(){return{inputTooLong:function(n){var e=n.input.length-n.maximum,u="Моля въведете с "+e+" по-малко символ";return e>1&&(u+="a"),u},inputTooShort:function(n){var e=n.minimum-n.input.length,u="Моля въведете още "+e+" символ";return e>1&&(u+="a"),u},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(n){var e="Можете да направите до "+n.maximum+" ";return n.maximum>1?e+="избора":e+="избор",e},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"},removeAllItems:function(){return"Премахнете всички елементи"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/bn.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/bn",[],function(){return{errorLoading:function(){return"ফলাফলগুলি লোড করা যায়নি।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।";return 1!=e&&(u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।"),u},inputTooShort:function(n){return n.minimum-n.input.length+" টি অক্ষর অথবা অধিক অক্ষর লিখুন।"},loadingMore:function(){return"আরো ফলাফল লোড হচ্ছে ..."},maximumSelected:function(n){var e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।";return 1!=n.maximum&&(e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।"),e},noResults:function(){return"কোন ফলাফল পাওয়া যায়নি।"},searching:function(){return"অনুসন্ধান করা হচ্ছে ..."}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/bs.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/bs",[],function(){function e(e,n,r,t){return e%10==1&&e%100!=11?n:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(n){var r=n.input.length-n.maximum,t="Obrišite "+r+" simbol";return t+=e(r,"","a","a")},inputTooShort:function(n){var r=n.minimum-n.input.length,t="Ukucajte bar još "+r+" simbol";return t+=e(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(n){var r="Možete izabrati samo "+n.maximum+" stavk";return r+=e(n.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Uklonite sve stavke"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/ca.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Si us plau, elimina "+n+" car";return r+=1==n?"àcter":"àcters"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Si us plau, introdueix "+n+" car";return r+=1==n?"àcter":"àcters"},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var n="Només es pot seleccionar "+e.maximum+" element";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/cs.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/cs",[],function(){function e(e,n){switch(e){case 2:return n?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadejte o jeden znak méně.":t<=4?"Prosím, zadejte o "+e(t,!0)+" znaky méně.":"Prosím, zadejte o "+t+" znaků méně."},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadejte ještě jeden znak.":t<=4?"Prosím, zadejte ještě další "+e(t,!0)+" znaky.":"Prosím, zadejte ještě dalších "+t+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(n){var t=n.maximum;return 1==t?"Můžete zvolit jen jednu položku.":t<=4?"Můžete zvolit maximálně "+e(t,!1)+" položky.":"Můžete zvolit maximálně "+t+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"},removeAllItems:function(){return"Odstraňte všechny položky"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/da.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){return"Angiv venligst "+(e.input.length-e.maximum)+" tegn mindre"},inputTooShort:function(e){return"Angiv venligst "+(e.minimum-e.input.length)+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var n="Du kan kun vælge "+e.maximum+" emne";return 1!=e.maximum&&(n+="r"),n},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/de.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){return"Bitte "+(e.input.length-e.maximum)+" Zeichen weniger eingeben"},inputTooShort:function(e){return"Bitte "+(e.minimum-e.input.length)+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var n="Sie können nur "+e.maximum+" Element";return 1!=e.maximum&&(n+="e"),n+=" auswählen"},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Elemente"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/dsb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/dsb",[],function(){var n=["znamuško","znamušce","znamuška","znamuškow"],e=["zapisk","zapiska","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Pšosym lašuj "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Pšosym zapódaj nanejmjenjej "+a+" "+u(a,n)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(n){return"Móžoš jano "+n.maximum+" "+u(n.maximum,e)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/el.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(n){var e=n.input.length-n.maximum,u="Παρακαλώ διαγράψτε "+e+" χαρακτήρ";return 1==e&&(u+="α"),1!=e&&(u+="ες"),u},inputTooShort:function(n){return"Παρακαλώ συμπληρώστε "+(n.minimum-n.input.length)+" ή περισσότερους χαρακτήρες"},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(n){var e="Μπορείτε να επιλέξετε μόνο "+n.maximum+" επιλογ";return 1==n.maximum&&(e+="ή"),1!=n.maximum&&(e+="ές"),e},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"},removeAllItems:function(){return"Καταργήστε όλα τα στοιχεία"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/en.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Please delete "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var n="You can only select "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/es.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Por favor, elimine "+n+" car";return r+=1==n?"ácter":"acteres"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Por favor, introduzca "+n+" car";return r+=1==n?"ácter":"acteres"},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var n="Sólo puede seleccionar "+e.maximum+" elemento";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/et.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var n=e.input.length-e.maximum,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" vähem"},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" rohkem"},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var n="Saad vaid "+e.maximum+" tulemus";return 1==e.maximum?n+="e":n+="t",n+=" valida"},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"},removeAllItems:function(){return"Eemalda kõik esemed"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/eu.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gutxiago"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gehiago"},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return 1===e.maximum?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"},removeAllItems:function(){return"Kendu elementu guztiak"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/fa.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(n){return"لطفاً "+(n.input.length-n.maximum)+" کاراکتر را حذف نمایید"},inputTooShort:function(n){return"لطفاً تعداد "+(n.minimum-n.input.length)+" کاراکتر یا بیشتر وارد نمایید"},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(n){return"شما تنها می‌توانید "+n.maximum+" آیتم را انتخاب نمایید"},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."},removeAllItems:function(){return"همه موارد را حذف کنید"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/fi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(n){return"Ole hyvä ja anna "+(n.input.length-n.maximum)+" merkkiä vähemmän"},inputTooShort:function(n){return"Ole hyvä ja anna "+(n.minimum-n.input.length)+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(n){return"Voit valita ainoastaan "+n.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"},removeAllItems:function(){return"Poista kaikki kohteet"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/fr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var n=e.input.length-e.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(e){var n=e.minimum-e.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/gl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var n=e.input.length-e.maximum;return 1===n?"Elimine un carácter":"Elimine "+n+" caracteres"},inputTooShort:function(e){var n=e.minimum-e.input.length;return 1===n?"Engada un carácter":"Engada "+n+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return 1===e.maximum?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Elimina todos os elementos"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/he.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="נא למחוק ";return r+=1===e?"תו אחד":e+" תווים"},inputTooShort:function(n){var e=n.minimum-n.input.length,r="נא להכניס ";return r+=1===e?"תו אחד":e+" תווים",r+=" או יותר"},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(n){var e="באפשרותך לבחור עד ";return 1===n.maximum?e+="פריט אחד":e+=n.maximum+" פריטים",e},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"},removeAllItems:function(){return"הסר את כל הפריטים"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/hi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(n){var e=n.input.length-n.maximum,r=e+" अक्षर को हटा दें";return e>1&&(r=e+" अक्षरों को हटा दें "),r},inputTooShort:function(n){return"कृपया "+(n.minimum-n.input.length)+" या अधिक अक्षर दर्ज करें"},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(n){return"आप केवल "+n.maximum+" आइटम का चयन कर सकते हैं"},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."},removeAllItems:function(){return"सभी वस्तुओं को हटा दें"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/hr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hr",[],function(){function n(n){var e=" "+n+" znak";return n%10<5&&n%10>0&&(n%100<5||n%100>19)?n%10>1&&(e+="a"):e+="ova",e}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(e){return"Unesite "+n(e.input.length-e.maximum)},inputTooShort:function(e){return"Unesite još "+n(e.minimum-e.input.length)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(n){return"Maksimalan broj odabranih stavki je "+n.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Ukloni sve stavke"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/hsb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hsb",[],function(){var n=["znamješko","znamješce","znamješka","znamješkow"],e=["zapisk","zapiskaj","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Prošu zhašej "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Prošu zapodaj znajmjeńša "+a+" "+u(a,n)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(n){return"Móžeš jenož "+n.maximum+" "+u(n.maximum,e)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/hu.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){return"Túl hosszú. "+(e.input.length-e.maximum)+" karakterrel több, mint kellene."},inputTooShort:function(e){return"Túl rövid. Még "+(e.minimum-e.input.length)+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/hy.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(n){return"Խնդրում ենք հեռացնել "+(n.input.length-n.maximum)+" նշան"},inputTooShort:function(n){return"Խնդրում ենք մուտքագրել "+(n.minimum-n.input.length)+" կամ ավել նշաններ"},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(n){return"Դուք կարող եք ընտրել առավելագույնը "+n.maximum+" կետ"},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"},removeAllItems:function(){return"Հեռացնել բոլոր տարրերը"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/id.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(n){return"Hapuskan "+(n.input.length-n.maximum)+" huruf"},inputTooShort:function(n){return"Masukkan "+(n.minimum-n.input.length)+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(n){return"Anda hanya dapat memilih "+n.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Hapus semua item"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/is.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/is",[],function(){return{inputTooLong:function(n){var t=n.input.length-n.maximum,e="Vinsamlegast styttið texta um "+t+" staf";return t<=1?e:e+"i"},inputTooShort:function(n){var t=n.minimum-n.input.length,e="Vinsamlegast skrifið "+t+" staf";return t>1&&(e+="i"),e+=" í viðbót"},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(n){return"Þú getur aðeins valið "+n.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"},removeAllItems:function(){return"Fjarlægðu öll atriði"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/it.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Per favore cancella "+n+" caratter";return t+=1!==n?"i":"e"},inputTooShort:function(e){return"Per favore inserisci "+(e.minimum-e.input.length)+" o più caratteri"},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var n="Puoi selezionare solo "+e.maximum+" element";return 1!==e.maximum?n+="i":n+="o",n},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/ja.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(n){return n.input.length-n.maximum+" 文字を削除してください"},inputTooShort:function(n){return"少なくとも "+(n.minimum-n.input.length)+" 文字を入力してください"},loadingMore:function(){return"読み込み中…"},maximumSelected:function(n){return n.maximum+" 件しか選択できません"},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"},removeAllItems:function(){return"すべてのアイテムを削除"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/ka.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ka",[],function(){return{errorLoading:function(){return"მონაცემების ჩატვირთვა შეუძლებელია."},inputTooLong:function(n){return"გთხოვთ აკრიფეთ "+(n.input.length-n.maximum)+" სიმბოლოთი ნაკლები"},inputTooShort:function(n){return"გთხოვთ აკრიფეთ "+(n.minimum-n.input.length)+" სიმბოლო ან მეტი"},loadingMore:function(){return"მონაცემების ჩატვირთვა…"},maximumSelected:function(n){return"თქვენ შეგიძლიათ აირჩიოთ არაუმეტეს "+n.maximum+" ელემენტი"},noResults:function(){return"რეზულტატი არ მოიძებნა"},searching:function(){return"ძიება…"},removeAllItems:function(){return"ამოიღე ყველა ელემენტი"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/km.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(n){return"សូមលុបចេញ "+(n.input.length-n.maximum)+" អក្សរ"},inputTooShort:function(n){return"សូមបញ្ចូល"+(n.minimum-n.input.length)+" អក្សរ រឺ ច្រើនជាងនេះ"},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(n){return"អ្នកអាចជ្រើសរើសបានតែ "+n.maximum+" ជម្រើសប៉ុណ្ណោះ"},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."},removeAllItems:function(){return"លុបធាតុទាំងអស់"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/ko.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(n){return"너무 깁니다. "+(n.input.length-n.maximum)+" 글자 지워주세요."},inputTooShort:function(n){return"너무 짧습니다. "+(n.minimum-n.input.length)+" 글자 더 입력해주세요."},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(n){return"최대 "+n.maximum+"개까지만 선택 가능합니다."},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"},removeAllItems:function(){return"모든 항목 삭제"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/lt.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/lt",[],function(){function n(n,e,i,t){return n%10==1&&(n%100<11||n%100>19)?e:n%10>=2&&n%10<=9&&(n%100<11||n%100>19)?i:t}return{inputTooLong:function(e){var i=e.input.length-e.maximum,t="Pašalinkite "+i+" simbol";return t+=n(i,"į","ius","ių")},inputTooShort:function(e){var i=e.minimum-e.input.length,t="Įrašykite dar "+i+" simbol";return t+=n(i,"į","ius","ių")},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(e){var i="Jūs galite pasirinkti tik "+e.maximum+" element";return i+=n(e.maximum,"ą","us","ų")},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"},removeAllItems:function(){return"Pašalinti visus elementus"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/lv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/lv",[],function(){function e(e,n,u,i){return 11===e?n:e%10==1?u:i}return{inputTooLong:function(n){var u=n.input.length-n.maximum,i="Lūdzu ievadiet par "+u;return(i+=" simbol"+e(u,"iem","u","iem"))+" mazāk"},inputTooShort:function(n){var u=n.minimum-n.input.length,i="Lūdzu ievadiet vēl "+u;return i+=" simbol"+e(u,"us","u","us")},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(n){var u="Jūs varat izvēlēties ne vairāk kā "+n.maximum;return u+=" element"+e(n.maximum,"us","u","us")},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"},removeAllItems:function(){return"Noņemt visus vienumus"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/mk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/mk",[],function(){return{inputTooLong:function(n){var e=(n.input.length,n.maximum,"Ве молиме внесете "+n.maximum+" помалку карактер");return 1!==n.maximum&&(e+="и"),e},inputTooShort:function(n){var e=(n.minimum,n.input.length,"Ве молиме внесете уште "+n.maximum+" карактер");return 1!==n.maximum&&(e+="и"),e},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(n){var e="Можете да изберете само "+n.maximum+" ставк";return 1===n.maximum?e+="а":e+="и",e},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"},removeAllItems:function(){return"Отстрани ги сите предмети"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/ms.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(n){return"Sila hapuskan "+(n.input.length-n.maximum)+" aksara"},inputTooShort:function(n){return"Sila masukkan "+(n.minimum-n.input.length)+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(n){return"Anda hanya boleh memilih "+n.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Keluarkan semua item"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/nb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){return"Vennligst fjern "+(e.input.length-e.maximum)+" tegn"},inputTooShort:function(e){return"Vennligst skriv inn "+(e.minimum-e.input.length)+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/ne.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ne",[],function(){return{errorLoading:function(){return"नतिजाहरु देखाउन सकिएन।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="कृपया "+e+" अक्षर मेटाउनुहोस्।";return 1!=e&&(u+="कृपया "+e+" अक्षरहरु मेटाउनुहोस्।"),u},inputTooShort:function(n){return"कृपया बाँकी रहेका "+(n.minimum-n.input.length)+" वा अरु धेरै अक्षरहरु भर्नुहोस्।"},loadingMore:function(){return"अरु नतिजाहरु भरिँदैछन् …"},maximumSelected:function(n){var e="तँपाई "+n.maximum+" वस्तु मात्र छान्न पाउँनुहुन्छ।";return 1!=n.maximum&&(e="तँपाई "+n.maximum+" वस्तुहरु मात्र छान्न पाउँनुहुन्छ।"),e},noResults:function(){return"कुनै पनि नतिजा भेटिएन।"},searching:function(){return"खोजि हुँदैछ…"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/nl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){return"Gelieve "+(e.input.length-e.maximum)+" karakters te verwijderen"},inputTooShort:function(e){return"Gelieve "+(e.minimum-e.input.length)+" of meer karakters in te voeren"},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var n=1==e.maximum?"kan":"kunnen",r="Er "+n+" maar "+e.maximum+" item";return 1!=e.maximum&&(r+="s"),r+=" worden geselecteerd"},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/pl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/pl",[],function(){var n=["znak","znaki","znaków"],e=["element","elementy","elementów"],r=function(n,e){return 1===n?e[0]:n>1&&n<=4?e[1]:n>=5?e[2]:void 0};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Usuń "+t+" "+r(t,n)},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Podaj przynajmniej "+t+" "+r(t,n)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(n){return"Możesz zaznaczyć tylko "+n.maximum+" "+r(n.maximum,e)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/ps.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="د مهربانۍ لمخي "+e+" توری ړنګ کړئ";return 1!=e&&(r=r.replace("توری","توري")),r},inputTooShort:function(n){return"لږ تر لږه "+(n.minimum-n.input.length)+" يا ډېر توري وليکئ"},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(n){var e="تاسو يوازي "+n.maximum+" قلم په نښه کولای سی";return 1!=n.maximum&&(e=e.replace("قلم","قلمونه")),e},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."},removeAllItems:function(){return"ټول توکي لرې کړئ"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/pt-BR.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Apague "+n+" caracter";return 1!=n&&(r+="es"),r},inputTooShort:function(e){return"Digite "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var n="Você só pode selecionar "+e.maximum+" ite";return 1==e.maximum?n+="m":n+="ns",n},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/pt.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var r=e.input.length-e.maximum,n="Por favor apague "+r+" ";return n+=1!=r?"caracteres":"caractere"},inputTooShort:function(e){return"Introduza "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var r="Apenas pode seleccionar "+e.maximum+" ";return r+=1!=e.maximum?"itens":"item"},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/ro.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return 1!==t&&(n+="e"),n},inputTooShort:function(e){return"Vă rugăm să introduceți "+(e.minimum-e.input.length)+" sau mai multe caractere"},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",1!==e.maximum&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"},removeAllItems:function(){return"Eliminați toate elementele"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/ru.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ru",[],function(){function n(n,e,r,u){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?r:e:u}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Пожалуйста, введите на "+r+" символ";return u+=n(r,"","a","ов"),u+=" меньше"},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Пожалуйста, введите ещё хотя бы "+r+" символ";return u+=n(r,"","a","ов")},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(e){var r="Вы можете выбрать не более "+e.maximum+" элемент";return r+=n(e.maximum,"","a","ов")},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/sk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadajte o jeden znak menej":t>=2&&t<=4?"Prosím, zadajte o "+e[t](!0)+" znaky menej":"Prosím, zadajte o "+t+" znakov menej"},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadajte ešte jeden znak":t<=4?"Prosím, zadajte ešte ďalšie "+e[t](!0)+" znaky":"Prosím, zadajte ešte ďalších "+t+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(n){return 1==n.maximum?"Môžete zvoliť len jednu položku":n.maximum>=2&&n.maximum<=4?"Môžete zvoliť najviac "+e[n.maximum](!1)+" položky":"Môžete zvoliť najviac "+n.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/sl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Prosim zbrišite "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Prosim vpišite še "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var n="Označite lahko največ "+e.maximum+" predmet";return 2==e.maximum?n+="a":1!=e.maximum&&(n+="e"),n},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"},removeAllItems:function(){return"Odstranite vse elemente"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/sq.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sq",[],function(){return{errorLoading:function(){return"Rezultatet nuk mund të ngarkoheshin."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Të lutem fshi "+n+" karakter";return 1!=n&&(t+="e"),t},inputTooShort:function(e){return"Të lutem shkruaj "+(e.minimum-e.input.length)+" ose më shumë karaktere"},loadingMore:function(){return"Duke ngarkuar më shumë rezultate…"},maximumSelected:function(e){var n="Mund të zgjedhësh vetëm "+e.maximum+" element";return 1!=e.maximum&&(n+="e"),n},noResults:function(){return"Nuk u gjet asnjë rezultat"},searching:function(){return"Duke kërkuar…"},removeAllItems:function(){return"Hiq të gjitha sendet"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/sr-Cyrl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sr-Cyrl",[],function(){function n(n,e,r,u){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:u}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Обришите "+r+" симбол";return u+=n(r,"","а","а")},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Укуцајте бар још "+r+" симбол";return u+=n(r,"","а","а")},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(e){var r="Можете изабрати само "+e.maximum+" ставк";return r+=n(e.maximum,"у","е","и")},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/sr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sr",[],function(){function n(n,e,r,t){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(e){var r=e.input.length-e.maximum,t="Obrišite "+r+" simbol";return t+=n(r,"","a","a")},inputTooShort:function(e){var r=e.minimum-e.input.length,t="Ukucajte bar još "+r+" simbol";return t+=n(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(e){var r="Možete izabrati samo "+e.maximum+" stavk";return r+=n(e.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/sv.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(n){return"Vänligen sudda ut "+(n.input.length-n.maximum)+" tecken"},inputTooShort:function(n){return"Vänligen skriv in "+(n.minimum-n.input.length)+" eller fler tecken"},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(n){return"Du kan max välja "+n.maximum+" element"},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"},removeAllItems:function(){return"Ta bort alla objekt"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/th.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(n){return"โปรดลบออก "+(n.input.length-n.maximum)+" ตัวอักษร"},inputTooShort:function(n){return"โปรดพิมพ์เพิ่มอีก "+(n.minimum-n.input.length)+" ตัวอักษร"},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(n){return"คุณสามารถเลือกได้ไม่เกิน "+n.maximum+" รายการ"},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"},removeAllItems:function(){return"ลบรายการทั้งหมด"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/tk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/tk",[],function(){return{errorLoading:function(){return"Netije ýüklenmedi."},inputTooLong:function(e){return e.input.length-e.maximum+" harp bozuň."},inputTooShort:function(e){return"Ýene-de iň az "+(e.minimum-e.input.length)+" harp ýazyň."},loadingMore:function(){return"Köpräk netije görkezilýär…"},maximumSelected:function(e){return"Diňe "+e.maximum+" sanysyny saýlaň."},noResults:function(){return"Netije tapylmady."},searching:function(){return"Gözlenýär…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();
assets/deps/select2-4.0.13/i18n/tr.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(n){return n.input.length-n.maximum+" karakter daha girmelisiniz"},inputTooShort:function(n){return"En az "+(n.minimum-n.input.length)+" karakter daha girmelisiniz"},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(n){return"Sadece "+n.maximum+" seçim yapabilirsiniz"},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"},removeAllItems:function(){return"Tüm öğeleri kaldır"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/uk.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/uk",[],function(){function n(n,e,u,r){return n%100>10&&n%100<15?r:n%10==1?e:n%10>1&&n%10<5?u:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(e){return"Будь ласка, видаліть "+(e.input.length-e.maximum)+" "+n(e.maximum,"літеру","літери","літер")},inputTooShort:function(n){return"Будь ласка, введіть "+(n.minimum-n.input.length)+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(e){return"Ви можете вибрати лише "+e.maximum+" "+n(e.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"},removeAllItems:function(){return"Видалити всі елементи"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/vi.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/vi",[],function(){return{inputTooLong:function(n){return"Vui lòng xóa bớt "+(n.input.length-n.maximum)+" ký tự"},inputTooShort:function(n){return"Vui lòng nhập thêm từ "+(n.minimum-n.input.length)+" ký tự trở lên"},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(n){return"Chỉ có thể chọn được "+n.maximum+" lựa chọn"},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"},removeAllItems:function(){return"Xóa tất cả các mục"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/zh-CN.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/i18n/zh-TW.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(n){return"請刪掉"+(n.input.length-n.maximum)+"個字元"},inputTooShort:function(n){return"請再輸入"+(n.minimum-n.input.length)+"個字元"},loadingMore:function(){return"載入中…"},maximumSelected:function(n){return"你只能選擇最多"+n.maximum+"項"},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"},removeAllItems:function(){return"刪除所有項目"}}}),n.define,n.require}();
assets/deps/select2-4.0.13/select2.css ADDED
@@ -0,0 +1,481 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .select2-container {
2
+ box-sizing: border-box;
3
+ display: inline-block;
4
+ margin: 0;
5
+ position: relative;
6
+ vertical-align: middle; }
7
+ .select2-container .select2-selection--single {
8
+ box-sizing: border-box;
9
+ cursor: pointer;
10
+ display: block;
11
+ height: 28px;
12
+ user-select: none;
13
+ -webkit-user-select: none; }
14
+ .select2-container .select2-selection--single .select2-selection__rendered {
15
+ display: block;
16
+ padding-left: 8px;
17
+ padding-right: 20px;
18
+ overflow: hidden;
19
+ text-overflow: ellipsis;
20
+ white-space: nowrap; }
21
+ .select2-container .select2-selection--single .select2-selection__clear {
22
+ position: relative; }
23
+ .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
24
+ padding-right: 8px;
25
+ padding-left: 20px; }
26
+ .select2-container .select2-selection--multiple {
27
+ box-sizing: border-box;
28
+ cursor: pointer;
29
+ display: block;
30
+ min-height: 32px;
31
+ user-select: none;
32
+ -webkit-user-select: none; }
33
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
34
+ display: inline-block;
35
+ overflow: hidden;
36
+ padding-left: 8px;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap; }
39
+ .select2-container .select2-search--inline {
40
+ float: left; }
41
+ .select2-container .select2-search--inline .select2-search__field {
42
+ box-sizing: border-box;
43
+ border: none;
44
+ font-size: 100%;
45
+ margin-top: 5px;
46
+ padding: 0; }
47
+ .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
48
+ -webkit-appearance: none; }
49
+
50
+ .select2-dropdown {
51
+ background-color: white;
52
+ border: 1px solid #aaa;
53
+ border-radius: 4px;
54
+ box-sizing: border-box;
55
+ display: block;
56
+ position: absolute;
57
+ left: -100000px;
58
+ width: 100%;
59
+ z-index: 1051; }
60
+
61
+ .select2-results {
62
+ display: block; }
63
+
64
+ .select2-results__options {
65
+ list-style: none;
66
+ margin: 0;
67
+ padding: 0; }
68
+
69
+ .select2-results__option {
70
+ padding: 6px;
71
+ user-select: none;
72
+ -webkit-user-select: none; }
73
+ .select2-results__option[aria-selected] {
74
+ cursor: pointer; }
75
+
76
+ .select2-container--open .select2-dropdown {
77
+ left: 0; }
78
+
79
+ .select2-container--open .select2-dropdown--above {
80
+ border-bottom: none;
81
+ border-bottom-left-radius: 0;
82
+ border-bottom-right-radius: 0; }
83
+
84
+ .select2-container--open .select2-dropdown--below {
85
+ border-top: none;
86
+ border-top-left-radius: 0;
87
+ border-top-right-radius: 0; }
88
+
89
+ .select2-search--dropdown {
90
+ display: block;
91
+ padding: 4px; }
92
+ .select2-search--dropdown .select2-search__field {
93
+ padding: 4px;
94
+ width: 100%;
95
+ box-sizing: border-box; }
96
+ .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
97
+ -webkit-appearance: none; }
98
+ .select2-search--dropdown.select2-search--hide {
99
+ display: none; }
100
+
101
+ .select2-close-mask {
102
+ border: 0;
103
+ margin: 0;
104
+ padding: 0;
105
+ display: block;
106
+ position: fixed;
107
+ left: 0;
108
+ top: 0;
109
+ min-height: 100%;
110
+ min-width: 100%;
111
+ height: auto;
112
+ width: auto;
113
+ opacity: 0;
114
+ z-index: 99;
115
+ background-color: #fff;
116
+ filter: alpha(opacity=0); }
117
+
118
+ .select2-hidden-accessible {
119
+ border: 0 !important;
120
+ clip: rect(0 0 0 0) !important;
121
+ -webkit-clip-path: inset(50%) !important;
122
+ clip-path: inset(50%) !important;
123
+ height: 1px !important;
124
+ overflow: hidden !important;
125
+ padding: 0 !important;
126
+ position: absolute !important;
127
+ width: 1px !important;
128
+ white-space: nowrap !important; }
129
+
130
+ .select2-container--default .select2-selection--single {
131
+ background-color: #fff;
132
+ border: 1px solid #aaa;
133
+ border-radius: 4px; }
134
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
135
+ color: #444;
136
+ line-height: 28px; }
137
+ .select2-container--default .select2-selection--single .select2-selection__clear {
138
+ cursor: pointer;
139
+ float: right;
140
+ font-weight: bold; }
141
+ .select2-container--default .select2-selection--single .select2-selection__placeholder {
142
+ color: #999; }
143
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
144
+ height: 26px;
145
+ position: absolute;
146
+ top: 1px;
147
+ right: 1px;
148
+ width: 20px; }
149
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
150
+ border-color: #888 transparent transparent transparent;
151
+ border-style: solid;
152
+ border-width: 5px 4px 0 4px;
153
+ height: 0;
154
+ left: 50%;
155
+ margin-left: -4px;
156
+ margin-top: -2px;
157
+ position: absolute;
158
+ top: 50%;
159
+ width: 0; }
160
+
161
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
162
+ float: left; }
163
+
164
+ .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
165
+ left: 1px;
166
+ right: auto; }
167
+
168
+ .select2-container--default.select2-container--disabled .select2-selection--single {
169
+ background-color: #eee;
170
+ cursor: default; }
171
+ .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
172
+ display: none; }
173
+
174
+ .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
175
+ border-color: transparent transparent #888 transparent;
176
+ border-width: 0 4px 5px 4px; }
177
+
178
+ .select2-container--default .select2-selection--multiple {
179
+ background-color: white;
180
+ border: 1px solid #aaa;
181
+ border-radius: 4px;
182
+ cursor: text; }
183
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered {
184
+ box-sizing: border-box;
185
+ list-style: none;
186
+ margin: 0;
187
+ padding: 0 5px;
188
+ width: 100%; }
189
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
190
+ list-style: none; }
191
+ .select2-container--default .select2-selection--multiple .select2-selection__clear {
192
+ cursor: pointer;
193
+ float: right;
194
+ font-weight: bold;
195
+ margin-top: 5px;
196
+ margin-right: 10px;
197
+ padding: 1px; }
198
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
199
+ background-color: #e4e4e4;
200
+ border: 1px solid #aaa;
201
+ border-radius: 4px;
202
+ cursor: default;
203
+ float: left;
204
+ margin-right: 5px;
205
+ margin-top: 5px;
206
+ padding: 0 5px; }
207
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
208
+ color: #999;
209
+ cursor: pointer;
210
+ display: inline-block;
211
+ font-weight: bold;
212
+ margin-right: 2px; }
213
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
214
+ color: #333; }
215
+
216
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
217
+ float: right; }
218
+
219
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
220
+ margin-left: 5px;
221
+ margin-right: auto; }
222
+
223
+ .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
224
+ margin-left: 2px;
225
+ margin-right: auto; }
226
+
227
+ .select2-container--default.select2-container--focus .select2-selection--multiple {
228
+ border: solid black 1px;
229
+ outline: 0; }
230
+
231
+ .select2-container--default.select2-container--disabled .select2-selection--multiple {
232
+ background-color: #eee;
233
+ cursor: default; }
234
+
235
+ .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
236
+ display: none; }
237
+
238
+ .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
239
+ border-top-left-radius: 0;
240
+ border-top-right-radius: 0; }
241
+
242
+ .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
243
+ border-bottom-left-radius: 0;
244
+ border-bottom-right-radius: 0; }
245
+
246
+ .select2-container--default .select2-search--dropdown .select2-search__field {
247
+ border: 1px solid #aaa; }
248
+
249
+ .select2-container--default .select2-search--inline .select2-search__field {
250
+ background: transparent;
251
+ border: none;
252
+ outline: 0;
253
+ box-shadow: none;
254
+ -webkit-appearance: textfield; }
255
+
256
+ .select2-container--default .select2-results > .select2-results__options {
257
+ max-height: 200px;
258
+ overflow-y: auto; }
259
+
260
+ .select2-container--default .select2-results__option[role=group] {
261
+ padding: 0; }
262
+
263
+ .select2-container--default .select2-results__option[aria-disabled=true] {
264
+ color: #999; }
265
+
266
+ .select2-container--default .select2-results__option[aria-selected=true] {
267
+ background-color: #ddd; }
268
+
269
+ .select2-container--default .select2-results__option .select2-results__option {
270
+ padding-left: 1em; }
271
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
272
+ padding-left: 0; }
273
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
274
+ margin-left: -1em;
275
+ padding-left: 2em; }
276
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
277
+ margin-left: -2em;
278
+ padding-left: 3em; }
279
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
280
+ margin-left: -3em;
281
+ padding-left: 4em; }
282
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
283
+ margin-left: -4em;
284
+ padding-left: 5em; }
285
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
286
+ margin-left: -5em;
287
+ padding-left: 6em; }
288
+
289
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
290
+ background-color: #5897fb;
291
+ color: white; }
292
+
293
+ .select2-container--default .select2-results__group {
294
+ cursor: default;
295
+ display: block;
296
+ padding: 6px; }
297
+
298
+ .select2-container--classic .select2-selection--single {
299
+ background-color: #f7f7f7;
300
+ border: 1px solid #aaa;
301
+ border-radius: 4px;
302
+ outline: 0;
303
+ background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
304
+ background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
305
+ background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
306
+ background-repeat: repeat-x;
307
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
308
+ .select2-container--classic .select2-selection--single:focus {
309
+ border: 1px solid #5897fb; }
310
+ .select2-container--classic .select2-selection--single .select2-selection__rendered {
311
+ color: #444;
312
+ line-height: 28px; }
313
+ .select2-container--classic .select2-selection--single .select2-selection__clear {
314
+ cursor: pointer;
315
+ float: right;
316
+ font-weight: bold;
317
+ margin-right: 10px; }
318
+ .select2-container--classic .select2-selection--single .select2-selection__placeholder {
319
+ color: #999; }
320
+ .select2-container--classic .select2-selection--single .select2-selection__arrow {
321
+ background-color: #ddd;
322
+ border: none;
323
+ border-left: 1px solid #aaa;
324
+ border-top-right-radius: 4px;
325
+ border-bottom-right-radius: 4px;
326
+ height: 26px;
327
+ position: absolute;
328
+ top: 1px;
329
+ right: 1px;
330
+ width: 20px;
331
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
332
+ background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
333
+ background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
334
+ background-repeat: repeat-x;
335
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
336
+ .select2-container--classic .select2-selection--single .select2-selection__arrow b {
337
+ border-color: #888 transparent transparent transparent;
338
+ border-style: solid;
339
+ border-width: 5px 4px 0 4px;
340
+ height: 0;
341
+ left: 50%;
342
+ margin-left: -4px;
343
+ margin-top: -2px;
344
+ position: absolute;
345
+ top: 50%;
346
+ width: 0; }
347
+
348
+ .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
349
+ float: left; }
350
+
351
+ .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
352
+ border: none;
353
+ border-right: 1px solid #aaa;
354
+ border-radius: 0;
355
+ border-top-left-radius: 4px;
356
+ border-bottom-left-radius: 4px;
357
+ left: 1px;
358
+ right: auto; }
359
+
360
+ .select2-container--classic.select2-container--open .select2-selection--single {
361
+ border: 1px solid #5897fb; }
362
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
363
+ background: transparent;
364
+ border: none; }
365
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
366
+ border-color: transparent transparent #888 transparent;
367
+ border-width: 0 4px 5px 4px; }
368
+
369
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
370
+ border-top: none;
371
+ border-top-left-radius: 0;
372
+ border-top-right-radius: 0;
373
+ background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
374
+ background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
375
+ background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
376
+ background-repeat: repeat-x;
377
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
378
+
379
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
380
+ border-bottom: none;
381
+ border-bottom-left-radius: 0;
382
+ border-bottom-right-radius: 0;
383
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
384
+ background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
385
+ background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
386
+ background-repeat: repeat-x;
387
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
388
+
389
+ .select2-container--classic .select2-selection--multiple {
390
+ background-color: white;
391
+ border: 1px solid #aaa;
392
+ border-radius: 4px;
393
+ cursor: text;
394
+ outline: 0; }
395
+ .select2-container--classic .select2-selection--multiple:focus {
396
+ border: 1px solid #5897fb; }
397
+ .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
398
+ list-style: none;
399
+ margin: 0;
400
+ padding: 0 5px; }
401
+ .select2-container--classic .select2-selection--multiple .select2-selection__clear {
402
+ display: none; }
403
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice {
404
+ background-color: #e4e4e4;
405
+ border: 1px solid #aaa;
406
+ border-radius: 4px;
407
+ cursor: default;
408
+ float: left;
409
+ margin-right: 5px;
410
+ margin-top: 5px;
411
+ padding: 0 5px; }
412
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
413
+ color: #888;
414
+ cursor: pointer;
415
+ display: inline-block;
416
+ font-weight: bold;
417
+ margin-right: 2px; }
418
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
419
+ color: #555; }
420
+
421
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
422
+ float: right;
423
+ margin-left: 5px;
424
+ margin-right: auto; }
425
+
426
+ .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
427
+ margin-left: 2px;
428
+ margin-right: auto; }
429
+
430
+ .select2-container--classic.select2-container--open .select2-selection--multiple {
431
+ border: 1px solid #5897fb; }
432
+
433
+ .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
434
+ border-top: none;
435
+ border-top-left-radius: 0;
436
+ border-top-right-radius: 0; }
437
+
438
+ .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
439
+ border-bottom: none;
440
+ border-bottom-left-radius: 0;
441
+ border-bottom-right-radius: 0; }
442
+
443
+ .select2-container--classic .select2-search--dropdown .select2-search__field {
444
+ border: 1px solid #aaa;
445
+ outline: 0; }
446
+
447
+ .select2-container--classic .select2-search--inline .select2-search__field {
448
+ outline: 0;
449
+ box-shadow: none; }
450
+
451
+ .select2-container--classic .select2-dropdown {
452
+ background-color: white;
453
+ border: 1px solid transparent; }
454
+
455
+ .select2-container--classic .select2-dropdown--above {
456
+ border-bottom: none; }
457
+
458
+ .select2-container--classic .select2-dropdown--below {
459
+ border-top: none; }
460
+
461
+ .select2-container--classic .select2-results > .select2-results__options {
462
+ max-height: 200px;
463
+ overflow-y: auto; }
464
+
465
+ .select2-container--classic .select2-results__option[role=group] {
466
+ padding: 0; }
467
+
468
+ .select2-container--classic .select2-results__option[aria-disabled=true] {
469
+ color: grey; }
470
+
471
+ .select2-container--classic .select2-results__option--highlighted[aria-selected] {
472
+ background-color: #3875d7;
473
+ color: white; }
474
+
475
+ .select2-container--classic .select2-results__group {
476
+ cursor: default;
477
+ display: block;
478
+ padding: 6px; }
479
+
480
+ .select2-container--classic.select2-container--open .select2-dropdown {
481
+ border-color: #5897fb; }
assets/deps/select2-4.0.13/select2.full.js ADDED
@@ -0,0 +1,6820 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Select2 4.0.13
3
+ * https://select2.github.io
4
+ *
5
+ * Released under the MIT license
6
+ * https://github.com/select2/select2/blob/master/LICENSE.md
7
+ */
8
+ ;(function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as an anonymous module.
11
+ define(['jquery'], factory);
12
+ } else if (typeof module === 'object' && module.exports) {
13
+ // Node/CommonJS
14
+ module.exports = function (root, jQuery) {
15
+ if (jQuery === undefined) {
16
+ // require('jQuery') returns a factory that requires window to
17
+ // build a jQuery instance, we normalize how we use modules
18
+ // that require this pattern but the window provided is a noop
19
+ // if it's defined (how jquery works)
20
+ if (typeof window !== 'undefined') {
21
+ jQuery = require('jquery');
22
+ }
23
+ else {
24
+ jQuery = require('jquery')(root);
25
+ }
26
+ }
27
+ factory(jQuery);
28
+ return jQuery;
29
+ };
30
+ } else {
31
+ // Browser globals
32
+ factory(jQuery);
33
+ }
34
+ } (function (jQuery) {
35
+ // This is needed so we can catch the AMD loader configuration and use it
36
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
37
+ // returns the AMD loader references.
38
+ var S2 =(function () {
39
+ // Restore the Select2 AMD loader so it can be used
40
+ // Needed mostly in the language files, where the loader is not inserted
41
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
42
+ var S2 = jQuery.fn.select2.amd;
43
+ }
44
+ var S2;(function () { if (!S2 || !S2.requirejs) {
45
+ if (!S2) { S2 = {}; } else { require = S2; }
46
+ /**
47
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
48
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
49
+ */
50
+ //Going sloppy to avoid 'use strict' string cost, but strict practices should
51
+ //be followed.
52
+ /*global setTimeout: false */
53
+
54
+ var requirejs, require, define;
55
+ (function (undef) {
56
+ var main, req, makeMap, handlers,
57
+ defined = {},
58
+ waiting = {},
59
+ config = {},
60
+ defining = {},
61
+ hasOwn = Object.prototype.hasOwnProperty,
62
+ aps = [].slice,
63
+ jsSuffixRegExp = /\.js$/;
64
+
65
+ function hasProp(obj, prop) {
66
+ return hasOwn.call(obj, prop);
67
+ }
68
+
69
+ /**
70
+ * Given a relative module name, like ./something, normalize it to
71
+ * a real name that can be mapped to a path.
72
+ * @param {String} name the relative name
73
+ * @param {String} baseName a real name that the name arg is relative
74
+ * to.
75
+ * @returns {String} normalized name
76
+ */
77
+ function normalize(name, baseName) {
78
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
79
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
80
+ baseParts = baseName && baseName.split("/"),
81
+ map = config.map,
82
+ starMap = (map && map['*']) || {};
83
+
84
+ //Adjust any relative paths.
85
+ if (name) {
86
+ name = name.split('/');
87
+ lastIndex = name.length - 1;
88
+
89
+ // If wanting node ID compatibility, strip .js from end
90
+ // of IDs. Have to do this here, and not in nameToUrl
91
+ // because node allows either .js or non .js to map
92
+ // to same file.
93
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
94
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
95
+ }
96
+
97
+ // Starts with a '.' so need the baseName
98
+ if (name[0].charAt(0) === '.' && baseParts) {
99
+ //Convert baseName to array, and lop off the last part,
100
+ //so that . matches that 'directory' and not name of the baseName's
101
+ //module. For instance, baseName of 'one/two/three', maps to
102
+ //'one/two/three.js', but we want the directory, 'one/two' for
103
+ //this normalization.
104
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
105
+ name = normalizedBaseParts.concat(name);
106
+ }
107
+
108
+ //start trimDots
109
+ for (i = 0; i < name.length; i++) {
110
+ part = name[i];
111
+ if (part === '.') {
112
+ name.splice(i, 1);
113
+ i -= 1;
114
+ } else if (part === '..') {
115
+ // If at the start, or previous value is still ..,
116
+ // keep them so that when converted to a path it may
117
+ // still work when converted to a path, even though
118
+ // as an ID it is less than ideal. In larger point
119
+ // releases, may be better to just kick out an error.
120
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
121
+ continue;
122
+ } else if (i > 0) {
123
+ name.splice(i - 1, 2);
124
+ i -= 2;
125
+ }
126
+ }
127
+ }
128
+ //end trimDots
129
+
130
+ name = name.join('/');
131
+ }
132
+
133
+ //Apply map config if available.
134
+ if ((baseParts || starMap) && map) {
135
+ nameParts = name.split('/');
136
+
137
+ for (i = nameParts.length; i > 0; i -= 1) {
138
+ nameSegment = nameParts.slice(0, i).join("/");
139
+
140
+ if (baseParts) {
141
+ //Find the longest baseName segment match in the config.
142
+ //So, do joins on the biggest to smallest lengths of baseParts.
143
+ for (j = baseParts.length; j > 0; j -= 1) {
144
+ mapValue = map[baseParts.slice(0, j).join('/')];
145
+
146
+ //baseName segment has config, find if it has one for
147
+ //this name.
148
+ if (mapValue) {
149
+ mapValue = mapValue[nameSegment];
150
+ if (mapValue) {
151
+ //Match, update name to the new value.
152
+ foundMap = mapValue;
153
+ foundI = i;
154
+ break;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ if (foundMap) {
161
+ break;
162
+ }
163
+
164
+ //Check for a star map match, but just hold on to it,
165
+ //if there is a shorter segment match later in a matching
166
+ //config, then favor over this star map.
167
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
168
+ foundStarMap = starMap[nameSegment];
169
+ starI = i;
170
+ }
171
+ }
172
+
173
+ if (!foundMap && foundStarMap) {
174
+ foundMap = foundStarMap;
175
+ foundI = starI;
176
+ }
177
+
178
+ if (foundMap) {
179
+ nameParts.splice(0, foundI, foundMap);
180
+ name = nameParts.join('/');
181
+ }
182
+ }
183
+
184
+ return name;
185
+ }
186
+
187
+ function makeRequire(relName, forceSync) {
188
+ return function () {
189
+ //A version of a require function that passes a moduleName
190
+ //value for items that may need to
191
+ //look up paths relative to the moduleName
192
+ var args = aps.call(arguments, 0);
193
+
194
+ //If first arg is not require('string'), and there is only
195
+ //one arg, it is the array form without a callback. Insert
196
+ //a null so that the following concat is correct.
197
+ if (typeof args[0] !== 'string' && args.length === 1) {
198
+ args.push(null);
199
+ }
200
+ return req.apply(undef, args.concat([relName, forceSync]));
201
+ };
202
+ }
203
+
204
+ function makeNormalize(relName) {
205
+ return function (name) {
206
+ return normalize(name, relName);
207
+ };
208
+ }
209
+
210
+ function makeLoad(depName) {
211
+ return function (value) {
212
+ defined[depName] = value;
213
+ };
214
+ }
215
+
216
+ function callDep(name) {
217
+ if (hasProp(waiting, name)) {
218
+ var args = waiting[name];
219
+ delete waiting[name];
220
+ defining[name] = true;
221
+ main.apply(undef, args);
222
+ }
223
+
224
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
225
+ throw new Error('No ' + name);
226
+ }
227
+ return defined[name];
228
+ }
229
+
230
+ //Turns a plugin!resource to [plugin, resource]
231
+ //with the plugin being undefined if the name
232
+ //did not have a plugin prefix.
233
+ function splitPrefix(name) {
234
+ var prefix,
235
+ index = name ? name.indexOf('!') : -1;
236
+ if (index > -1) {
237
+ prefix = name.substring(0, index);
238
+ name = name.substring(index + 1, name.length);
239
+ }
240
+ return [prefix, name];
241
+ }
242
+
243
+ //Creates a parts array for a relName where first part is plugin ID,
244
+ //second part is resource ID. Assumes relName has already been normalized.
245
+ function makeRelParts(relName) {
246
+ return relName ? splitPrefix(relName) : [];
247
+ }
248
+
249
+ /**
250
+ * Makes a name map, normalizing the name, and using a plugin
251
+ * for normalization if necessary. Grabs a ref to plugin
252
+ * too, as an optimization.
253
+ */
254
+ makeMap = function (name, relParts) {
255
+ var plugin,
256
+ parts = splitPrefix(name),
257
+ prefix = parts[0],
258
+ relResourceName = relParts[1];
259
+
260
+ name = parts[1];
261
+
262
+ if (prefix) {
263
+ prefix = normalize(prefix, relResourceName);
264
+ plugin = callDep(prefix);
265
+ }
266
+
267
+ //Normalize according
268
+ if (prefix) {
269
+ if (plugin && plugin.normalize) {
270
+ name = plugin.normalize(name, makeNormalize(relResourceName));
271
+ } else {
272
+ name = normalize(name, relResourceName);
273
+ }
274
+ } else {
275
+ name = normalize(name, relResourceName);
276
+ parts = splitPrefix(name);
277
+ prefix = parts[0];
278
+ name = parts[1];
279
+ if (prefix) {
280
+ plugin = callDep(prefix);
281
+ }
282
+ }
283
+
284
+ //Using ridiculous property names for space reasons
285
+ return {
286
+ f: prefix ? prefix + '!' + name : name, //fullName
287
+ n: name,
288
+ pr: prefix,
289
+ p: plugin
290
+ };
291
+ };
292
+
293
+ function makeConfig(name) {
294
+ return function () {
295
+ return (config && config.config && config.config[name]) || {};
296
+ };
297
+ }
298
+
299
+ handlers = {
300
+ require: function (name) {
301
+ return makeRequire(name);
302
+ },
303
+ exports: function (name) {
304
+ var e = defined[name];
305
+ if (typeof e !== 'undefined') {
306
+ return e;
307
+ } else {
308
+ return (defined[name] = {});
309
+ }
310
+ },
311
+ module: function (name) {
312
+ return {
313
+ id: name,
314
+ uri: '',
315
+ exports: defined[name],
316
+ config: makeConfig(name)
317
+ };
318
+ }
319
+ };
320
+
321
+ main = function (name, deps, callback, relName) {
322
+ var cjsModule, depName, ret, map, i, relParts,
323
+ args = [],
324
+ callbackType = typeof callback,
325
+ usingExports;
326
+
327
+ //Use name if no relName
328
+ relName = relName || name;
329
+ relParts = makeRelParts(relName);
330
+
331
+ //Call the callback to define the module, if necessary.
332
+ if (callbackType === 'undefined' || callbackType === 'function') {
333
+ //Pull out the defined dependencies and pass the ordered
334
+ //values to the callback.
335
+ //Default to [require, exports, module] if no deps
336
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
337
+ for (i = 0; i < deps.length; i += 1) {
338
+ map = makeMap(deps[i], relParts);
339
+ depName = map.f;
340
+
341
+ //Fast path CommonJS standard dependencies.
342
+ if (depName === "require") {
343
+ args[i] = handlers.require(name);
344
+ } else if (depName === "exports") {
345
+ //CommonJS module spec 1.1
346
+ args[i] = handlers.exports(name);
347
+ usingExports = true;
348
+ } else if (depName === "module") {
349
+ //CommonJS module spec 1.1
350
+ cjsModule = args[i] = handlers.module(name);
351
+ } else if (hasProp(defined, depName) ||
352
+ hasProp(waiting, depName) ||
353
+ hasProp(defining, depName)) {
354
+ args[i] = callDep(depName);
355
+ } else if (map.p) {
356
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
357
+ args[i] = defined[depName];
358
+ } else {
359
+ throw new Error(name + ' missing ' + depName);
360
+ }
361
+ }
362
+
363
+ ret = callback ? callback.apply(defined[name], args) : undefined;
364
+
365
+ if (name) {
366
+ //If setting exports via "module" is in play,
367
+ //favor that over return value and exports. After that,
368
+ //favor a non-undefined return value over exports use.
369
+ if (cjsModule && cjsModule.exports !== undef &&
370
+ cjsModule.exports !== defined[name]) {
371
+ defined[name] = cjsModule.exports;
372
+ } else if (ret !== undef || !usingExports) {
373
+ //Use the return value from the function.
374
+ defined[name] = ret;
375
+ }
376
+ }
377
+ } else if (name) {
378
+ //May just be an object definition for the module. Only
379
+ //worry about defining if have a module name.
380
+ defined[name] = callback;
381
+ }
382
+ };
383
+
384
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
385
+ if (typeof deps === "string") {
386
+ if (handlers[deps]) {
387
+ //callback in this case is really relName
388
+ return handlers[deps](callback);
389
+ }
390
+ //Just return the module wanted. In this scenario, the
391
+ //deps arg is the module name, and second arg (if passed)
392
+ //is just the relName.
393
+ //Normalize module name, if it contains . or ..
394
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
395
+ } else if (!deps.splice) {
396
+ //deps is a config object, not an array.
397
+ config = deps;
398
+ if (config.deps) {
399
+ req(config.deps, config.callback);
400
+ }
401
+ if (!callback) {
402
+ return;
403
+ }
404
+
405
+ if (callback.splice) {
406
+ //callback is an array, which means it is a dependency list.
407
+ //Adjust args if there are dependencies
408
+ deps = callback;
409
+ callback = relName;
410
+ relName = null;
411
+ } else {
412
+ deps = undef;
413
+ }
414
+ }
415
+
416
+ //Support require(['a'])
417
+ callback = callback || function () {};
418
+
419
+ //If relName is a function, it is an errback handler,
420
+ //so remove it.
421
+ if (typeof relName === 'function') {
422
+ relName = forceSync;
423
+ forceSync = alt;
424
+ }
425
+
426
+ //Simulate async callback;
427
+ if (forceSync) {
428
+ main(undef, deps, callback, relName);
429
+ } else {
430
+ //Using a non-zero value because of concern for what old browsers
431
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
432
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
433
+ //If want a value immediately, use require('id') instead -- something
434
+ //that works in almond on the global level, but not guaranteed and
435
+ //unlikely to work in other AMD implementations.
436
+ setTimeout(function () {
437
+ main(undef, deps, callback, relName);
438
+ }, 4);
439
+ }
440
+
441
+ return req;
442
+ };
443
+
444
+ /**
445
+ * Just drops the config on the floor, but returns req in case
446
+ * the config return value is used.
447
+ */
448
+ req.config = function (cfg) {
449
+ return req(cfg);
450
+ };
451
+
452
+ /**
453
+ * Expose module registry for debugging and tooling
454
+ */
455
+ requirejs._defined = defined;
456
+
457
+ define = function (name, deps, callback) {
458
+ if (typeof name !== 'string') {
459
+ throw new Error('See almond README: incorrect module build, no module name');
460
+ }
461
+
462
+ //This module may not have dependencies
463
+ if (!deps.splice) {
464
+ //deps is not an array, so probably means
465
+ //an object literal or factory function for
466
+ //the value. Adjust args.
467
+ callback = deps;
468
+ deps = [];
469
+ }
470
+
471
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
472
+ waiting[name] = [name, deps, callback];
473
+ }
474
+ };
475
+
476
+ define.amd = {
477
+ jQuery: true
478
+ };
479
+ }());
480
+
481
+ S2.requirejs = requirejs;S2.require = require;S2.define = define;
482
+ }
483
+ }());
484
+ S2.define("almond", function(){});
485
+
486
+ /* global jQuery:false, $:false */
487
+ S2.define('jquery',[],function () {
488
+ var _$ = jQuery || $;
489
+
490
+ if (_$ == null && console && console.error) {
491
+ console.error(
492
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
493
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
494
+ 'web page.'
495
+ );
496
+ }
497
+
498
+ return _$;
499
+ });
500
+
501
+ S2.define('select2/utils',[
502
+ 'jquery'
503
+ ], function ($) {
504
+ var Utils = {};
505
+
506
+ Utils.Extend = function (ChildClass, SuperClass) {
507
+ var __hasProp = {}.hasOwnProperty;
508
+
509
+ function BaseConstructor () {
510
+ this.constructor = ChildClass;
511
+ }
512
+
513
+ for (var key in SuperClass) {
514
+ if (__hasProp.call(SuperClass, key)) {
515
+ ChildClass[key] = SuperClass[key];
516
+ }
517
+ }
518
+
519
+ BaseConstructor.prototype = SuperClass.prototype;
520
+ ChildClass.prototype = new BaseConstructor();
521
+ ChildClass.__super__ = SuperClass.prototype;
522
+
523
+ return ChildClass;
524
+ };
525
+
526
+ function getMethods (theClass) {
527
+ var proto = theClass.prototype;
528
+
529
+ var methods = [];
530
+
531
+ for (var methodName in proto) {
532
+ var m = proto[methodName];
533
+
534
+ if (typeof m !== 'function') {
535
+ continue;
536
+ }
537
+
538
+ if (methodName === 'constructor') {
539
+ continue;
540
+ }
541
+
542
+ methods.push(methodName);
543
+ }
544
+
545
+ return methods;
546
+ }
547
+
548
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
549
+ var decoratedMethods = getMethods(DecoratorClass);
550
+ var superMethods = getMethods(SuperClass);
551
+
552
+ function DecoratedClass () {
553
+ var unshift = Array.prototype.unshift;
554
+
555
+ var argCount = DecoratorClass.prototype.constructor.length;
556
+
557
+ var calledConstructor = SuperClass.prototype.constructor;
558
+
559
+ if (argCount > 0) {
560
+ unshift.call(arguments, SuperClass.prototype.constructor);
561
+
562
+ calledConstructor = DecoratorClass.prototype.constructor;
563
+ }
564
+
565
+ calledConstructor.apply(this, arguments);
566
+ }
567
+
568
+ DecoratorClass.displayName = SuperClass.displayName;
569
+
570
+ function ctr () {
571
+ this.constructor = DecoratedClass;
572
+ }
573
+
574
+ DecoratedClass.prototype = new ctr();
575
+
576
+ for (var m = 0; m < superMethods.length; m++) {
577
+ var superMethod = superMethods[m];
578
+
579
+ DecoratedClass.prototype[superMethod] =
580
+ SuperClass.prototype[superMethod];
581
+ }
582
+
583
+ var calledMethod = function (methodName) {
584
+ // Stub out the original method if it's not decorating an actual method
585
+ var originalMethod = function () {};
586
+
587
+ if (methodName in DecoratedClass.prototype) {
588
+ originalMethod = DecoratedClass.prototype[methodName];
589
+ }
590
+
591
+ var decoratedMethod = DecoratorClass.prototype[methodName];
592
+
593
+ return function () {
594
+ var unshift = Array.prototype.unshift;
595
+
596
+ unshift.call(arguments, originalMethod);
597
+
598
+ return decoratedMethod.apply(this, arguments);
599
+ };
600
+ };
601
+
602
+ for (var d = 0; d < decoratedMethods.length; d++) {
603
+ var decoratedMethod = decoratedMethods[d];
604
+
605
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
606
+ }
607
+
608
+ return DecoratedClass;
609
+ };
610
+
611
+ var Observable = function () {
612
+ this.listeners = {};
613
+ };
614
+
615
+ Observable.prototype.on = function (event, callback) {
616
+ this.listeners = this.listeners || {};
617
+
618
+ if (event in this.listeners) {
619
+ this.listeners[event].push(callback);
620
+ } else {
621
+ this.listeners[event] = [callback];
622
+ }
623
+ };
624
+
625
+ Observable.prototype.trigger = function (event) {
626
+ var slice = Array.prototype.slice;
627
+ var params = slice.call(arguments, 1);
628
+
629
+ this.listeners = this.listeners || {};
630
+
631
+ // Params should always come in as an array
632
+ if (params == null) {
633
+ params = [];
634
+ }
635
+
636
+ // If there are no arguments to the event, use a temporary object
637
+ if (params.length === 0) {
638
+ params.push({});
639
+ }
640
+
641
+ // Set the `_type` of the first object to the event
642
+ params[0]._type = event;
643
+
644
+ if (event in this.listeners) {
645
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
646
+ }
647
+
648
+ if ('*' in this.listeners) {
649
+ this.invoke(this.listeners['*'], arguments);
650
+ }
651
+ };
652
+
653
+ Observable.prototype.invoke = function (listeners, params) {
654
+ for (var i = 0, len = listeners.length; i < len; i++) {
655
+ listeners[i].apply(this, params);
656
+ }
657
+ };
658
+
659
+ Utils.Observable = Observable;
660
+
661
+ Utils.generateChars = function (length) {
662
+ var chars = '';
663
+
664
+ for (var i = 0; i < length; i++) {
665
+ var randomChar = Math.floor(Math.random() * 36);
666
+ chars += randomChar.toString(36);
667
+ }
668
+
669
+ return chars;
670
+ };
671
+
672
+ Utils.bind = function (func, context) {
673
+ return function () {
674
+ func.apply(context, arguments);
675
+ };
676
+ };
677
+
678
+ Utils._convertData = function (data) {
679
+ for (var originalKey in data) {
680
+ var keys = originalKey.split('-');
681
+
682
+ var dataLevel = data;
683
+
684
+ if (keys.length === 1) {
685
+ continue;
686
+ }
687
+
688
+ for (var k = 0; k < keys.length; k++) {
689
+ var key = keys[k];
690
+
691
+ // Lowercase the first letter
692
+ // By default, dash-separated becomes camelCase
693
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
694
+
695
+ if (!(key in dataLevel)) {
696
+ dataLevel[key] = {};
697
+ }
698
+
699
+ if (k == keys.length - 1) {
700
+ dataLevel[key] = data[originalKey];
701
+ }
702
+
703
+ dataLevel = dataLevel[key];
704
+ }
705
+
706
+ delete data[originalKey];
707
+ }
708
+
709
+ return data;
710
+ };
711
+
712
+ Utils.hasScroll = function (index, el) {
713
+ // Adapted from the function created by @ShadowScripter
714
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
715
+ // The original code can be found at
716
+ // http://codereview.stackexchange.com/q/13338
717
+ // and was designed to be used with the Sizzle selector engine.
718
+
719
+ var $el = $(el);
720
+ var overflowX = el.style.overflowX;
721
+ var overflowY = el.style.overflowY;
722
+
723
+ //Check both x and y declarations
724
+ if (overflowX === overflowY &&
725
+ (overflowY === 'hidden' || overflowY === 'visible')) {
726
+ return false;
727
+ }
728
+
729
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
730
+ return true;
731
+ }
732
+
733
+ return ($el.innerHeight() < el.scrollHeight ||
734
+ $el.innerWidth() < el.scrollWidth);
735
+ };
736
+
737
+ Utils.escapeMarkup = function (markup) {
738
+ var replaceMap = {
739
+ '\\': '&#92;',
740
+ '&': '&amp;',
741
+ '<': '&lt;',
742
+ '>': '&gt;',
743
+ '"': '&quot;',
744
+ '\'': '&#39;',
745
+ '/': '&#47;'
746
+ };
747
+
748
+ // Do not try to escape the markup if it's not a string
749
+ if (typeof markup !== 'string') {
750
+ return markup;
751
+ }
752
+
753
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
754
+ return replaceMap[match];
755
+ });
756
+ };
757
+
758
+ // Append an array of jQuery nodes to a given element.
759
+ Utils.appendMany = function ($element, $nodes) {
760
+ // jQuery 1.7.x does not support $.fn.append() with an array
761
+ // Fall back to a jQuery object collection using $.fn.add()
762
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
763
+ var $jqNodes = $();
764
+
765
+ $.map($nodes, function (node) {
766
+ $jqNodes = $jqNodes.add(node);
767
+ });
768
+
769
+ $nodes = $jqNodes;
770
+ }
771
+
772
+ $element.append($nodes);
773
+ };
774
+
775
+ // Cache objects in Utils.__cache instead of $.data (see #4346)
776
+ Utils.__cache = {};
777
+
778
+ var id = 0;
779
+ Utils.GetUniqueElementId = function (element) {
780
+ // Get a unique element Id. If element has no id,
781
+ // creates a new unique number, stores it in the id
782
+ // attribute and returns the new id.
783
+ // If an id already exists, it simply returns it.
784
+
785
+ var select2Id = element.getAttribute('data-select2-id');
786
+ if (select2Id == null) {
787
+ // If element has id, use it.
788
+ if (element.id) {
789
+ select2Id = element.id;
790
+ element.setAttribute('data-select2-id', select2Id);
791
+ } else {
792
+ element.setAttribute('data-select2-id', ++id);
793
+ select2Id = id.toString();
794
+ }
795
+ }
796
+ return select2Id;
797
+ };
798
+
799
+ Utils.StoreData = function (element, name, value) {
800
+ // Stores an item in the cache for a specified element.
801
+ // name is the cache key.
802
+ var id = Utils.GetUniqueElementId(element);
803
+ if (!Utils.__cache[id]) {
804
+ Utils.__cache[id] = {};
805
+ }
806
+
807
+ Utils.__cache[id][name] = value;
808
+ };
809
+
810
+ Utils.GetData = function (element, name) {
811
+ // Retrieves a value from the cache by its key (name)
812
+ // name is optional. If no name specified, return
813
+ // all cache items for the specified element.
814
+ // and for a specified element.
815
+ var id = Utils.GetUniqueElementId(element);
816
+ if (name) {
817
+ if (Utils.__cache[id]) {
818
+ if (Utils.__cache[id][name] != null) {
819
+ return Utils.__cache[id][name];
820
+ }
821
+ return $(element).data(name); // Fallback to HTML5 data attribs.
822
+ }
823
+ return $(element).data(name); // Fallback to HTML5 data attribs.
824
+ } else {
825
+ return Utils.__cache[id];
826
+ }
827
+ };
828
+
829
+ Utils.RemoveData = function (element) {
830
+ // Removes all cached items for a specified element.
831
+ var id = Utils.GetUniqueElementId(element);
832
+ if (Utils.__cache[id] != null) {
833
+ delete Utils.__cache[id];
834
+ }
835
+
836
+ element.removeAttribute('data-select2-id');
837
+ };
838
+
839
+ return Utils;
840
+ });
841
+
842
+ S2.define('select2/results',[
843
+ 'jquery',
844
+ './utils'
845
+ ], function ($, Utils) {
846
+ function Results ($element, options, dataAdapter) {
847
+ this.$element = $element;
848
+ this.data = dataAdapter;
849
+ this.options = options;
850
+
851
+ Results.__super__.constructor.call(this);
852
+ }
853
+
854
+ Utils.Extend(Results, Utils.Observable);
855
+
856
+ Results.prototype.render = function () {
857
+ var $results = $(
858
+ '<ul class="select2-results__options" role="listbox"></ul>'
859
+ );
860
+
861
+ if (this.options.get('multiple')) {
862
+ $results.attr('aria-multiselectable', 'true');
863
+ }
864
+
865
+ this.$results = $results;
866
+
867
+ return $results;
868
+ };
869
+
870
+ Results.prototype.clear = function () {
871
+ this.$results.empty();
872
+ };
873
+
874
+ Results.prototype.displayMessage = function (params) {
875
+ var escapeMarkup = this.options.get('escapeMarkup');
876
+
877
+ this.clear();
878
+ this.hideLoading();
879
+
880
+ var $message = $(
881
+ '<li role="alert" aria-live="assertive"' +
882
+ ' class="select2-results__option"></li>'
883
+ );
884
+
885
+ var message = this.options.get('translations').get(params.message);
886
+
887
+ $message.append(
888
+ escapeMarkup(
889
+ message(params.args)
890
+ )
891
+ );
892
+
893
+ $message[0].className += ' select2-results__message';
894
+
895
+ this.$results.append($message);
896
+ };
897
+
898
+ Results.prototype.hideMessages = function () {
899
+ this.$results.find('.select2-results__message').remove();
900
+ };
901
+
902
+ Results.prototype.append = function (data) {
903
+ this.hideLoading();
904
+
905
+ var $options = [];
906
+
907
+ if (data.results == null || data.results.length === 0) {
908
+ if (this.$results.children().length === 0) {
909
+ this.trigger('results:message', {
910
+ message: 'noResults'
911
+ });
912
+ }
913
+
914
+ return;
915
+ }
916
+
917
+ data.results = this.sort(data.results);
918
+
919
+ for (var d = 0; d < data.results.length; d++) {
920
+ var item = data.results[d];
921
+
922
+ var $option = this.option(item);
923
+
924
+ $options.push($option);
925
+ }
926
+
927
+ this.$results.append($options);
928
+ };
929
+
930
+ Results.prototype.position = function ($results, $dropdown) {
931
+ var $resultsContainer = $dropdown.find('.select2-results');
932
+ $resultsContainer.append($results);
933
+ };
934
+
935
+ Results.prototype.sort = function (data) {
936
+ var sorter = this.options.get('sorter');
937
+
938
+ return sorter(data);
939
+ };
940
+
941
+ Results.prototype.highlightFirstItem = function () {
942
+ var $options = this.$results
943
+ .find('.select2-results__option[aria-selected]');
944
+
945
+ var $selected = $options.filter('[aria-selected=true]');
946
+
947
+ // Check if there are any selected options
948
+ if ($selected.length > 0) {
949
+ // If there are selected options, highlight the first
950
+ $selected.first().trigger('mouseenter');
951
+ } else {
952
+ // If there are no selected options, highlight the first option
953
+ // in the dropdown
954
+ $options.first().trigger('mouseenter');
955
+ }
956
+
957
+ this.ensureHighlightVisible();
958
+ };
959
+
960
+ Results.prototype.setClasses = function () {
961
+ var self = this;
962
+
963
+ this.data.current(function (selected) {
964
+ var selectedIds = $.map(selected, function (s) {
965
+ return s.id.toString();
966
+ });
967
+
968
+ var $options = self.$results
969
+ .find('.select2-results__option[aria-selected]');
970
+
971
+ $options.each(function () {
972
+ var $option = $(this);
973
+
974
+ var item = Utils.GetData(this, 'data');
975
+
976
+ // id needs to be converted to a string when comparing
977
+ var id = '' + item.id;
978
+
979
+ if ((item.element != null && item.element.selected) ||
980
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
981
+ $option.attr('aria-selected', 'true');
982
+ } else {
983
+ $option.attr('aria-selected', 'false');
984
+ }
985
+ });
986
+
987
+ });
988
+ };
989
+
990
+ Results.prototype.showLoading = function (params) {
991
+ this.hideLoading();
992
+
993
+ var loadingMore = this.options.get('translations').get('searching');
994
+
995
+ var loading = {
996
+ disabled: true,
997
+ loading: true,
998
+ text: loadingMore(params)
999
+ };
1000
+ var $loading = this.option(loading);
1001
+ $loading.className += ' loading-results';
1002
+
1003
+ this.$results.prepend($loading);
1004
+ };
1005
+
1006
+ Results.prototype.hideLoading = function () {
1007
+ this.$results.find('.loading-results').remove();
1008
+ };
1009
+
1010
+ Results.prototype.option = function (data) {
1011
+ var option = document.createElement('li');
1012
+ option.className = 'select2-results__option';
1013
+
1014
+ var attrs = {
1015
+ 'role': 'option',
1016
+ 'aria-selected': 'false'
1017
+ };
1018
+
1019
+ var matches = window.Element.prototype.matches ||
1020
+ window.Element.prototype.msMatchesSelector ||
1021
+ window.Element.prototype.webkitMatchesSelector;
1022
+
1023
+ if ((data.element != null && matches.call(data.element, ':disabled')) ||
1024
+ (data.element == null && data.disabled)) {
1025
+ delete attrs['aria-selected'];
1026
+ attrs['aria-disabled'] = 'true';
1027
+ }
1028
+
1029
+ if (data.id == null) {
1030
+ delete attrs['aria-selected'];
1031
+ }
1032
+
1033
+ if (data._resultId != null) {
1034
+ option.id = data._resultId;
1035
+ }
1036
+
1037
+ if (data.title) {
1038
+ option.title = data.title;
1039
+ }
1040
+
1041
+ if (data.children) {
1042
+ attrs.role = 'group';
1043
+ attrs['aria-label'] = data.text;
1044
+ delete attrs['aria-selected'];
1045
+ }
1046
+
1047
+ for (var attr in attrs) {
1048
+ var val = attrs[attr];
1049
+
1050
+ option.setAttribute(attr, val);
1051
+ }
1052
+
1053
+ if (data.children) {
1054
+ var $option = $(option);
1055
+
1056
+ var label = document.createElement('strong');
1057
+ label.className = 'select2-results__group';
1058
+
1059
+ var $label = $(label);
1060
+ this.template(data, label);
1061
+
1062
+ var $children = [];
1063
+
1064
+ for (var c = 0; c < data.children.length; c++) {
1065
+ var child = data.children[c];
1066
+
1067
+ var $child = this.option(child);
1068
+
1069
+ $children.push($child);
1070
+ }
1071
+
1072
+ var $childrenContainer = $('<ul></ul>', {
1073
+ 'class': 'select2-results__options select2-results__options--nested'
1074
+ });
1075
+
1076
+ $childrenContainer.append($children);
1077
+
1078
+ $option.append(label);
1079
+ $option.append($childrenContainer);
1080
+ } else {
1081
+ this.template(data, option);
1082
+ }
1083
+
1084
+ Utils.StoreData(option, 'data', data);
1085
+
1086
+ return option;
1087
+ };
1088
+
1089
+ Results.prototype.bind = function (container, $container) {
1090
+ var self = this;
1091
+
1092
+ var id = container.id + '-results';
1093
+
1094
+ this.$results.attr('id', id);
1095
+
1096
+ container.on('results:all', function (params) {
1097
+ self.clear();
1098
+ self.append(params.data);
1099
+
1100
+ if (container.isOpen()) {
1101
+ self.setClasses();
1102
+ self.highlightFirstItem();
1103
+ }
1104
+ });
1105
+
1106
+ container.on('results:append', function (params) {
1107
+ self.append(params.data);
1108
+
1109
+ if (container.isOpen()) {
1110
+ self.setClasses();
1111
+ }
1112
+ });
1113
+
1114
+ container.on('query', function (params) {
1115
+ self.hideMessages();
1116
+ self.showLoading(params);
1117
+ });
1118
+
1119
+ container.on('select', function () {
1120
+ if (!container.isOpen()) {
1121
+ return;
1122
+ }
1123
+
1124
+ self.setClasses();
1125
+
1126
+ if (self.options.get('scrollAfterSelect')) {
1127
+ self.highlightFirstItem();
1128
+ }
1129
+ });
1130
+
1131
+ container.on('unselect', function () {
1132
+ if (!container.isOpen()) {
1133
+ return;
1134
+ }
1135
+
1136
+ self.setClasses();
1137
+
1138
+ if (self.options.get('scrollAfterSelect')) {
1139
+ self.highlightFirstItem();
1140
+ }
1141
+ });
1142
+
1143
+ container.on('open', function () {
1144
+ // When the dropdown is open, aria-expended="true"
1145
+ self.$results.attr('aria-expanded', 'true');
1146
+ self.$results.attr('aria-hidden', 'false');
1147
+
1148
+ self.setClasses();
1149
+ self.ensureHighlightVisible();
1150
+ });
1151
+
1152
+ container.on('close', function () {
1153
+ // When the dropdown is closed, aria-expended="false"
1154
+ self.$results.attr('aria-expanded', 'false');
1155
+ self.$results.attr('aria-hidden', 'true');
1156
+ self.$results.removeAttr('aria-activedescendant');
1157
+ });
1158
+
1159
+ container.on('results:toggle', function () {
1160
+ var $highlighted = self.getHighlightedResults();
1161
+
1162
+ if ($highlighted.length === 0) {
1163
+ return;
1164
+ }
1165
+
1166
+ $highlighted.trigger('mouseup');
1167
+ });
1168
+
1169
+ container.on('results:select', function () {
1170
+ var $highlighted = self.getHighlightedResults();
1171
+
1172
+ if ($highlighted.length === 0) {
1173
+ return;
1174
+ }
1175
+
1176
+ var data = Utils.GetData($highlighted[0], 'data');
1177
+
1178
+ if ($highlighted.attr('aria-selected') == 'true') {
1179
+ self.trigger('close', {});
1180
+ } else {
1181
+ self.trigger('select', {
1182
+ data: data
1183
+ });
1184
+ }
1185
+ });
1186
+
1187
+ container.on('results:previous', function () {
1188
+ var $highlighted = self.getHighlightedResults();
1189
+
1190
+ var $options = self.$results.find('[aria-selected]');
1191
+
1192
+ var currentIndex = $options.index($highlighted);
1193
+
1194
+ // If we are already at the top, don't move further
1195
+ // If no options, currentIndex will be -1
1196
+ if (currentIndex <= 0) {
1197
+ return;
1198
+ }
1199
+
1200
+ var nextIndex = currentIndex - 1;
1201
+
1202
+ // If none are highlighted, highlight the first
1203
+ if ($highlighted.length === 0) {
1204
+ nextIndex = 0;
1205
+ }
1206
+
1207
+ var $next = $options.eq(nextIndex);
1208
+
1209
+ $next.trigger('mouseenter');
1210
+
1211
+ var currentOffset = self.$results.offset().top;
1212
+ var nextTop = $next.offset().top;
1213
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1214
+
1215
+ if (nextIndex === 0) {
1216
+ self.$results.scrollTop(0);
1217
+ } else if (nextTop - currentOffset < 0) {
1218
+ self.$results.scrollTop(nextOffset);
1219
+ }
1220
+ });
1221
+
1222
+ container.on('results:next', function () {
1223
+ var $highlighted = self.getHighlightedResults();
1224
+
1225
+ var $options = self.$results.find('[aria-selected]');
1226
+
1227
+ var currentIndex = $options.index($highlighted);
1228
+
1229
+ var nextIndex = currentIndex + 1;
1230
+
1231
+ // If we are at the last option, stay there
1232
+ if (nextIndex >= $options.length) {
1233
+ return;
1234
+ }
1235
+
1236
+ var $next = $options.eq(nextIndex);
1237
+
1238
+ $next.trigger('mouseenter');
1239
+
1240
+ var currentOffset = self.$results.offset().top +
1241
+ self.$results.outerHeight(false);
1242
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
1243
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1244
+
1245
+ if (nextIndex === 0) {
1246
+ self.$results.scrollTop(0);
1247
+ } else if (nextBottom > currentOffset) {
1248
+ self.$results.scrollTop(nextOffset);
1249
+ }
1250
+ });
1251
+
1252
+ container.on('results:focus', function (params) {
1253
+ params.element.addClass('select2-results__option--highlighted');
1254
+ });
1255
+
1256
+ container.on('results:message', function (params) {
1257
+ self.displayMessage(params);
1258
+ });
1259
+
1260
+ if ($.fn.mousewheel) {
1261
+ this.$results.on('mousewheel', function (e) {
1262
+ var top = self.$results.scrollTop();
1263
+
1264
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
1265
+
1266
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1267
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
1268
+
1269
+ if (isAtTop) {
1270
+ self.$results.scrollTop(0);
1271
+
1272
+ e.preventDefault();
1273
+ e.stopPropagation();
1274
+ } else if (isAtBottom) {
1275
+ self.$results.scrollTop(
1276
+ self.$results.get(0).scrollHeight - self.$results.height()
1277
+ );
1278
+
1279
+ e.preventDefault();
1280
+ e.stopPropagation();
1281
+ }
1282
+ });
1283
+ }
1284
+
1285
+ this.$results.on('mouseup', '.select2-results__option[aria-selected]',
1286
+ function (evt) {
1287
+ var $this = $(this);
1288
+
1289
+ var data = Utils.GetData(this, 'data');
1290
+
1291
+ if ($this.attr('aria-selected') === 'true') {
1292
+ if (self.options.get('multiple')) {
1293
+ self.trigger('unselect', {
1294
+ originalEvent: evt,
1295
+ data: data
1296
+ });
1297
+ } else {
1298
+ self.trigger('close', {});
1299
+ }
1300
+
1301
+ return;
1302
+ }
1303
+
1304
+ self.trigger('select', {
1305
+ originalEvent: evt,
1306
+ data: data
1307
+ });
1308
+ });
1309
+
1310
+ this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
1311
+ function (evt) {
1312
+ var data = Utils.GetData(this, 'data');
1313
+
1314
+ self.getHighlightedResults()
1315
+ .removeClass('select2-results__option--highlighted');
1316
+
1317
+ self.trigger('results:focus', {
1318
+ data: data,
1319
+ element: $(this)
1320
+ });
1321
+ });
1322
+ };
1323
+
1324
+ Results.prototype.getHighlightedResults = function () {
1325
+ var $highlighted = this.$results
1326
+ .find('.select2-results__option--highlighted');
1327
+
1328
+ return $highlighted;
1329
+ };
1330
+
1331
+ Results.prototype.destroy = function () {
1332
+ this.$results.remove();
1333
+ };
1334
+
1335
+ Results.prototype.ensureHighlightVisible = function () {
1336
+ var $highlighted = this.getHighlightedResults();
1337
+
1338
+ if ($highlighted.length === 0) {
1339
+ return;
1340
+ }
1341
+
1342
+ var $options = this.$results.find('[aria-selected]');
1343
+
1344
+ var currentIndex = $options.index($highlighted);
1345
+
1346
+ var currentOffset = this.$results.offset().top;
1347
+ var nextTop = $highlighted.offset().top;
1348
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1349
+
1350
+ var offsetDelta = nextTop - currentOffset;
1351
+ nextOffset -= $highlighted.outerHeight(false) * 2;
1352
+
1353
+ if (currentIndex <= 2) {
1354
+ this.$results.scrollTop(0);
1355
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1356
+ this.$results.scrollTop(nextOffset);
1357
+ }
1358
+ };
1359
+
1360
+ Results.prototype.template = function (result, container) {
1361
+ var template = this.options.get('templateResult');
1362
+ var escapeMarkup = this.options.get('escapeMarkup');
1363
+
1364
+ var content = template(result, container);
1365
+
1366
+ if (content == null) {
1367
+ container.style.display = 'none';
1368
+ } else if (typeof content === 'string') {
1369
+ container.innerHTML = escapeMarkup(content);
1370
+ } else {
1371
+ $(container).append(content);
1372
+ }
1373
+ };
1374
+
1375
+ return Results;
1376
+ });
1377
+
1378
+ S2.define('select2/keys',[
1379
+
1380
+ ], function () {
1381
+ var KEYS = {
1382
+ BACKSPACE: 8,
1383
+ TAB: 9,
1384
+ ENTER: 13,
1385
+ SHIFT: 16,
1386
+ CTRL: 17,
1387
+ ALT: 18,
1388
+ ESC: 27,
1389
+ SPACE: 32,
1390
+ PAGE_UP: 33,
1391
+ PAGE_DOWN: 34,
1392
+ END: 35,
1393
+ HOME: 36,
1394
+ LEFT: 37,
1395
+ UP: 38,
1396
+ RIGHT: 39,
1397
+ DOWN: 40,
1398
+ DELETE: 46
1399
+ };
1400
+
1401
+ return KEYS;
1402
+ });
1403
+
1404
+ S2.define('select2/selection/base',[
1405
+ 'jquery',
1406
+ '../utils',
1407
+ '../keys'
1408
+ ], function ($, Utils, KEYS) {
1409
+ function BaseSelection ($element, options) {
1410
+ this.$element = $element;
1411
+ this.options = options;
1412
+
1413
+ BaseSelection.__super__.constructor.call(this);
1414
+ }
1415
+
1416
+ Utils.Extend(BaseSelection, Utils.Observable);
1417
+
1418
+ BaseSelection.prototype.render = function () {
1419
+ var $selection = $(
1420
+ '<span class="select2-selection" role="combobox" ' +
1421
+ ' aria-haspopup="true" aria-expanded="false">' +
1422
+ '</span>'
1423
+ );
1424
+
1425
+ this._tabindex = 0;
1426
+
1427
+ if (Utils.GetData(this.$element[0], 'old-tabindex') != null) {
1428
+ this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex');
1429
+ } else if (this.$element.attr('tabindex') != null) {
1430
+ this._tabindex = this.$element.attr('tabindex');
1431
+ }
1432
+
1433
+ $selection.attr('title', this.$element.attr('title'));
1434
+ $selection.attr('tabindex', this._tabindex);
1435
+ $selection.attr('aria-disabled', 'false');
1436
+
1437
+ this.$selection = $selection;
1438
+
1439
+ return $selection;
1440
+ };
1441
+
1442
+ BaseSelection.prototype.bind = function (container, $container) {
1443
+ var self = this;
1444
+
1445
+ var resultsId = container.id + '-results';
1446
+
1447
+ this.container = container;
1448
+
1449
+ this.$selection.on('focus', function (evt) {
1450
+ self.trigger('focus', evt);
1451
+ });
1452
+
1453
+ this.$selection.on('blur', function (evt) {
1454
+ self._handleBlur(evt);
1455
+ });
1456
+
1457
+ this.$selection.on('keydown', function (evt) {
1458
+ self.trigger('keypress', evt);
1459
+
1460
+ if (evt.which === KEYS.SPACE) {
1461
+ evt.preventDefault();
1462
+ }
1463
+ });
1464
+
1465
+ container.on('results:focus', function (params) {
1466
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
1467
+ });
1468
+
1469
+ container.on('selection:update', function (params) {
1470
+ self.update(params.data);
1471
+ });
1472
+
1473
+ container.on('open', function () {
1474
+ // When the dropdown is open, aria-expanded="true"
1475
+ self.$selection.attr('aria-expanded', 'true');
1476
+ self.$selection.attr('aria-owns', resultsId);
1477
+
1478
+ self._attachCloseHandler(container);
1479
+ });
1480
+
1481
+ container.on('close', function () {
1482
+ // When the dropdown is closed, aria-expanded="false"
1483
+ self.$selection.attr('aria-expanded', 'false');
1484
+ self.$selection.removeAttr('aria-activedescendant');
1485
+ self.$selection.removeAttr('aria-owns');
1486
+
1487
+ self.$selection.trigger('focus');
1488
+
1489
+ self._detachCloseHandler(container);
1490
+ });
1491
+
1492
+ container.on('enable', function () {
1493
+ self.$selection.attr('tabindex', self._tabindex);
1494
+ self.$selection.attr('aria-disabled', 'false');
1495
+ });
1496
+
1497
+ container.on('disable', function () {
1498
+ self.$selection.attr('tabindex', '-1');
1499
+ self.$selection.attr('aria-disabled', 'true');
1500
+ });
1501
+ };
1502
+
1503
+ BaseSelection.prototype._handleBlur = function (evt) {
1504
+ var self = this;
1505
+
1506
+ // This needs to be delayed as the active element is the body when the tab
1507
+ // key is pressed, possibly along with others.
1508
+ window.setTimeout(function () {
1509
+ // Don't trigger `blur` if the focus is still in the selection
1510
+ if (
1511
+ (document.activeElement == self.$selection[0]) ||
1512
+ ($.contains(self.$selection[0], document.activeElement))
1513
+ ) {
1514
+ return;
1515
+ }
1516
+
1517
+ self.trigger('blur', evt);
1518
+ }, 1);
1519
+ };
1520
+
1521
+ BaseSelection.prototype._attachCloseHandler = function (container) {
1522
+
1523
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
1524
+ var $target = $(e.target);
1525
+
1526
+ var $select = $target.closest('.select2');
1527
+
1528
+ var $all = $('.select2.select2-container--open');
1529
+
1530
+ $all.each(function () {
1531
+ if (this == $select[0]) {
1532
+ return;
1533
+ }
1534
+
1535
+ var $element = Utils.GetData(this, 'element');
1536
+
1537
+ $element.select2('close');
1538
+ });
1539
+ });
1540
+ };
1541
+
1542
+ BaseSelection.prototype._detachCloseHandler = function (container) {
1543
+ $(document.body).off('mousedown.select2.' + container.id);
1544
+ };
1545
+
1546
+ BaseSelection.prototype.position = function ($selection, $container) {
1547
+ var $selectionContainer = $container.find('.selection');
1548
+ $selectionContainer.append($selection);
1549
+ };
1550
+
1551
+ BaseSelection.prototype.destroy = function () {
1552
+ this._detachCloseHandler(this.container);
1553
+ };
1554
+
1555
+ BaseSelection.prototype.update = function (data) {
1556
+ throw new Error('The `update` method must be defined in child classes.');
1557
+ };
1558
+
1559
+ /**
1560
+ * Helper method to abstract the "enabled" (not "disabled") state of this
1561
+ * object.
1562
+ *
1563
+ * @return {true} if the instance is not disabled.
1564
+ * @return {false} if the instance is disabled.
1565
+ */
1566
+ BaseSelection.prototype.isEnabled = function () {
1567
+ return !this.isDisabled();
1568
+ };
1569
+
1570
+ /**
1571
+ * Helper method to abstract the "disabled" state of this object.
1572
+ *
1573
+ * @return {true} if the disabled option is true.
1574
+ * @return {false} if the disabled option is false.
1575
+ */
1576
+ BaseSelection.prototype.isDisabled = function () {
1577
+ return this.options.get('disabled');
1578
+ };
1579
+
1580
+ return BaseSelection;
1581
+ });
1582
+
1583
+ S2.define('select2/selection/single',[
1584
+ 'jquery',
1585
+ './base',
1586
+ '../utils',
1587
+ '../keys'
1588
+ ], function ($, BaseSelection, Utils, KEYS) {
1589
+ function SingleSelection () {
1590
+ SingleSelection.__super__.constructor.apply(this, arguments);
1591
+ }
1592
+
1593
+ Utils.Extend(SingleSelection, BaseSelection);
1594
+
1595
+ SingleSelection.prototype.render = function () {
1596
+ var $selection = SingleSelection.__super__.render.call(this);
1597
+
1598
+ $selection.addClass('select2-selection--single');
1599
+
1600
+ $selection.html(
1601
+ '<span class="select2-selection__rendered"></span>' +
1602
+ '<span class="select2-selection__arrow" role="presentation">' +
1603
+ '<b role="presentation"></b>' +
1604
+ '</span>'
1605
+ );
1606
+
1607
+ return $selection;
1608
+ };
1609
+
1610
+ SingleSelection.prototype.bind = function (container, $container) {
1611
+ var self = this;
1612
+
1613
+ SingleSelection.__super__.bind.apply(this, arguments);
1614
+
1615
+ var id = container.id + '-container';
1616
+
1617
+ this.$selection.find('.select2-selection__rendered')
1618
+ .attr('id', id)
1619
+ .attr('role', 'textbox')
1620
+ .attr('aria-readonly', 'true');
1621
+ this.$selection.attr('aria-labelledby', id);
1622
+
1623
+ this.$selection.on('mousedown', function (evt) {
1624
+ // Only respond to left clicks
1625
+ if (evt.which !== 1) {
1626
+ return;
1627
+ }
1628
+
1629
+ self.trigger('toggle', {
1630
+ originalEvent: evt
1631
+ });
1632
+ });
1633
+
1634
+ this.$selection.on('focus', function (evt) {
1635
+ // User focuses on the container
1636
+ });
1637
+
1638
+ this.$selection.on('blur', function (evt) {
1639
+ // User exits the container
1640
+ });
1641
+
1642
+ container.on('focus', function (evt) {
1643
+ if (!container.isOpen()) {
1644
+ self.$selection.trigger('focus');
1645
+ }
1646
+ });
1647
+ };
1648
+
1649
+ SingleSelection.prototype.clear = function () {
1650
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1651
+ $rendered.empty();
1652
+ $rendered.removeAttr('title'); // clear tooltip on empty
1653
+ };
1654
+
1655
+ SingleSelection.prototype.display = function (data, container) {
1656
+ var template = this.options.get('templateSelection');
1657
+ var escapeMarkup = this.options.get('escapeMarkup');
1658
+
1659
+ return escapeMarkup(template(data, container));
1660
+ };
1661
+
1662
+ SingleSelection.prototype.selectionContainer = function () {
1663
+ return $('<span></span>');
1664
+ };
1665
+
1666
+ SingleSelection.prototype.update = function (data) {
1667
+ if (data.length === 0) {
1668
+ this.clear();
1669
+ return;
1670
+ }
1671
+
1672
+ var selection = data[0];
1673
+
1674
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1675
+ var formatted = this.display(selection, $rendered);
1676
+
1677
+ $rendered.empty().append(formatted);
1678
+
1679
+ var title = selection.title || selection.text;
1680
+
1681
+ if (title) {
1682
+ $rendered.attr('title', title);
1683
+ } else {
1684
+ $rendered.removeAttr('title');
1685
+ }
1686
+ };
1687
+
1688
+ return SingleSelection;
1689
+ });
1690
+
1691
+ S2.define('select2/selection/multiple',[
1692
+ 'jquery',
1693
+ './base',
1694
+ '../utils'
1695
+ ], function ($, BaseSelection, Utils) {
1696
+ function MultipleSelection ($element, options) {
1697
+ MultipleSelection.__super__.constructor.apply(this, arguments);
1698
+ }
1699
+
1700
+ Utils.Extend(MultipleSelection, BaseSelection);
1701
+
1702
+ MultipleSelection.prototype.render = function () {
1703
+ var $selection = MultipleSelection.__super__.render.call(this);
1704
+
1705
+ $selection.addClass('select2-selection--multiple');
1706
+
1707
+ $selection.html(
1708
+ '<ul class="select2-selection__rendered"></ul>'
1709
+ );
1710
+
1711
+ return $selection;
1712
+ };
1713
+
1714
+ MultipleSelection.prototype.bind = function (container, $container) {
1715
+ var self = this;
1716
+
1717
+ MultipleSelection.__super__.bind.apply(this, arguments);
1718
+
1719
+ this.$selection.on('click', function (evt) {
1720
+ self.trigger('toggle', {
1721
+ originalEvent: evt
1722
+ });
1723
+ });
1724
+
1725
+ this.$selection.on(
1726
+ 'click',
1727
+ '.select2-selection__choice__remove',
1728
+ function (evt) {
1729
+ // Ignore the event if it is disabled
1730
+ if (self.isDisabled()) {
1731
+ return;
1732
+ }
1733
+
1734
+ var $remove = $(this);
1735
+ var $selection = $remove.parent();
1736
+
1737
+ var data = Utils.GetData($selection[0], 'data');
1738
+
1739
+ self.trigger('unselect', {
1740
+ originalEvent: evt,
1741
+ data: data
1742
+ });
1743
+ }
1744
+ );
1745
+ };
1746
+
1747
+ MultipleSelection.prototype.clear = function () {
1748
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1749
+ $rendered.empty();
1750
+ $rendered.removeAttr('title');
1751
+ };
1752
+
1753
+ MultipleSelection.prototype.display = function (data, container) {
1754
+ var template = this.options.get('templateSelection');
1755
+ var escapeMarkup = this.options.get('escapeMarkup');
1756
+
1757
+ return escapeMarkup(template(data, container));
1758
+ };
1759
+
1760
+ MultipleSelection.prototype.selectionContainer = function () {
1761
+ var $container = $(
1762
+ '<li class="select2-selection__choice">' +
1763
+ '<span class="select2-selection__choice__remove" role="presentation">' +
1764
+ '&times;' +
1765
+ '</span>' +
1766
+ '</li>'
1767
+ );
1768
+
1769
+ return $container;
1770
+ };
1771
+
1772
+ MultipleSelection.prototype.update = function (data) {
1773
+ this.clear();
1774
+
1775
+ if (data.length === 0) {
1776
+ return;
1777
+ }
1778
+
1779
+ var $selections = [];
1780
+
1781
+ for (var d = 0; d < data.length; d++) {
1782
+ var selection = data[d];
1783
+
1784
+ var $selection = this.selectionContainer();
1785
+ var formatted = this.display(selection, $selection);
1786
+
1787
+ $selection.append(formatted);
1788
+
1789
+ var title = selection.title || selection.text;
1790
+
1791
+ if (title) {
1792
+ $selection.attr('title', title);
1793
+ }
1794
+
1795
+ Utils.StoreData($selection[0], 'data', selection);
1796
+
1797
+ $selections.push($selection);
1798
+ }
1799
+
1800
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1801
+
1802
+ Utils.appendMany($rendered, $selections);
1803
+ };
1804
+
1805
+ return MultipleSelection;
1806
+ });
1807
+
1808
+ S2.define('select2/selection/placeholder',[
1809
+ '../utils'
1810
+ ], function (Utils) {
1811
+ function Placeholder (decorated, $element, options) {
1812
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1813
+
1814
+ decorated.call(this, $element, options);
1815
+ }
1816
+
1817
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1818
+ if (typeof placeholder === 'string') {
1819
+ placeholder = {
1820
+ id: '',
1821
+ text: placeholder
1822
+ };
1823
+ }
1824
+
1825
+ return placeholder;
1826
+ };
1827
+
1828
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1829
+ var $placeholder = this.selectionContainer();
1830
+
1831
+ $placeholder.html(this.display(placeholder));
1832
+ $placeholder.addClass('select2-selection__placeholder')
1833
+ .removeClass('select2-selection__choice');
1834
+
1835
+ return $placeholder;
1836
+ };
1837
+
1838
+ Placeholder.prototype.update = function (decorated, data) {
1839
+ var singlePlaceholder = (
1840
+ data.length == 1 && data[0].id != this.placeholder.id
1841
+ );
1842
+ var multipleSelections = data.length > 1;
1843
+
1844
+ if (multipleSelections || singlePlaceholder) {
1845
+ return decorated.call(this, data);
1846
+ }
1847
+
1848
+ this.clear();
1849
+
1850
+ var $placeholder = this.createPlaceholder(this.placeholder);
1851
+
1852
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
1853
+ };
1854
+
1855
+ return Placeholder;
1856
+ });
1857
+
1858
+ S2.define('select2/selection/allowClear',[
1859
+ 'jquery',
1860
+ '../keys',
1861
+ '../utils'
1862
+ ], function ($, KEYS, Utils) {
1863
+ function AllowClear () { }
1864
+
1865
+ AllowClear.prototype.bind = function (decorated, container, $container) {
1866
+ var self = this;
1867
+
1868
+ decorated.call(this, container, $container);
1869
+
1870
+ if (this.placeholder == null) {
1871
+ if (this.options.get('debug') && window.console && console.error) {
1872
+ console.error(
1873
+ 'Select2: The `allowClear` option should be used in combination ' +
1874
+ 'with the `placeholder` option.'
1875
+ );
1876
+ }
1877
+ }
1878
+
1879
+ this.$selection.on('mousedown', '.select2-selection__clear',
1880
+ function (evt) {
1881
+ self._handleClear(evt);
1882
+ });
1883
+
1884
+ container.on('keypress', function (evt) {
1885
+ self._handleKeyboardClear(evt, container);
1886
+ });
1887
+ };
1888
+
1889
+ AllowClear.prototype._handleClear = function (_, evt) {
1890
+ // Ignore the event if it is disabled
1891
+ if (this.isDisabled()) {
1892
+ return;
1893
+ }
1894
+
1895
+ var $clear = this.$selection.find('.select2-selection__clear');
1896
+
1897
+ // Ignore the event if nothing has been selected
1898
+ if ($clear.length === 0) {
1899
+ return;
1900
+ }
1901
+
1902
+ evt.stopPropagation();
1903
+
1904
+ var data = Utils.GetData($clear[0], 'data');
1905
+
1906
+ var previousVal = this.$element.val();
1907
+ this.$element.val(this.placeholder.id);
1908
+
1909
+ var unselectData = {
1910
+ data: data
1911
+ };
1912
+ this.trigger('clear', unselectData);
1913
+ if (unselectData.prevented) {
1914
+ this.$element.val(previousVal);
1915
+ return;
1916
+ }
1917
+
1918
+ for (var d = 0; d < data.length; d++) {
1919
+ unselectData = {
1920
+ data: data[d]
1921
+ };
1922
+
1923
+ // Trigger the `unselect` event, so people can prevent it from being
1924
+ // cleared.
1925
+ this.trigger('unselect', unselectData);
1926
+
1927
+ // If the event was prevented, don't clear it out.
1928
+ if (unselectData.prevented) {
1929
+ this.$element.val(previousVal);
1930
+ return;
1931
+ }
1932
+ }
1933
+
1934
+ this.$element.trigger('input').trigger('change');
1935
+
1936
+ this.trigger('toggle', {});
1937
+ };
1938
+
1939
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1940
+ if (container.isOpen()) {
1941
+ return;
1942
+ }
1943
+
1944
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1945
+ this._handleClear(evt);
1946
+ }
1947
+ };
1948
+
1949
+ AllowClear.prototype.update = function (decorated, data) {
1950
+ decorated.call(this, data);
1951
+
1952
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1953
+ data.length === 0) {
1954
+ return;
1955
+ }
1956
+
1957
+ var removeAll = this.options.get('translations').get('removeAllItems');
1958
+
1959
+ var $remove = $(
1960
+ '<span class="select2-selection__clear" title="' + removeAll() +'">' +
1961
+ '&times;' +
1962
+ '</span>'
1963
+ );
1964
+ Utils.StoreData($remove[0], 'data', data);
1965
+
1966
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
1967
+ };
1968
+
1969
+ return AllowClear;
1970
+ });
1971
+
1972
+ S2.define('select2/selection/search',[
1973
+ 'jquery',
1974
+ '../utils',
1975
+ '../keys'
1976
+ ], function ($, Utils, KEYS) {
1977
+ function Search (decorated, $element, options) {
1978
+ decorated.call(this, $element, options);
1979
+ }
1980
+
1981
+ Search.prototype.render = function (decorated) {
1982
+ var $search = $(
1983
+ '<li class="select2-search select2-search--inline">' +
1984
+ '<input class="select2-search__field" type="search" tabindex="-1"' +
1985
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
1986
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
1987
+ '</li>'
1988
+ );
1989
+
1990
+ this.$searchContainer = $search;
1991
+ this.$search = $search.find('input');
1992
+
1993
+ var $rendered = decorated.call(this);
1994
+
1995
+ this._transferTabIndex();
1996
+
1997
+ return $rendered;
1998
+ };
1999
+
2000
+ Search.prototype.bind = function (decorated, container, $container) {
2001
+ var self = this;
2002
+
2003
+ var resultsId = container.id + '-results';
2004
+
2005
+ decorated.call(this, container, $container);
2006
+
2007
+ container.on('open', function () {
2008
+ self.$search.attr('aria-controls', resultsId);
2009
+ self.$search.trigger('focus');
2010
+ });
2011
+
2012
+ container.on('close', function () {
2013
+ self.$search.val('');
2014
+ self.$search.removeAttr('aria-controls');
2015
+ self.$search.removeAttr('aria-activedescendant');
2016
+ self.$search.trigger('focus');
2017
+ });
2018
+
2019
+ container.on('enable', function () {
2020
+ self.$search.prop('disabled', false);
2021
+
2022
+ self._transferTabIndex();
2023
+ });
2024
+
2025
+ container.on('disable', function () {
2026
+ self.$search.prop('disabled', true);
2027
+ });
2028
+
2029
+ container.on('focus', function (evt) {
2030
+ self.$search.trigger('focus');
2031
+ });
2032
+
2033
+ container.on('results:focus', function (params) {
2034
+ if (params.data._resultId) {
2035
+ self.$search.attr('aria-activedescendant', params.data._resultId);
2036
+ } else {
2037
+ self.$search.removeAttr('aria-activedescendant');
2038
+ }
2039
+ });
2040
+
2041
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
2042
+ self.trigger('focus', evt);
2043
+ });
2044
+
2045
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
2046
+ self._handleBlur(evt);
2047
+ });
2048
+
2049
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
2050
+ evt.stopPropagation();
2051
+
2052
+ self.trigger('keypress', evt);
2053
+
2054
+ self._keyUpPrevented = evt.isDefaultPrevented();
2055
+
2056
+ var key = evt.which;
2057
+
2058
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
2059
+ var $previousChoice = self.$searchContainer
2060
+ .prev('.select2-selection__choice');
2061
+
2062
+ if ($previousChoice.length > 0) {
2063
+ var item = Utils.GetData($previousChoice[0], 'data');
2064
+
2065
+ self.searchRemoveChoice(item);
2066
+
2067
+ evt.preventDefault();
2068
+ }
2069
+ }
2070
+ });
2071
+
2072
+ this.$selection.on('click', '.select2-search--inline', function (evt) {
2073
+ if (self.$search.val()) {
2074
+ evt.stopPropagation();
2075
+ }
2076
+ });
2077
+
2078
+ // Try to detect the IE version should the `documentMode` property that
2079
+ // is stored on the document. This is only implemented in IE and is
2080
+ // slightly cleaner than doing a user agent check.
2081
+ // This property is not available in Edge, but Edge also doesn't have
2082
+ // this bug.
2083
+ var msie = document.documentMode;
2084
+ var disableInputEvents = msie && msie <= 11;
2085
+
2086
+ // Workaround for browsers which do not support the `input` event
2087
+ // This will prevent double-triggering of events for browsers which support
2088
+ // both the `keyup` and `input` events.
2089
+ this.$selection.on(
2090
+ 'input.searchcheck',
2091
+ '.select2-search--inline',
2092
+ function (evt) {
2093
+ // IE will trigger the `input` event when a placeholder is used on a
2094
+ // search box. To get around this issue, we are forced to ignore all
2095
+ // `input` events in IE and keep using `keyup`.
2096
+ if (disableInputEvents) {
2097
+ self.$selection.off('input.search input.searchcheck');
2098
+ return;
2099
+ }
2100
+
2101
+ // Unbind the duplicated `keyup` event
2102
+ self.$selection.off('keyup.search');
2103
+ }
2104
+ );
2105
+
2106
+ this.$selection.on(
2107
+ 'keyup.search input.search',
2108
+ '.select2-search--inline',
2109
+ function (evt) {
2110
+ // IE will trigger the `input` event when a placeholder is used on a
2111
+ // search box. To get around this issue, we are forced to ignore all
2112
+ // `input` events in IE and keep using `keyup`.
2113
+ if (disableInputEvents && evt.type === 'input') {
2114
+ self.$selection.off('input.search input.searchcheck');
2115
+ return;
2116
+ }
2117
+
2118
+ var key = evt.which;
2119
+
2120
+ // We can freely ignore events from modifier keys
2121
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
2122
+ return;
2123
+ }
2124
+
2125
+ // Tabbing will be handled during the `keydown` phase
2126
+ if (key == KEYS.TAB) {
2127
+ return;
2128
+ }
2129
+
2130
+ self.handleSearch(evt);
2131
+ }
2132
+ );
2133
+ };
2134
+
2135
+ /**
2136
+ * This method will transfer the tabindex attribute from the rendered
2137
+ * selection to the search box. This allows for the search box to be used as
2138
+ * the primary focus instead of the selection container.
2139
+ *
2140
+ * @private
2141
+ */
2142
+ Search.prototype._transferTabIndex = function (decorated) {
2143
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
2144
+ this.$selection.attr('tabindex', '-1');
2145
+ };
2146
+
2147
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
2148
+ this.$search.attr('placeholder', placeholder.text);
2149
+ };
2150
+
2151
+ Search.prototype.update = function (decorated, data) {
2152
+ var searchHadFocus = this.$search[0] == document.activeElement;
2153
+
2154
+ this.$search.attr('placeholder', '');
2155
+
2156
+ decorated.call(this, data);
2157
+
2158
+ this.$selection.find('.select2-selection__rendered')
2159
+ .append(this.$searchContainer);
2160
+
2161
+ this.resizeSearch();
2162
+ if (searchHadFocus) {
2163
+ this.$search.trigger('focus');
2164
+ }
2165
+ };
2166
+
2167
+ Search.prototype.handleSearch = function () {
2168
+ this.resizeSearch();
2169
+
2170
+ if (!this._keyUpPrevented) {
2171
+ var input = this.$search.val();
2172
+
2173
+ this.trigger('query', {
2174
+ term: input
2175
+ });
2176
+ }
2177
+
2178
+ this._keyUpPrevented = false;
2179
+ };
2180
+
2181
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
2182
+ this.trigger('unselect', {
2183
+ data: item
2184
+ });
2185
+
2186
+ this.$search.val(item.text);
2187
+ this.handleSearch();
2188
+ };
2189
+
2190
+ Search.prototype.resizeSearch = function () {
2191
+ this.$search.css('width', '25px');
2192
+
2193
+ var width = '';
2194
+
2195
+ if (this.$search.attr('placeholder') !== '') {
2196
+ width = this.$selection.find('.select2-selection__rendered').width();
2197
+ } else {
2198
+ var minimumWidth = this.$search.val().length + 1;
2199
+
2200
+ width = (minimumWidth * 0.75) + 'em';
2201
+ }
2202
+
2203
+ this.$search.css('width', width);
2204
+ };
2205
+
2206
+ return Search;
2207
+ });
2208
+
2209
+ S2.define('select2/selection/eventRelay',[
2210
+ 'jquery'
2211
+ ], function ($) {
2212
+ function EventRelay () { }
2213
+
2214
+ EventRelay.prototype.bind = function (decorated, container, $container) {
2215
+ var self = this;
2216
+ var relayEvents = [
2217
+ 'open', 'opening',
2218
+ 'close', 'closing',
2219
+ 'select', 'selecting',
2220
+ 'unselect', 'unselecting',
2221
+ 'clear', 'clearing'
2222
+ ];
2223
+
2224
+ var preventableEvents = [
2225
+ 'opening', 'closing', 'selecting', 'unselecting', 'clearing'
2226
+ ];
2227
+
2228
+ decorated.call(this, container, $container);
2229
+
2230
+ container.on('*', function (name, params) {
2231
+ // Ignore events that should not be relayed
2232
+ if ($.inArray(name, relayEvents) === -1) {
2233
+ return;
2234
+ }
2235
+
2236
+ // The parameters should always be an object
2237
+ params = params || {};
2238
+
2239
+ // Generate the jQuery event for the Select2 event
2240
+ var evt = $.Event('select2:' + name, {
2241
+ params: params
2242
+ });
2243
+
2244
+ self.$element.trigger(evt);
2245
+
2246
+ // Only handle preventable events if it was one
2247
+ if ($.inArray(name, preventableEvents) === -1) {
2248
+ return;
2249
+ }
2250
+
2251
+ params.prevented = evt.isDefaultPrevented();
2252
+ });
2253
+ };
2254
+
2255
+ return EventRelay;
2256
+ });
2257
+
2258
+ S2.define('select2/translation',[
2259
+ 'jquery',
2260
+ 'require'
2261
+ ], function ($, require) {
2262
+ function Translation (dict) {
2263
+ this.dict = dict || {};
2264
+ }
2265
+
2266
+ Translation.prototype.all = function () {
2267
+ return this.dict;
2268
+ };
2269
+
2270
+ Translation.prototype.get = function (key) {
2271
+ return this.dict[key];
2272
+ };
2273
+
2274
+ Translation.prototype.extend = function (translation) {
2275
+ this.dict = $.extend({}, translation.all(), this.dict);
2276
+ };
2277
+
2278
+ // Static functions
2279
+
2280
+ Translation._cache = {};
2281
+
2282
+ Translation.loadPath = function (path) {
2283
+ if (!(path in Translation._cache)) {
2284
+ var translations = require(path);
2285
+
2286
+ Translation._cache[path] = translations;
2287
+ }
2288
+
2289
+ return new Translation(Translation._cache[path]);
2290
+ };
2291
+
2292
+ return Translation;
2293
+ });
2294
+
2295
+ S2.define('select2/diacritics',[
2296
+
2297
+ ], function () {
2298
+ var diacritics = {
2299
+ '\u24B6': 'A',
2300
+ '\uFF21': 'A',
2301
+ '\u00C0': 'A',
2302
+ '\u00C1': 'A',
2303
+ '\u00C2': 'A',
2304
+ '\u1EA6': 'A',
2305
+ '\u1EA4': 'A',
2306
+ '\u1EAA': 'A',
2307
+ '\u1EA8': 'A',
2308
+ '\u00C3': 'A',
2309
+ '\u0100': 'A',
2310
+ '\u0102': 'A',
2311
+ '\u1EB0': 'A',
2312
+ '\u1EAE': 'A',
2313
+ '\u1EB4': 'A',
2314
+ '\u1EB2': 'A',
2315
+ '\u0226': 'A',
2316
+ '\u01E0': 'A',
2317
+ '\u00C4': 'A',
2318
+ '\u01DE': 'A',
2319
+ '\u1EA2': 'A',
2320
+ '\u00C5': 'A',
2321
+ '\u01FA': 'A',
2322
+ '\u01CD': 'A',
2323
+ '\u0200': 'A',
2324
+ '\u0202': 'A',
2325
+ '\u1EA0': 'A',
2326
+ '\u1EAC': 'A',
2327
+ '\u1EB6': 'A',
2328
+ '\u1E00': 'A',
2329
+ '\u0104': 'A',
2330
+ '\u023A': 'A',
2331
+ '\u2C6F': 'A',
2332
+ '\uA732': 'AA',
2333
+ '\u00C6': 'AE',
2334
+ '\u01FC': 'AE',
2335
+ '\u01E2': 'AE',
2336
+ '\uA734': 'AO',
2337
+ '\uA736': 'AU',
2338
+ '\uA738': 'AV',
2339
+ '\uA73A': 'AV',
2340
+ '\uA73C': 'AY',
2341
+ '\u24B7': 'B',
2342
+ '\uFF22': 'B',
2343
+ '\u1E02': 'B',
2344
+ '\u1E04': 'B',
2345
+ '\u1E06': 'B',
2346
+ '\u0243': 'B',
2347
+ '\u0182': 'B',
2348
+ '\u0181': 'B',
2349
+ '\u24B8': 'C',
2350
+ '\uFF23': 'C',
2351
+ '\u0106': 'C',
2352
+ '\u0108': 'C',
2353
+ '\u010A': 'C',
2354
+ '\u010C': 'C',
2355
+ '\u00C7': 'C',
2356
+ '\u1E08': 'C',
2357
+ '\u0187': 'C',
2358
+ '\u023B': 'C',
2359
+ '\uA73E': 'C',
2360
+ '\u24B9': 'D',
2361
+ '\uFF24': 'D',
2362
+ '\u1E0A': 'D',
2363
+ '\u010E': 'D',
2364
+ '\u1E0C': 'D',
2365
+ '\u1E10': 'D',
2366
+ '\u1E12': 'D',
2367
+ '\u1E0E': 'D',
2368
+ '\u0110': 'D',
2369
+ '\u018B': 'D',
2370
+ '\u018A': 'D',
2371
+ '\u0189': 'D',
2372
+ '\uA779': 'D',
2373
+ '\u01F1': 'DZ',
2374
+ '\u01C4': 'DZ',
2375
+ '\u01F2': 'Dz',
2376
+ '\u01C5': 'Dz',
2377
+ '\u24BA': 'E',
2378
+ '\uFF25': 'E',
2379
+ '\u00C8': 'E',
2380
+ '\u00C9': 'E',
2381
+ '\u00CA': 'E',
2382
+ '\u1EC0': 'E',
2383
+ '\u1EBE': 'E',
2384
+ '\u1EC4': 'E',
2385
+ '\u1EC2': 'E',
2386
+ '\u1EBC': 'E',
2387
+ '\u0112': 'E',
2388
+ '\u1E14': 'E',
2389
+ '\u1E16': 'E',
2390
+ '\u0114': 'E',
2391
+ '\u0116': 'E',
2392
+ '\u00CB': 'E',
2393
+ '\u1EBA': 'E',
2394
+ '\u011A': 'E',
2395
+ '\u0204': 'E',
2396
+ '\u0206': 'E',
2397
+ '\u1EB8': 'E',
2398
+ '\u1EC6': 'E',
2399
+ '\u0228': 'E',
2400
+ '\u1E1C': 'E',
2401
+ '\u0118': 'E',
2402
+ '\u1E18': 'E',
2403
+ '\u1E1A': 'E',
2404
+ '\u0190': 'E',
2405
+ '\u018E': 'E',
2406
+ '\u24BB': 'F',
2407
+ '\uFF26': 'F',
2408
+ '\u1E1E': 'F',
2409
+ '\u0191': 'F',
2410
+ '\uA77B': 'F',
2411
+ '\u24BC': 'G',
2412
+ '\uFF27': 'G',
2413
+ '\u01F4': 'G',
2414
+ '\u011C': 'G',
2415
+ '\u1E20': 'G',
2416
+ '\u011E': 'G',
2417
+ '\u0120': 'G',
2418
+ '\u01E6': 'G',
2419
+ '\u0122': 'G',
2420
+ '\u01E4': 'G',
2421
+ '\u0193': 'G',
2422
+ '\uA7A0': 'G',
2423
+ '\uA77D': 'G',
2424
+ '\uA77E': 'G',
2425
+ '\u24BD': 'H',
2426
+ '\uFF28': 'H',
2427
+ '\u0124': 'H',
2428
+ '\u1E22': 'H',
2429
+ '\u1E26': 'H',
2430
+ '\u021E': 'H',
2431
+ '\u1E24': 'H',
2432
+ '\u1E28': 'H',
2433
+ '\u1E2A': 'H',
2434
+ '\u0126': 'H',
2435
+ '\u2C67': 'H',
2436
+ '\u2C75': 'H',
2437
+ '\uA78D': 'H',
2438
+ '\u24BE': 'I',
2439
+ '\uFF29': 'I',
2440
+ '\u00CC': 'I',
2441
+ '\u00CD': 'I',
2442
+ '\u00CE': 'I',
2443
+ '\u0128': 'I',
2444
+ '\u012A': 'I',
2445
+ '\u012C': 'I',
2446
+ '\u0130': 'I',
2447
+ '\u00CF': 'I',
2448
+ '\u1E2E': 'I',
2449
+ '\u1EC8': 'I',
2450
+ '\u01CF': 'I',
2451
+ '\u0208': 'I',
2452
+ '\u020A': 'I',
2453
+ '\u1ECA': 'I',
2454
+ '\u012E': 'I',
2455
+ '\u1E2C': 'I',
2456
+ '\u0197': 'I',
2457
+ '\u24BF': 'J',
2458
+ '\uFF2A': 'J',
2459
+ '\u0134': 'J',
2460
+ '\u0248': 'J',
2461
+ '\u24C0': 'K',
2462
+ '\uFF2B': 'K',
2463
+ '\u1E30': 'K',
2464
+ '\u01E8': 'K',
2465
+ '\u1E32': 'K',
2466
+ '\u0136': 'K',
2467
+ '\u1E34': 'K',
2468
+ '\u0198': 'K',
2469
+ '\u2C69': 'K',
2470
+ '\uA740': 'K',
2471
+ '\uA742': 'K',
2472
+ '\uA744': 'K',
2473
+ '\uA7A2': 'K',
2474
+ '\u24C1': 'L',
2475
+ '\uFF2C': 'L',
2476
+ '\u013F': 'L',
2477
+ '\u0139': 'L',
2478
+ '\u013D': 'L',
2479
+ '\u1E36': 'L',
2480
+ '\u1E38': 'L',
2481
+ '\u013B': 'L',
2482
+ '\u1E3C': 'L',
2483
+ '\u1E3A': 'L',
2484
+ '\u0141': 'L',
2485
+ '\u023D': 'L',
2486
+ '\u2C62': 'L',
2487
+ '\u2C60': 'L',
2488
+ '\uA748': 'L',
2489
+ '\uA746': 'L',
2490
+ '\uA780': 'L',
2491
+ '\u01C7': 'LJ',
2492
+ '\u01C8': 'Lj',
2493
+ '\u24C2': 'M',
2494
+ '\uFF2D': 'M',
2495
+ '\u1E3E': 'M',
2496
+ '\u1E40': 'M',
2497
+ '\u1E42': 'M',
2498
+ '\u2C6E': 'M',
2499
+ '\u019C': 'M',
2500
+ '\u24C3': 'N',
2501
+ '\uFF2E': 'N',
2502
+ '\u01F8': 'N',
2503
+ '\u0143': 'N',
2504
+ '\u00D1': 'N',
2505
+ '\u1E44': 'N',
2506
+ '\u0147': 'N',
2507
+ '\u1E46': 'N',
2508
+ '\u0145': 'N',
2509
+ '\u1E4A': 'N',
2510
+ '\u1E48': 'N',
2511
+ '\u0220': 'N',
2512
+ '\u019D': 'N',
2513
+ '\uA790': 'N',
2514
+ '\uA7A4': 'N',
2515
+ '\u01CA': 'NJ',
2516
+ '\u01CB': 'Nj',
2517
+ '\u24C4': 'O',
2518
+ '\uFF2F': 'O',
2519
+ '\u00D2': 'O',
2520
+ '\u00D3': 'O',
2521
+ '\u00D4': 'O',
2522
+ '\u1ED2': 'O',
2523
+ '\u1ED0': 'O',
2524
+ '\u1ED6': 'O',
2525
+ '\u1ED4': 'O',
2526
+ '\u00D5': 'O',
2527
+ '\u1E4C': 'O',
2528
+ '\u022C': 'O',
2529
+ '\u1E4E': 'O',
2530
+ '\u014C': 'O',
2531
+ '\u1E50': 'O',
2532
+ '\u1E52': 'O',
2533
+ '\u014E': 'O',
2534
+ '\u022E': 'O',
2535
+ '\u0230': 'O',
2536
+ '\u00D6': 'O',
2537
+ '\u022A': 'O',
2538
+ '\u1ECE': 'O',
2539
+ '\u0150': 'O',
2540
+ '\u01D1': 'O',
2541
+ '\u020C': 'O',
2542
+ '\u020E': 'O',
2543
+ '\u01A0': 'O',
2544
+ '\u1EDC': 'O',
2545
+ '\u1EDA': 'O',
2546
+ '\u1EE0': 'O',
2547
+ '\u1EDE': 'O',
2548
+ '\u1EE2': 'O',
2549
+ '\u1ECC': 'O',
2550
+ '\u1ED8': 'O',
2551
+ '\u01EA': 'O',
2552
+ '\u01EC': 'O',
2553
+ '\u00D8': 'O',
2554
+ '\u01FE': 'O',
2555
+ '\u0186': 'O',
2556
+ '\u019F': 'O',
2557
+ '\uA74A': 'O',
2558
+ '\uA74C': 'O',
2559
+ '\u0152': 'OE',
2560
+ '\u01A2': 'OI',
2561
+ '\uA74E': 'OO',
2562
+ '\u0222': 'OU',
2563
+ '\u24C5': 'P',
2564
+ '\uFF30': 'P',
2565
+ '\u1E54': 'P',
2566
+ '\u1E56': 'P',
2567
+ '\u01A4': 'P',
2568
+ '\u2C63': 'P',
2569
+ '\uA750': 'P',
2570
+ '\uA752': 'P',
2571
+ '\uA754': 'P',
2572
+ '\u24C6': 'Q',
2573
+ '\uFF31': 'Q',
2574
+ '\uA756': 'Q',
2575
+ '\uA758': 'Q',
2576
+ '\u024A': 'Q',
2577
+ '\u24C7': 'R',
2578
+ '\uFF32': 'R',
2579
+ '\u0154': 'R',
2580
+ '\u1E58': 'R',
2581
+ '\u0158': 'R',
2582
+ '\u0210': 'R',
2583
+ '\u0212': 'R',
2584
+ '\u1E5A': 'R',
2585
+ '\u1E5C': 'R',
2586
+ '\u0156': 'R',
2587
+ '\u1E5E': 'R',
2588
+ '\u024C': 'R',
2589
+ '\u2C64': 'R',
2590
+ '\uA75A': 'R',
2591
+ '\uA7A6': 'R',
2592
+ '\uA782': 'R',
2593
+ '\u24C8': 'S',
2594
+ '\uFF33': 'S',
2595
+ '\u1E9E': 'S',
2596
+ '\u015A': 'S',
2597
+ '\u1E64': 'S',
2598
+ '\u015C': 'S',
2599
+ '\u1E60': 'S',
2600
+ '\u0160': 'S',
2601
+ '\u1E66': 'S',
2602
+ '\u1E62': 'S',
2603
+ '\u1E68': 'S',
2604
+ '\u0218': 'S',
2605
+ '\u015E': 'S',
2606
+ '\u2C7E': 'S',
2607
+ '\uA7A8': 'S',
2608
+ '\uA784': 'S',
2609
+ '\u24C9': 'T',
2610
+ '\uFF34': 'T',
2611
+ '\u1E6A': 'T',
2612
+ '\u0164': 'T',
2613
+ '\u1E6C': 'T',
2614
+ '\u021A': 'T',
2615
+ '\u0162': 'T',
2616
+ '\u1E70': 'T',
2617
+ '\u1E6E': 'T',
2618
+ '\u0166': 'T',
2619
+ '\u01AC': 'T',
2620
+ '\u01AE': 'T',
2621
+ '\u023E': 'T',
2622
+ '\uA786': 'T',
2623
+ '\uA728': 'TZ',
2624
+ '\u24CA': 'U',
2625
+ '\uFF35': 'U',
2626
+ '\u00D9': 'U',
2627
+ '\u00DA': 'U',
2628
+ '\u00DB': 'U',
2629
+ '\u0168': 'U',
2630
+ '\u1E78': 'U',
2631
+ '\u016A': 'U',
2632
+ '\u1E7A': 'U',
2633
+ '\u016C': 'U',
2634
+ '\u00DC': 'U',
2635
+ '\u01DB': 'U',
2636
+ '\u01D7': 'U',
2637
+ '\u01D5': 'U',
2638
+ '\u01D9': 'U',
2639
+ '\u1EE6': 'U',
2640
+ '\u016E': 'U',
2641
+ '\u0170': 'U',
2642
+ '\u01D3': 'U',
2643
+ '\u0214': 'U',
2644
+ '\u0216': 'U',
2645
+ '\u01AF': 'U',
2646
+ '\u1EEA': 'U',
2647
+ '\u1EE8': 'U',
2648
+ '\u1EEE': 'U',
2649
+ '\u1EEC': 'U',
2650
+ '\u1EF0': 'U',
2651
+ '\u1EE4': 'U',
2652
+ '\u1E72': 'U',
2653
+ '\u0172': 'U',
2654
+ '\u1E76': 'U',
2655
+ '\u1E74': 'U',
2656
+ '\u0244': 'U',
2657
+ '\u24CB': 'V',
2658
+ '\uFF36': 'V',
2659
+ '\u1E7C': 'V',
2660
+ '\u1E7E': 'V',
2661
+ '\u01B2': 'V',
2662
+ '\uA75E': 'V',
2663
+ '\u0245': 'V',
2664
+ '\uA760': 'VY',
2665
+ '\u24CC': 'W',
2666
+ '\uFF37': 'W',
2667
+ '\u1E80': 'W',
2668
+ '\u1E82': 'W',
2669
+ '\u0174': 'W',
2670
+ '\u1E86': 'W',
2671
+ '\u1E84': 'W',
2672
+ '\u1E88': 'W',
2673
+ '\u2C72': 'W',
2674
+ '\u24CD': 'X',
2675
+ '\uFF38': 'X',
2676
+ '\u1E8A': 'X',
2677
+ '\u1E8C': 'X',
2678
+ '\u24CE': 'Y',
2679
+ '\uFF39': 'Y',
2680
+ '\u1EF2': 'Y',
2681
+ '\u00DD': 'Y',
2682
+ '\u0176': 'Y',
2683
+ '\u1EF8': 'Y',
2684
+ '\u0232': 'Y',
2685
+ '\u1E8E': 'Y',
2686
+ '\u0178': 'Y',
2687
+ '\u1EF6': 'Y',
2688
+ '\u1EF4': 'Y',
2689
+ '\u01B3': 'Y',
2690
+ '\u024E': 'Y',
2691
+ '\u1EFE': 'Y',
2692
+ '\u24CF': 'Z',
2693
+ '\uFF3A': 'Z',
2694
+ '\u0179': 'Z',
2695
+ '\u1E90': 'Z',
2696
+ '\u017B': 'Z',
2697
+ '\u017D': 'Z',
2698
+ '\u1E92': 'Z',
2699
+ '\u1E94': 'Z',
2700
+ '\u01B5': 'Z',
2701
+ '\u0224': 'Z',
2702
+ '\u2C7F': 'Z',
2703
+ '\u2C6B': 'Z',
2704
+ '\uA762': 'Z',
2705
+ '\u24D0': 'a',
2706
+ '\uFF41': 'a',
2707
+ '\u1E9A': 'a',
2708
+ '\u00E0': 'a',
2709
+ '\u00E1': 'a',
2710
+ '\u00E2': 'a',
2711
+ '\u1EA7': 'a',
2712
+ '\u1EA5': 'a',
2713
+ '\u1EAB': 'a',
2714
+ '\u1EA9': 'a',
2715
+ '\u00E3': 'a',
2716
+ '\u0101': 'a',
2717
+ '\u0103': 'a',
2718
+ '\u1EB1': 'a',
2719
+ '\u1EAF': 'a',
2720
+ '\u1EB5': 'a',
2721
+ '\u1EB3': 'a',
2722
+ '\u0227': 'a',
2723
+ '\u01E1': 'a',
2724
+ '\u00E4': 'a',
2725
+ '\u01DF': 'a',
2726
+ '\u1EA3': 'a',
2727
+ '\u00E5': 'a',
2728
+ '\u01FB': 'a',
2729
+ '\u01CE': 'a',
2730
+ '\u0201': 'a',
2731
+ '\u0203': 'a',
2732
+ '\u1EA1': 'a',
2733
+ '\u1EAD': 'a',
2734
+ '\u1EB7': 'a',
2735
+ '\u1E01': 'a',
2736
+ '\u0105': 'a',
2737
+ '\u2C65': 'a',
2738
+ '\u0250': 'a',
2739
+ '\uA733': 'aa',
2740
+ '\u00E6': 'ae',
2741
+ '\u01FD': 'ae',
2742
+ '\u01E3': 'ae',
2743
+ '\uA735': 'ao',
2744
+ '\uA737': 'au',
2745
+ '\uA739': 'av',
2746
+ '\uA73B': 'av',
2747
+ '\uA73D': 'ay',
2748
+ '\u24D1': 'b',
2749
+ '\uFF42': 'b',
2750
+ '\u1E03': 'b',
2751
+ '\u1E05': 'b',
2752
+ '\u1E07': 'b',
2753
+ '\u0180': 'b',
2754
+ '\u0183': 'b',
2755
+ '\u0253': 'b',
2756
+ '\u24D2': 'c',
2757
+ '\uFF43': 'c',
2758
+ '\u0107': 'c',
2759
+ '\u0109': 'c',
2760
+ '\u010B': 'c',
2761
+ '\u010D': 'c',
2762
+ '\u00E7': 'c',
2763
+ '\u1E09': 'c',
2764
+ '\u0188': 'c',
2765
+ '\u023C': 'c',
2766
+ '\uA73F': 'c',
2767
+ '\u2184': 'c',
2768
+ '\u24D3': 'd',
2769
+ '\uFF44': 'd',
2770
+ '\u1E0B': 'd',
2771
+ '\u010F': 'd',
2772
+ '\u1E0D': 'd',
2773
+ '\u1E11': 'd',
2774
+ '\u1E13': 'd',
2775
+ '\u1E0F': 'd',
2776
+ '\u0111': 'd',
2777
+ '\u018C': 'd',
2778
+ '\u0256': 'd',
2779
+ '\u0257': 'd',
2780
+ '\uA77A': 'd',
2781
+ '\u01F3': 'dz',
2782
+ '\u01C6': 'dz',
2783
+ '\u24D4': 'e',
2784
+ '\uFF45': 'e',
2785
+ '\u00E8': 'e',
2786
+ '\u00E9': 'e',
2787
+ '\u00EA': 'e',
2788
+ '\u1EC1': 'e',
2789
+ '\u1EBF': 'e',
2790
+ '\u1EC5': 'e',
2791
+ '\u1EC3': 'e',
2792
+ '\u1EBD': 'e',
2793
+ '\u0113': 'e',
2794
+ '\u1E15': 'e',
2795
+ '\u1E17': 'e',
2796
+ '\u0115': 'e',
2797
+ '\u0117': 'e',
2798
+ '\u00EB': 'e',
2799
+ '\u1EBB': 'e',
2800
+ '\u011B': 'e',
2801
+ '\u0205': 'e',
2802
+ '\u0207': 'e',
2803
+ '\u1EB9': 'e',
2804
+ '\u1EC7': 'e',
2805
+ '\u0229': 'e',
2806
+ '\u1E1D': 'e',
2807
+ '\u0119': 'e',
2808
+ '\u1E19': 'e',
2809
+ '\u1E1B': 'e',
2810
+ '\u0247': 'e',
2811
+ '\u025B': 'e',
2812
+ '\u01DD': 'e',
2813
+ '\u24D5': 'f',
2814
+ '\uFF46': 'f',
2815
+ '\u1E1F': 'f',
2816
+ '\u0192': 'f',
2817
+ '\uA77C': 'f',
2818
+ '\u24D6': 'g',
2819
+ '\uFF47': 'g',
2820
+ '\u01F5': 'g',
2821
+ '\u011D': 'g',
2822
+ '\u1E21': 'g',
2823
+ '\u011F': 'g',
2824
+ '\u0121': 'g',
2825
+ '\u01E7': 'g',
2826
+ '\u0123': 'g',
2827
+ '\u01E5': 'g',
2828
+ '\u0260': 'g',
2829
+ '\uA7A1': 'g',
2830
+ '\u1D79': 'g',
2831
+ '\uA77F': 'g',
2832
+ '\u24D7': 'h',
2833
+ '\uFF48': 'h',
2834
+ '\u0125': 'h',
2835
+ '\u1E23': 'h',
2836
+ '\u1E27': 'h',
2837
+ '\u021F': 'h',
2838
+ '\u1E25': 'h',
2839
+ '\u1E29': 'h',
2840
+ '\u1E2B': 'h',
2841
+ '\u1E96': 'h',
2842
+ '\u0127': 'h',
2843
+ '\u2C68': 'h',
2844
+ '\u2C76': 'h',
2845
+ '\u0265': 'h',
2846
+ '\u0195': 'hv',
2847
+ '\u24D8': 'i',
2848
+ '\uFF49': 'i',
2849
+ '\u00EC': 'i',
2850
+ '\u00ED': 'i',
2851
+ '\u00EE': 'i',
2852
+ '\u0129': 'i',
2853
+ '\u012B': 'i',
2854
+ '\u012D': 'i',
2855
+ '\u00EF': 'i',
2856
+ '\u1E2F': 'i',
2857
+ '\u1EC9': 'i',
2858
+ '\u01D0': 'i',
2859
+ '\u0209': 'i',
2860
+ '\u020B': 'i',
2861
+ '\u1ECB': 'i',
2862
+ '\u012F': 'i',
2863
+ '\u1E2D': 'i',
2864
+ '\u0268': 'i',
2865
+ '\u0131': 'i',
2866
+ '\u24D9': 'j',
2867
+ '\uFF4A': 'j',
2868
+ '\u0135': 'j',
2869
+ '\u01F0': 'j',
2870
+ '\u0249': 'j',
2871
+ '\u24DA': 'k',
2872
+ '\uFF4B': 'k',
2873
+ '\u1E31': 'k',
2874
+ '\u01E9': 'k',
2875
+ '\u1E33': 'k',
2876
+ '\u0137': 'k',
2877
+ '\u1E35': 'k',
2878
+ '\u0199': 'k',
2879
+ '\u2C6A': 'k',
2880
+ '\uA741': 'k',
2881
+ '\uA743': 'k',
2882
+ '\uA745': 'k',
2883
+ '\uA7A3': 'k',
2884
+ '\u24DB': 'l',
2885
+ '\uFF4C': 'l',
2886
+ '\u0140': 'l',
2887
+ '\u013A': 'l',
2888
+ '\u013E': 'l',
2889
+ '\u1E37': 'l',
2890
+ '\u1E39': 'l',
2891
+ '\u013C': 'l',
2892
+ '\u1E3D': 'l',
2893
+ '\u1E3B': 'l',
2894
+ '\u017F': 'l',
2895
+ '\u0142': 'l',
2896
+ '\u019A': 'l',
2897
+ '\u026B': 'l',
2898
+ '\u2C61': 'l',
2899
+ '\uA749': 'l',
2900
+ '\uA781': 'l',
2901
+ '\uA747': 'l',
2902
+ '\u01C9': 'lj',
2903
+ '\u24DC': 'm',
2904
+ '\uFF4D': 'm',
2905
+ '\u1E3F': 'm',
2906
+ '\u1E41': 'm',
2907
+ '\u1E43': 'm',
2908
+ '\u0271': 'm',
2909
+ '\u026F': 'm',
2910
+ '\u24DD': 'n',
2911
+ '\uFF4E': 'n',
2912
+ '\u01F9': 'n',
2913
+ '\u0144': 'n',
2914
+ '\u00F1': 'n',
2915
+ '\u1E45': 'n',
2916
+ '\u0148': 'n',
2917
+ '\u1E47': 'n',
2918
+ '\u0146': 'n',
2919
+ '\u1E4B': 'n',
2920
+ '\u1E49': 'n',
2921
+ '\u019E': 'n',
2922
+ '\u0272': 'n',
2923
+ '\u0149': 'n',
2924
+ '\uA791': 'n',
2925
+ '\uA7A5': 'n',
2926
+ '\u01CC': 'nj',
2927
+ '\u24DE': 'o',
2928
+ '\uFF4F': 'o',
2929
+ '\u00F2': 'o',
2930
+ '\u00F3': 'o',
2931
+ '\u00F4': 'o',
2932
+ '\u1ED3': 'o',
2933
+ '\u1ED1': 'o',
2934
+ '\u1ED7': 'o',
2935
+ '\u1ED5': 'o',
2936
+ '\u00F5': 'o',
2937
+ '\u1E4D': 'o',
2938
+ '\u022D': 'o',
2939
+ '\u1E4F': 'o',
2940
+ '\u014D': 'o',
2941
+ '\u1E51': 'o',
2942
+ '\u1E53': 'o',
2943
+ '\u014F': 'o',
2944
+ '\u022F': 'o',
2945
+ '\u0231': 'o',
2946
+ '\u00F6': 'o',
2947
+ '\u022B': 'o',
2948
+ '\u1ECF': 'o',
2949
+ '\u0151': 'o',
2950
+ '\u01D2': 'o',
2951
+ '\u020D': 'o',
2952
+ '\u020F': 'o',
2953
+ '\u01A1': 'o',
2954
+ '\u1EDD': 'o',
2955
+ '\u1EDB': 'o',
2956
+ '\u1EE1': 'o',
2957
+ '\u1EDF': 'o',
2958
+ '\u1EE3': 'o',
2959
+ '\u1ECD': 'o',
2960
+ '\u1ED9': 'o',
2961
+ '\u01EB': 'o',
2962
+ '\u01ED': 'o',
2963
+ '\u00F8': 'o',
2964
+ '\u01FF': 'o',
2965
+ '\u0254': 'o',
2966
+ '\uA74B': 'o',
2967
+ '\uA74D': 'o',
2968
+ '\u0275': 'o',
2969
+ '\u0153': 'oe',
2970
+ '\u01A3': 'oi',
2971
+ '\u0223': 'ou',
2972
+ '\uA74F': 'oo',
2973
+ '\u24DF': 'p',
2974
+ '\uFF50': 'p',
2975
+ '\u1E55': 'p',
2976
+ '\u1E57': 'p',
2977
+ '\u01A5': 'p',
2978
+ '\u1D7D': 'p',
2979
+ '\uA751': 'p',
2980
+ '\uA753': 'p',
2981
+ '\uA755': 'p',
2982
+ '\u24E0': 'q',
2983
+ '\uFF51': 'q',
2984
+ '\u024B': 'q',
2985
+ '\uA757': 'q',
2986
+ '\uA759': 'q',
2987
+ '\u24E1': 'r',
2988
+ '\uFF52': 'r',
2989
+ '\u0155': 'r',
2990
+ '\u1E59': 'r',
2991
+ '\u0159': 'r',
2992
+ '\u0211': 'r',
2993
+ '\u0213': 'r',
2994
+ '\u1E5B': 'r',
2995
+ '\u1E5D': 'r',
2996
+ '\u0157': 'r',
2997
+ '\u1E5F': 'r',
2998
+ '\u024D': 'r',
2999
+ '\u027D': 'r',
3000
+ '\uA75B': 'r',
3001
+ '\uA7A7': 'r',
3002
+ '\uA783': 'r',
3003
+ '\u24E2': 's',
3004
+ '\uFF53': 's',
3005
+ '\u00DF': 's',
3006
+ '\u015B': 's',
3007
+ '\u1E65': 's',
3008
+ '\u015D': 's',
3009
+ '\u1E61': 's',
3010
+ '\u0161': 's',
3011
+ '\u1E67': 's',
3012
+ '\u1E63': 's',
3013
+ '\u1E69': 's',
3014
+ '\u0219': 's',
3015
+ '\u015F': 's',
3016
+ '\u023F': 's',
3017
+ '\uA7A9': 's',
3018
+ '\uA785': 's',
3019
+ '\u1E9B': 's',
3020
+ '\u24E3': 't',
3021
+ '\uFF54': 't',
3022
+ '\u1E6B': 't',
3023
+ '\u1E97': 't',
3024
+ '\u0165': 't',
3025
+ '\u1E6D': 't',
3026
+ '\u021B': 't',
3027
+ '\u0163': 't',
3028
+ '\u1E71': 't',
3029
+ '\u1E6F': 't',
3030
+ '\u0167': 't',
3031
+ '\u01AD': 't',
3032
+ '\u0288': 't',
3033
+ '\u2C66': 't',
3034
+ '\uA787': 't',
3035
+ '\uA729': 'tz',
3036
+ '\u24E4': 'u',
3037
+ '\uFF55': 'u',
3038
+ '\u00F9': 'u',
3039
+ '\u00FA': 'u',
3040
+ '\u00FB': 'u',
3041
+ '\u0169': 'u',
3042
+ '\u1E79': 'u',
3043
+ '\u016B': 'u',
3044
+ '\u1E7B': 'u',
3045
+ '\u016D': 'u',
3046
+ '\u00FC': 'u',
3047
+ '\u01DC': 'u',
3048
+ '\u01D8': 'u',
3049
+ '\u01D6': 'u',
3050
+ '\u01DA': 'u',
3051
+ '\u1EE7': 'u',
3052
+ '\u016F': 'u',
3053
+ '\u0171': 'u',
3054
+ '\u01D4': 'u',
3055
+ '\u0215': 'u',
3056
+ '\u0217': 'u',
3057
+ '\u01B0': 'u',
3058
+ '\u1EEB': 'u',
3059
+ '\u1EE9': 'u',
3060
+ '\u1EEF': 'u',
3061
+ '\u1EED': 'u',
3062
+ '\u1EF1': 'u',
3063
+ '\u1EE5': 'u',
3064
+ '\u1E73': 'u',
3065
+ '\u0173': 'u',
3066
+ '\u1E77': 'u',
3067
+ '\u1E75': 'u',
3068
+ '\u0289': 'u',
3069
+ '\u24E5': 'v',
3070
+ '\uFF56': 'v',
3071
+ '\u1E7D': 'v',
3072
+ '\u1E7F': 'v',
3073
+ '\u028B': 'v',
3074
+ '\uA75F': 'v',
3075
+ '\u028C': 'v',
3076
+ '\uA761': 'vy',
3077
+ '\u24E6': 'w',
3078
+ '\uFF57': 'w',
3079
+ '\u1E81': 'w',
3080
+ '\u1E83': 'w',
3081
+ '\u0175': 'w',
3082
+ '\u1E87': 'w',
3083
+ '\u1E85': 'w',
3084
+ '\u1E98': 'w',
3085
+ '\u1E89': 'w',
3086
+ '\u2C73': 'w',
3087
+ '\u24E7': 'x',
3088
+ '\uFF58': 'x',
3089
+ '\u1E8B': 'x',
3090
+ '\u1E8D': 'x',
3091
+ '\u24E8': 'y',
3092
+ '\uFF59': 'y',
3093
+ '\u1EF3': 'y',
3094
+ '\u00FD': 'y',
3095
+ '\u0177': 'y',
3096
+ '\u1EF9': 'y',
3097
+ '\u0233': 'y',
3098
+ '\u1E8F': 'y',
3099
+ '\u00FF': 'y',
3100
+ '\u1EF7': 'y',
3101
+ '\u1E99': 'y',
3102
+ '\u1EF5': 'y',
3103
+ '\u01B4': 'y',
3104
+ '\u024F': 'y',
3105
+ '\u1EFF': 'y',
3106
+ '\u24E9': 'z',
3107
+ '\uFF5A': 'z',
3108
+ '\u017A': 'z',
3109
+ '\u1E91': 'z',
3110
+ '\u017C': 'z',
3111
+ '\u017E': 'z',
3112
+ '\u1E93': 'z',
3113
+ '\u1E95': 'z',
3114
+ '\u01B6': 'z',
3115
+ '\u0225': 'z',
3116
+ '\u0240': 'z',
3117
+ '\u2C6C': 'z',
3118
+ '\uA763': 'z',
3119
+ '\u0386': '\u0391',
3120
+ '\u0388': '\u0395',
3121
+ '\u0389': '\u0397',
3122
+ '\u038A': '\u0399',
3123
+ '\u03AA': '\u0399',
3124
+ '\u038C': '\u039F',
3125
+ '\u038E': '\u03A5',
3126
+ '\u03AB': '\u03A5',
3127
+ '\u038F': '\u03A9',
3128
+ '\u03AC': '\u03B1',
3129
+ '\u03AD': '\u03B5',
3130
+ '\u03AE': '\u03B7',
3131
+ '\u03AF': '\u03B9',
3132
+ '\u03CA': '\u03B9',
3133
+ '\u0390': '\u03B9',
3134
+ '\u03CC': '\u03BF',
3135
+ '\u03CD': '\u03C5',
3136
+ '\u03CB': '\u03C5',
3137
+ '\u03B0': '\u03C5',
3138
+ '\u03CE': '\u03C9',
3139
+ '\u03C2': '\u03C3',
3140
+ '\u2019': '\''
3141
+ };
3142
+
3143
+ return diacritics;
3144
+ });
3145
+
3146
+ S2.define('select2/data/base',[
3147
+ '../utils'
3148
+ ], function (Utils) {
3149
+ function BaseAdapter ($element, options) {
3150
+ BaseAdapter.__super__.constructor.call(this);
3151
+ }
3152
+
3153
+ Utils.Extend(BaseAdapter, Utils.Observable);
3154
+
3155
+ BaseAdapter.prototype.current = function (callback) {
3156
+ throw new Error('The `current` method must be defined in child classes.');
3157
+ };
3158
+
3159
+ BaseAdapter.prototype.query = function (params, callback) {
3160
+ throw new Error('The `query` method must be defined in child classes.');
3161
+ };
3162
+
3163
+ BaseAdapter.prototype.bind = function (container, $container) {
3164
+ // Can be implemented in subclasses
3165
+ };
3166
+
3167
+ BaseAdapter.prototype.destroy = function () {
3168
+ // Can be implemented in subclasses
3169
+ };
3170
+
3171
+ BaseAdapter.prototype.generateResultId = function (container, data) {
3172
+ var id = container.id + '-result-';
3173
+
3174
+ id += Utils.generateChars(4);
3175
+
3176
+ if (data.id != null) {
3177
+ id += '-' + data.id.toString();
3178
+ } else {
3179
+ id += '-' + Utils.generateChars(4);
3180
+ }
3181
+ return id;
3182
+ };
3183
+
3184
+ return BaseAdapter;
3185
+ });
3186
+
3187
+ S2.define('select2/data/select',[
3188
+ './base',
3189
+ '../utils',
3190
+ 'jquery'
3191
+ ], function (BaseAdapter, Utils, $) {
3192
+ function SelectAdapter ($element, options) {
3193
+ this.$element = $element;
3194
+ this.options = options;
3195
+
3196
+ SelectAdapter.__super__.constructor.call(this);
3197
+ }
3198
+
3199
+ Utils.Extend(SelectAdapter, BaseAdapter);
3200
+
3201
+ SelectAdapter.prototype.current = function (callback) {
3202
+ var data = [];
3203
+ var self = this;
3204
+
3205
+ this.$element.find(':selected').each(function () {
3206
+ var $option = $(this);
3207
+
3208
+ var option = self.item($option);
3209
+
3210
+ data.push(option);
3211
+ });
3212
+
3213
+ callback(data);
3214
+ };
3215
+
3216
+ SelectAdapter.prototype.select = function (data) {
3217
+ var self = this;
3218
+
3219
+ data.selected = true;
3220
+
3221
+ // If data.element is a DOM node, use it instead
3222
+ if ($(data.element).is('option')) {
3223
+ data.element.selected = true;
3224
+
3225
+ this.$element.trigger('input').trigger('change');
3226
+
3227
+ return;
3228
+ }
3229
+
3230
+ if (this.$element.prop('multiple')) {
3231
+ this.current(function (currentData) {
3232
+ var val = [];
3233
+
3234
+ data = [data];
3235
+ data.push.apply(data, currentData);
3236
+
3237
+ for (var d = 0; d < data.length; d++) {
3238
+ var id = data[d].id;
3239
+
3240
+ if ($.inArray(id, val) === -1) {
3241
+ val.push(id);
3242
+ }
3243
+ }
3244
+
3245
+ self.$element.val(val);
3246
+ self.$element.trigger('input').trigger('change');
3247
+ });
3248
+ } else {
3249
+ var val = data.id;
3250
+
3251
+ this.$element.val(val);
3252
+ this.$element.trigger('input').trigger('change');
3253
+ }
3254
+ };
3255
+
3256
+ SelectAdapter.prototype.unselect = function (data) {
3257
+ var self = this;
3258
+
3259
+ if (!this.$element.prop('multiple')) {
3260
+ return;
3261
+ }
3262
+
3263
+ data.selected = false;
3264
+
3265
+ if ($(data.element).is('option')) {
3266
+ data.element.selected = false;
3267
+
3268
+ this.$element.trigger('input').trigger('change');
3269
+
3270
+ return;
3271
+ }
3272
+
3273
+ this.current(function (currentData) {
3274
+ var val = [];
3275
+
3276
+ for (var d = 0; d < currentData.length; d++) {
3277
+ var id = currentData[d].id;
3278
+
3279
+ if (id !== data.id && $.inArray(id, val) === -1) {
3280
+ val.push(id);
3281
+ }
3282
+ }
3283
+
3284
+ self.$element.val(val);
3285
+
3286
+ self.$element.trigger('input').trigger('change');
3287
+ });
3288
+ };
3289
+
3290
+ SelectAdapter.prototype.bind = function (container, $container) {
3291
+ var self = this;
3292
+
3293
+ this.container = container;
3294
+
3295
+ container.on('select', function (params) {
3296
+ self.select(params.data);
3297
+ });
3298
+
3299
+ container.on('unselect', function (params) {
3300
+ self.unselect(params.data);
3301
+ });
3302
+ };
3303
+
3304
+ SelectAdapter.prototype.destroy = function () {
3305
+ // Remove anything added to child elements
3306
+ this.$element.find('*').each(function () {
3307
+ // Remove any custom data set by Select2
3308
+ Utils.RemoveData(this);
3309
+ });
3310
+ };
3311
+
3312
+ SelectAdapter.prototype.query = function (params, callback) {
3313
+ var data = [];
3314
+ var self = this;
3315
+
3316
+ var $options = this.$element.children();
3317
+
3318
+ $options.each(function () {
3319
+ var $option = $(this);
3320
+
3321
+ if (!$option.is('option') && !$option.is('optgroup')) {
3322
+ return;
3323
+ }
3324
+
3325
+ var option = self.item($option);
3326
+
3327
+ var matches = self.matches(params, option);
3328
+
3329
+ if (matches !== null) {
3330
+ data.push(matches);
3331
+ }
3332
+ });
3333
+
3334
+ callback({
3335
+ results: data
3336
+ });
3337
+ };
3338
+
3339
+ SelectAdapter.prototype.addOptions = function ($options) {
3340
+ Utils.appendMany(this.$element, $options);
3341
+ };
3342
+
3343
+ SelectAdapter.prototype.option = function (data) {
3344
+ var option;
3345
+
3346
+ if (data.children) {
3347
+ option = document.createElement('optgroup');
3348
+ option.label = data.text;
3349
+ } else {
3350
+ option = document.createElement('option');
3351
+
3352
+ if (option.textContent !== undefined) {
3353
+ option.textContent = data.text;
3354
+ } else {
3355
+ option.innerText = data.text;
3356
+ }
3357
+ }
3358
+
3359
+ if (data.id !== undefined) {
3360
+ option.value = data.id;
3361
+ }
3362
+
3363
+ if (data.disabled) {
3364
+ option.disabled = true;
3365
+ }
3366
+
3367
+ if (data.selected) {
3368
+ option.selected = true;
3369
+ }
3370
+
3371
+ if (data.title) {
3372
+ option.title = data.title;
3373
+ }
3374
+
3375
+ var $option = $(option);
3376
+
3377
+ var normalizedData = this._normalizeItem(data);
3378
+ normalizedData.element = option;
3379
+
3380
+ // Override the option's data with the combined data
3381
+ Utils.StoreData(option, 'data', normalizedData);
3382
+
3383
+ return $option;
3384
+ };
3385
+
3386
+ SelectAdapter.prototype.item = function ($option) {
3387
+ var data = {};
3388
+
3389
+ data = Utils.GetData($option[0], 'data');
3390
+
3391
+ if (data != null) {
3392
+ return data;
3393
+ }
3394
+
3395
+ if ($option.is('option')) {
3396
+ data = {
3397
+ id: $option.val(),
3398
+ text: $option.text(),
3399
+ disabled: $option.prop('disabled'),
3400
+ selected: $option.prop('selected'),
3401
+ title: $option.prop('title')
3402
+ };
3403
+ } else if ($option.is('optgroup')) {
3404
+ data = {
3405
+ text: $option.prop('label'),
3406
+ children: [],
3407
+ title: $option.prop('title')
3408
+ };
3409
+
3410
+ var $children = $option.children('option');
3411
+ var children = [];
3412
+
3413
+ for (var c = 0; c < $children.length; c++) {
3414
+ var $child = $($children[c]);
3415
+
3416
+ var child = this.item($child);
3417
+
3418
+ children.push(child);
3419
+ }
3420
+
3421
+ data.children = children;
3422
+ }
3423
+
3424
+ data = this._normalizeItem(data);
3425
+ data.element = $option[0];
3426
+
3427
+ Utils.StoreData($option[0], 'data', data);
3428
+
3429
+ return data;
3430
+ };
3431
+
3432
+ SelectAdapter.prototype._normalizeItem = function (item) {
3433
+ if (item !== Object(item)) {
3434
+ item = {
3435
+ id: item,
3436
+ text: item
3437
+ };
3438
+ }
3439
+
3440
+ item = $.extend({}, {
3441
+ text: ''
3442
+ }, item);
3443
+
3444
+ var defaults = {
3445
+ selected: false,
3446
+ disabled: false
3447
+ };
3448
+
3449
+ if (item.id != null) {
3450
+ item.id = item.id.toString();
3451
+ }
3452
+
3453
+ if (item.text != null) {
3454
+ item.text = item.text.toString();
3455
+ }
3456
+
3457
+ if (item._resultId == null && item.id && this.container != null) {
3458
+ item._resultId = this.generateResultId(this.container, item);
3459
+ }
3460
+
3461
+ return $.extend({}, defaults, item);
3462
+ };
3463
+
3464
+ SelectAdapter.prototype.matches = function (params, data) {
3465
+ var matcher = this.options.get('matcher');
3466
+
3467
+ return matcher(params, data);
3468
+ };
3469
+
3470
+ return SelectAdapter;
3471
+ });
3472
+
3473
+ S2.define('select2/data/array',[
3474
+ './select',
3475
+ '../utils',
3476
+ 'jquery'
3477
+ ], function (SelectAdapter, Utils, $) {
3478
+ function ArrayAdapter ($element, options) {
3479
+ this._dataToConvert = options.get('data') || [];
3480
+
3481
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
3482
+ }
3483
+
3484
+ Utils.Extend(ArrayAdapter, SelectAdapter);
3485
+
3486
+ ArrayAdapter.prototype.bind = function (container, $container) {
3487
+ ArrayAdapter.__super__.bind.call(this, container, $container);
3488
+
3489
+ this.addOptions(this.convertToOptions(this._dataToConvert));
3490
+ };
3491
+
3492
+ ArrayAdapter.prototype.select = function (data) {
3493
+ var $option = this.$element.find('option').filter(function (i, elm) {
3494
+ return elm.value == data.id.toString();
3495
+ });
3496
+
3497
+ if ($option.length === 0) {
3498
+ $option = this.option(data);
3499
+
3500
+ this.addOptions($option);
3501
+ }
3502
+
3503
+ ArrayAdapter.__super__.select.call(this, data);
3504
+ };
3505
+
3506
+ ArrayAdapter.prototype.convertToOptions = function (data) {
3507
+ var self = this;
3508
+
3509
+ var $existing = this.$element.find('option');
3510
+ var existingIds = $existing.map(function () {
3511
+ return self.item($(this)).id;
3512
+ }).get();
3513
+
3514
+ var $options = [];
3515
+
3516
+ // Filter out all items except for the one passed in the argument
3517
+ function onlyItem (item) {
3518
+ return function () {
3519
+ return $(this).val() == item.id;
3520
+ };
3521
+ }
3522
+
3523
+ for (var d = 0; d < data.length; d++) {
3524
+ var item = this._normalizeItem(data[d]);
3525
+
3526
+ // Skip items which were pre-loaded, only merge the data
3527
+ if ($.inArray(item.id, existingIds) >= 0) {
3528
+ var $existingOption = $existing.filter(onlyItem(item));
3529
+
3530
+ var existingData = this.item($existingOption);
3531
+ var newData = $.extend(true, {}, item, existingData);
3532
+
3533
+ var $newOption = this.option(newData);
3534
+
3535
+ $existingOption.replaceWith($newOption);
3536
+
3537
+ continue;
3538
+ }
3539
+
3540
+ var $option = this.option(item);
3541
+
3542
+ if (item.children) {
3543
+ var $children = this.convertToOptions(item.children);
3544
+
3545
+ Utils.appendMany($option, $children);
3546
+ }
3547
+
3548
+ $options.push($option);
3549
+ }
3550
+
3551
+ return $options;
3552
+ };
3553
+
3554
+ return ArrayAdapter;
3555
+ });
3556
+
3557
+ S2.define('select2/data/ajax',[
3558
+ './array',
3559
+ '../utils',
3560
+ 'jquery'
3561
+ ], function (ArrayAdapter, Utils, $) {
3562
+ function AjaxAdapter ($element, options) {
3563
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3564
+
3565
+ if (this.ajaxOptions.processResults != null) {
3566
+ this.processResults = this.ajaxOptions.processResults;
3567
+ }
3568
+
3569
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
3570
+ }
3571
+
3572
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
3573
+
3574
+ AjaxAdapter.prototype._applyDefaults = function (options) {
3575
+ var defaults = {
3576
+ data: function (params) {
3577
+ return $.extend({}, params, {
3578
+ q: params.term
3579
+ });
3580
+ },
3581
+ transport: function (params, success, failure) {
3582
+ var $request = $.ajax(params);
3583
+
3584
+ $request.then(success);
3585
+ $request.fail(failure);
3586
+
3587
+ return $request;
3588
+ }
3589
+ };
3590
+
3591
+ return $.extend({}, defaults, options, true);
3592
+ };
3593
+
3594
+ AjaxAdapter.prototype.processResults = function (results) {
3595
+ return results;
3596
+ };
3597
+
3598
+ AjaxAdapter.prototype.query = function (params, callback) {
3599
+ var matches = [];
3600
+ var self = this;
3601
+
3602
+ if (this._request != null) {
3603
+ // JSONP requests cannot always be aborted
3604
+ if ($.isFunction(this._request.abort)) {
3605
+ this._request.abort();
3606
+ }
3607
+
3608
+ this._request = null;
3609
+ }
3610
+
3611
+ var options = $.extend({
3612
+ type: 'GET'
3613
+ }, this.ajaxOptions);
3614
+
3615
+ if (typeof options.url === 'function') {
3616
+ options.url = options.url.call(this.$element, params);
3617
+ }
3618
+
3619
+ if (typeof options.data === 'function') {
3620
+ options.data = options.data.call(this.$element, params);
3621
+ }
3622
+
3623
+ function request () {
3624
+ var $request = options.transport(options, function (data) {
3625
+ var results = self.processResults(data, params);
3626
+
3627
+ if (self.options.get('debug') && window.console && console.error) {
3628
+ // Check to make sure that the response included a `results` key.
3629
+ if (!results || !results.results || !$.isArray(results.results)) {
3630
+ console.error(
3631
+ 'Select2: The AJAX results did not return an array in the ' +
3632
+ '`results` key of the response.'
3633
+ );
3634
+ }
3635
+ }
3636
+
3637
+ callback(results);
3638
+ }, function () {
3639
+ // Attempt to detect if a request was aborted
3640
+ // Only works if the transport exposes a status property
3641
+ if ('status' in $request &&
3642
+ ($request.status === 0 || $request.status === '0')) {
3643
+ return;
3644
+ }
3645
+
3646
+ self.trigger('results:message', {
3647
+ message: 'errorLoading'
3648
+ });
3649
+ });
3650
+
3651
+ self._request = $request;
3652
+ }
3653
+
3654
+ if (this.ajaxOptions.delay && params.term != null) {
3655
+ if (this._queryTimeout) {
3656
+ window.clearTimeout(this._queryTimeout);
3657
+ }
3658
+
3659
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3660
+ } else {
3661
+ request();
3662
+ }
3663
+ };
3664
+
3665
+ return AjaxAdapter;
3666
+ });
3667
+
3668
+ S2.define('select2/data/tags',[
3669
+ 'jquery'
3670
+ ], function ($) {
3671
+ function Tags (decorated, $element, options) {
3672
+ var tags = options.get('tags');
3673
+
3674
+ var createTag = options.get('createTag');
3675
+
3676
+ if (createTag !== undefined) {
3677
+ this.createTag = createTag;
3678
+ }
3679
+
3680
+ var insertTag = options.get('insertTag');
3681
+
3682
+ if (insertTag !== undefined) {
3683
+ this.insertTag = insertTag;
3684
+ }
3685
+
3686
+ decorated.call(this, $element, options);
3687
+
3688
+ if ($.isArray(tags)) {
3689
+ for (var t = 0; t < tags.length; t++) {
3690
+ var tag = tags[t];
3691
+ var item = this._normalizeItem(tag);
3692
+
3693
+ var $option = this.option(item);
3694
+
3695
+ this.$element.append($option);
3696
+ }
3697
+ }
3698
+ }
3699
+
3700
+ Tags.prototype.query = function (decorated, params, callback) {
3701
+ var self = this;
3702
+
3703
+ this._removeOldTags();
3704
+
3705
+ if (params.term == null || params.page != null) {
3706
+ decorated.call(this, params, callback);
3707
+ return;
3708
+ }
3709
+
3710
+ function wrapper (obj, child) {
3711
+ var data = obj.results;
3712
+
3713
+ for (var i = 0; i < data.length; i++) {
3714
+ var option = data[i];
3715
+
3716
+ var checkChildren = (
3717
+ option.children != null &&
3718
+ !wrapper({
3719
+ results: option.children
3720
+ }, true)
3721
+ );
3722
+
3723
+ var optionText = (option.text || '').toUpperCase();
3724
+ var paramsTerm = (params.term || '').toUpperCase();
3725
+
3726
+ var checkText = optionText === paramsTerm;
3727
+
3728
+ if (checkText || checkChildren) {
3729
+ if (child) {
3730
+ return false;
3731
+ }
3732
+
3733
+ obj.data = data;
3734
+ callback(obj);
3735
+
3736
+ return;
3737
+ }
3738
+ }
3739
+
3740
+ if (child) {
3741
+ return true;
3742
+ }
3743
+
3744
+ var tag = self.createTag(params);
3745
+
3746
+ if (tag != null) {
3747
+ var $option = self.option(tag);
3748
+ $option.attr('data-select2-tag', true);
3749
+
3750
+ self.addOptions([$option]);
3751
+
3752
+ self.insertTag(data, tag);
3753
+ }
3754
+
3755
+ obj.results = data;
3756
+
3757
+ callback(obj);
3758
+ }
3759
+
3760
+ decorated.call(this, params, wrapper);
3761
+ };
3762
+
3763
+ Tags.prototype.createTag = function (decorated, params) {
3764
+ var term = $.trim(params.term);
3765
+
3766
+ if (term === '') {
3767
+ return null;
3768
+ }
3769
+
3770
+ return {
3771
+ id: term,
3772
+ text: term
3773
+ };
3774
+ };
3775
+
3776
+ Tags.prototype.insertTag = function (_, data, tag) {
3777
+ data.unshift(tag);
3778
+ };
3779
+
3780
+ Tags.prototype._removeOldTags = function (_) {
3781
+ var $options = this.$element.find('option[data-select2-tag]');
3782
+
3783
+ $options.each(function () {
3784
+ if (this.selected) {
3785
+ return;
3786
+ }
3787
+
3788
+ $(this).remove();
3789
+ });
3790
+ };
3791
+
3792
+ return Tags;
3793
+ });
3794
+
3795
+ S2.define('select2/data/tokenizer',[
3796
+ 'jquery'
3797
+ ], function ($) {
3798
+ function Tokenizer (decorated, $element, options) {
3799
+ var tokenizer = options.get('tokenizer');
3800
+
3801
+ if (tokenizer !== undefined) {
3802
+ this.tokenizer = tokenizer;
3803
+ }
3804
+
3805
+ decorated.call(this, $element, options);
3806
+ }
3807
+
3808
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
3809
+ decorated.call(this, container, $container);
3810
+
3811
+ this.$search = container.dropdown.$search || container.selection.$search ||
3812
+ $container.find('.select2-search__field');
3813
+ };
3814
+
3815
+ Tokenizer.prototype.query = function (decorated, params, callback) {
3816
+ var self = this;
3817
+
3818
+ function createAndSelect (data) {
3819
+ // Normalize the data object so we can use it for checks
3820
+ var item = self._normalizeItem(data);
3821
+
3822
+ // Check if the data object already exists as a tag
3823
+ // Select it if it doesn't
3824
+ var $existingOptions = self.$element.find('option').filter(function () {
3825
+ return $(this).val() === item.id;
3826
+ });
3827
+
3828
+ // If an existing option wasn't found for it, create the option
3829
+ if (!$existingOptions.length) {
3830
+ var $option = self.option(item);
3831
+ $option.attr('data-select2-tag', true);
3832
+
3833
+ self._removeOldTags();
3834
+ self.addOptions([$option]);
3835
+ }
3836
+
3837
+ // Select the item, now that we know there is an option for it
3838
+ select(item);
3839
+ }
3840
+
3841
+ function select (data) {
3842
+ self.trigger('select', {
3843
+ data: data
3844
+ });
3845
+ }
3846
+
3847
+ params.term = params.term || '';
3848
+
3849
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
3850
+
3851
+ if (tokenData.term !== params.term) {
3852
+ // Replace the search term if we have the search box
3853
+ if (this.$search.length) {
3854
+ this.$search.val(tokenData.term);
3855
+ this.$search.trigger('focus');
3856
+ }
3857
+
3858
+ params.term = tokenData.term;
3859
+ }
3860
+
3861
+ decorated.call(this, params, callback);
3862
+ };
3863
+
3864
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3865
+ var separators = options.get('tokenSeparators') || [];
3866
+ var term = params.term;
3867
+ var i = 0;
3868
+
3869
+ var createTag = this.createTag || function (params) {
3870
+ return {
3871
+ id: params.term,
3872
+ text: params.term
3873
+ };
3874
+ };
3875
+
3876
+ while (i < term.length) {
3877
+ var termChar = term[i];
3878
+
3879
+ if ($.inArray(termChar, separators) === -1) {
3880
+ i++;
3881
+
3882
+ continue;
3883
+ }
3884
+
3885
+ var part = term.substr(0, i);
3886
+ var partParams = $.extend({}, params, {
3887
+ term: part
3888
+ });
3889
+
3890
+ var data = createTag(partParams);
3891
+
3892
+ if (data == null) {
3893
+ i++;
3894
+ continue;
3895
+ }
3896
+
3897
+ callback(data);
3898
+
3899
+ // Reset the term to not include the tokenized portion
3900
+ term = term.substr(i + 1) || '';
3901
+ i = 0;
3902
+ }
3903
+
3904
+ return {
3905
+ term: term
3906
+ };
3907
+ };
3908
+
3909
+ return Tokenizer;
3910
+ });
3911
+
3912
+ S2.define('select2/data/minimumInputLength',[
3913
+
3914
+ ], function () {
3915
+ function MinimumInputLength (decorated, $e, options) {
3916
+ this.minimumInputLength = options.get('minimumInputLength');
3917
+
3918
+ decorated.call(this, $e, options);
3919
+ }
3920
+
3921
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
3922
+ params.term = params.term || '';
3923
+
3924
+ if (params.term.length < this.minimumInputLength) {
3925
+ this.trigger('results:message', {
3926
+ message: 'inputTooShort',
3927
+ args: {
3928
+ minimum: this.minimumInputLength,
3929
+ input: params.term,
3930
+ params: params
3931
+ }
3932
+ });
3933
+
3934
+ return;
3935
+ }
3936
+
3937
+ decorated.call(this, params, callback);
3938
+ };
3939
+
3940
+ return MinimumInputLength;
3941
+ });
3942
+
3943
+ S2.define('select2/data/maximumInputLength',[
3944
+
3945
+ ], function () {
3946
+ function MaximumInputLength (decorated, $e, options) {
3947
+ this.maximumInputLength = options.get('maximumInputLength');
3948
+
3949
+ decorated.call(this, $e, options);
3950
+ }
3951
+
3952
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
3953
+ params.term = params.term || '';
3954
+
3955
+ if (this.maximumInputLength > 0 &&
3956
+ params.term.length > this.maximumInputLength) {
3957
+ this.trigger('results:message', {
3958
+ message: 'inputTooLong',
3959
+ args: {
3960
+ maximum: this.maximumInputLength,
3961
+ input: params.term,
3962
+ params: params
3963
+ }
3964
+ });
3965
+
3966
+ return;
3967
+ }
3968
+
3969
+ decorated.call(this, params, callback);
3970
+ };
3971
+
3972
+ return MaximumInputLength;
3973
+ });
3974
+
3975
+ S2.define('select2/data/maximumSelectionLength',[
3976
+
3977
+ ], function (){
3978
+ function MaximumSelectionLength (decorated, $e, options) {
3979
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
3980
+
3981
+ decorated.call(this, $e, options);
3982
+ }
3983
+
3984
+ MaximumSelectionLength.prototype.bind =
3985
+ function (decorated, container, $container) {
3986
+ var self = this;
3987
+
3988
+ decorated.call(this, container, $container);
3989
+
3990
+ container.on('select', function () {
3991
+ self._checkIfMaximumSelected();
3992
+ });
3993
+ };
3994
+
3995
+ MaximumSelectionLength.prototype.query =
3996
+ function (decorated, params, callback) {
3997
+ var self = this;
3998
+
3999
+ this._checkIfMaximumSelected(function () {
4000
+ decorated.call(self, params, callback);
4001
+ });
4002
+ };
4003
+
4004
+ MaximumSelectionLength.prototype._checkIfMaximumSelected =
4005
+ function (_, successCallback) {
4006
+ var self = this;
4007
+
4008
+ this.current(function (currentData) {
4009
+ var count = currentData != null ? currentData.length : 0;
4010
+ if (self.maximumSelectionLength > 0 &&
4011
+ count >= self.maximumSelectionLength) {
4012
+ self.trigger('results:message', {
4013
+ message: 'maximumSelected',
4014
+ args: {
4015
+ maximum: self.maximumSelectionLength
4016
+ }
4017
+ });
4018
+ return;
4019
+ }
4020
+
4021
+ if (successCallback) {
4022
+ successCallback();
4023
+ }
4024
+ });
4025
+ };
4026
+
4027
+ return MaximumSelectionLength;
4028
+ });
4029
+
4030
+ S2.define('select2/dropdown',[
4031
+ 'jquery',
4032
+ './utils'
4033
+ ], function ($, Utils) {
4034
+ function Dropdown ($element, options) {
4035
+ this.$element = $element;
4036
+ this.options = options;
4037
+
4038
+ Dropdown.__super__.constructor.call(this);
4039
+ }
4040
+
4041
+ Utils.Extend(Dropdown, Utils.Observable);
4042
+
4043
+ Dropdown.prototype.render = function () {
4044
+ var $dropdown = $(
4045
+ '<span class="select2-dropdown">' +
4046
+ '<span class="select2-results"></span>' +
4047
+ '</span>'
4048
+ );
4049
+
4050
+ $dropdown.attr('dir', this.options.get('dir'));
4051
+
4052
+ this.$dropdown = $dropdown;
4053
+
4054
+ return $dropdown;
4055
+ };
4056
+
4057
+ Dropdown.prototype.bind = function () {
4058
+ // Should be implemented in subclasses
4059
+ };
4060
+
4061
+ Dropdown.prototype.position = function ($dropdown, $container) {
4062
+ // Should be implemented in subclasses
4063
+ };
4064
+
4065
+ Dropdown.prototype.destroy = function () {
4066
+ // Remove the dropdown from the DOM
4067
+ this.$dropdown.remove();
4068
+ };
4069
+
4070
+ return Dropdown;
4071
+ });
4072
+
4073
+ S2.define('select2/dropdown/search',[
4074
+ 'jquery',
4075
+ '../utils'
4076
+ ], function ($, Utils) {
4077
+ function Search () { }
4078
+
4079
+ Search.prototype.render = function (decorated) {
4080
+ var $rendered = decorated.call(this);
4081
+
4082
+ var $search = $(
4083
+ '<span class="select2-search select2-search--dropdown">' +
4084
+ '<input class="select2-search__field" type="search" tabindex="-1"' +
4085
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
4086
+ ' spellcheck="false" role="searchbox" aria-autocomplete="list" />' +
4087
+ '</span>'
4088
+ );
4089
+
4090
+ this.$searchContainer = $search;
4091
+ this.$search = $search.find('input');
4092
+
4093
+ $rendered.prepend($search);
4094
+
4095
+ return $rendered;
4096
+ };
4097
+
4098
+ Search.prototype.bind = function (decorated, container, $container) {
4099
+ var self = this;
4100
+
4101
+ var resultsId = container.id + '-results';
4102
+
4103
+ decorated.call(this, container, $container);
4104
+
4105
+ this.$search.on('keydown', function (evt) {
4106
+ self.trigger('keypress', evt);
4107
+
4108
+ self._keyUpPrevented = evt.isDefaultPrevented();
4109
+ });
4110
+
4111
+ // Workaround for browsers which do not support the `input` event
4112
+ // This will prevent double-triggering of events for browsers which support
4113
+ // both the `keyup` and `input` events.
4114
+ this.$search.on('input', function (evt) {
4115
+ // Unbind the duplicated `keyup` event
4116
+ $(this).off('keyup');
4117
+ });
4118
+
4119
+ this.$search.on('keyup input', function (evt) {
4120
+ self.handleSearch(evt);
4121
+ });
4122
+
4123
+ container.on('open', function () {
4124
+ self.$search.attr('tabindex', 0);
4125
+ self.$search.attr('aria-controls', resultsId);
4126
+
4127
+ self.$search.trigger('focus');
4128
+
4129
+ window.setTimeout(function () {
4130
+ self.$search.trigger('focus');
4131
+ }, 0);
4132
+ });
4133
+
4134
+ container.on('close', function () {
4135
+ self.$search.attr('tabindex', -1);
4136
+ self.$search.removeAttr('aria-controls');
4137
+ self.$search.removeAttr('aria-activedescendant');
4138
+
4139
+ self.$search.val('');
4140
+ self.$search.trigger('blur');
4141
+ });
4142
+
4143
+ container.on('focus', function () {
4144
+ if (!container.isOpen()) {
4145
+ self.$search.trigger('focus');
4146
+ }
4147
+ });
4148
+
4149
+ container.on('results:all', function (params) {
4150
+ if (params.query.term == null || params.query.term === '') {
4151
+ var showSearch = self.showSearch(params);
4152
+
4153
+ if (showSearch) {
4154
+ self.$searchContainer.removeClass('select2-search--hide');
4155
+ } else {
4156
+ self.$searchContainer.addClass('select2-search--hide');
4157
+ }
4158
+ }
4159
+ });
4160
+
4161
+ container.on('results:focus', function (params) {
4162
+ if (params.data._resultId) {
4163
+ self.$search.attr('aria-activedescendant', params.data._resultId);
4164
+ } else {
4165
+ self.$search.removeAttr('aria-activedescendant');
4166
+ }
4167
+ });
4168
+ };
4169
+
4170
+ Search.prototype.handleSearch = function (evt) {
4171
+ if (!this._keyUpPrevented) {
4172
+ var input = this.$search.val();
4173
+
4174
+ this.trigger('query', {
4175
+ term: input
4176
+ });
4177
+ }
4178
+
4179
+ this._keyUpPrevented = false;
4180
+ };
4181
+
4182
+ Search.prototype.showSearch = function (_, params) {
4183
+ return true;
4184
+ };
4185
+
4186
+ return Search;
4187
+ });
4188
+
4189
+ S2.define('select2/dropdown/hidePlaceholder',[
4190
+
4191
+ ], function () {
4192
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
4193
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4194
+
4195
+ decorated.call(this, $element, options, dataAdapter);
4196
+ }
4197
+
4198
+ HidePlaceholder.prototype.append = function (decorated, data) {
4199
+ data.results = this.removePlaceholder(data.results);
4200
+
4201
+ decorated.call(this, data);
4202
+ };
4203
+
4204
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
4205
+ if (typeof placeholder === 'string') {
4206
+ placeholder = {
4207
+ id: '',
4208
+ text: placeholder
4209
+ };
4210
+ }
4211
+
4212
+ return placeholder;
4213
+ };
4214
+
4215
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4216
+ var modifiedData = data.slice(0);
4217
+
4218
+ for (var d = data.length - 1; d >= 0; d--) {
4219
+ var item = data[d];
4220
+
4221
+ if (this.placeholder.id === item.id) {
4222
+ modifiedData.splice(d, 1);
4223
+ }
4224
+ }
4225
+
4226
+ return modifiedData;
4227
+ };
4228
+
4229
+ return HidePlaceholder;
4230
+ });
4231
+
4232
+ S2.define('select2/dropdown/infiniteScroll',[
4233
+ 'jquery'
4234
+ ], function ($) {
4235
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
4236
+ this.lastParams = {};
4237
+
4238
+ decorated.call(this, $element, options, dataAdapter);
4239
+
4240
+ this.$loadingMore = this.createLoadingMore();
4241
+ this.loading = false;
4242
+ }
4243
+
4244
+ InfiniteScroll.prototype.append = function (decorated, data) {
4245
+ this.$loadingMore.remove();
4246
+ this.loading = false;
4247
+
4248
+ decorated.call(this, data);
4249
+
4250
+ if (this.showLoadingMore(data)) {
4251
+ this.$results.append(this.$loadingMore);
4252
+ this.loadMoreIfNeeded();
4253
+ }
4254
+ };
4255
+
4256
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4257
+ var self = this;
4258
+
4259
+ decorated.call(this, container, $container);
4260
+
4261
+ container.on('query', function (params) {
4262
+ self.lastParams = params;
4263
+ self.loading = true;
4264
+ });
4265
+
4266
+ container.on('query:append', function (params) {
4267
+ self.lastParams = params;
4268
+ self.loading = true;
4269
+ });
4270
+
4271
+ this.$results.on('scroll', this.loadMoreIfNeeded.bind(this));
4272
+ };
4273
+
4274
+ InfiniteScroll.prototype.loadMoreIfNeeded = function () {
4275
+ var isLoadMoreVisible = $.contains(
4276
+ document.documentElement,
4277
+ this.$loadingMore[0]
4278
+ );
4279
+
4280
+ if (this.loading || !isLoadMoreVisible) {
4281
+ return;
4282
+ }
4283
+
4284
+ var currentOffset = this.$results.offset().top +
4285
+ this.$results.outerHeight(false);
4286
+ var loadingMoreOffset = this.$loadingMore.offset().top +
4287
+ this.$loadingMore.outerHeight(false);
4288
+
4289
+ if (currentOffset + 50 >= loadingMoreOffset) {
4290
+ this.loadMore();
4291
+ }
4292
+ };
4293
+
4294
+ InfiniteScroll.prototype.loadMore = function () {
4295
+ this.loading = true;
4296
+
4297
+ var params = $.extend({}, {page: 1}, this.lastParams);
4298
+
4299
+ params.page++;
4300
+
4301
+ this.trigger('query:append', params);
4302
+ };
4303
+
4304
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4305
+ return data.pagination && data.pagination.more;
4306
+ };
4307
+
4308
+ InfiniteScroll.prototype.createLoadingMore = function () {
4309
+ var $option = $(
4310
+ '<li ' +
4311
+ 'class="select2-results__option select2-results__option--load-more"' +
4312
+ 'role="option" aria-disabled="true"></li>'
4313
+ );
4314
+
4315
+ var message = this.options.get('translations').get('loadingMore');
4316
+
4317
+ $option.html(message(this.lastParams));
4318
+
4319
+ return $option;
4320
+ };
4321
+
4322
+ return InfiniteScroll;
4323
+ });
4324
+
4325
+ S2.define('select2/dropdown/attachBody',[
4326
+ 'jquery',
4327
+ '../utils'
4328
+ ], function ($, Utils) {
4329
+ function AttachBody (decorated, $element, options) {
4330
+ this.$dropdownParent = $(options.get('dropdownParent') || document.body);
4331
+
4332
+ decorated.call(this, $element, options);
4333
+ }
4334
+
4335
+ AttachBody.prototype.bind = function (decorated, container, $container) {
4336
+ var self = this;
4337
+
4338
+ decorated.call(this, container, $container);
4339
+
4340
+ container.on('open', function () {
4341
+ self._showDropdown();
4342
+ self._attachPositioningHandler(container);
4343
+
4344
+ // Must bind after the results handlers to ensure correct sizing
4345
+ self._bindContainerResultHandlers(container);
4346
+ });
4347
+
4348
+ container.on('close', function () {
4349
+ self._hideDropdown();
4350
+ self._detachPositioningHandler(container);
4351
+ });
4352
+
4353
+ this.$dropdownContainer.on('mousedown', function (evt) {
4354
+ evt.stopPropagation();
4355
+ });
4356
+ };
4357
+
4358
+ AttachBody.prototype.destroy = function (decorated) {
4359
+ decorated.call(this);
4360
+
4361
+ this.$dropdownContainer.remove();
4362
+ };
4363
+
4364
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4365
+ // Clone all of the container classes
4366
+ $dropdown.attr('class', $container.attr('class'));
4367
+
4368
+ $dropdown.removeClass('select2');
4369
+ $dropdown.addClass('select2-container--open');
4370
+
4371
+ $dropdown.css({
4372
+ position: 'absolute',
4373
+ top: -999999
4374
+ });
4375
+
4376
+ this.$container = $container;
4377
+ };
4378
+
4379
+ AttachBody.prototype.render = function (decorated) {
4380
+ var $container = $('<span></span>');
4381
+
4382
+ var $dropdown = decorated.call(this);
4383
+ $container.append($dropdown);
4384
+
4385
+ this.$dropdownContainer = $container;
4386
+
4387
+ return $container;
4388
+ };
4389
+
4390
+ AttachBody.prototype._hideDropdown = function (decorated) {
4391
+ this.$dropdownContainer.detach();
4392
+ };
4393
+
4394
+ AttachBody.prototype._bindContainerResultHandlers =
4395
+ function (decorated, container) {
4396
+
4397
+ // These should only be bound once
4398
+ if (this._containerResultsHandlersBound) {
4399
+ return;
4400
+ }
4401
+
4402
+ var self = this;
4403
+
4404
+ container.on('results:all', function () {
4405
+ self._positionDropdown();
4406
+ self._resizeDropdown();
4407
+ });
4408
+
4409
+ container.on('results:append', function () {
4410
+ self._positionDropdown();
4411
+ self._resizeDropdown();
4412
+ });
4413
+
4414
+ container.on('results:message', function () {
4415
+ self._positionDropdown();
4416
+ self._resizeDropdown();
4417
+ });
4418
+
4419
+ container.on('select', function () {
4420
+ self._positionDropdown();
4421
+ self._resizeDropdown();
4422
+ });
4423
+
4424
+ container.on('unselect', function () {
4425
+ self._positionDropdown();
4426
+ self._resizeDropdown();
4427
+ });
4428
+
4429
+ this._containerResultsHandlersBound = true;
4430
+ };
4431
+
4432
+ AttachBody.prototype._attachPositioningHandler =
4433
+ function (decorated, container) {
4434
+ var self = this;
4435
+
4436
+ var scrollEvent = 'scroll.select2.' + container.id;
4437
+ var resizeEvent = 'resize.select2.' + container.id;
4438
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4439
+
4440
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4441
+ $watchers.each(function () {
4442
+ Utils.StoreData(this, 'select2-scroll-position', {
4443
+ x: $(this).scrollLeft(),
4444
+ y: $(this).scrollTop()
4445
+ });
4446
+ });
4447
+
4448
+ $watchers.on(scrollEvent, function (ev) {
4449
+ var position = Utils.GetData(this, 'select2-scroll-position');
4450
+ $(this).scrollTop(position.y);
4451
+ });
4452
+
4453
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4454
+ function (e) {
4455
+ self._positionDropdown();
4456
+ self._resizeDropdown();
4457
+ });
4458
+ };
4459
+
4460
+ AttachBody.prototype._detachPositioningHandler =
4461
+ function (decorated, container) {
4462
+ var scrollEvent = 'scroll.select2.' + container.id;
4463
+ var resizeEvent = 'resize.select2.' + container.id;
4464
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4465
+
4466
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4467
+ $watchers.off(scrollEvent);
4468
+
4469
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4470
+ };
4471
+
4472
+ AttachBody.prototype._positionDropdown = function () {
4473
+ var $window = $(window);
4474
+
4475
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4476
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
4477
+
4478
+ var newDirection = null;
4479
+
4480
+ var offset = this.$container.offset();
4481
+
4482
+ offset.bottom = offset.top + this.$container.outerHeight(false);
4483
+
4484
+ var container = {
4485
+ height: this.$container.outerHeight(false)
4486
+ };
4487
+
4488
+ container.top = offset.top;
4489
+ container.bottom = offset.top + container.height;
4490
+
4491
+ var dropdown = {
4492
+ height: this.$dropdown.outerHeight(false)
4493
+ };
4494
+
4495
+ var viewport = {
4496
+ top: $window.scrollTop(),
4497
+ bottom: $window.scrollTop() + $window.height()
4498
+ };
4499
+
4500
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4501
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
4502
+
4503
+ var css = {
4504
+ left: offset.left,
4505
+ top: container.bottom
4506
+ };
4507
+
4508
+ // Determine what the parent element is to use for calculating the offset
4509
+ var $offsetParent = this.$dropdownParent;
4510
+
4511
+ // For statically positioned elements, we need to get the element
4512
+ // that is determining the offset
4513
+ if ($offsetParent.css('position') === 'static') {
4514
+ $offsetParent = $offsetParent.offsetParent();
4515
+ }
4516
+
4517
+ var parentOffset = {
4518
+ top: 0,
4519
+ left: 0
4520
+ };
4521
+
4522
+ if (
4523
+ $.contains(document.body, $offsetParent[0]) ||
4524
+ $offsetParent[0].isConnected
4525
+ ) {
4526
+ parentOffset = $offsetParent.offset();
4527
+ }
4528
+
4529
+ css.top -= parentOffset.top;
4530
+ css.left -= parentOffset.left;
4531
+
4532
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
4533
+ newDirection = 'below';
4534
+ }
4535
+
4536
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4537
+ newDirection = 'above';
4538
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4539
+ newDirection = 'below';
4540
+ }
4541
+
4542
+ if (newDirection == 'above' ||
4543
+ (isCurrentlyAbove && newDirection !== 'below')) {
4544
+ css.top = container.top - parentOffset.top - dropdown.height;
4545
+ }
4546
+
4547
+ if (newDirection != null) {
4548
+ this.$dropdown
4549
+ .removeClass('select2-dropdown--below select2-dropdown--above')
4550
+ .addClass('select2-dropdown--' + newDirection);
4551
+ this.$container
4552
+ .removeClass('select2-container--below select2-container--above')
4553
+ .addClass('select2-container--' + newDirection);
4554
+ }
4555
+
4556
+ this.$dropdownContainer.css(css);
4557
+ };
4558
+
4559
+ AttachBody.prototype._resizeDropdown = function () {
4560
+ var css = {
4561
+ width: this.$container.outerWidth(false) + 'px'
4562
+ };
4563
+
4564
+ if (this.options.get('dropdownAutoWidth')) {
4565
+ css.minWidth = css.width;
4566
+ css.position = 'relative';
4567
+ css.width = 'auto';
4568
+ }
4569
+
4570
+ this.$dropdown.css(css);
4571
+ };
4572
+
4573
+ AttachBody.prototype._showDropdown = function (decorated) {
4574
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
4575
+
4576
+ this._positionDropdown();
4577
+ this._resizeDropdown();
4578
+ };
4579
+
4580
+ return AttachBody;
4581
+ });
4582
+
4583
+ S2.define('select2/dropdown/minimumResultsForSearch',[
4584
+
4585
+ ], function () {
4586
+ function countResults (data) {
4587
+ var count = 0;
4588
+
4589
+ for (var d = 0; d < data.length; d++) {
4590
+ var item = data[d];
4591
+
4592
+ if (item.children) {
4593
+ count += countResults(item.children);
4594
+ } else {
4595
+ count++;
4596
+ }
4597
+ }
4598
+
4599
+ return count;
4600
+ }
4601
+
4602
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4603
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
4604
+
4605
+ if (this.minimumResultsForSearch < 0) {
4606
+ this.minimumResultsForSearch = Infinity;
4607
+ }
4608
+
4609
+ decorated.call(this, $element, options, dataAdapter);
4610
+ }
4611
+
4612
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4613
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
4614
+ return false;
4615
+ }
4616
+
4617
+ return decorated.call(this, params);
4618
+ };
4619
+
4620
+ return MinimumResultsForSearch;
4621
+ });
4622
+
4623
+ S2.define('select2/dropdown/selectOnClose',[
4624
+ '../utils'
4625
+ ], function (Utils) {
4626
+ function SelectOnClose () { }
4627
+
4628
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
4629
+ var self = this;
4630
+
4631
+ decorated.call(this, container, $container);
4632
+
4633
+ container.on('close', function (params) {
4634
+ self._handleSelectOnClose(params);
4635
+ });
4636
+ };
4637
+
4638
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4639
+ if (params && params.originalSelect2Event != null) {
4640
+ var event = params.originalSelect2Event;
4641
+
4642
+ // Don't select an item if the close event was triggered from a select or
4643
+ // unselect event
4644
+ if (event._type === 'select' || event._type === 'unselect') {
4645
+ return;
4646
+ }
4647
+ }
4648
+
4649
+ var $highlightedResults = this.getHighlightedResults();
4650
+
4651
+ // Only select highlighted results
4652
+ if ($highlightedResults.length < 1) {
4653
+ return;
4654
+ }
4655
+
4656
+ var data = Utils.GetData($highlightedResults[0], 'data');
4657
+
4658
+ // Don't re-select already selected resulte
4659
+ if (
4660
+ (data.element != null && data.element.selected) ||
4661
+ (data.element == null && data.selected)
4662
+ ) {
4663
+ return;
4664
+ }
4665
+
4666
+ this.trigger('select', {
4667
+ data: data
4668
+ });
4669
+ };
4670
+
4671
+ return SelectOnClose;
4672
+ });
4673
+
4674
+ S2.define('select2/dropdown/closeOnSelect',[
4675
+
4676
+ ], function () {
4677
+ function CloseOnSelect () { }
4678
+
4679
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4680
+ var self = this;
4681
+
4682
+ decorated.call(this, container, $container);
4683
+
4684
+ container.on('select', function (evt) {
4685
+ self._selectTriggered(evt);
4686
+ });
4687
+
4688
+ container.on('unselect', function (evt) {
4689
+ self._selectTriggered(evt);
4690
+ });
4691
+ };
4692
+
4693
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4694
+ var originalEvent = evt.originalEvent;
4695
+
4696
+ // Don't close if the control key is being held
4697
+ if (originalEvent && (originalEvent.ctrlKey || originalEvent.metaKey)) {
4698
+ return;
4699
+ }
4700
+
4701
+ this.trigger('close', {
4702
+ originalEvent: originalEvent,
4703
+ originalSelect2Event: evt
4704
+ });
4705
+ };
4706
+
4707
+ return CloseOnSelect;
4708
+ });
4709
+
4710
+ S2.define('select2/i18n/en',[],function () {
4711
+ // English
4712
+ return {
4713
+ errorLoading: function () {
4714
+ return 'The results could not be loaded.';
4715
+ },
4716
+ inputTooLong: function (args) {
4717
+ var overChars = args.input.length - args.maximum;
4718
+
4719
+ var message = 'Please delete ' + overChars + ' character';
4720
+
4721
+ if (overChars != 1) {
4722
+ message += 's';
4723
+ }
4724
+
4725
+ return message;
4726
+ },
4727
+ inputTooShort: function (args) {
4728
+ var remainingChars = args.minimum - args.input.length;
4729
+
4730
+ var message = 'Please enter ' + remainingChars + ' or more characters';
4731
+
4732
+ return message;
4733
+ },
4734
+ loadingMore: function () {
4735
+ return 'Loading more results…';
4736
+ },
4737
+ maximumSelected: function (args) {
4738
+ var message = 'You can only select ' + args.maximum + ' item';
4739
+
4740
+ if (args.maximum != 1) {
4741
+ message += 's';
4742
+ }
4743
+
4744
+ return message;
4745
+ },
4746
+ noResults: function () {
4747
+ return 'No results found';
4748
+ },
4749
+ searching: function () {
4750
+ return 'Searching…';
4751
+ },
4752
+ removeAllItems: function () {
4753
+ return 'Remove all items';
4754
+ }
4755
+ };
4756
+ });
4757
+
4758
+ S2.define('select2/defaults',[
4759
+ 'jquery',
4760
+ 'require',
4761
+
4762
+ './results',
4763
+
4764
+ './selection/single',
4765
+ './selection/multiple',
4766
+ './selection/placeholder',
4767
+ './selection/allowClear',
4768
+ './selection/search',
4769
+ './selection/eventRelay',
4770
+
4771
+ './utils',
4772
+ './translation',
4773
+ './diacritics',
4774
+
4775
+ './data/select',
4776
+ './data/array',
4777
+ './data/ajax',
4778
+ './data/tags',
4779
+ './data/tokenizer',
4780
+ './data/minimumInputLength',
4781
+ './data/maximumInputLength',
4782
+ './data/maximumSelectionLength',
4783
+
4784
+ './dropdown',
4785
+ './dropdown/search',
4786
+ './dropdown/hidePlaceholder',
4787
+ './dropdown/infiniteScroll',
4788
+ './dropdown/attachBody',
4789
+ './dropdown/minimumResultsForSearch',
4790
+ './dropdown/selectOnClose',
4791
+ './dropdown/closeOnSelect',
4792
+
4793
+ './i18n/en'
4794
+ ], function ($, require,
4795
+
4796
+ ResultsList,
4797
+
4798
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
4799
+ SelectionSearch, EventRelay,
4800
+
4801
+ Utils, Translation, DIACRITICS,
4802
+
4803
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4804
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4805
+
4806
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4807
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4808
+
4809
+ EnglishTranslation) {
4810
+ function Defaults () {
4811
+ this.reset();
4812
+ }
4813
+
4814
+ Defaults.prototype.apply = function (options) {
4815
+ options = $.extend(true, {}, this.defaults, options);
4816
+
4817
+ if (options.dataAdapter == null) {
4818
+ if (options.ajax != null) {
4819
+ options.dataAdapter = AjaxData;
4820
+ } else if (options.data != null) {
4821
+ options.dataAdapter = ArrayData;
4822
+ } else {
4823
+ options.dataAdapter = SelectData;
4824
+ }
4825
+
4826
+ if (options.minimumInputLength > 0) {
4827
+ options.dataAdapter = Utils.Decorate(
4828
+ options.dataAdapter,
4829
+ MinimumInputLength
4830
+ );
4831
+ }
4832
+
4833
+ if (options.maximumInputLength > 0) {
4834
+ options.dataAdapter = Utils.Decorate(
4835
+ options.dataAdapter,
4836
+ MaximumInputLength
4837
+ );
4838
+ }
4839
+
4840
+ if (options.maximumSelectionLength > 0) {
4841
+ options.dataAdapter = Utils.Decorate(
4842
+ options.dataAdapter,
4843
+ MaximumSelectionLength
4844
+ );
4845
+ }
4846
+
4847
+ if (options.tags) {
4848
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4849
+ }
4850
+
4851
+ if (options.tokenSeparators != null || options.tokenizer != null) {
4852
+ options.dataAdapter = Utils.Decorate(
4853
+ options.dataAdapter,
4854
+ Tokenizer
4855
+ );
4856
+ }
4857
+
4858
+ if (options.query != null) {
4859
+ var Query = require(options.amdBase + 'compat/query');
4860
+
4861
+ options.dataAdapter = Utils.Decorate(
4862
+ options.dataAdapter,
4863
+ Query
4864
+ );
4865
+ }
4866
+
4867
+ if (options.initSelection != null) {
4868
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
4869
+
4870
+ options.dataAdapter = Utils.Decorate(
4871
+ options.dataAdapter,
4872
+ InitSelection
4873
+ );
4874
+ }
4875
+ }
4876
+
4877
+ if (options.resultsAdapter == null) {
4878
+ options.resultsAdapter = ResultsList;
4879
+
4880
+ if (options.ajax != null) {
4881
+ options.resultsAdapter = Utils.Decorate(
4882
+ options.resultsAdapter,
4883
+ InfiniteScroll
4884
+ );
4885
+ }
4886
+
4887
+ if (options.placeholder != null) {
4888
+ options.resultsAdapter = Utils.Decorate(
4889
+ options.resultsAdapter,
4890
+ HidePlaceholder
4891
+ );
4892
+ }
4893
+
4894
+ if (options.selectOnClose) {
4895
+ options.resultsAdapter = Utils.Decorate(
4896
+ options.resultsAdapter,
4897
+ SelectOnClose
4898
+ );
4899
+ }
4900
+ }
4901
+
4902
+ if (options.dropdownAdapter == null) {
4903
+ if (options.multiple) {
4904
+ options.dropdownAdapter = Dropdown;
4905
+ } else {
4906
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4907
+
4908
+ options.dropdownAdapter = SearchableDropdown;
4909
+ }
4910
+
4911
+ if (options.minimumResultsForSearch !== 0) {
4912
+ options.dropdownAdapter = Utils.Decorate(
4913
+ options.dropdownAdapter,
4914
+ MinimumResultsForSearch
4915
+ );
4916
+ }
4917
+
4918
+ if (options.closeOnSelect) {
4919
+ options.dropdownAdapter = Utils.Decorate(
4920
+ options.dropdownAdapter,
4921
+ CloseOnSelect
4922
+ );
4923
+ }
4924
+
4925
+ if (
4926
+ options.dropdownCssClass != null ||
4927
+ options.dropdownCss != null ||
4928
+ options.adaptDropdownCssClass != null
4929
+ ) {
4930
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4931
+
4932
+ options.dropdownAdapter = Utils.Decorate(
4933
+ options.dropdownAdapter,
4934
+ DropdownCSS
4935
+ );
4936
+ }
4937
+
4938
+ options.dropdownAdapter = Utils.Decorate(
4939
+ options.dropdownAdapter,
4940
+ AttachBody
4941
+ );
4942
+ }
4943
+
4944
+ if (options.selectionAdapter == null) {
4945
+ if (options.multiple) {
4946
+ options.selectionAdapter = MultipleSelection;
4947
+ } else {
4948
+ options.selectionAdapter = SingleSelection;
4949
+ }
4950
+
4951
+ // Add the placeholder mixin if a placeholder was specified
4952
+ if (options.placeholder != null) {
4953
+ options.selectionAdapter = Utils.Decorate(
4954
+ options.selectionAdapter,
4955
+ Placeholder
4956
+ );
4957
+ }
4958
+
4959
+ if (options.allowClear) {
4960
+ options.selectionAdapter = Utils.Decorate(
4961
+ options.selectionAdapter,
4962
+ AllowClear
4963
+ );
4964
+ }
4965
+
4966
+ if (options.multiple) {
4967
+ options.selectionAdapter = Utils.Decorate(
4968
+ options.selectionAdapter,
4969
+ SelectionSearch
4970
+ );
4971
+ }
4972
+
4973
+ if (
4974
+ options.containerCssClass != null ||
4975
+ options.containerCss != null ||
4976
+ options.adaptContainerCssClass != null
4977
+ ) {
4978
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4979
+
4980
+ options.selectionAdapter = Utils.Decorate(
4981
+ options.selectionAdapter,
4982
+ ContainerCSS
4983
+ );
4984
+ }
4985
+
4986
+ options.selectionAdapter = Utils.Decorate(
4987
+ options.selectionAdapter,
4988
+ EventRelay
4989
+ );
4990
+ }
4991
+
4992
+ // If the defaults were not previously applied from an element, it is
4993
+ // possible for the language option to have not been resolved
4994
+ options.language = this._resolveLanguage(options.language);
4995
+
4996
+ // Always fall back to English since it will always be complete
4997
+ options.language.push('en');
4998
+
4999
+ var uniqueLanguages = [];
5000
+
5001
+ for (var l = 0; l < options.language.length; l++) {
5002
+ var language = options.language[l];
5003
+
5004
+ if (uniqueLanguages.indexOf(language) === -1) {
5005
+ uniqueLanguages.push(language);
5006
+ }
5007
+ }
5008
+
5009
+ options.language = uniqueLanguages;
5010
+
5011
+ options.translations = this._processTranslations(
5012
+ options.language,
5013
+ options.debug
5014
+ );
5015
+
5016
+ return options;
5017
+ };
5018
+
5019
+ Defaults.prototype.reset = function () {
5020
+ function stripDiacritics (text) {
5021
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
5022
+ function match(a) {
5023
+ return DIACRITICS[a] || a;
5024
+ }
5025
+
5026
+ return text.replace(/[^\u0000-\u007E]/g, match);
5027
+ }
5028
+
5029
+ function matcher (params, data) {
5030
+ // Always return the object if there is nothing to compare
5031
+ if ($.trim(params.term) === '') {
5032
+ return data;
5033
+ }
5034
+
5035
+ // Do a recursive check for options with children
5036
+ if (data.children && data.children.length > 0) {
5037
+ // Clone the data object if there are children
5038
+ // This is required as we modify the object to remove any non-matches
5039
+ var match = $.extend(true, {}, data);
5040
+
5041
+ // Check each child of the option
5042
+ for (var c = data.children.length - 1; c >= 0; c--) {
5043
+ var child = data.children[c];
5044
+
5045
+ var matches = matcher(params, child);
5046
+
5047
+ // If there wasn't a match, remove the object in the array
5048
+ if (matches == null) {
5049
+ match.children.splice(c, 1);
5050
+ }
5051
+ }
5052
+
5053
+ // If any children matched, return the new object
5054
+ if (match.children.length > 0) {
5055
+ return match;
5056
+ }
5057
+
5058
+ // If there were no matching children, check just the plain object
5059
+ return matcher(params, match);
5060
+ }
5061
+
5062
+ var original = stripDiacritics(data.text).toUpperCase();
5063
+ var term = stripDiacritics(params.term).toUpperCase();
5064
+
5065
+ // Check if the text contains the term
5066
+ if (original.indexOf(term) > -1) {
5067
+ return data;
5068
+ }
5069
+
5070
+ // If it doesn't contain the term, don't return anything
5071
+ return null;
5072
+ }
5073
+
5074
+ this.defaults = {
5075
+ amdBase: './',
5076
+ amdLanguageBase: './i18n/',
5077
+ closeOnSelect: true,
5078
+ debug: false,
5079
+ dropdownAutoWidth: false,
5080
+ escapeMarkup: Utils.escapeMarkup,
5081
+ language: {},
5082
+ matcher: matcher,
5083
+ minimumInputLength: 0,
5084
+ maximumInputLength: 0,
5085
+ maximumSelectionLength: 0,
5086
+ minimumResultsForSearch: 0,
5087
+ selectOnClose: false,
5088
+ scrollAfterSelect: false,
5089
+ sorter: function (data) {
5090
+ return data;
5091
+ },
5092
+ templateResult: function (result) {
5093
+ return result.text;
5094
+ },
5095
+ templateSelection: function (selection) {
5096
+ return selection.text;
5097
+ },
5098
+ theme: 'default',
5099
+ width: 'resolve'
5100
+ };
5101
+ };
5102
+
5103
+ Defaults.prototype.applyFromElement = function (options, $element) {
5104
+ var optionLanguage = options.language;
5105
+ var defaultLanguage = this.defaults.language;
5106
+ var elementLanguage = $element.prop('lang');
5107
+ var parentLanguage = $element.closest('[lang]').prop('lang');
5108
+
5109
+ var languages = Array.prototype.concat.call(
5110
+ this._resolveLanguage(elementLanguage),
5111
+ this._resolveLanguage(optionLanguage),
5112
+ this._resolveLanguage(defaultLanguage),
5113
+ this._resolveLanguage(parentLanguage)
5114
+ );
5115
+
5116
+ options.language = languages;
5117
+
5118
+ return options;
5119
+ };
5120
+
5121
+ Defaults.prototype._resolveLanguage = function (language) {
5122
+ if (!language) {
5123
+ return [];
5124
+ }
5125
+
5126
+ if ($.isEmptyObject(language)) {
5127
+ return [];
5128
+ }
5129
+
5130
+ if ($.isPlainObject(language)) {
5131
+ return [language];
5132
+ }
5133
+
5134
+ var languages;
5135
+
5136
+ if (!$.isArray(language)) {
5137
+ languages = [language];
5138
+ } else {
5139
+ languages = language;
5140
+ }
5141
+
5142
+ var resolvedLanguages = [];
5143
+
5144
+ for (var l = 0; l < languages.length; l++) {
5145
+ resolvedLanguages.push(languages[l]);
5146
+
5147
+ if (typeof languages[l] === 'string' && languages[l].indexOf('-') > 0) {
5148
+ // Extract the region information if it is included
5149
+ var languageParts = languages[l].split('-');
5150
+ var baseLanguage = languageParts[0];
5151
+
5152
+ resolvedLanguages.push(baseLanguage);
5153
+ }
5154
+ }
5155
+
5156
+ return resolvedLanguages;
5157
+ };
5158
+
5159
+ Defaults.prototype._processTranslations = function (languages, debug) {
5160
+ var translations = new Translation();
5161
+
5162
+ for (var l = 0; l < languages.length; l++) {
5163
+ var languageData = new Translation();
5164
+
5165
+ var language = languages[l];
5166
+
5167
+ if (typeof language === 'string') {
5168
+ try {
5169
+ // Try to load it with the original name
5170
+ languageData = Translation.loadPath(language);
5171
+ } catch (e) {
5172
+ try {
5173
+ // If we couldn't load it, check if it wasn't the full path
5174
+ language = this.defaults.amdLanguageBase + language;
5175
+ languageData = Translation.loadPath(language);
5176
+ } catch (ex) {
5177
+ // The translation could not be loaded at all. Sometimes this is
5178
+ // because of a configuration problem, other times this can be
5179
+ // because of how Select2 helps load all possible translation files
5180
+ if (debug && window.console && console.warn) {
5181
+ console.warn(
5182
+ 'Select2: The language file for "' + language + '" could ' +
5183
+ 'not be automatically loaded. A fallback will be used instead.'
5184
+ );
5185
+ }
5186
+ }
5187
+ }
5188
+ } else if ($.isPlainObject(language)) {
5189
+ languageData = new Translation(language);
5190
+ } else {
5191
+ languageData = language;
5192
+ }
5193
+
5194
+ translations.extend(languageData);
5195
+ }
5196
+
5197
+ return translations;
5198
+ };
5199
+
5200
+ Defaults.prototype.set = function (key, value) {
5201
+ var camelKey = $.camelCase(key);
5202
+
5203
+ var data = {};
5204
+ data[camelKey] = value;
5205
+
5206
+ var convertedData = Utils._convertData(data);
5207
+
5208
+ $.extend(true, this.defaults, convertedData);
5209
+ };
5210
+
5211
+ var defaults = new Defaults();
5212
+
5213
+ return defaults;
5214
+ });
5215
+
5216
+ S2.define('select2/options',[
5217
+ 'require',
5218
+ 'jquery',
5219
+ './defaults',
5220
+ './utils'
5221
+ ], function (require, $, Defaults, Utils) {
5222
+ function Options (options, $element) {
5223
+ this.options = options;
5224
+
5225
+ if ($element != null) {
5226
+ this.fromElement($element);
5227
+ }
5228
+
5229
+ if ($element != null) {
5230
+ this.options = Defaults.applyFromElement(this.options, $element);
5231
+ }
5232
+
5233
+ this.options = Defaults.apply(this.options);
5234
+
5235
+ if ($element && $element.is('input')) {
5236
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
5237
+
5238
+ this.options.dataAdapter = Utils.Decorate(
5239
+ this.options.dataAdapter,
5240
+ InputCompat
5241
+ );
5242
+ }
5243
+ }
5244
+
5245
+ Options.prototype.fromElement = function ($e) {
5246
+ var excludedData = ['select2'];
5247
+
5248
+ if (this.options.multiple == null) {
5249
+ this.options.multiple = $e.prop('multiple');
5250
+ }
5251
+
5252
+ if (this.options.disabled == null) {
5253
+ this.options.disabled = $e.prop('disabled');
5254
+ }
5255
+
5256
+ if (this.options.dir == null) {
5257
+ if ($e.prop('dir')) {
5258
+ this.options.dir = $e.prop('dir');
5259
+ } else if ($e.closest('[dir]').prop('dir')) {
5260
+ this.options.dir = $e.closest('[dir]').prop('dir');
5261
+ } else {
5262
+ this.options.dir = 'ltr';
5263
+ }
5264
+ }
5265
+
5266
+ $e.prop('disabled', this.options.disabled);
5267
+ $e.prop('multiple', this.options.multiple);
5268
+
5269
+ if (Utils.GetData($e[0], 'select2Tags')) {
5270
+ if (this.options.debug && window.console && console.warn) {
5271
+ console.warn(
5272
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
5273
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
5274
+ 'removed in future versions of Select2.'
5275
+ );
5276
+ }
5277
+
5278
+ Utils.StoreData($e[0], 'data', Utils.GetData($e[0], 'select2Tags'));
5279
+ Utils.StoreData($e[0], 'tags', true);
5280
+ }
5281
+
5282
+ if (Utils.GetData($e[0], 'ajaxUrl')) {
5283
+ if (this.options.debug && window.console && console.warn) {
5284
+ console.warn(
5285
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
5286
+ '`data-ajax--url` and support for the old attribute will be removed' +
5287
+ ' in future versions of Select2.'
5288
+ );
5289
+ }
5290
+
5291
+ $e.attr('ajax--url', Utils.GetData($e[0], 'ajaxUrl'));
5292
+ Utils.StoreData($e[0], 'ajax-Url', Utils.GetData($e[0], 'ajaxUrl'));
5293
+ }
5294
+
5295
+ var dataset = {};
5296
+
5297
+ function upperCaseLetter(_, letter) {
5298
+ return letter.toUpperCase();
5299
+ }
5300
+
5301
+ // Pre-load all of the attributes which are prefixed with `data-`
5302
+ for (var attr = 0; attr < $e[0].attributes.length; attr++) {
5303
+ var attributeName = $e[0].attributes[attr].name;
5304
+ var prefix = 'data-';
5305
+
5306
+ if (attributeName.substr(0, prefix.length) == prefix) {
5307
+ // Get the contents of the attribute after `data-`
5308
+ var dataName = attributeName.substring(prefix.length);
5309
+
5310
+ // Get the data contents from the consistent source
5311
+ // This is more than likely the jQuery data helper
5312
+ var dataValue = Utils.GetData($e[0], dataName);
5313
+
5314
+ // camelCase the attribute name to match the spec
5315
+ var camelDataName = dataName.replace(/-([a-z])/g, upperCaseLetter);
5316
+
5317
+ // Store the data attribute contents into the dataset since
5318
+ dataset[camelDataName] = dataValue;
5319
+ }
5320
+ }
5321
+
5322
+ // Prefer the element's `dataset` attribute if it exists
5323
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
5324
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
5325
+ dataset = $.extend(true, {}, $e[0].dataset, dataset);
5326
+ }
5327
+
5328
+ // Prefer our internal data cache if it exists
5329
+ var data = $.extend(true, {}, Utils.GetData($e[0]), dataset);
5330
+
5331
+ data = Utils._convertData(data);
5332
+
5333
+ for (var key in data) {
5334
+ if ($.inArray(key, excludedData) > -1) {
5335
+ continue;
5336
+ }
5337
+
5338
+ if ($.isPlainObject(this.options[key])) {
5339
+ $.extend(this.options[key], data[key]);
5340
+ } else {
5341
+ this.options[key] = data[key];
5342
+ }
5343
+ }
5344
+
5345
+ return this;
5346
+ };
5347
+
5348
+ Options.prototype.get = function (key) {
5349
+ return this.options[key];
5350
+ };
5351
+
5352
+ Options.prototype.set = function (key, val) {
5353
+ this.options[key] = val;
5354
+ };
5355
+
5356
+ return Options;
5357
+ });
5358
+
5359
+ S2.define('select2/core',[
5360
+ 'jquery',
5361
+ './options',
5362
+ './utils',
5363
+ './keys'
5364
+ ], function ($, Options, Utils, KEYS) {
5365
+ var Select2 = function ($element, options) {
5366
+ if (Utils.GetData($element[0], 'select2') != null) {
5367
+ Utils.GetData($element[0], 'select2').destroy();
5368
+ }
5369
+
5370
+ this.$element = $element;
5371
+
5372
+ this.id = this._generateId($element);
5373
+
5374
+ options = options || {};
5375
+
5376
+ this.options = new Options(options, $element);
5377
+
5378
+ Select2.__super__.constructor.call(this);
5379
+
5380
+ // Set up the tabindex
5381
+
5382
+ var tabindex = $element.attr('tabindex') || 0;
5383
+ Utils.StoreData($element[0], 'old-tabindex', tabindex);
5384
+ $element.attr('tabindex', '-1');
5385
+
5386
+ // Set up containers and adapters
5387
+
5388
+ var DataAdapter = this.options.get('dataAdapter');
5389
+ this.dataAdapter = new DataAdapter($element, this.options);
5390
+
5391
+ var $container = this.render();
5392
+
5393
+ this._placeContainer($container);
5394
+
5395
+ var SelectionAdapter = this.options.get('selectionAdapter');
5396
+ this.selection = new SelectionAdapter($element, this.options);
5397
+ this.$selection = this.selection.render();
5398
+
5399
+ this.selection.position(this.$selection, $container);
5400
+
5401
+ var DropdownAdapter = this.options.get('dropdownAdapter');
5402
+ this.dropdown = new DropdownAdapter($element, this.options);
5403
+ this.$dropdown = this.dropdown.render();
5404
+
5405
+ this.dropdown.position(this.$dropdown, $container);
5406
+
5407
+ var ResultsAdapter = this.options.get('resultsAdapter');
5408
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5409
+ this.$results = this.results.render();
5410
+
5411
+ this.results.position(this.$results, this.$dropdown);
5412
+
5413
+ // Bind events
5414
+
5415
+ var self = this;
5416
+
5417
+ // Bind the container to all of the adapters
5418
+ this._bindAdapters();
5419
+
5420
+ // Register any DOM event handlers
5421
+ this._registerDomEvents();
5422
+
5423
+ // Register any internal event handlers
5424
+ this._registerDataEvents();
5425
+ this._registerSelectionEvents();
5426
+ this._registerDropdownEvents();
5427
+ this._registerResultsEvents();
5428
+ this._registerEvents();
5429
+
5430
+ // Set the initial state
5431
+ this.dataAdapter.current(function (initialData) {
5432
+ self.trigger('selection:update', {
5433
+ data: initialData
5434
+ });
5435
+ });
5436
+
5437
+ // Hide the original select
5438
+ $element.addClass('select2-hidden-accessible');
5439
+ $element.attr('aria-hidden', 'true');
5440
+
5441
+ // Synchronize any monitored attributes
5442
+ this._syncAttributes();
5443
+
5444
+ Utils.StoreData($element[0], 'select2', this);
5445
+
5446
+ // Ensure backwards compatibility with $element.data('select2').
5447
+ $element.data('select2', this);
5448
+ };
5449
+
5450
+ Utils.Extend(Select2, Utils.Observable);
5451
+
5452
+ Select2.prototype._generateId = function ($element) {
5453
+ var id = '';
5454
+
5455
+ if ($element.attr('id') != null) {
5456
+ id = $element.attr('id');
5457
+ } else if ($element.attr('name') != null) {
5458
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
5459
+ } else {
5460
+ id = Utils.generateChars(4);
5461
+ }
5462
+
5463
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
5464
+ id = 'select2-' + id;
5465
+
5466
+ return id;
5467
+ };
5468
+
5469
+ Select2.prototype._placeContainer = function ($container) {
5470
+ $container.insertAfter(this.$element);
5471
+
5472
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
5473
+
5474
+ if (width != null) {
5475
+ $container.css('width', width);
5476
+ }
5477
+ };
5478
+
5479
+ Select2.prototype._resolveWidth = function ($element, method) {
5480
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5481
+
5482
+ if (method == 'resolve') {
5483
+ var styleWidth = this._resolveWidth($element, 'style');
5484
+
5485
+ if (styleWidth != null) {
5486
+ return styleWidth;
5487
+ }
5488
+
5489
+ return this._resolveWidth($element, 'element');
5490
+ }
5491
+
5492
+ if (method == 'element') {
5493
+ var elementWidth = $element.outerWidth(false);
5494
+
5495
+ if (elementWidth <= 0) {
5496
+ return 'auto';
5497
+ }
5498
+
5499
+ return elementWidth + 'px';
5500
+ }
5501
+
5502
+ if (method == 'style') {
5503
+ var style = $element.attr('style');
5504
+
5505
+ if (typeof(style) !== 'string') {
5506
+ return null;
5507
+ }
5508
+
5509
+ var attrs = style.split(';');
5510
+
5511
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5512
+ var attr = attrs[i].replace(/\s/g, '');
5513
+ var matches = attr.match(WIDTH);
5514
+
5515
+ if (matches !== null && matches.length >= 1) {
5516
+ return matches[1];
5517
+ }
5518
+ }
5519
+
5520
+ return null;
5521
+ }
5522
+
5523
+ if (method == 'computedstyle') {
5524
+ var computedStyle = window.getComputedStyle($element[0]);
5525
+
5526
+ return computedStyle.width;
5527
+ }
5528
+
5529
+ return method;
5530
+ };
5531
+
5532
+ Select2.prototype._bindAdapters = function () {
5533
+ this.dataAdapter.bind(this, this.$container);
5534
+ this.selection.bind(this, this.$container);
5535
+
5536
+ this.dropdown.bind(this, this.$container);
5537
+ this.results.bind(this, this.$container);
5538
+ };
5539
+
5540
+ Select2.prototype._registerDomEvents = function () {
5541
+ var self = this;
5542
+
5543
+ this.$element.on('change.select2', function () {
5544
+ self.dataAdapter.current(function (data) {
5545
+ self.trigger('selection:update', {
5546
+ data: data
5547
+ });
5548
+ });
5549
+ });
5550
+
5551
+ this.$element.on('focus.select2', function (evt) {
5552
+ self.trigger('focus', evt);
5553
+ });
5554
+
5555
+ this._syncA = Utils.bind(this._syncAttributes, this);
5556
+ this._syncS = Utils.bind(this._syncSubtree, this);
5557
+
5558
+ if (this.$element[0].attachEvent) {
5559
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
5560
+ }
5561
+
5562
+ var observer = window.MutationObserver ||
5563
+ window.WebKitMutationObserver ||
5564
+ window.MozMutationObserver
5565
+ ;
5566
+
5567
+ if (observer != null) {
5568
+ this._observer = new observer(function (mutations) {
5569
+ self._syncA();
5570
+ self._syncS(null, mutations);
5571
+ });
5572
+ this._observer.observe(this.$element[0], {
5573
+ attributes: true,
5574
+ childList: true,
5575
+ subtree: false
5576
+ });
5577
+ } else if (this.$element[0].addEventListener) {
5578
+ this.$element[0].addEventListener(
5579
+ 'DOMAttrModified',
5580
+ self._syncA,
5581
+ false
5582
+ );
5583
+ this.$element[0].addEventListener(
5584
+ 'DOMNodeInserted',
5585
+ self._syncS,
5586
+ false
5587
+ );
5588
+ this.$element[0].addEventListener(
5589
+ 'DOMNodeRemoved',
5590
+ self._syncS,
5591
+ false
5592
+ );
5593
+ }
5594
+ };
5595
+
5596
+ Select2.prototype._registerDataEvents = function () {
5597
+ var self = this;
5598
+
5599
+ this.dataAdapter.on('*', function (name, params) {
5600
+ self.trigger(name, params);
5601
+ });
5602
+ };
5603
+
5604
+ Select2.prototype._registerSelectionEvents = function () {
5605
+ var self = this;
5606
+ var nonRelayEvents = ['toggle', 'focus'];
5607
+
5608
+ this.selection.on('toggle', function () {
5609
+ self.toggleDropdown();
5610
+ });
5611
+
5612
+ this.selection.on('focus', function (params) {
5613
+ self.focus(params);
5614
+ });
5615
+
5616
+ this.selection.on('*', function (name, params) {
5617
+ if ($.inArray(name, nonRelayEvents) !== -1) {
5618
+ return;
5619
+ }
5620
+
5621
+ self.trigger(name, params);
5622
+ });
5623
+ };
5624
+
5625
+ Select2.prototype._registerDropdownEvents = function () {
5626
+ var self = this;
5627
+
5628
+ this.dropdown.on('*', function (name, params) {
5629
+ self.trigger(name, params);
5630
+ });
5631
+ };
5632
+
5633
+ Select2.prototype._registerResultsEvents = function () {
5634
+ var self = this;
5635
+
5636
+ this.results.on('*', function (name, params) {
5637
+ self.trigger(name, params);
5638
+ });
5639
+ };
5640
+
5641
+ Select2.prototype._registerEvents = function () {
5642
+ var self = this;
5643
+
5644
+ this.on('open', function () {
5645
+ self.$container.addClass('select2-container--open');
5646
+ });
5647
+
5648
+ this.on('close', function () {
5649
+ self.$container.removeClass('select2-container--open');
5650
+ });
5651
+
5652
+ this.on('enable', function () {
5653
+ self.$container.removeClass('select2-container--disabled');
5654
+ });
5655
+
5656
+ this.on('disable', function () {
5657
+ self.$container.addClass('select2-container--disabled');
5658
+ });
5659
+
5660
+ this.on('blur', function () {
5661
+ self.$container.removeClass('select2-container--focus');
5662
+ });
5663
+
5664
+ this.on('query', function (params) {
5665
+ if (!self.isOpen()) {
5666
+ self.trigger('open', {});
5667
+ }
5668
+
5669
+ this.dataAdapter.query(params, function (data) {
5670
+ self.trigger('results:all', {
5671
+ data: data,
5672
+ query: params
5673
+ });
5674
+ });
5675
+ });
5676
+
5677
+ this.on('query:append', function (params) {
5678
+ this.dataAdapter.query(params, function (data) {
5679
+ self.trigger('results:append', {
5680
+ data: data,
5681
+ query: params
5682
+ });
5683
+ });
5684
+ });
5685
+
5686
+ this.on('keypress', function (evt) {
5687
+ var key = evt.which;
5688
+
5689
+ if (self.isOpen()) {
5690
+ if (key === KEYS.ESC || key === KEYS.TAB ||
5691
+ (key === KEYS.UP && evt.altKey)) {
5692
+ self.close(evt);
5693
+
5694
+ evt.preventDefault();
5695
+ } else if (key === KEYS.ENTER) {
5696
+ self.trigger('results:select', {});
5697
+
5698
+ evt.preventDefault();
5699
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5700
+ self.trigger('results:toggle', {});
5701
+
5702
+ evt.preventDefault();
5703
+ } else if (key === KEYS.UP) {
5704
+ self.trigger('results:previous', {});
5705
+
5706
+ evt.preventDefault();
5707
+ } else if (key === KEYS.DOWN) {
5708
+ self.trigger('results:next', {});
5709
+
5710
+ evt.preventDefault();
5711
+ }
5712
+ } else {
5713
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
5714
+ (key === KEYS.DOWN && evt.altKey)) {
5715
+ self.open();
5716
+
5717
+ evt.preventDefault();
5718
+ }
5719
+ }
5720
+ });
5721
+ };
5722
+
5723
+ Select2.prototype._syncAttributes = function () {
5724
+ this.options.set('disabled', this.$element.prop('disabled'));
5725
+
5726
+ if (this.isDisabled()) {
5727
+ if (this.isOpen()) {
5728
+ this.close();
5729
+ }
5730
+
5731
+ this.trigger('disable', {});
5732
+ } else {
5733
+ this.trigger('enable', {});
5734
+ }
5735
+ };
5736
+
5737
+ Select2.prototype._isChangeMutation = function (evt, mutations) {
5738
+ var changed = false;
5739
+ var self = this;
5740
+
5741
+ // Ignore any mutation events raised for elements that aren't options or
5742
+ // optgroups. This handles the case when the select element is destroyed
5743
+ if (
5744
+ evt && evt.target && (
5745
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5746
+ )
5747
+ ) {
5748
+ return;
5749
+ }
5750
+
5751
+ if (!mutations) {
5752
+ // If mutation events aren't supported, then we can only assume that the
5753
+ // change affected the selections
5754
+ changed = true;
5755
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5756
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
5757
+ var node = mutations.addedNodes[n];
5758
+
5759
+ if (node.selected) {
5760
+ changed = true;
5761
+ }
5762
+ }
5763
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5764
+ changed = true;
5765
+ } else if ($.isArray(mutations)) {
5766
+ $.each(mutations, function(evt, mutation) {
5767
+ if (self._isChangeMutation(evt, mutation)) {
5768
+ // We've found a change mutation.
5769
+ // Let's escape from the loop and continue
5770
+ changed = true;
5771
+ return false;
5772
+ }
5773
+ });
5774
+ }
5775
+ return changed;
5776
+ };
5777
+
5778
+ Select2.prototype._syncSubtree = function (evt, mutations) {
5779
+ var changed = this._isChangeMutation(evt, mutations);
5780
+ var self = this;
5781
+
5782
+ // Only re-pull the data if we think there is a change
5783
+ if (changed) {
5784
+ this.dataAdapter.current(function (currentData) {
5785
+ self.trigger('selection:update', {
5786
+ data: currentData
5787
+ });
5788
+ });
5789
+ }
5790
+ };
5791
+
5792
+ /**
5793
+ * Override the trigger method to automatically trigger pre-events when
5794
+ * there are events that can be prevented.
5795
+ */
5796
+ Select2.prototype.trigger = function (name, args) {
5797
+ var actualTrigger = Select2.__super__.trigger;
5798
+ var preTriggerMap = {
5799
+ 'open': 'opening',
5800
+ 'close': 'closing',
5801
+ 'select': 'selecting',
5802
+ 'unselect': 'unselecting',
5803
+ 'clear': 'clearing'
5804
+ };
5805
+
5806
+ if (args === undefined) {
5807
+ args = {};
5808
+ }
5809
+
5810
+ if (name in preTriggerMap) {
5811
+ var preTriggerName = preTriggerMap[name];
5812
+ var preTriggerArgs = {
5813
+ prevented: false,
5814
+ name: name,
5815
+ args: args
5816
+ };
5817
+
5818
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
5819
+
5820
+ if (preTriggerArgs.prevented) {
5821
+ args.prevented = true;
5822
+
5823
+ return;
5824
+ }
5825
+ }
5826
+
5827
+ actualTrigger.call(this, name, args);
5828
+ };
5829
+
5830
+ Select2.prototype.toggleDropdown = function () {
5831
+ if (this.isDisabled()) {
5832
+ return;
5833
+ }
5834
+
5835
+ if (this.isOpen()) {
5836
+ this.close();
5837
+ } else {
5838
+ this.open();
5839
+ }
5840
+ };
5841
+
5842
+ Select2.prototype.open = function () {
5843
+ if (this.isOpen()) {
5844
+ return;
5845
+ }
5846
+
5847
+ if (this.isDisabled()) {
5848
+ return;
5849
+ }
5850
+
5851
+ this.trigger('query', {});
5852
+ };
5853
+
5854
+ Select2.prototype.close = function (evt) {
5855
+ if (!this.isOpen()) {
5856
+ return;
5857
+ }
5858
+
5859
+ this.trigger('close', { originalEvent : evt });
5860
+ };
5861
+
5862
+ /**
5863
+ * Helper method to abstract the "enabled" (not "disabled") state of this
5864
+ * object.
5865
+ *
5866
+ * @return {true} if the instance is not disabled.
5867
+ * @return {false} if the instance is disabled.
5868
+ */
5869
+ Select2.prototype.isEnabled = function () {
5870
+ return !this.isDisabled();
5871
+ };
5872
+
5873
+ /**
5874
+ * Helper method to abstract the "disabled" state of this object.
5875
+ *
5876
+ * @return {true} if the disabled option is true.
5877
+ * @return {false} if the disabled option is false.
5878
+ */
5879
+ Select2.prototype.isDisabled = function () {
5880
+ return this.options.get('disabled');
5881
+ };
5882
+
5883
+ Select2.prototype.isOpen = function () {
5884
+ return this.$container.hasClass('select2-container--open');
5885
+ };
5886
+
5887
+ Select2.prototype.hasFocus = function () {
5888
+ return this.$container.hasClass('select2-container--focus');
5889
+ };
5890
+
5891
+ Select2.prototype.focus = function (data) {
5892
+ // No need to re-trigger focus events if we are already focused
5893
+ if (this.hasFocus()) {
5894
+ return;
5895
+ }
5896
+
5897
+ this.$container.addClass('select2-container--focus');
5898
+ this.trigger('focus', {});
5899
+ };
5900
+
5901
+ Select2.prototype.enable = function (args) {
5902
+ if (this.options.get('debug') && window.console && console.warn) {
5903
+ console.warn(
5904
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
5905
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5906
+ ' instead.'
5907
+ );
5908
+ }
5909
+
5910
+ if (args == null || args.length === 0) {
5911
+ args = [true];
5912
+ }
5913
+
5914
+ var disabled = !args[0];
5915
+
5916
+ this.$element.prop('disabled', disabled);
5917
+ };
5918
+
5919
+ Select2.prototype.data = function () {
5920
+ if (this.options.get('debug') &&
5921
+ arguments.length > 0 && window.console && console.warn) {
5922
+ console.warn(
5923
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
5924
+ 'should consider setting the value instead using `$element.val()`.'
5925
+ );
5926
+ }
5927
+
5928
+ var data = [];
5929
+
5930
+ this.dataAdapter.current(function (currentData) {
5931
+ data = currentData;
5932
+ });
5933
+
5934
+ return data;
5935
+ };
5936
+
5937
+ Select2.prototype.val = function (args) {
5938
+ if (this.options.get('debug') && window.console && console.warn) {
5939
+ console.warn(
5940
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
5941
+ ' removed in later Select2 versions. Use $element.val() instead.'
5942
+ );
5943
+ }
5944
+
5945
+ if (args == null || args.length === 0) {
5946
+ return this.$element.val();
5947
+ }
5948
+
5949
+ var newVal = args[0];
5950
+
5951
+ if ($.isArray(newVal)) {
5952
+ newVal = $.map(newVal, function (obj) {
5953
+ return obj.toString();
5954
+ });
5955
+ }
5956
+
5957
+ this.$element.val(newVal).trigger('input').trigger('change');
5958
+ };
5959
+
5960
+ Select2.prototype.destroy = function () {
5961
+ this.$container.remove();
5962
+
5963
+ if (this.$element[0].detachEvent) {
5964
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
5965
+ }
5966
+
5967
+ if (this._observer != null) {
5968
+ this._observer.disconnect();
5969
+ this._observer = null;
5970
+ } else if (this.$element[0].removeEventListener) {
5971
+ this.$element[0]
5972
+ .removeEventListener('DOMAttrModified', this._syncA, false);
5973
+ this.$element[0]
5974
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
5975
+ this.$element[0]
5976
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
5977
+ }
5978
+
5979
+ this._syncA = null;
5980
+ this._syncS = null;
5981
+
5982
+ this.$element.off('.select2');
5983
+ this.$element.attr('tabindex',
5984
+ Utils.GetData(this.$element[0], 'old-tabindex'));
5985
+
5986
+ this.$element.removeClass('select2-hidden-accessible');
5987
+ this.$element.attr('aria-hidden', 'false');
5988
+ Utils.RemoveData(this.$element[0]);
5989
+ this.$element.removeData('select2');
5990
+
5991
+ this.dataAdapter.destroy();
5992
+ this.selection.destroy();
5993
+ this.dropdown.destroy();
5994
+ this.results.destroy();
5995
+
5996
+ this.dataAdapter = null;
5997
+ this.selection = null;
5998
+ this.dropdown = null;
5999
+ this.results = null;
6000
+ };
6001
+
6002
+ Select2.prototype.render = function () {
6003
+ var $container = $(
6004
+ '<span class="select2 select2-container">' +
6005
+ '<span class="selection"></span>' +
6006
+ '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
6007
+ '</span>'
6008
+ );
6009
+
6010
+ $container.attr('dir', this.options.get('dir'));
6011
+
6012
+ this.$container = $container;
6013
+
6014
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
6015
+
6016
+ Utils.StoreData($container[0], 'element', this.$element);
6017
+
6018
+ return $container;
6019
+ };
6020
+
6021
+ return Select2;
6022
+ });
6023
+
6024
+ S2.define('select2/compat/utils',[
6025
+ 'jquery'
6026
+ ], function ($) {
6027
+ function syncCssClasses ($dest, $src, adapter) {
6028
+ var classes, replacements = [], adapted;
6029
+
6030
+ classes = $.trim($dest.attr('class'));
6031
+
6032
+ if (classes) {
6033
+ classes = '' + classes; // for IE which returns object
6034
+
6035
+ $(classes.split(/\s+/)).each(function () {
6036
+ // Save all Select2 classes
6037
+ if (this.indexOf('select2-') === 0) {
6038
+ replacements.push(this);
6039
+ }
6040
+ });
6041
+ }
6042
+
6043
+ classes = $.trim($src.attr('class'));
6044
+
6045
+ if (classes) {
6046
+ classes = '' + classes; // for IE which returns object
6047
+
6048
+ $(classes.split(/\s+/)).each(function () {
6049
+ // Only adapt non-Select2 classes
6050
+ if (this.indexOf('select2-') !== 0) {
6051
+ adapted = adapter(this);
6052
+
6053
+ if (adapted != null) {
6054
+ replacements.push(adapted);
6055
+ }
6056
+ }
6057
+ });
6058
+ }
6059
+
6060
+ $dest.attr('class', replacements.join(' '));
6061
+ }
6062
+
6063
+ return {
6064
+ syncCssClasses: syncCssClasses
6065
+ };
6066
+ });
6067
+
6068
+ S2.define('select2/compat/containerCss',[
6069
+ 'jquery',
6070
+ './utils'
6071
+ ], function ($, CompatUtils) {
6072
+ // No-op CSS adapter that discards all classes by default
6073
+ function _containerAdapter (clazz) {
6074
+ return null;
6075
+ }
6076
+
6077
+ function ContainerCSS () { }
6078
+
6079
+ ContainerCSS.prototype.render = function (decorated) {
6080
+ var $container = decorated.call(this);
6081
+
6082
+ var containerCssClass = this.options.get('containerCssClass') || '';
6083
+
6084
+ if ($.isFunction(containerCssClass)) {
6085
+ containerCssClass = containerCssClass(this.$element);
6086
+ }
6087
+
6088
+ var containerCssAdapter = this.options.get('adaptContainerCssClass');
6089
+ containerCssAdapter = containerCssAdapter || _containerAdapter;
6090
+
6091
+ if (containerCssClass.indexOf(':all:') !== -1) {
6092
+ containerCssClass = containerCssClass.replace(':all:', '');
6093
+
6094
+ var _cssAdapter = containerCssAdapter;
6095
+
6096
+ containerCssAdapter = function (clazz) {
6097
+ var adapted = _cssAdapter(clazz);
6098
+
6099
+ if (adapted != null) {
6100
+ // Append the old one along with the adapted one
6101
+ return adapted + ' ' + clazz;
6102
+ }
6103
+
6104
+ return clazz;
6105
+ };
6106
+ }
6107
+
6108
+ var containerCss = this.options.get('containerCss') || {};
6109
+
6110
+ if ($.isFunction(containerCss)) {
6111
+ containerCss = containerCss(this.$element);
6112
+ }
6113
+
6114
+ CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);
6115
+
6116
+ $container.css(containerCss);
6117
+ $container.addClass(containerCssClass);
6118
+
6119
+ return $container;
6120
+ };
6121
+
6122
+ return ContainerCSS;
6123
+ });
6124
+
6125
+ S2.define('select2/compat/dropdownCss',[
6126
+ 'jquery',
6127
+ './utils'
6128
+ ], function ($, CompatUtils) {
6129
+ // No-op CSS adapter that discards all classes by default
6130
+ function _dropdownAdapter (clazz) {
6131
+ return null;
6132
+ }
6133
+
6134
+ function DropdownCSS () { }
6135
+
6136
+ DropdownCSS.prototype.render = function (decorated) {
6137
+ var $dropdown = decorated.call(this);
6138
+
6139
+ var dropdownCssClass = this.options.get('dropdownCssClass') || '';
6140
+
6141
+ if ($.isFunction(dropdownCssClass)) {
6142
+ dropdownCssClass = dropdownCssClass(this.$element);
6143
+ }
6144
+
6145
+ var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');
6146
+ dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
6147
+
6148
+ if (dropdownCssClass.indexOf(':all:') !== -1) {
6149
+ dropdownCssClass = dropdownCssClass.replace(':all:', '');
6150
+
6151
+ var _cssAdapter = dropdownCssAdapter;
6152
+
6153
+ dropdownCssAdapter = function (clazz) {
6154
+ var adapted = _cssAdapter(clazz);
6155
+
6156
+ if (adapted != null) {
6157
+ // Append the old one along with the adapted one
6158
+ return adapted + ' ' + clazz;
6159
+ }
6160
+
6161
+ return clazz;
6162
+ };
6163
+ }
6164
+
6165
+ var dropdownCss = this.options.get('dropdownCss') || {};
6166
+
6167
+ if ($.isFunction(dropdownCss)) {
6168
+ dropdownCss = dropdownCss(this.$element);
6169
+ }
6170
+
6171
+ CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);
6172
+
6173
+ $dropdown.css(dropdownCss);
6174
+ $dropdown.addClass(dropdownCssClass);
6175
+
6176
+ return $dropdown;
6177
+ };
6178
+
6179
+ return DropdownCSS;
6180
+ });
6181
+
6182
+ S2.define('select2/compat/initSelection',[
6183
+ 'jquery'
6184
+ ], function ($) {
6185
+ function InitSelection (decorated, $element, options) {
6186
+ if (options.get('debug') && window.console && console.warn) {
6187
+ console.warn(
6188
+ 'Select2: The `initSelection` option has been deprecated in favor' +
6189
+ ' of a custom data adapter that overrides the `current` method. ' +
6190
+ 'This method is now called multiple times instead of a single ' +
6191
+ 'time when the instance is initialized. Support will be removed ' +
6192
+ 'for the `initSelection` option in future versions of Select2'
6193
+ );
6194
+ }
6195
+
6196
+ this.initSelection = options.get('initSelection');
6197
+ this._isInitialized = false;
6198
+
6199
+ decorated.call(this, $element, options);
6200
+ }
6201
+
6202
+ InitSelection.prototype.current = function (decorated, callback) {
6203
+ var self = this;
6204
+
6205
+ if (this._isInitialized) {
6206
+ decorated.call(this, callback);
6207
+
6208
+ return;
6209
+ }
6210
+
6211
+ this.initSelection.call(null, this.$element, function (data) {
6212
+ self._isInitialized = true;
6213
+
6214
+ if (!$.isArray(data)) {
6215
+ data = [data];
6216
+ }
6217
+
6218
+ callback(data);
6219
+ });
6220
+ };
6221
+
6222
+ return InitSelection;
6223
+ });
6224
+
6225
+ S2.define('select2/compat/inputData',[
6226
+ 'jquery',
6227
+ '../utils'
6228
+ ], function ($, Utils) {
6229
+ function InputData (decorated, $element, options) {
6230
+ this._currentData = [];
6231
+ this._valueSeparator = options.get('valueSeparator') || ',';
6232
+
6233
+ if ($element.prop('type') === 'hidden') {
6234
+ if (options.get('debug') && console && console.warn) {
6235
+ console.warn(
6236
+ 'Select2: Using a hidden input with Select2 is no longer ' +
6237
+ 'supported and may stop working in the future. It is recommended ' +
6238
+ 'to use a `<select>` element instead.'
6239
+ );
6240
+ }
6241
+ }
6242
+
6243
+ decorated.call(this, $element, options);
6244
+ }
6245
+
6246
+ InputData.prototype.current = function (_, callback) {
6247
+ function getSelected (data, selectedIds) {
6248
+ var selected = [];
6249
+
6250
+ if (data.selected || $.inArray(data.id, selectedIds) !== -1) {
6251
+ data.selected = true;
6252
+ selected.push(data);
6253
+ } else {
6254
+ data.selected = false;
6255
+ }
6256
+
6257
+ if (data.children) {
6258
+ selected.push.apply(selected, getSelected(data.children, selectedIds));
6259
+ }
6260
+
6261
+ return selected;
6262
+ }
6263
+
6264
+ var selected = [];
6265
+
6266
+ for (var d = 0; d < this._currentData.length; d++) {
6267
+ var data = this._currentData[d];
6268
+
6269
+ selected.push.apply(
6270
+ selected,
6271
+ getSelected(
6272
+ data,
6273
+ this.$element.val().split(
6274
+ this._valueSeparator
6275
+ )
6276
+ )
6277
+ );
6278
+ }
6279
+
6280
+ callback(selected);
6281
+ };
6282
+
6283
+ InputData.prototype.select = function (_, data) {
6284
+ if (!this.options.get('multiple')) {
6285
+ this.current(function (allData) {
6286
+ $.map(allData, function (data) {
6287
+ data.selected = false;
6288
+ });
6289
+ });
6290
+
6291
+ this.$element.val(data.id);
6292
+ this.$element.trigger('input').trigger('change');
6293
+ } else {
6294
+ var value = this.$element.val();
6295
+ value += this._valueSeparator + data.id;
6296
+
6297
+ this.$element.val(value);
6298
+ this.$element.trigger('input').trigger('change');
6299
+ }
6300
+ };
6301
+
6302
+ InputData.prototype.unselect = function (_, data) {
6303
+ var self = this;
6304
+
6305
+ data.selected = false;
6306
+
6307
+ this.current(function (allData) {
6308
+ var values = [];
6309
+
6310
+ for (var d = 0; d < allData.length; d++) {
6311
+ var item = allData[d];
6312
+
6313
+ if (data.id == item.id) {
6314
+ continue;
6315
+ }
6316
+
6317
+ values.push(item.id);
6318
+ }
6319
+
6320
+ self.$element.val(values.join(self._valueSeparator));
6321
+ self.$element.trigger('input').trigger('change');
6322
+ });
6323
+ };
6324
+
6325
+ InputData.prototype.query = function (_, params, callback) {
6326
+ var results = [];
6327
+
6328
+ for (var d = 0; d < this._currentData.length; d++) {
6329
+ var data = this._currentData[d];
6330
+
6331
+ var matches = this.matches(params, data);
6332
+
6333
+ if (matches !== null) {
6334
+ results.push(matches);
6335
+ }
6336
+ }
6337
+
6338
+ callback({
6339
+ results: results
6340
+ });
6341
+ };
6342
+
6343
+ InputData.prototype.addOptions = function (_, $options) {
6344
+ var options = $.map($options, function ($option) {
6345
+ return Utils.GetData($option[0], 'data');
6346
+ });
6347
+
6348
+ this._currentData.push.apply(this._currentData, options);
6349
+ };
6350
+
6351
+ return InputData;
6352
+ });
6353
+
6354
+ S2.define('select2/compat/matcher',[
6355
+ 'jquery'
6356
+ ], function ($) {
6357
+ function oldMatcher (matcher) {
6358
+ function wrappedMatcher (params, data) {
6359
+ var match = $.extend(true, {}, data);
6360
+
6361
+ if (params.term == null || $.trim(params.term) === '') {
6362
+ return match;
6363
+ }
6364
+
6365
+ if (data.children) {
6366
+ for (var c = data.children.length - 1; c >= 0; c--) {
6367
+ var child = data.children[c];
6368
+
6369
+ // Check if the child object matches
6370
+ // The old matcher returned a boolean true or false
6371
+ var doesMatch = matcher(params.term, child.text, child);
6372
+
6373
+ // If the child didn't match, pop it off
6374
+ if (!doesMatch) {
6375
+ match.children.splice(c, 1);
6376
+ }
6377
+ }
6378
+
6379
+ if (match.children.length > 0) {
6380
+ return match;
6381
+ }
6382
+ }
6383
+
6384
+ if (matcher(params.term, data.text, data)) {
6385
+ return match;
6386
+ }
6387
+
6388
+ return null;
6389
+ }
6390
+
6391
+ return wrappedMatcher;
6392
+ }
6393
+
6394
+ return oldMatcher;
6395
+ });
6396
+
6397
+ S2.define('select2/compat/query',[
6398
+
6399
+ ], function () {
6400
+ function Query (decorated, $element, options) {
6401
+ if (options.get('debug') && window.console && console.warn) {
6402
+ console.warn(
6403
+ 'Select2: The `query` option has been deprecated in favor of a ' +
6404
+ 'custom data adapter that overrides the `query` method. Support ' +
6405
+ 'will be removed for the `query` option in future versions of ' +
6406
+ 'Select2.'
6407
+ );
6408
+ }
6409
+
6410
+ decorated.call(this, $element, options);
6411
+ }
6412
+
6413
+ Query.prototype.query = function (_, params, callback) {
6414
+ params.callback = callback;
6415
+
6416
+ var query = this.options.get('query');
6417
+
6418
+ query.call(null, params);
6419
+ };
6420
+
6421
+ return Query;
6422
+ });
6423
+
6424
+ S2.define('select2/dropdown/attachContainer',[
6425
+
6426
+ ], function () {
6427
+ function AttachContainer (decorated, $element, options) {
6428
+ decorated.call(this, $element, options);
6429
+ }
6430
+
6431
+ AttachContainer.prototype.position =
6432
+ function (decorated, $dropdown, $container) {
6433
+ var $dropdownContainer = $container.find('.dropdown-wrapper');
6434
+ $dropdownContainer.append($dropdown);
6435
+
6436
+ $dropdown.addClass('select2-dropdown--below');
6437
+ $container.addClass('select2-container--below');
6438
+ };
6439
+
6440
+ return AttachContainer;
6441
+ });
6442
+
6443
+ S2.define('select2/dropdown/stopPropagation',[
6444
+
6445
+ ], function () {
6446
+ function StopPropagation () { }
6447
+
6448
+ StopPropagation.prototype.bind = function (decorated, container, $container) {
6449
+ decorated.call(this, container, $container);
6450
+
6451
+ var stoppedEvents = [
6452
+ 'blur',
6453
+ 'change',
6454
+ 'click',
6455
+ 'dblclick',
6456
+ 'focus',
6457
+ 'focusin',
6458
+ 'focusout',
6459
+ 'input',
6460
+ 'keydown',
6461
+ 'keyup',
6462
+ 'keypress',
6463
+ 'mousedown',
6464
+ 'mouseenter',
6465
+ 'mouseleave',
6466
+ 'mousemove',
6467
+ 'mouseover',
6468
+ 'mouseup',
6469
+ 'search',
6470
+ 'touchend',
6471
+ 'touchstart'
6472
+ ];
6473
+
6474
+ this.$dropdown.on(stoppedEvents.join(' '), function (evt) {
6475
+ evt.stopPropagation();
6476
+ });
6477
+ };
6478
+
6479
+ return StopPropagation;
6480
+ });
6481
+
6482
+ S2.define('select2/selection/stopPropagation',[
6483
+
6484
+ ], function () {
6485
+ function StopPropagation () { }
6486
+
6487
+ StopPropagation.prototype.bind = function (decorated, container, $container) {
6488
+ decorated.call(this, container, $container);
6489
+
6490
+ var stoppedEvents = [
6491
+ 'blur',
6492
+ 'change',
6493
+ 'click',
6494
+ 'dblclick',
6495
+ 'focus',
6496
+ 'focusin',
6497
+ 'focusout',
6498
+ 'input',
6499
+ 'keydown',
6500
+ 'keyup',
6501
+ 'keypress',
6502
+ 'mousedown',
6503
+ 'mouseenter',
6504
+ 'mouseleave',
6505
+ 'mousemove',
6506
+ 'mouseover',
6507
+ 'mouseup',
6508
+ 'search',
6509
+ 'touchend',
6510
+ 'touchstart'
6511
+ ];
6512
+
6513
+ this.$selection.on(stoppedEvents.join(' '), function (evt) {
6514
+ evt.stopPropagation();
6515
+ });
6516
+ };
6517
+
6518
+ return StopPropagation;
6519
+ });
6520
+
6521
+ /*!
6522
+ * jQuery Mousewheel 3.1.13
6523
+ *
6524
+ * Copyright jQuery Foundation and other contributors
6525
+ * Released under the MIT license
6526
+ * http://jquery.org/license
6527
+ */
6528
+
6529
+ (function (factory) {
6530
+ if ( typeof S2.define === 'function' && S2.define.amd ) {
6531
+ // AMD. Register as an anonymous module.
6532
+ S2.define('jquery-mousewheel',['jquery'], factory);
6533
+ } else if (typeof exports === 'object') {
6534
+ // Node/CommonJS style for Browserify
6535
+ module.exports = factory;
6536
+ } else {
6537
+ // Browser globals
6538
+ factory(jQuery);
6539
+ }
6540
+ }(function ($) {
6541
+
6542
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
6543
+ toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
6544
+ ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
6545
+ slice = Array.prototype.slice,
6546
+ nullLowestDeltaTimeout, lowestDelta;
6547
+
6548
+ if ( $.event.fixHooks ) {
6549
+ for ( var i = toFix.length; i; ) {
6550
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
6551
+ }
6552
+ }
6553
+
6554
+ var special = $.event.special.mousewheel = {
6555
+ version: '3.1.12',
6556
+
6557
+ setup: function() {
6558
+ if ( this.addEventListener ) {
6559
+ for ( var i = toBind.length; i; ) {
6560
+ this.addEventListener( toBind[--i], handler, false );
6561
+ }
6562
+ } else {
6563
+ this.onmousewheel = handler;
6564
+ }
6565
+ // Store the line height and page height for this particular element
6566
+ $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
6567
+ $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
6568
+ },
6569
+
6570
+ teardown: function() {
6571
+ if ( this.removeEventListener ) {
6572
+ for ( var i = toBind.length; i; ) {
6573
+ this.removeEventListener( toBind[--i], handler, false );
6574
+ }
6575
+ } else {
6576
+ this.onmousewheel = null;
6577
+ }
6578
+ // Clean up the data we added to the element
6579
+ $.removeData(this, 'mousewheel-line-height');
6580
+ $.removeData(this, 'mousewheel-page-height');
6581
+ },
6582
+
6583
+ getLineHeight: function(elem) {
6584
+ var $elem = $(elem),
6585
+ $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
6586
+ if (!$parent.length) {
6587
+ $parent = $('body');
6588
+ }
6589
+ return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
6590
+ },
6591
+
6592
+ getPageHeight: function(elem) {
6593
+ return $(elem).height();
6594
+ },
6595
+
6596
+ settings: {
6597
+ adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
6598
+ normalizeOffset: true // calls getBoundingClientRect for each event
6599
+ }
6600
+ };
6601
+
6602
+ $.fn.extend({
6603
+ mousewheel: function(fn) {
6604
+ return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
6605
+ },
6606
+
6607
+ unmousewheel: function(fn) {
6608
+ return this.unbind('mousewheel', fn);
6609
+ }
6610
+ });
6611
+
6612
+
6613
+ function handler(event) {
6614
+ var orgEvent = event || window.event,
6615
+ args = slice.call(arguments, 1),
6616
+ delta = 0,
6617
+ deltaX = 0,
6618
+ deltaY = 0,
6619
+ absDelta = 0,
6620
+ offsetX = 0,
6621
+ offsetY = 0;
6622
+ event = $.event.fix(orgEvent);
6623
+ event.type = 'mousewheel';
6624
+
6625
+ // Old school scrollwheel delta
6626
+ if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
6627
+ if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
6628
+ if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
6629
+ if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
6630
+
6631
+ // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
6632
+ if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
6633
+ deltaX = deltaY * -1;
6634
+ deltaY = 0;
6635
+ }
6636
+
6637
+ // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
6638
+ delta = deltaY === 0 ? deltaX : deltaY;
6639
+
6640
+ // New school wheel delta (wheel event)
6641
+ if ( 'deltaY' in orgEvent ) {
6642
+ deltaY = orgEvent.deltaY * -1;
6643
+ delta = deltaY;
6644
+ }
6645
+ if ( 'deltaX' in orgEvent ) {
6646
+ deltaX = orgEvent.deltaX;
6647
+ if ( deltaY === 0 ) { delta = deltaX * -1; }
6648
+ }
6649
+
6650
+ // No change actually happened, no reason to go any further
6651
+ if ( deltaY === 0 && deltaX === 0 ) { return; }
6652
+
6653
+ // Need to convert lines and pages to pixels if we aren't already in pixels
6654
+ // There are three delta modes:
6655
+ // * deltaMode 0 is by pixels, nothing to do
6656
+ // * deltaMode 1 is by lines
6657
+ // * deltaMode 2 is by pages
6658
+ if ( orgEvent.deltaMode === 1 ) {
6659
+ var lineHeight = $.data(this, 'mousewheel-line-height');
6660
+ delta *= lineHeight;
6661
+ deltaY *= lineHeight;
6662
+ deltaX *= lineHeight;
6663
+ } else if ( orgEvent.deltaMode === 2 ) {
6664
+ var pageHeight = $.data(this, 'mousewheel-page-height');
6665
+ delta *= pageHeight;
6666
+ deltaY *= pageHeight;
6667
+ deltaX *= pageHeight;
6668
+ }
6669
+
6670
+ // Store lowest absolute delta to normalize the delta values
6671
+ absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
6672
+
6673
+ if ( !lowestDelta || absDelta < lowestDelta ) {
6674
+ lowestDelta = absDelta;
6675
+
6676
+ // Adjust older deltas if necessary
6677
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
6678
+ lowestDelta /= 40;
6679
+ }
6680
+ }
6681
+
6682
+ // Adjust older deltas if necessary
6683
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
6684
+ // Divide all the things by 40!
6685
+ delta /= 40;
6686
+ deltaX /= 40;
6687
+ deltaY /= 40;
6688
+ }
6689
+
6690
+ // Get a whole, normalized value for the deltas
6691
+ delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
6692
+ deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
6693
+ deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
6694
+
6695
+ // Normalise offsetX and offsetY properties
6696
+ if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
6697
+ var boundingRect = this.getBoundingClientRect();
6698
+ offsetX = event.clientX - boundingRect.left;
6699
+ offsetY = event.clientY - boundingRect.top;
6700
+ }
6701
+
6702
+ // Add information to the event object
6703
+ event.deltaX = deltaX;
6704
+ event.deltaY = deltaY;
6705
+ event.deltaFactor = lowestDelta;
6706
+ event.offsetX = offsetX;
6707
+ event.offsetY = offsetY;
6708
+ // Go ahead and set deltaMode to 0 since we converted to pixels
6709
+ // Although this is a little odd since we overwrite the deltaX/Y
6710
+ // properties with normalized deltas.
6711
+ event.deltaMode = 0;
6712
+
6713
+ // Add event and delta to the front of the arguments
6714
+ args.unshift(event, delta, deltaX, deltaY);
6715
+
6716
+ // Clearout lowestDelta after sometime to better
6717
+ // handle multiple device types that give different
6718
+ // a different lowestDelta
6719
+ // Ex: trackpad = 3 and mouse wheel = 120
6720
+ if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
6721
+ nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
6722
+
6723
+ return ($.event.dispatch || $.event.handle).apply(this, args);
6724
+ }
6725
+
6726
+ function nullLowestDelta() {
6727
+ lowestDelta = null;
6728
+ }
6729
+
6730
+ function shouldAdjustOldDeltas(orgEvent, absDelta) {
6731
+ // If this is an older event and the delta is divisable by 120,
6732
+ // then we are assuming that the browser is treating this as an
6733
+ // older mouse wheel event and that we should divide the deltas
6734
+ // by 40 to try and get a more usable deltaFactor.
6735
+ // Side note, this actually impacts the reported scroll distance
6736
+ // in older browsers and can cause scrolling to be slower than native.
6737
+ // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
6738
+ return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
6739
+ }
6740
+
6741
+ }));
6742
+
6743
+ S2.define('jquery.select2',[
6744
+ 'jquery',
6745
+ 'jquery-mousewheel',
6746
+
6747
+ './select2/core',
6748
+ './select2/defaults',
6749
+ './select2/utils'
6750
+ ], function ($, _, Select2, Defaults, Utils) {
6751
+ if ($.fn.select2 == null) {
6752
+ // All methods that should return the element
6753
+ var thisMethods = ['open', 'close', 'destroy'];
6754
+
6755
+ $.fn.select2 = function (options) {
6756
+ options = options || {};
6757
+
6758
+ if (typeof options === 'object') {
6759
+ this.each(function () {
6760
+ var instanceOptions = $.extend(true, {}, options);
6761
+
6762
+ var instance = new Select2($(this), instanceOptions);
6763
+ });
6764
+
6765
+ return this;
6766
+ } else if (typeof options === 'string') {
6767
+ var ret;
6768
+ var args = Array.prototype.slice.call(arguments, 1);
6769
+
6770
+ this.each(function () {
6771
+ var instance = Utils.GetData(this, 'select2');
6772
+
6773
+ if (instance == null && window.console && console.error) {
6774
+ console.error(
6775
+ 'The select2(\'' + options + '\') method was called on an ' +
6776
+ 'element that is not using Select2.'
6777
+ );
6778
+ }
6779
+
6780
+ ret = instance[options].apply(instance, args);
6781
+ });
6782
+
6783
+ // Check if we should be returning `this`
6784
+ if ($.inArray(options, thisMethods) > -1) {
6785
+ return this;
6786
+ }
6787
+
6788
+ return ret;
6789
+ } else {
6790
+ throw new Error('Invalid arguments for Select2: ' + options);
6791
+ }
6792
+ };
6793
+ }
6794
+
6795
+ if ($.fn.select2.defaults == null) {
6796
+ $.fn.select2.defaults = Defaults;
6797
+ }
6798
+
6799
+ return Select2;
6800
+ });
6801
+
6802
+ // Return the AMD loader configuration so it can be used outside of this file
6803
+ return {
6804
+ define: S2.define,
6805
+ require: S2.require
6806
+ };
6807
+ }());
6808
+
6809
+ // Autoload the jQuery bindings
6810
+ // We know that all of the modules exist above this, so we're safe
6811
+ var select2 = S2.require('jquery.select2');
6812
+
6813
+ // Hold the AMD module references on the jQuery function that was just loaded
6814
+ // This allows Select2 to use the internal loader outside of this file, such
6815
+ // as in the language files.
6816
+ jQuery.fn.select2.amd = S2;
6817
+
6818
+ // Return the Select2 instance for anyone who is importing it.
6819
+ return select2;
6820
+ }));
includes/classes/core/Manager.php CHANGED
@@ -437,11 +437,19 @@ class TCMP_Manager {
437
  }
438
  $text = $buffer;
439
  }
440
- global $tcmp_allowed_html_tags;
441
- echo wp_kses( $text, $tcmp_allowed_html_tags );
442
  }
443
  }
444
 
 
 
 
 
 
 
 
 
 
445
  //return snippets that match with options
446
  public function get_conversion_snippets( $options = null ) {
447
  global $tcmp;
437
  }
438
  $text = $buffer;
439
  }
440
+ echo $this->esc_js_code( $text );
 
441
  }
442
  }
443
 
444
+ private function esc_js_code( $text ) {
445
+ global $tcmp_allowed_html_tags;
446
+ $text = wp_kses( $text, $tcmp_allowed_html_tags );
447
+ $text = str_replace( '&lt;', '<', $text );
448
+ $text = str_replace( '&gt;', '>', $text );
449
+ $text = str_replace( '&amp;', '&', $text );
450
+ return $text;
451
+ }
452
+
453
  //return snippets that match with options
454
  public function get_conversion_snippets( $options = null ) {
455
  global $tcmp;
includes/classes/ui/Tabs.php CHANGED
@@ -42,8 +42,8 @@ class TCMP_Tabs {
42
 
43
  $this->wpEnqueueStyle( 'assets/css/style.css' );
44
  $this->wpEnqueueStyle( 'assets/css/manager.css' );
45
- $this->wpEnqueueStyle( 'assets/deps/select2-3.5.2/select2.css' );
46
- $this->wpEnqueueScript( 'assets/deps/select2-3.5.2/select2.min.js' );
47
  $this->wpEnqueueScript( 'assets/deps/starrr/starrr.js' );
48
 
49
  $this->wpEnqueueScript( 'assets/js/library.js' );
42
 
43
  $this->wpEnqueueStyle( 'assets/css/style.css' );
44
  $this->wpEnqueueStyle( 'assets/css/manager.css' );
45
+ $this->wpEnqueueStyle( 'assets/deps/select2-4.0.13/select2.css' );
46
+ $this->wpEnqueueScript( 'assets/deps/select2-4.0.13/select2.full.js' );
47
  $this->wpEnqueueScript( 'assets/deps/starrr/starrr.js' );
48
 
49
  $this->wpEnqueueScript( 'assets/js/library.js' );
includes/classes/utils/Options.php CHANGED
@@ -126,6 +126,7 @@ class TCMP_Options {
126
  $value = wp_kses( $value, $tcmp_allowed_html_tags );
127
  $value = str_replace( '&lt;', '<', $value );
128
  $value = str_replace( '&gt;', '>', $value );
 
129
  }
130
  }
131
  return $array;
126
  $value = wp_kses( $value, $tcmp_allowed_html_tags );
127
  $value = str_replace( '&lt;', '<', $value );
128
  $value = str_replace( '&gt;', '>', $value );
129
+ $value = str_replace( '&amp;', '&', $value );
130
  }
131
  }
132
  return $array;
index.php CHANGED
@@ -6,7 +6,7 @@ Description: A plugin to manage ALL your tracking code and conversion pixels, si
6
  Author: Data443
7
  Author URI: https://data443.com/
8
  Email: info@intellywp.com
9
- Version: 2.0.9
10
  Requires at least: 3.6.0
11
  Requires PHP: 5.6
12
  */
@@ -27,7 +27,7 @@ define( 'TCMP_PLUGIN_PREFIX', 'TCMP_' );
27
  define( 'TCMP_PLUGIN_FILE', __FILE__ );
28
  define( 'TCMP_PLUGIN_SLUG', 'tracking-code-manager' );
29
  define( 'TCMP_PLUGIN_NAME', 'Tracking Code Manager' );
30
- define( 'TCMP_PLUGIN_VERSION', '2.0.9' );
31
  define( 'TCMP_PLUGIN_AUTHOR', 'IntellyWP' );
32
 
33
  define( 'TCMP_PLUGIN_DIR', dirname( __FILE__ ) . '/' );
@@ -90,33 +90,41 @@ include_once( dirname( __FILE__ ) . '/autoload.php' );
90
  tcmp_include_php( dirname( __FILE__ ) . '/includes/' );
91
 
92
  global $tcmp_allowed_html_tags;
93
- $tcmp_allowed_atts = array(
94
- 'align' => array(),
95
- 'class' => array(),
96
- 'type' => array(),
97
- 'id' => array(),
98
- 'dir' => array(),
99
- 'lang' => array(),
100
- 'style' => array(),
101
- 'xml:lang' => array(),
102
- 'src' => array(),
103
- 'alt' => array(),
104
- 'href' => array(),
105
- 'rel' => array(),
106
- 'rev' => array(),
107
- 'target' => array(),
108
- 'novalidate' => array(),
109
- 'type' => array(),
110
- 'value' => array(),
111
- 'name' => array(),
112
- 'tabindex' => array(),
113
- 'action' => array(),
114
- 'method' => array(),
115
- 'for' => array(),
116
- 'width' => array(),
117
- 'height' => array(),
118
- 'data' => array(),
119
- 'title' => array(),
 
 
 
 
 
 
 
 
120
  );
121
  $tcmp_allowed_html_tags['form'] = $tcmp_allowed_atts;
122
  $tcmp_allowed_html_tags['label'] = $tcmp_allowed_atts;
@@ -124,7 +132,7 @@ $tcmp_allowed_html_tags['input'] = $tcmp_allowed_atts;
124
  $tcmp_allowed_html_tags['textarea'] = $tcmp_allowed_atts;
125
  $tcmp_allowed_html_tags['iframe'] = $tcmp_allowed_atts;
126
  $tcmp_allowed_html_tags['script'] = $tcmp_allowed_atts;
127
- $tcmp_allowed_html_tags['noscript'] = $tcmp_allowed_atts;
128
  $tcmp_allowed_html_tags['style'] = $tcmp_allowed_atts;
129
  $tcmp_allowed_html_tags['strong'] = $tcmp_allowed_atts;
130
  $tcmp_allowed_html_tags['small'] = $tcmp_allowed_atts;
6
  Author: Data443
7
  Author URI: https://data443.com/
8
  Email: info@intellywp.com
9
+ Version: 2.0.10
10
  Requires at least: 3.6.0
11
  Requires PHP: 5.6
12
  */
27
  define( 'TCMP_PLUGIN_FILE', __FILE__ );
28
  define( 'TCMP_PLUGIN_SLUG', 'tracking-code-manager' );
29
  define( 'TCMP_PLUGIN_NAME', 'Tracking Code Manager' );
30
+ define( 'TCMP_PLUGIN_VERSION', '2.0.10' );
31
  define( 'TCMP_PLUGIN_AUTHOR', 'IntellyWP' );
32
 
33
  define( 'TCMP_PLUGIN_DIR', dirname( __FILE__ ) . '/' );
90
  tcmp_include_php( dirname( __FILE__ ) . '/includes/' );
91
 
92
  global $tcmp_allowed_html_tags;
93
+ $tcmp_allowed_atts = array(
94
+ 'align' => array(),
95
+ 'class' => array(),
96
+ 'type' => array(),
97
+ 'id' => array(),
98
+ 'dir' => array(),
99
+ 'lang' => array(),
100
+ 'style' => array(),
101
+ 'xml:lang' => array(),
102
+ 'src' => array(),
103
+ 'alt' => array(),
104
+ 'href' => array(),
105
+ 'rel' => array(),
106
+ 'rev' => array(),
107
+ 'target' => array(),
108
+ 'novalidate' => array(),
109
+ 'type' => array(),
110
+ 'value' => array(),
111
+ 'name' => array(),
112
+ 'tabindex' => array(),
113
+ 'action' => array(),
114
+ 'method' => array(),
115
+ 'for' => array(),
116
+ 'width' => array(),
117
+ 'height' => array(),
118
+ 'data' => array(),
119
+ 'title' => array(),
120
+ 'async' => array(),
121
+ 'loading' => array(),
122
+ 'referrerpolicy' => array(),
123
+ 'sandbox' => array(),
124
+ 'crossorigin' => array(),
125
+ 'defer' => array(),
126
+ 'integrity' => array(),
127
+ 'nomodule' => array(),
128
  );
129
  $tcmp_allowed_html_tags['form'] = $tcmp_allowed_atts;
130
  $tcmp_allowed_html_tags['label'] = $tcmp_allowed_atts;
132
  $tcmp_allowed_html_tags['textarea'] = $tcmp_allowed_atts;
133
  $tcmp_allowed_html_tags['iframe'] = $tcmp_allowed_atts;
134
  $tcmp_allowed_html_tags['script'] = $tcmp_allowed_atts;
135
+ $tcmp_allowed_html_tags['noscript'] = $tcmp_allowed_atts;
136
  $tcmp_allowed_html_tags['style'] = $tcmp_allowed_atts;
137
  $tcmp_allowed_html_tags['strong'] = $tcmp_allowed_atts;
138
  $tcmp_allowed_html_tags['small'] = $tcmp_allowed_atts;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: IntellyWP, Data443
3
  Tags: adwords remarketing, analytics conversion tracking, conversion pixel, conversion tracking, conversion tracking adwords, conversion tracking pixel, conversion tracking script,Facebook Ads, facebook conversion pixel, facebook custom audience, facebook retargeting, google adwords, google analytics web tracking code, google tag manager, html snippet, html snippets, html tracking code, javascript snippet, javascript snippets, header and footer, pay per click tracking, pixel tracking code, remarketing, retargeting, snippets, Tag Management, track conversion, track conversions, tracking code, tracking codes, tracking script, woocommerce, edd, easy digital downloads, wp ecommerce, wp e-commerce, gdpr, tracking gdpr, privacy
4
  Requires at least: 2.7
5
  Tested up to: 6.0
6
- Stable tag: 2.0.9
7
  Requires PHP: 5.6
8
 
9
  A plugin to manage ALL of your tracking code and conversion pixels. Compatible with Facebook Ads, Google Adwords, WooCommerce, Easy Digital Downloads, ..
@@ -112,6 +112,12 @@ Have a look at the source code of your page (search for: Tracking Code Manager)
112
 
113
  For detailed release notes, see our documentation here: [https://intellywp.com/docs/category/tracking-code-manager/](https://intellywp.com/docs/category/tracking-code-manager/).
114
 
 
 
 
 
 
 
115
  = 2.0.9 =
116
  *Release Date - 2022-7-11*
117
 
3
  Tags: adwords remarketing, analytics conversion tracking, conversion pixel, conversion tracking, conversion tracking adwords, conversion tracking pixel, conversion tracking script,Facebook Ads, facebook conversion pixel, facebook custom audience, facebook retargeting, google adwords, google analytics web tracking code, google tag manager, html snippet, html snippets, html tracking code, javascript snippet, javascript snippets, header and footer, pay per click tracking, pixel tracking code, remarketing, retargeting, snippets, Tag Management, track conversion, track conversions, tracking code, tracking codes, tracking script, woocommerce, edd, easy digital downloads, wp ecommerce, wp e-commerce, gdpr, tracking gdpr, privacy
4
  Requires at least: 2.7
5
  Tested up to: 6.0
6
+ Stable tag: 2.0.10
7
  Requires PHP: 5.6
8
 
9
  A plugin to manage ALL of your tracking code and conversion pixels. Compatible with Facebook Ads, Google Adwords, WooCommerce, Easy Digital Downloads, ..
112
 
113
  For detailed release notes, see our documentation here: [https://intellywp.com/docs/category/tracking-code-manager/](https://intellywp.com/docs/category/tracking-code-manager/).
114
 
115
+ = 2.0.10 =
116
+ *Release Date - 2022-7-12*
117
+
118
+ * IWP-462 - Update select2 library
119
+ * IWP-464 - Fix encoding of JavaScript operators after sanitization
120
+
121
  = 2.0.9 =
122
  *Release Date - 2022-7-11*
123