Scripts n Styles - Version 2.0.1.1

Version Description

Download this release

Release Info

Developer WraithKenny
Plugin Icon wp plugin Scripts n Styles
Version 2.0.1.1
Comparing to
See all releases

Code changes from version 3.4.1 to 2.0.1.1

Files changed (60) hide show
  1. README.txt +13 -111
  2. css/code-editor.css +0 -3
  3. css/meta-box-styles.css +101 -0
  4. css/meta-box.css +0 -42
  5. css/options-styles.css +14 -26
  6. images/icon32.png +0 -0
  7. images/menu.png +0 -0
  8. includes/class-sns-admin.php +0 -206
  9. includes/class-sns-ajax.php +0 -415
  10. includes/class-sns-code-editor.php +0 -36
  11. includes/class-sns-form.php +0 -186
  12. includes/class-sns-global-page.php +0 -202
  13. includes/class-sns-hoops-page.php +0 -194
  14. includes/class-sns-list-usage.php +0 -176
  15. includes/class-sns-meta-box.php +0 -422
  16. includes/class-sns-settings-page.php +0 -187
  17. includes/class-sns-theme-page.php +0 -171
  18. includes/class-sns-usage-page.php +0 -90
  19. includes/class.SnS_Admin.php +84 -0
  20. includes/class.SnS_Admin_Meta_Box.php +215 -0
  21. includes/class.SnS_Settings_Page.php +281 -0
  22. js/code-editor.js +0 -114
  23. js/global-page.js +0 -130
  24. js/hoops-page.js +0 -105
  25. js/meta-box-scripts.js +12 -0
  26. js/meta-box.js +0 -588
  27. js/options-scripts.js +10 -0
  28. js/settings-page.js +0 -18
  29. js/theme-page.js +0 -276
  30. languages/scripts-n-styles.pot +0 -398
  31. libraries/codemirror/LICENSE +19 -0
  32. libraries/codemirror/lib/codemirror.css +64 -0
  33. libraries/codemirror/lib/codemirror.js +2071 -0
  34. libraries/codemirror/lib/overlay.js +51 -0
  35. libraries/codemirror/lib/runmode.js +27 -0
  36. libraries/codemirror/mode/css.js +124 -0
  37. libraries/codemirror/mode/htmlmixed.js +74 -0
  38. libraries/codemirror/mode/javascript.js +348 -0
  39. libraries/codemirror/mode/xml.js +206 -0
  40. libraries/codemirror/theme/default.css +18 -0
  41. libraries/codemirror/theme/elegant.css +9 -0
  42. libraries/codemirror/theme/neat.css +8 -0
  43. libraries/codemirror/theme/night.css +20 -0
  44. license.txt +258 -651
  45. screenshot-1.png +0 -0
  46. screenshot-2.png +0 -0
  47. screenshot-3.png +0 -0
  48. screenshot-4.png +0 -0
  49. screenshot-5.png +0 -0
  50. screenshot-6.png +0 -0
  51. scripts-n-styles.php +180 -346
  52. uninstall.php +11 -23
  53. vendor/chosen/chosen-sprite.png +0 -0
  54. vendor/chosen/chosen-sprite@2x.png +0 -0
  55. vendor/chosen/chosen.jquery.min.js +0 -2
  56. vendor/chosen/chosen.min.css +0 -3
  57. vendor/codemirror/codemirror-compressed.css +0 -659
  58. vendor/codemirror/codemirror-compressed.js +0 -9
  59. vendor/coffee-script.js +0 -12
  60. vendor/less.js +0 -4232
README.txt CHANGED
@@ -1,33 +1,25 @@
1
  === Scripts n Styles ===
2
- Contributors: WraithKenny, CaptainN
 
3
  Tags: admin, CSS, javascript, code, custom, Style
4
- Requires at least: 4.7.2
5
- Tested up to: 4.8
6
- Stable tag: 3.4.1
7
- License: GPLv3 or later
8
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
  This plugin allows Admin users to individually add custom CSS, Classes and JavaScript directly to Post, Pages or any other custom post types.
11
 
12
  == Description ==
13
 
14
- This plugin allows Admin users the ability to add custom CSS and JavaScript directly into individual Post, Pages or any other registered custom post types. You can also add classes to the body tag and the post container. There is a Global settings page for which you can write Scripts n Styles for the entire blog.
15
-
16
- Admin's can also add classes to the TinyMCE "Formats" dropdown which users can use to style posts and pages directly. As of Scripts n Styles 3+ styles are reflected in the post editor.
17
 
18
  Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin's have access to even more sensitive areas by definition, so that should be relatively safe ;)
19
 
20
- = Notes about the implementation: =
21
 
22
- * Admin users, or more specifically, *any user with the `manage_options` and `unfiltered_html` capabilities* (which by default is *only* the admin type user) can use this plugin's functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.
23
- * CSS Styles are embeded, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
24
- * JavaScript is embeded, not linked, at the bottom of the `body` (or `head`) element with `script` tags by using `wp-footer` (or `wp-head`). If your theme doesn't have this hook, this plugin (as well as most others) won't work.
25
  * **There is no input validation.** This plugin puts exactly what you type in the meta box directly into the `html` with no error checking. You are an Admin, and we trust you to be carefull. Try not to break anything.
26
- * Do to the licensing of the libraries used, this plugin is released "GPL 3.0 or later" if you care about those things.
27
-
28
- = Contact: =
29
-
30
- You'll have better luck contacting the other if you try me on [Twitter](http://twitter.com/WraithKenny) and [Github](https://github.com/unFocus/Scripts-n-Styles/issues). If that fails, I have an [open thread](http://wordpress.org/support/topic/contacting-scripts-n-styles-author "Contacting Scripts n Styles' author") on the support forums that will trigger an email.
31
 
32
  == Installation ==
33
 
@@ -45,78 +37,15 @@ Well, because plugins are supposed to, and should be expected to clean up after
45
 
46
  = Can I get around that somehow? =
47
 
48
- Sure, if you are an Admin, just go to the plugin editor and wipe out the uninstall.php and then WordPress will not delete the meta data on uninstall.
49
 
50
  == Screenshots ==
51
 
52
- 1. Settings Page for Writing Scripts n Styles that apply to the whole blog.
53
- 2. The Scripts panel of the Meta Box.
54
- 3. The Styles panel of the Meta Box.
55
- 4. The Classes panel. Add classes to the Style dropdown!
56
- 5. Enqueue panel. You can enqueue jQuery from here if you need!
57
- 6. Your styles are reflected in the Editor.
58
 
59
  == Changelog ==
60
 
61
- = 3.4.1 =
62
- * Fix meta box saving.
63
-
64
- = 3.4 =
65
- * Add option to not delete data on uninstall
66
- * Version 4.0 will drop php support under 5.4
67
- * This version disables updates for installs with php < 5.4
68
- * 4.0 will launch when most have updated to 3.4 :) (and when it's done.)
69
-
70
- = 3.3 =
71
- * See the github repo commits
72
-
73
- = 3.2.1 =
74
- * metabox add shortcode bugfix
75
-
76
- = 3.2 =
77
- * Add AJAX to Shortcode Tab
78
- * Add "Chosen" for selects
79
- * General UI Improvements
80
- * Add CoffeeScript Support
81
- * Add Hoops Widget
82
- * Add Global Hoops Shortcodes
83
- * Add Markdown mode to code editor
84
- * Add (fix) code editor themes
85
- * Theme Support (Beta Feature)
86
-
87
- = 3.1.1 =
88
- * Add (fix) CodeMirror Themes
89
-
90
- = 3.1 =
91
- * Feature: Dynamic Shortcodes.
92
- * Feature: LESS.js support.
93
- * Bug Fix: Proper output escaping.
94
-
95
- = 3.0.3 =
96
- * Bug Fix: wpautop formatting.
97
-
98
- = 3.0.2 =
99
- * Bug Fix: Fatal Error on post save
100
-
101
- = 3.0.1 =
102
- * Option to show Metabox by default
103
- * Check upgrade in more places
104
- * Fix double Settings Message on general-options
105
- * Fix empty post showing on usage
106
- * Cleaned up constants (internal)
107
-
108
- = 3 =
109
- * AJAX Saving of Meta-box
110
- * Dynamically populate the Styles Dropdown for TinyMCE
111
- * Styles preview in Post Editor
112
- * Enqueue dependant scripts if you need (like jQuery)
113
- * Adjustable menu placement
114
- * CodeMirror Themes
115
-
116
- = 2.0.3 =
117
- * fixed some bugs
118
-
119
- = 2.0.1 =
120
  * Better selection of `post_types` to add Scripts-n-Styles
121
  * micro-optimization for storage of class names.
122
  * Adds option page for globally adding Scripts and Styles.
@@ -142,33 +71,6 @@ Sure, if you are an Admin, just go to the plugin editor and wipe out the uninsta
142
 
143
  == Upgrade Notice ==
144
 
145
- = 3.3 =
146
- Bug fixes and lib upgrades
147
-
148
- = 3.2.1 =
149
- Bug fix (add shortcode)
150
-
151
- = 3.2 =
152
- New Major Features
153
-
154
- = 3.1.1 =
155
- Add (fix) CodeMirror Themes
156
-
157
- = 3.1 =
158
- New Features and Bug fixes
159
-
160
- = 3.0.3 =
161
- Bug fix (wpauto issue)
162
-
163
- = 3.0.2 =
164
- Bug fix
165
-
166
- = 3.0.1 =
167
- Bug fixes
168
-
169
- = 3 =
170
- Adds new features.
171
-
172
  = 2 =
173
  Adds new features.
174
 
1
  === Scripts n Styles ===
2
+ Contributors: WraithKenny, Touvan
3
+ Donate link: http://wordpressfoundation.org/donate/
4
  Tags: admin, CSS, javascript, code, custom, Style
5
+ Requires at least: 3.1
6
+ Tested up to: 3.2
7
+ Stable tag: 2.0.1.1
 
 
8
 
9
  This plugin allows Admin users to individually add custom CSS, Classes and JavaScript directly to Post, Pages or any other custom post types.
10
 
11
  == Description ==
12
 
13
+ This plugin allows Admin users the ability to add custom CSS (at the bottom of the 'head' tag) and JavaScript (at the bottom of the 'body' tag) directly into individual Post, Pages or any other registered custom post types. You can also add classes to the body tag and the post container (if your theme supports `body_class()` and `post_class()` functions).
 
 
14
 
15
  Because only well trusted users should ever be allowed to insert JavaScript directly into the pages of your site, this plugin restricts usage to admin type users. Admin's have access to even more sensitive areas by definition, so that should be relatively safe ;)
16
 
17
+ A few notes about the implementation:
18
 
19
+ * Admin users, or more specifically, *any user with the `manage_options` capability* (which by default is *only* the admin type user) can use this plugin's functionality. Some plugins extend user rolls, and so this plugin would naturally extend include rolls that have the appropriate capability.
20
+ * CSS Styles are included inline, not linked, at the bottom of the `head` element with `style` tags by using `wp-head`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
21
+ * JavaScript is included inline, not linked, at the bottom of the `body` element with `script` tags by using `wp-footer`. If your theme doesn't have this hook, this plugin (as well as most others) won't work.
22
  * **There is no input validation.** This plugin puts exactly what you type in the meta box directly into the `html` with no error checking. You are an Admin, and we trust you to be carefull. Try not to break anything.
 
 
 
 
 
23
 
24
  == Installation ==
25
 
37
 
38
  = Can I get around that somehow? =
39
 
40
+ Sure, if you are an Admin, just go to the plugin editor and wipe out the uninstall.php (Replace everything with a space character) and then WordPress will not delete the meta data on uninstall.
41
 
42
  == Screenshots ==
43
 
44
+ 1. The New and Improved Meta Box.
 
 
 
 
 
45
 
46
  == Changelog ==
47
 
48
+ = 2 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  * Better selection of `post_types` to add Scripts-n-Styles
50
  * micro-optimization for storage of class names.
51
  * Adds option page for globally adding Scripts and Styles.
71
 
72
  == Upgrade Notice ==
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  = 2 =
75
  Adds new features.
76
 
css/code-editor.css DELETED
@@ -1,3 +0,0 @@
1
- #newcontent{display:block;}
2
- .CodeMirror{border:1px solid #DFDFDF;background-color:white;margin:8px 0;}
3
- #template .CodeMirror{margin-right:30px;}#template .CodeMirror div{margin-right:0;}
 
 
 
css/meta-box-styles.css ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* MetaBox.css */
2
+
3
+ #uFp_meta_box .title {
4
+ display: block;
5
+ margin-top: 1.5em;
6
+ }
7
+ #uFp_meta_box .tabs-vertical .title,
8
+ #uFp_meta_box .tabs-horizontal .title {
9
+ display: none;
10
+ }
11
+
12
+ #uFp_meta_box .tabs-vertical,
13
+ #uFp_meta_box .tabs-horizontal,
14
+ #uFp_meta_box .ui-tabs-panel {
15
+ overflow: hidden;
16
+ }
17
+
18
+ #uFp_meta_box .tabs-vertical .wp-tab-bar {
19
+ margin-bottom: 3px;
20
+ }
21
+ #uFp_meta_box .tabs-vertical .wp-tab-bar li {
22
+ display: inline;
23
+ line-height: 1.35em;
24
+ }
25
+ #uFp_meta_box .tabs-vertical .wp-tab-bar .ui-state-active {
26
+ background-color: #FFFFFF;
27
+ border-color: #DFDFDF;
28
+ border-style: solid solid none;
29
+ border-width: 1px 1px 0;
30
+ }
31
+ #uFp_meta_box .tabs-vertical .wp-tab-bar .ui-state-active a {
32
+ color: #333333;
33
+ }
34
+ #uFp_meta_box .tabs-vertical .ui-tabs-panel {
35
+ border-style: solid;
36
+ border-width: 1px;
37
+ padding: 0.5em 0.9em;
38
+ background-color: #FFFFFF;
39
+ border-color: #DFDFDF;
40
+ }
41
+
42
+
43
+ #uFp_meta_box .tabs-horizontal .wp-tab-bar {
44
+ float: left;
45
+ margin: 0 -120px 0 5px;
46
+ padding: 0;
47
+ text-align: right;
48
+ width: 120px;
49
+ }
50
+ #uFp_meta_box .tabs-horizontal .wp-tab-bar li {
51
+ padding: 8px;
52
+ display: block;
53
+ }
54
+ #uFp_meta_box .tabs-horizontal .wp-tab-bar li a {
55
+ display: block;
56
+ }
57
+ #uFp_meta_box .tabs-horizontal .wp-tab-bar .ui-state-active {
58
+ background-color: #FFFFFF;
59
+ border-color: #DFDFDF;
60
+ border-style: solid none solid solid;
61
+ border-width: 1px 0 1px 1px;
62
+ margin-right: -1px;
63
+ border-radius: 3px 0 0 3px;
64
+ font-weight: bold;
65
+ text-decoration: none;
66
+ }
67
+ #uFp_meta_box .tabs-horizontal .wp-tab-bar .ui-state-active a {
68
+ color: #333333;
69
+ }
70
+ #uFp_meta_box .tabs-horizontal .ui-tabs-panel {
71
+ background-color: #FFFFFF;
72
+ border-color: #DFDFDF;
73
+ border-style: solid;
74
+ border-width: 1px;
75
+ min-height: 200px;
76
+ margin: 0 5px 0 125px;
77
+ overflow: hidden;
78
+ padding: 0.5em 0.9em;
79
+ }
80
+ #uFp_meta_box .tabs-horizontal .inside div {
81
+ overflow: hidden;
82
+ }
83
+
84
+ .ui-tabs .ui-tabs-hide {
85
+ position: absolute;
86
+ left: -10000px;
87
+ display: block;
88
+ }
89
+
90
+ .CodeMirror {
91
+ border: 1px solid #DFDFDF;
92
+ background-color: white;
93
+ border-radius: 3px;
94
+ margin: 8px 0;
95
+ }
96
+ .CodeMirror-scroll {
97
+ height: auto;
98
+ min-height: 50px;
99
+ max-height: 300px;
100
+ overflow: auto;
101
+ }
css/meta-box.css DELETED
@@ -1,42 +0,0 @@
1
- #editorcontainer #content{font-family:"Courier New",Courier,monospace;}
2
- .CodeMirror{height:200px;border:1px solid #DFDFDF;}
3
- .autoheight .CodeMirror{height:auto;}
4
- .autoheight .CodeMirror-scroll{overflow-x:auto;overflow-y:hidden;}
5
- .style,.script,.less,.coffee{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background-color:white;margin:8px 0;background-clip:padding-box;font-family:"Courier New",Courier,monospace;}.style:before,.script:before,.less:before,.coffee:before,.style:after,.script:after,.less:after,.coffee:after{border:1px solid #dfdfdf;position:relative;z-index:3;display:block;padding:.5em;background-color:#f5f5f5;color:#333;font-family:"Courier New",Courier,monospace;line-height:1em;text-shadow:none;}
6
- .style:before,.script:before,.less:before,.coffee:before{border-bottom:0 none;border-radius:5px 5px 0px 0px;}
7
- .style:after,.script:after,.less:after,.coffee:after{border-top:0 none;border-radius:0px 0px 5px 5px;}
8
- .style:before{content:'<style type="text/css">';}
9
- .style:after{content:'</style>';}
10
- .script:before{content:'<script type="text/javascript">';}
11
- .script:after{content:'</script>';}
12
- .less:before{content:'<style type="text/less">';}
13
- .less:after{content:'</style>';}
14
- .coffee:before{content:'<script type="text/coffeescript">';}
15
- .coffee:after{content:'</script>';}
16
- .sns-shortcode p{margin:0;}
17
- .sns-collapsed-shortcode{overflow:hidden;}.sns-collapsed-shortcode .sns-collapsed-shortcode-btn{background-position:1px -107px;}
18
- .sns-collapsed-shortcode .CodeMirror,.sns-collapsed-shortcode .sns-ajax-wrap{visibility:hidden;position:absolute;}
19
- .sns-collapsed-shortcode-btn{cursor:pointer;float:left;height:1.4em;width:1.4em;background-image:url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0F%00%00%00%7B%08%06%00%00%00%ABe%DA%9D%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01%90IDATx%DA%EC%991N%C3%40%10E%D7%40%1D%A4(G%A0%A2%A0%E2%06Q%90%DB%5C%02%09%AA%F4%A1%8C%7BW%20%E5%10P%DA%22%E2%06%AERP%E5%08%08)%F4%D6%F2G%FA%C5j%E5%F5%AEM%81%10%B3%D2%D7%EC%3A~%1E%7Bci%BE%C6%99%B5%D6%8C%1D'%E6%07%E3%8F%C2g%FE%81%BA%AE%1B%84%0B.'%D0%17%E7%87%3C%CF%AFc%99%0B%E8%9C%CA%9Cy%E1%9F%98u%FDU%C8%FE%8A%B0p%0E%ED%90%F5%26%F5%99WP%CBy%CBu%DA%86!%CB%3B%C2%96%CB-%D7%83v%FB%01%B2%8C%DDC%9E9%A4%AA%AA%E6%7D%BFg%FAn%2B%AC%B0%C2%0A%2B%FC%CB0%EA%F4%BC%EF%F7%60%AD%028E%F8%80f(%B1%9FC3oh%2B6%832%23%EB%25%C2%1E%3A%A53%B8%EA*%F0%A1%CC%25A%C3X%26%DD6%B2.%3D3%23c%C1%E3%D1%CCk%E8HYg%BEN%DEm%7D%B7%15VXa%85%15V8v%82%D4e%B6%3F%E2%7D%12%CFZ%94%2C%F4%C7%D4%26%CB%94%26%E6%D6%B1%16%F1%0E%0D%7D%D7%8E.%C8%1D%93%E83%C3%F1%BC%89%EF%82%9E%9C%3E%89qZ%3C%FD%1B%26%86%0D%BA%17%FB%C4%BB0%A3Z%1Dlw%2C%A1F%5B%1D%0A%2B%AC%B0%C2%0A%2B%CC%22%DFt%F5%08R3%CB%B7%9Bg%F9%92Bo2%EA%B6%C5%CC%ECq%81Gz%95%24%D8%F5%20bj%EE%A4%D5%E3%F7%8AB%B0%EBAZz%94%19%3DK%DC%87q%88'Y%85%BE%DD%84%E0%03T%00z%E9%BB%F2%7F%F4%24%DF%02%0C%00%C9H%D9%18%7B.%E6%93%00%00%00%00IEND%AEB%60%82");background-attachment:scroll;background-repeat:no-repeat;background-position:1px 1px;margin-right:.5em;}
20
- #add-mce-dropdown-names label{width:50px;display:inline-block;}
21
- .sns-ajax-loading{display:none;vertical-align:top;}.sns-ajax-loading .spinner{float:none;}
22
- .sns-ajax-wrap{height:23px;height:auto;}
23
- #sns-classes{overflow:hidden;width:100%;}
24
- #SnS_classes_mce_wrapper{margin:6px 0;}
25
- #mce-dropdown-names{display:none;}body.js #mce-dropdown-names{display:block;}
26
- #delete-mce-dropdown-names .sns-ajax-delete{cursor:pointer;display:inline-block;height:10px;overflow:hidden;text-indent:-9999px;width:10px;background:url("/wp-admin/images/xit.gif") no-repeat scroll 0 0 transparent;}#delete-mce-dropdown-names .sns-ajax-delete:hover{background:url("/wp-admin/images/xit.gif") no-repeat scroll -10px 0 transparent;}
27
- body.js #SnS_meta_box .title{display:none;}
28
- body.js #SnS_meta_box>.inside{height:auto;padding:0 10px;margin:6px 0 8px;}
29
- body.js #SnS_meta_box .wp-tab-panel{display:none;margin-bottom:0;}
30
- body.js #SnS_meta_box .wp-tabs-panel-active{display:block;}
31
- body.no-js #SnS_meta_box .wp-tab-bar{position:absolute;top:36px;}
32
- body.no-js #SnS_meta_box .wp-tab-panel{margin-bottom:1em;}
33
- body.no-js #side-sortables #SnS_meta_box>.inside{margin-top:33px;padding-top:0;}
34
- #SnS_meta_box>.inside{height:300px;overflow:auto;padding:6px 10px 8px;margin:0;position:static;}
35
- #SnS_meta_box .wp-tab-bar{text-align:right;overflow:auto;width:100%;padding:0;margin-top:3px;margin-bottom:-1px;}#SnS_meta_box .wp-tab-bar li{float:left;background-color:inherit;border:0 none;margin:0;padding:0;display:inline;}
36
- #SnS_meta_box .wp-tab-bar a{display:block;border-radius:3px 3px 0 0;border-style:none;border-width:1px 1px 0 1px;padding:3px 5px 5px;margin-right:3px;text-decoration:none;}
37
- #SnS_meta_box .wp-tab-active a{background-color:#FFFFFF;border-color:#DFDFDF;border-style:solid;margin-bottom:-1px;}
38
- #SnS_meta_box .wp-tab-panel{border-style:solid;border-width:1px;overflow:auto;padding:0.5em 0.9em;min-height:200px;height:auto;}
39
- #normal-sortables #SnS_meta_box .wp-tab-bar,#advanced-sortables #SnS_meta_box .wp-tab-bar{float:left;margin:0 -1px 0 5px;width:121px;overflow:visible;}#normal-sortables #SnS_meta_box .wp-tab-bar a,#advanced-sortables #SnS_meta_box .wp-tab-bar a{padding:8px;width:104px;}
40
- #normal-sortables #SnS_meta_box .wp-tab-panel,#advanced-sortables #SnS_meta_box .wp-tab-panel{margin-left:125px;margin-right:5px;max-height:none;}
41
- #normal-sortables #SnS_meta_box .wp-tab-active a,#advanced-sortables #SnS_meta_box .wp-tab-active a{border-radius:3px 0 0 3px;border-style:solid none solid solid;border-width:1px 0 1px 1px;margin-right:-1px;font-weight:bold;}
42
- @media only screen and (max-width:1050px){body.no-js #SnS_meta_box>.inside{margin-top:33px;padding-top:0;} body.js #normal-sortables #SnS_meta_box .wp-tab-panel,body.js #advanced-sortables #SnS_meta_box .wp-tab-panel{margin:0;} #normal-sortables #SnS_meta_box .wp-tab-bar,#advanced-sortables #SnS_meta_box .wp-tab-bar{float:none;margin:3px 0 -1px;width:100%;overflow:hidden;} #normal-sortables #SnS_meta_box .wp-tab-panel,#advanced-sortables #SnS_meta_box .wp-tab-panel{margin:0 0 1em;} #normal-sortables #SnS_meta_box .wp-tab-bar a,#advanced-sortables #SnS_meta_box .wp-tab-bar a{padding:3px 5px 5px;width:auto;} #normal-sortables #SnS_meta_box .wp-tab-active a,#advanced-sortables #SnS_meta_box .wp-tab-active a{border-radius:3px 3px 0 0;border-style:solid solid none solid;border-width:1px 1px 0 1px;margin-right:3px;font-weight:normal;}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/options-styles.css CHANGED
@@ -1,26 +1,14 @@
1
- textarea.code{display:block;}
2
- .CodeMirror{height:200px;border:1px solid #DFDFDF;}
3
- .autoheight .CodeMirror{height:auto;}
4
- .autoheight .CodeMirror-scroll{overflow-x:auto;overflow-y:hidden;}
5
- .style,.script,.less,.coffee{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background-color:white;margin:8px 0 6px;background-clip:padding-box;font-family:"Courier New",Courier,monospace;}.style:before,.script:before,.less:before,.coffee:before,.style:after,.script:after,.less:after,.coffee:after{border:1px solid #dfdfdf;position:relative;z-index:3;display:block;padding:.5em;background-color:#f5f5f5;color:#333;font-family:"Courier New",Courier,monospace;line-height:1em;text-shadow:none;}
6
- .style:before,.script:before,.less:before,.coffee:before{border-bottom:0 none;border-radius:5px 5px 0px 0px;}
7
- .style:after,.script:after,.less:after,.coffee:after{border-top:0 none;border-radius:0px 0px 5px 5px;}
8
- .style>label,.script>label,.less>label,.coffee>label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;padding:3px 6px;border:1px solid #dfdfdf;border-top:0 none;}
9
- .style:before{content:'<style type="text/css">';}
10
- .style:after{content:'</style>';}
11
- .script:before{content:'<script type="text/javascript">';}
12
- .script:after{content:'</script>';}
13
- .less:before{content:'<style type="text/less">';}
14
- .less:after{content:'</style>';}
15
- .coffee:before{content:'<script type="text/coffeescript">';}
16
- .coffee:after{content:'</script>';}
17
- .scripts-n-styles_page_sns_theme .CodeMirror-scroll{max-height:none;}
18
- #icon-sns{background:no-repeat center url('../images/icon32.png');}
19
- .sns-less-ide .disabled{cursor:default;}
20
- .sns-less-ide .inside{margin:6px 0;padding:0 10px;line-height:1.4em;}
21
- .sns-collapsed-btn{cursor:pointer;float:left;height:1.4em;width:1.4em;background-image:url("data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%0F%00%00%00%7B%08%06%00%00%00%ABe%DA%9D%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01%90IDATx%DA%EC%991N%C3%40%10E%D7%40%1D%A4(G%A0%A2%A0%E2%06Q%90%DB%5C%02%09%AA%F4%A1%8C%7BW%20%E5%10P%DA%22%E2%06%AERP%E5%08%08)%F4%D6%F2G%FA%C5j%E5%F5%AEM%81%10%B3%D2%D7%EC%3A~%1E%7Bci%BE%C6%99%B5%D6%8C%1D'%E6%07%E3%8F%C2g%FE%81%BA%AE%1B%84%0B.'%D0%17%E7%87%3C%CF%AFc%99%0B%E8%9C%CA%9Cy%E1%9F%98u%FDU%C8%FE%8A%B0p%0E%ED%90%F5%26%F5%99WP%CBy%CBu%DA%86!%CB%3B%C2%96%CB-%D7%83v%FB%01%B2%8C%DDC%9E9%A4%AA%AA%E6%7D%BFg%FAn%2B%AC%B0%C2%0A%2B%FC%CB0%EA%F4%BC%EF%F7%60%AD%028E%F8%80f(%B1%9FC3oh%2B6%832%23%EB%25%C2%1E%3A%A53%B8%EA*%F0%A1%CC%25A%C3X%26%DD6%B2.%3D3%23c%C1%E3%D1%CCk%E8HYg%BEN%DEm%7D%B7%15VXa%85%15V8v%82%D4e%B6%3F%E2%7D%12%CFZ%94%2C%F4%C7%D4%26%CB%94%26%E6%D6%B1%16%F1%0E%0D%7D%D7%8E.%C8%1D%93%E83%C3%F1%BC%89%EF%82%9E%9C%3E%89qZ%3C%FD%1B%26%86%0D%BA%17%FB%C4%BB0%A3Z%1Dlw%2C%A1F%5B%1D%0A%2B%AC%B0%C2%0A%2B%CC%22%DFt%F5%08R3%CB%B7%9Bg%F9%92Bo2%EA%B6%C5%CC%ECq%81Gz%95%24%D8%F5%20bj%EE%A4%D5%E3%F7%8AB%B0%EBAZz%94%19%3DK%DC%87q%88'Y%85%BE%DD%84%E0%03T%00z%E9%BB%F2%7F%F4%24%DF%02%0C%00%C9H%D9%18%7B.%E6%93%00%00%00%00IEND%AEB%60%82");background-attachment:scroll;background-repeat:no-repeat;background-position:1px 1px;margin-right:.5em;}.sns-collapsed-btn+label,.sns-collapsed-btn+p{height:1.4em;display:block;margin:0;}
22
- .sns-collapsed{overflow:hidden;}.sns-collapsed .sns-collapsed-btn{background-position:1px -107px;}
23
- .sns-collapsed .CodeMirror,.sns-collapsed .code,.sns-collapsed .sns-ajax-wrap,.sns-collapsed textarea{visibility:hidden;position:absolute;}
24
- .sns-ajax-loading{display:none;vertical-align:top;}.sns-ajax-loading .spinner{float:none;}
25
- .sns-ajax-wrap{height:23px;}.sns-ajax-wrap .single-status{display:inline-block;vertical-align:middle;}.sns-ajax-wrap .single-status .settings-error{margin:0;}
26
- .sns-shortcode{background-color:#F5F5F5;background-image:-moz-linear-gradient(center top, #f9f9f9, #f5f5f5);border-color:#DFDFDF;border-radius:3px 3px 3px 3px;box-shadow:0 1px 0 #FFFFFF inset;border-style:solid;border-width:1px;line-height:1;margin-bottom:20px;padding:0;}.sns-shortcode .inside{margin:6px 0 8px;position:relative;line-height:1.4em;padding:0 10px;}
1
+ /* Options.css */
2
+
3
+ .CodeMirror {
4
+ border: 1px solid #DFDFDF;
5
+ background-color: white;
6
+ border-radius: 3px;
7
+ margin: 8px 0;
8
+ }
9
+ .CodeMirror-scroll {
10
+ height: auto;
11
+ min-height: 50px;
12
+ max-height: 300px;
13
+ overflow: auto;
14
+ }
 
 
 
 
 
 
 
 
 
 
 
 
images/icon32.png DELETED
Binary file
images/menu.png DELETED
Binary file
includes/class-sns-admin.php DELETED
@@ -1,206 +0,0 @@
1
- <?php
2
- /**
3
- * Scripts n Styles Admin Class
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- require_once( 'class-sns-meta-box.php' );
11
- require_once( 'class-sns-code-editor.php' );
12
- require_once( 'class-sns-settings-page.php' );
13
- require_once( 'class-sns-usage-page.php' );
14
- require_once( 'class-sns-global-page.php' );
15
- require_once( 'class-sns-hoops-page.php' );
16
- require_once( 'class-sns-theme-page.php' );
17
- require_once( 'class-sns-ajax.php' );
18
- require_once( 'class-sns-form.php' );
19
-
20
- class SnS_Admin
21
- {
22
- /**#@+
23
- * Constants
24
- */
25
- const OPTION_GROUP = 'scripts_n_styles';
26
- const MENU_SLUG = 'sns';
27
- static $parent_slug = '';
28
- /**#@-*/
29
-
30
- /**
31
- * Initializing method.
32
- * @static
33
- */
34
- static function init() {
35
- add_action( 'admin_menu', array( 'SnS_Admin_Meta_Box', 'init' ) );
36
- add_action( 'admin_menu', array( 'SnS_Admin_Code_Editor', 'init' ) );
37
- add_action( 'network_admin_menu', array( 'SnS_Admin_Code_Editor', 'init' ) );
38
-
39
- add_action( 'admin_menu', array( __CLASS__, 'menu' ) );
40
-
41
- add_action( 'admin_init', array( 'SnS_AJAX', 'init' ) );
42
- add_action( 'admin_init', array( __CLASS__, 'load_plugin_textdomain' ) );
43
-
44
- $plugin_file = plugin_basename( Scripts_n_Styles::$file );
45
- add_filter( "plugin_action_links_$plugin_file", array( __CLASS__, 'plugin_action_links') );
46
-
47
- register_activation_hook( Scripts_n_Styles::$file, array( __CLASS__, 'upgrade' ) );
48
- }
49
-
50
- static function load_plugin_textdomain() {
51
- load_plugin_textdomain( 'scripts-n-styles', false, dirname( plugin_basename( Scripts_n_Styles::$file ) ) . '/languages/' );
52
- }
53
- static function menu() {
54
- if ( ! current_user_can( 'manage_options' ) || ! current_user_can( 'unfiltered_html' ) ) return;
55
-
56
- $options = get_option( 'SnS_options' );
57
- $menu_spot = isset( $options[ 'menu_position' ] ) ? $options[ 'menu_position' ]: '';
58
- $top_spots = array( 'menu', 'object', 'utility' );
59
- $sub_spots = array( 'tools.php', 'options-general.php', 'themes.php' );
60
-
61
- if ( in_array( $menu_spot, $top_spots ) ) $parent_slug = SnS_Admin::MENU_SLUG;
62
- else if ( in_array( $menu_spot, $sub_spots ) ) $parent_slug = $menu_spot;
63
- else $parent_slug = 'tools.php';
64
-
65
- self::$parent_slug = $parent_slug;
66
-
67
- switch( $menu_spot ) {
68
- case 'menu':
69
- add_menu_page( __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Scripts n Styles', 'scripts-n-styles' ), 'unfiltered_html', $parent_slug, array( 'SnS_Form', 'page' ), plugins_url( 'images/menu.png', Scripts_n_Styles::$file ) );
70
- break;
71
- case 'object':
72
- add_object_page( __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Scripts n Styles', 'scripts-n-styles' ), 'unfiltered_html', $parent_slug, array( 'SnS_Form', 'page' ), plugins_url( 'images/menu.png', Scripts_n_Styles::$file ) );
73
- break;
74
- case 'utility':
75
- add_utility_page( __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Scripts n Styles', 'scripts-n-styles' ), 'unfiltered_html', $parent_slug, array( 'SnS_Form', 'page' ), plugins_url( 'images/menu.png', Scripts_n_Styles::$file ) );
76
- break;
77
- }
78
- SnS_Global_Page::init();
79
- SnS_Hoops_Page::init();
80
- if ( current_theme_supports( 'scripts-n-styles' ) )
81
- SnS_Theme_Page::init();
82
- SnS_Settings_Page::init();
83
- SnS_Usage_Page::init();
84
- }
85
-
86
- /**
87
- * Nav Tabs
88
- */
89
- static function nav() {
90
- $options = get_option( 'SnS_options' );
91
- $page = $_REQUEST[ 'page' ];
92
- ?>
93
- <?php screen_icon(); ?>
94
- <h2>Scripts n Styles</h2>
95
- <?php if ( ! isset( $options[ 'menu_position' ] ) || 'options-general.php' != $options[ 'menu_position' ] ) settings_errors(); ?>
96
- <?php screen_icon( 'none' ); ?>
97
- <h3 class="nav-tab-wrapper">
98
- <a class="nav-tab<?php echo ( self::MENU_SLUG == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG ); ?>"><?php _e( 'Global', 'scripts-n-styles' ); ?></a>
99
- <a class="nav-tab<?php echo ( self::MENU_SLUG . '_hoops' == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG . '_hoops' ); ?>"><?php _e( 'Hoops', 'scripts-n-styles' ); ?></a>
100
- <?php if ( current_theme_supports( 'scripts-n-styles' ) ) { ?>
101
- <a class="nav-tab<?php echo ( self::MENU_SLUG . '_theme' == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG . '_theme' ); ?>"><?php _e( 'Theme', 'scripts-n-styles' ); ?></a>
102
- <?php } ?>
103
- <a class="nav-tab<?php echo ( self::MENU_SLUG . '_settings' == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG . '_settings' ); ?>"><?php _e( 'Settings', 'scripts-n-styles' ); ?></a>
104
- <a class="nav-tab<?php echo ( self::MENU_SLUG . '_usage' == $page ) ? ' nav-tab-active': ''; ?>" href="<?php menu_page_url( self::MENU_SLUG . '_usage' ); ?>"><?php _e( 'Usage', 'scripts-n-styles' ); ?></a>
105
- </h3>
106
- <?php
107
- }
108
-
109
- /**
110
- * Settings Page help
111
- */
112
- static function help() {
113
- $help = '<p>' . __( 'In default (non MultiSite) WordPress installs, both <em>Administrators</em> and <em>Editors</em> can access <em>Scripts-n-Styles</em> on individual edit screens. Only <em>Administrators</em> can access this Options Page. In MultiSite WordPress installs, only <em>"Super Admin"</em> users can access either <em>Scripts-n-Styles</em> on individual edit screens or this Options Page. If other plugins change capabilities (specifically "unfiltered_html"), other users can be granted access.', 'scripts-n-styles' ) . '</p>';
114
- $help .= '<p><strong>' . __( 'Reference: jQuery Wrappers', 'scripts-n-styles' ) . '</strong></p>' .
115
- '<pre><code>jQuery(document).ready(function($) {
116
- // $() will work as an alias for jQuery() inside of this function
117
- });</code></pre>';
118
- $help .= '<pre><code>(function($) {
119
- // $() will work as an alias for jQuery() inside of this function
120
- })(jQuery);</code></pre>';
121
- $sidebar = '<p><strong>' . __( 'For more information:', 'scripts-n-styles' ) . '</strong></p>' .
122
- '<p>' . __( '<a href="http://wordpress.org/extend/plugins/scripts-n-styles/faq/" target="_blank">Frequently Asked Questions</a>', 'scripts-n-styles' ) . '</p>' .
123
- '<p>' . __( '<a href="https://github.com/unFocus/Scripts-n-Styles" target="_blank">Source on github</a>', 'scripts-n-styles' ) . '</p>' .
124
- '<p>' . __( '<a href="http://wordpress.org/tags/scripts-n-styles" target="_blank">Support Forums</a>', 'scripts-n-styles' ) . '</p>';
125
- $screen = get_current_screen();
126
- if ( method_exists( $screen, 'add_help_tab' ) ) {
127
- $screen->add_help_tab( array(
128
- 'title' => __( 'Scripts n Styles', 'scripts-n-styles' ),
129
- 'id' => 'scripts-n-styles',
130
- 'content' => $help
131
- )
132
- );
133
- if ( 'post' != $screen->id )
134
- $screen->set_help_sidebar( $sidebar );
135
- } else {
136
- add_contextual_help( $screen, $help . $sidebar );
137
- }
138
- }
139
-
140
- /**
141
- * Utility Method: Sets defaults if not previously set. Sets stored 'version' to VERSION.
142
- */
143
- static function upgrade() {
144
- $options = get_option( 'SnS_options' );
145
- if ( ! $options ) $options = array();
146
- $options[ 'version' ] = Scripts_n_Styles::VERSION;
147
- update_option( 'SnS_options', $options );
148
-
149
- /*
150
- * upgrade proceedure
151
- */
152
- $posts = get_posts(
153
- array(
154
- 'numberposts' => -1,
155
- 'post_type' => 'any',
156
- 'post_status' => 'any',
157
- 'meta_query' => array(
158
- 'relation' => 'OR',
159
- array( 'key' => '_SnS_scripts' ),
160
- array( 'key' => '_SnS_styles' ),
161
- array( 'key' => 'uFp_scripts' ),
162
- array( 'key' => 'uFp_styles' )
163
- )
164
- )
165
- );
166
-
167
- foreach( $posts as $post) {
168
- $styles = get_post_meta( $post->ID, '_SnS_styles', true );
169
- if ( empty( $styles ) )
170
- $styles = get_post_meta( $post->ID, 'uFp_styles', true );
171
-
172
- $scripts = get_post_meta( $post->ID, '_SnS_scripts', true );
173
- if ( empty( $scripts ) )
174
- $scripts = get_post_meta( $post->ID, 'uFp_scripts', true );
175
-
176
- $SnS = array();
177
- if ( ! empty( $styles ) )
178
- $SnS[ 'styles' ] = $styles;
179
-
180
- if ( ! empty( $scripts ) )
181
- $SnS[ 'scripts' ] = $scripts;
182
-
183
- if ( ! empty( $SnS ) )
184
- update_post_meta( $post->ID, '_SnS', $SnS );
185
-
186
- delete_post_meta( $post->ID, 'uFp_styles' );
187
- delete_post_meta( $post->ID, 'uFp_scripts' );
188
- delete_post_meta( $post->ID, '_SnS_styles' );
189
- delete_post_meta( $post->ID, '_SnS_scripts' );
190
- }
191
-
192
- }
193
-
194
- /**
195
- * Adds link to the Settings Page in the WordPress "Plugin Action Links" array.
196
- * @param array $actions
197
- * @return array
198
- */
199
- static function plugin_action_links( $actions ) {
200
- $actions[ 'settings' ] = '<a href="' . menu_page_url( SnS_Settings_Page::MENU_SLUG, false ) . '"/>' . __( 'Settings' ) . '</a>';
201
- return $actions;
202
- }
203
-
204
- }
205
-
206
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-ajax.php DELETED
@@ -1,415 +0,0 @@
1
- <?php
2
- class SnS_AJAX
3
- {
4
- static function init() {
5
- // Keep track of current tab.
6
- add_action( 'wp_ajax_sns_update_tab', array( __CLASS__, 'update_tab' ) );
7
- // TinyMCE requests a css file.
8
- add_action( 'wp_ajax_sns_tinymce_styles', array( __CLASS__, 'tinymce_styles' ) );
9
-
10
- // Ajax Saves.
11
- add_action( 'wp_ajax_sns_classes', array( __CLASS__, 'classes' ) );
12
- add_action( 'wp_ajax_sns_scripts', array( __CLASS__, 'scripts' ) );
13
- add_action( 'wp_ajax_sns_styles', array( __CLASS__, 'styles' ) );
14
- add_action( 'wp_ajax_sns_dropdown', array( __CLASS__, 'dropdown' ) );
15
- add_action( 'wp_ajax_sns_delete_class', array( __CLASS__, 'delete_class' ) );
16
- add_action( 'wp_ajax_sns_shortcodes', array( __CLASS__, 'shortcodes' ) );
17
- add_action( 'wp_ajax_sns_open_theme_panels', array( __CLASS__, 'open_theme_panels' ) );
18
- add_action( 'wp_ajax_sns_plugin_editor', array( __CLASS__, 'plugin_editor' ) );
19
- }
20
-
21
- static function plugin_editor() {
22
- check_ajax_referer( 'sns_plugin_editor' );
23
- if ( ! current_user_can( 'edit_plugins' ) ) exit( 'Insufficient Privileges.' );
24
-
25
- $active = false;
26
- $plugin = '';
27
- $debug = array();
28
- $need_update = false;
29
- $plugins = array_keys( get_plugins() );
30
- $file = $_REQUEST[ 'file' ];
31
- $short = substr( $file, 0, strpos( $file, '/' ) );
32
-
33
- if ( ! in_array( $file, $plugins ) ) {
34
- $need_update = true;
35
-
36
- if ( in_array( $_REQUEST[ 'plugin' ], $plugins ) ) {
37
- $plugin = $_REQUEST[ 'plugin' ];
38
- } else {
39
- foreach ( $plugins as $maybe ) {
40
- if ( false !== strpos( $maybe, $short ) ) {
41
- $plugin = $maybe;
42
- break;
43
- }
44
- }
45
- }
46
- } else {
47
- $plugin = $file;
48
- while ( 1 < substr_count( $plugin, "/" ) ) {
49
- $plugin = dirname( $plugin );
50
- }
51
- }
52
-
53
- $active = is_plugin_active( $plugin ) || is_plugin_active_for_network( $plugin );
54
-
55
- $files = get_plugin_files( $plugin );
56
-
57
- add_filter( 'editable_extensions', array( 'SnS_Admin_Code_Editor', 'extend' ) );
58
- $editable_extensions = array('php', 'txt', 'text', 'js', 'css', 'html', 'htm', 'xml', 'inc', 'include');
59
- $editable_extensions = (array) apply_filters('editable_extensions', $editable_extensions);
60
- $ul = '';
61
- foreach ( $files as $plugin_file ) {
62
- // Get the extension of the file
63
- if ( preg_match( '/\.([^.]+)$/', $plugin_file, $matches ) ) {
64
- $ext = strtolower( $matches[1] );
65
- // If extension is not in the acceptable list, skip it
66
- if ( ! in_array( $ext, $editable_extensions ) )
67
- continue;
68
- } else {
69
- // No extension found
70
- continue;
71
- }
72
- $ul .= '<li';
73
- $ul .= $file == $plugin_file ? ' class="highlight">' : '>';
74
- $ul .= '<a href="plugin-editor.php?file=' . urlencode( $plugin_file ) . '&amp;plugin=' . urlencode( $plugin ) . '">';
75
- $ul .= str_replace( $short . '/', '', $plugin_file );
76
- $ul .= '</a>';
77
- $ul .= '</li>';
78
- }
79
-
80
- header('Content-Type: application/json; charset=UTF-8');
81
- echo json_encode( array(
82
- "plugin" => $plugin,
83
- "active" => $active,
84
- "files" => $files,
85
- "need_update" => $need_update,
86
- "ul" => $ul,
87
- ) );
88
-
89
- exit();
90
- }
91
- static function open_theme_panels() {
92
- check_ajax_referer( SnS_Admin::OPTION_GROUP . "-options" );
93
-
94
- $name = isset( $_POST[ 'file-name' ] ) ? $_POST[ 'file-name' ] : '';
95
- if ( empty( $name ) ) exit( 'empty name');
96
-
97
- $collapsed = isset( $_POST[ 'collapsed' ] ) ? $_POST[ 'collapsed' ] : '';
98
- if ( empty( $collapsed ) ) exit( 'empty value');
99
-
100
- if ( ! $user = get_current_user_id() ) exit( 'Bad User' );
101
-
102
- $open_theme_panels = json_decode( get_user_option( 'sns_open_theme_panels', $user ), true );
103
- $open_theme_panels = is_array( $open_theme_panels ) ? $open_theme_panels : array();
104
- $open_theme_panels[ $name ] = $collapsed;
105
- $open_theme_panels = json_encode( $open_theme_panels );
106
- update_user_option( $user, 'sns_open_theme_panels', $open_theme_panels );
107
-
108
- exit();
109
- }
110
- static function update_tab() {
111
- check_ajax_referer( Scripts_n_Styles::$file );
112
-
113
- $active_tab = isset( $_POST[ 'active_tab' ] ) ? 's'.$_POST[ 'active_tab' ] : 's0';
114
-
115
- if ( ! $user = wp_get_current_user() ) exit( 'Bad User' );
116
-
117
- $success = update_user_option( $user->ID, 'current_sns_tab', $active_tab, true);
118
- exit();
119
- }
120
- static function tinymce_styles() {
121
- check_ajax_referer( 'sns_tinymce_styles' );
122
-
123
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
124
- $post_id = absint( $_REQUEST[ 'post_id' ] );
125
-
126
- $options = get_option( 'SnS_options' );
127
- $SnS = get_post_meta( $post_id, '_SnS', true );
128
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
129
-
130
- header('Content-Type: text/css; charset=UTF-8');
131
-
132
- if ( ! empty( $options[ 'styles' ] ) ) echo $options[ 'styles' ];
133
-
134
- if ( ! empty( $styles[ 'styles' ] ) ) echo $styles[ 'styles' ];
135
-
136
- exit();
137
- }
138
-
139
- // AJAX handlers
140
- static function classes() {
141
- check_ajax_referer( Scripts_n_Styles::$file );
142
- if ( ! current_user_can( 'unfiltered_html' ) || ! current_user_can( 'edit_posts' ) ) exit( 'Insufficient Privileges.' );
143
-
144
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
145
- if ( ! isset( $_REQUEST[ 'classes_body' ], $_REQUEST[ 'classes_post' ] ) ) exit( 'Data missing.' );
146
-
147
- $post_id = absint( $_REQUEST[ 'post_id' ] );
148
- $SnS = get_post_meta( $post_id, '_SnS', true );
149
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
150
-
151
- $styles = self::maybe_set( $styles, 'classes_body' );
152
- $styles = self::maybe_set( $styles, 'classes_post' );
153
-
154
- if ( empty( $styles ) ) {
155
- if ( isset( $SnS['styles'] ) )
156
- unset( $SnS['styles'] );
157
- } else {
158
- $SnS[ 'styles' ] = $styles;
159
- }
160
- self::maybe_update( $post_id, '_SnS', $SnS );
161
-
162
- header('Content-Type: application/json; charset=UTF-8');
163
- echo json_encode( array(
164
- "classes_post" => $_REQUEST[ 'classes_post' ]
165
- , "classes_body" => $_REQUEST[ 'classes_body' ]
166
- ) );
167
-
168
- exit();
169
- }
170
- static function scripts() {
171
- check_ajax_referer( Scripts_n_Styles::$file );
172
- if ( ! current_user_can( 'unfiltered_html' ) || ! current_user_can( 'edit_posts' ) ) exit( 'Insufficient Privileges.' );
173
-
174
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
175
- if ( ! isset( $_REQUEST[ 'scripts' ], $_REQUEST[ 'scripts_in_head' ] ) ) exit( 'Data incorrectly sent.' );
176
-
177
- $post_id = absint( $_REQUEST[ 'post_id' ] );
178
- $SnS = get_post_meta( $post_id, '_SnS', true );
179
- $scripts = isset( $SnS['scripts'] ) ? $SnS[ 'scripts' ]: array();
180
-
181
- $scripts = self::maybe_set( $scripts, 'scripts_in_head' );
182
- $scripts = self::maybe_set( $scripts, 'scripts' );
183
-
184
- if ( empty( $scripts ) ) {
185
- if ( isset( $SnS['scripts'] ) )
186
- unset( $SnS['scripts'] );
187
- } else {
188
- $SnS[ 'scripts' ] = $scripts;
189
- }
190
- self::maybe_update( $post_id, '_SnS', $SnS );
191
-
192
- header('Content-Type: application/json; charset=UTF-8');
193
- echo json_encode( array(
194
- "scripts" => $_REQUEST[ 'scripts' ]
195
- , "scripts_in_head" => $_REQUEST[ 'scripts_in_head' ]
196
- ) );
197
-
198
- exit();
199
- }
200
- static function styles() {
201
- check_ajax_referer( Scripts_n_Styles::$file );
202
- if ( ! current_user_can( 'unfiltered_html' ) || ! current_user_can( 'edit_posts' ) ) exit( 'Insufficient Privileges.' );
203
-
204
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
205
- if ( ! isset( $_REQUEST[ 'styles' ] ) ) exit( 'Data incorrectly sent.' );
206
-
207
- $post_id = absint( $_REQUEST[ 'post_id' ] );
208
- $SnS = get_post_meta( $post_id, '_SnS', true );
209
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
210
-
211
- $styles = self::maybe_set( $styles, 'styles' );
212
-
213
- if ( empty( $styles ) ) {
214
- if ( isset( $SnS['styles'] ) )
215
- unset( $SnS['styles'] );
216
- } else {
217
- $SnS[ 'styles' ] = $styles;
218
- }
219
- self::maybe_update( $post_id, '_SnS', $SnS );
220
-
221
- header('Content-Type: application/json; charset=UTF-8');
222
- echo json_encode( array(
223
- "styles" => $_REQUEST[ 'styles' ],
224
- ) );
225
-
226
- exit();
227
- }
228
- static function dropdown() {
229
- check_ajax_referer( Scripts_n_Styles::$file );
230
- if ( ! current_user_can( 'unfiltered_html' ) || ! current_user_can( 'edit_posts' ) ) exit( 'Insufficient Privileges.' );
231
-
232
- if ( empty( $_REQUEST[ 'format' ] ) ) exit( 'Missing Format.' );
233
- if ( empty( $_REQUEST[ 'format' ][ 'title' ] ) ) exit( 'Title is required.' );
234
- if ( empty( $_REQUEST[ 'format' ][ 'classes' ] ) ) exit( 'Classes is required.' );
235
- if (
236
- empty( $_REQUEST[ 'format' ][ 'inline' ] ) &&
237
- empty( $_REQUEST[ 'format' ][ 'block' ] ) &&
238
- empty( $_REQUEST[ 'format' ][ 'selector' ] )
239
- ) exit( 'A type is required.' );
240
-
241
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
242
- $post_id = absint( $_REQUEST[ 'post_id' ] );
243
-
244
- $SnS = get_post_meta( $post_id, '_SnS', true );
245
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
246
-
247
- if ( ! isset( $styles[ 'classes_mce' ] ) ) $styles[ 'classes_mce' ] = array();
248
-
249
- // pass title as key to be able to delete.
250
- $styles[ 'classes_mce' ][ $_REQUEST[ 'format' ][ 'title' ] ] = $_REQUEST[ 'format' ];
251
-
252
- $SnS[ 'styles' ] = $styles;
253
- update_post_meta( $post_id, '_SnS', $SnS );
254
-
255
- header('Content-Type: application/json; charset=UTF-8');
256
- echo json_encode( array(
257
- "classes_mce" => array_values( $styles[ 'classes_mce' ] )
258
- ) );
259
-
260
- exit();
261
- }
262
- static function delete_class() {
263
- check_ajax_referer( Scripts_n_Styles::$file );
264
- if ( ! current_user_can( 'unfiltered_html' ) || ! current_user_can( 'edit_posts' ) ) exit( 'Insufficient Privileges.' );
265
-
266
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
267
- $post_id = absint( $_REQUEST[ 'post_id' ] );
268
- $SnS = get_post_meta( $post_id, '_SnS', true );
269
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
270
-
271
- $title = $_REQUEST[ 'delete' ];
272
-
273
- if ( isset( $styles[ 'classes_mce' ][ $title ] ) ) unset( $styles[ 'classes_mce' ][ $title ] );
274
- else exit ( 'No Format of that name.' );
275
-
276
- if ( empty( $styles[ 'classes_mce' ] ) ) unset( $styles[ 'classes_mce' ] );
277
-
278
- if ( empty( $styles ) ) {
279
- if ( isset( $SnS['styles'] ) )
280
- unset( $SnS['styles'] );
281
- } else {
282
- $SnS[ 'styles' ] = $styles;
283
- }
284
- self::maybe_update( $post_id, '_SnS', $SnS );
285
-
286
- if ( ! isset( $styles[ 'classes_mce' ] ) ) $styles[ 'classes_mce' ] = array( 'Empty' );
287
-
288
- header('Content-Type: application/json; charset=UTF-8');
289
- echo json_encode( array(
290
- "classes_mce" => array_values( $styles[ 'classes_mce' ] )
291
- ) );
292
-
293
- exit();
294
- }
295
- static function shortcodes() {
296
- check_ajax_referer( Scripts_n_Styles::$file );
297
- if ( ! current_user_can( 'unfiltered_html' ) || ! current_user_can( 'edit_posts' ) ) exit( 'Insufficient Privileges.' );
298
-
299
- if ( empty( $_REQUEST[ 'post_id' ] ) ) exit( 'Bad post ID.' );
300
- if ( empty( $_REQUEST[ 'subaction' ] ) ) exit( 'missing directive' );
301
-
302
- if ( in_array( $_REQUEST[ 'subaction' ], array( 'add', 'update', 'delete' ) ) )
303
- $subaction = $_REQUEST[ 'subaction' ];
304
- else
305
- exit( 'unknown directive' );
306
-
307
- $post_id = absint( $_REQUEST[ 'post_id' ] );
308
- $SnS = get_post_meta( $post_id, '_SnS', true );
309
- $shortcodes = isset( $SnS[ 'shortcodes' ] ) ? $SnS[ 'shortcodes' ]: array();
310
- $message = '';
311
- $code = 0;
312
- $key = '';
313
- $value = '';
314
-
315
- if ( isset( $_REQUEST[ 'name' ] ) )
316
- $key = $_REQUEST[ 'name' ];
317
- else
318
- exit( 'bad directive.' );
319
-
320
- if ( '' == $key ) {
321
- $key = count( $shortcodes );
322
- while ( isset( $shortcodes[ $key ] ) )
323
- $key++;
324
- }
325
-
326
- switch ( $subaction ) {
327
- case 'add':
328
- if ( empty( $_REQUEST[ 'shortcode' ] ) )
329
- exit( 'empty value.' );
330
- else
331
- $value = $_REQUEST[ 'shortcode' ];
332
-
333
- if ( isset( $shortcodes[ $key ] ) ) {
334
- $countr = 1;
335
- while ( isset( $shortcodes[ $key . '_' . $countr ] ) )
336
- $countr++;
337
- $key .= '_' . $countr;
338
- }
339
-
340
- $code = 1;
341
- $shortcodes[ $key ] = $value;
342
- break;
343
-
344
- case 'update':
345
- if ( empty( $_REQUEST[ 'shortcode' ] ) ) {
346
- if ( isset( $shortcodes[ $key ] ) )
347
- unset( $shortcodes[ $key ] );
348
- $code = 3;
349
- $message = $key;
350
- } else {
351
- $value = $_REQUEST[ 'shortcode' ];
352
- if ( isset( $shortcodes[ $key ] ) )
353
- $shortcodes[ $key ] = $value;
354
- else
355
- exit( 'wrong key.' );
356
- $code = 2;
357
- $message = 'updated ' . $key;
358
- }
359
- break;
360
-
361
- case 'delete':
362
- if ( isset( $shortcodes[ $key ] ) )
363
- unset( $shortcodes[ $key ] );
364
- else
365
- exit( 'bad key.' );
366
- $code = 3;
367
- $message = $key;
368
- break;
369
- }
370
-
371
- if ( empty( $shortcodes ) ) {
372
- if ( isset( $SnS[ 'shortcodes' ] ) )
373
- unset( $SnS[ 'shortcodes' ] );
374
- } else {
375
- $SnS[ 'shortcodes' ] = $shortcodes;
376
- }
377
- self::maybe_update( $post_id, '_SnS', $SnS );
378
-
379
- if ( 1 < $code ) {
380
- header('Content-Type: application/json; charset=UTF-8');
381
- echo json_encode( array(
382
- "message" => $message
383
- , "code" => $code
384
- ) );
385
- } else {
386
- header('Content-Type: text/html; charset=' . get_option('blog_charset'));
387
- ?><div class="sns-shortcode widget">
388
- <div class="inside">
389
- <p>[hoops name="<?php echo esc_attr( $key ) ?>"]</p>
390
- <textarea style="width: 98%;" cols="40" rows="5" name="SnS_shortcodes[existing][<?php echo esc_attr( $key ) ?>]"
391
- data-sns-shortcode-key="<?php echo esc_attr( $key ) ?>" class="codemirror-new htmlmixed"><?php echo esc_textarea( stripslashes( $value ) ) ?></textarea>
392
- <div class="sns-ajax-wrap"><a href="#" class="sns-ajax-delete-shortcode button">Delete</a> &nbsp; <a href="#" class="sns-ajax-update-shortcode button">Update</a> <span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span></div>
393
- </div>
394
- </div><?php
395
- }
396
- exit();
397
- }
398
-
399
- // Differs from SnS_Admin_Meta_Box::maybe_set() in that this needs no prefix.
400
- static function maybe_set( $o, $i ) {
401
- if ( ! is_array( $o ) ) return array();
402
- if ( empty( $_REQUEST[ $i ] ) ) {
403
- if ( isset( $o[ $i ] ) ) unset( $o[ $i ] );
404
- } else $o[ $i ] = $_REQUEST[ $i ];
405
- return $o;
406
- }
407
- static function maybe_update( $id, $name, $meta ) {
408
- if ( empty( $meta ) ) {
409
- delete_post_meta( $id, $name );
410
- } else {
411
- update_post_meta( $id, $name, $meta );
412
- }
413
- }
414
- }
415
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-code-editor.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Admin_Code_Editor
4
- */
5
-
6
- class SnS_Admin_Code_Editor
7
- {
8
- /**
9
- * Initializing method.
10
- */
11
- static function init() {
12
- add_action( 'admin_head-theme-editor.php', array( __CLASS__, 'styles' ) );
13
- add_action( 'admin_head-plugin-editor.php', array( __CLASS__, 'styles' ) );
14
- add_filter( 'editable_extensions', array( __CLASS__, 'extend' ) );
15
- }
16
-
17
- static function extend( $editable_extensions ) {
18
- $editable_extensions[] = 'less';
19
- $editable_extensions[] = 'coffee';
20
- $editable_extensions[] = 'md';
21
- return $editable_extensions;
22
- }
23
-
24
- static function styles() {
25
- $options = get_option( 'SnS_options' );
26
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
27
- wp_enqueue_style( 'sns-code-editor' );
28
- wp_enqueue_script( 'sns-code-editor' );
29
- wp_localize_script( 'sns-code-editor', 'codemirror_options', array( 'theme' => $cm_theme ) );
30
- wp_localize_script( 'sns-code-editor', 'sns_plugin_editor_options', array(
31
- 'action' => 'sns_plugin_editor',
32
- 'nonce' => wp_create_nonce( 'sns_plugin_editor')
33
- ) );
34
- }
35
- }
36
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-form.php DELETED
@@ -1,186 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Global_Page
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- class SnS_Form
11
- {
12
- /**
13
- * Settings Page
14
- * Outputs a textarea for setting 'scripts_in_head'.
15
- */
16
- static function textarea( $args ) {
17
- extract( $args );
18
- $options = get_option( $setting );
19
- $value = isset( $options[ $label_for ] ) ? $options[ $label_for ] : '';
20
- $output = '';
21
- if ( isset( $wrap_class ) ) $output .= '<div class="'. $wrap_class . '">';
22
- $output .= '<textarea';
23
- $output .= ( $style ) ? ' style="' . $style . '"': '';
24
- $output .= ( $class ) ? ' class="' . $class . '"': '';
25
- $output .= ( $rows ) ? ' rows="' . $rows . '"': '';
26
- $output .= ( $cols ) ? ' cols="' . $cols . '"': '';
27
- $output .= ' name="' . $setting . '[' . $label_for . ']"';
28
- $output .= ' id="' . $label_for . '">';
29
- $output .= esc_textarea( $value ) . '</textarea>';
30
- if ( isset( $wrap_class ) ) $output .= '</div>';
31
- if ( $description ) {
32
- $output .= $description;
33
- }
34
- echo $output;
35
- }
36
-
37
- static function radio( $args ) {
38
- extract( $args );
39
- $options = get_option( $setting );
40
- $default = isset( $default ) ? $default : '';
41
- $value = isset( $options[ $label_for ] ) ? $options[ $label_for ] : $default;
42
- $output = '<fieldset>';
43
- if ( $legend ) {
44
- $output .= '<legend class="screen-reader-text"><span>';
45
- $output .= $legend;
46
- $output .= '</span></legend>';
47
- }
48
- $output .= '<p>';
49
- foreach ( $choices as $choice ) {
50
- $output .= '<label style="white-space: pre;">';
51
- $output .= '<input type="radio"';
52
- $output .= checked( $value, $choice, false );
53
- $output .= ' value="' . $choice . '" name="' . $setting . '[' . $label_for . ']"> ' . $choice;
54
- $output .= '</label>';
55
- $output .= ( ! isset( $layout ) || 'horizontal' != $layout ) ? '<br>' : ' &nbsp; ';
56
- }
57
- $output .= '</p></fieldset>';
58
- if ( $description ) {
59
- $output .= $description;
60
- }
61
- echo $output;
62
- }
63
-
64
- /**
65
- * Settings Page
66
- * Outputs a select element for selecting options to set scripts for including.
67
- */
68
- static function select( $args ) {
69
- extract( $args );
70
- $options = get_option( $setting );
71
- $selected = isset( $options[ $label_for ] ) ? $options[ $label_for ] : array();
72
-
73
- $output = '<select';
74
- $output .= ' id="' . $label_for . '"';
75
- $output .= ' name="' . $setting . '[' . $label_for . ']';
76
- if ( isset( $multiple ) && $multiple )
77
- $output .= '[]" multiple="multiple"';
78
- else
79
- $output .= '"';
80
- $output .= ( $size ) ? ' size="' . $size . '"': '';
81
- $output .= ( $style ) ? ' style="' . $style . '"': '';
82
- $output .= '>';
83
- foreach ( $choices as $choice ) {
84
- $output .= '<option value="' . $choice . '"';
85
- if ( isset( $multiple ) && $multiple )
86
- foreach ( $selected as $handle ) $output .= selected( $handle, $choice, false );
87
- else
88
- $output .= selected( $selected, $choice, false );
89
- $output .= '>' . $choice . '</option> ';
90
- }
91
- $output .= '</select>';
92
- if ( ! empty( $show_current ) && ! empty( $selected ) ) {
93
- $output .= '<p>' . $show_current;
94
- foreach ( $selected as $handle ) $output .= '<code>' . $handle . '</code> ';
95
- $output .= '</p>';
96
- }
97
- echo $output;
98
- }
99
-
100
- /**
101
- * Settings Page
102
- * Outputs the Admin Page and calls the Settings registered with the Settings API.
103
- */
104
- static function take_action() {
105
- global $action, $option_page, $page, $new_whitelist_options;
106
-
107
- if ( ! current_user_can( 'manage_options' ) || ! current_user_can( 'unfiltered_html' ) || ( is_multisite() && ! is_super_admin() ) )
108
- wp_die( __( 'Cheatin&#8217; uh?' ) );
109
-
110
- // Handle menu-redirected update message.
111
- if ( isset( $_REQUEST[ 'message' ] ) && $_REQUEST[ 'message' ] )
112
- add_settings_error( $page, 'settings_updated', __( 'Settings saved.' ), 'updated' );
113
-
114
- if ( ! isset( $_REQUEST[ 'action' ], $_REQUEST[ 'option_page' ], $_REQUEST[ 'page' ] ) )
115
- return;
116
-
117
- wp_reset_vars( array( 'action', 'option_page', 'page' ) );
118
-
119
- check_admin_referer( $option_page . '-options' );
120
-
121
- if ( ! isset( $new_whitelist_options[ $option_page ] ) )
122
- return;
123
-
124
- $options = $new_whitelist_options[ $option_page ];
125
- foreach ( (array) $options as $option ) {
126
- $old = get_option( $option );
127
- $option = trim( $option );
128
- $new = null;
129
- if ( isset($_POST[ $option ]) )
130
- $new = $_POST[ $option ];
131
- if ( !is_array( $new ) )
132
- $new = trim( $new );
133
- $new = stripslashes_deep( $new );
134
- $value = array_merge( $old, $new );
135
-
136
- // Allow modification of $value
137
- $value = apply_filters( 'sns_options_pre_update_option', $value, $page, $action, $new, $old );
138
-
139
- update_option( $option, $value );
140
- }
141
-
142
- if ( ! count( get_settings_errors() ) )
143
- add_settings_error( $page, 'settings_updated', __( 'Settings saved.' ), 'updated' );
144
-
145
- if ( isset( $_REQUEST[ 'ajaxsubmit' ] ) && $_REQUEST[ 'ajaxsubmit' ] ) {
146
- ob_start();
147
- settings_errors( $page );
148
- $output = ob_get_contents();
149
- ob_end_clean();
150
- exit( $output );
151
- }
152
-
153
- // Redirect to new page if changed.
154
- if ( isset( $_POST[ $option ][ 'menu_position' ] ) && ( $value[ 'menu_position' ] != SnS_Admin::$parent_slug ) ) {
155
- switch( $value[ 'menu_position' ] ) {
156
- case 'menu':
157
- case 'object':
158
- case 'utility':
159
- wp_redirect( add_query_arg( array( 'message' => 1, 'page' => 'sns_settings' ), admin_url( 'admin.php' ) ) );
160
- break;
161
- default:
162
- wp_redirect( add_query_arg( array( 'message' => 1, 'page' => 'sns_settings' ), admin_url( $value[ 'menu_position' ] ) ) );
163
- break;
164
- }
165
- }
166
- return;
167
- }
168
-
169
- /**
170
- * Settings Page
171
- * Outputs the Admin Page and calls the Settings registered with the Settings API in init_options_page().
172
- */
173
- static function page() {
174
- ?>
175
- <div class="wrap">
176
- <?php SnS_Admin::nav(); ?>
177
- <form action="" method="post" autocomplete="off">
178
- <?php settings_fields( SnS_Admin::OPTION_GROUP ); ?>
179
- <?php do_settings_sections( SnS_Admin::MENU_SLUG ); ?>
180
- <?php if ( apply_filters( 'sns_show_submit_button', true ) ) submit_button(); ?>
181
- </form>
182
- </div>
183
- <?php
184
- }
185
- }
186
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-global-page.php DELETED
@@ -1,202 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Global_Page
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- class SnS_Global_Page
11
- {
12
- /**
13
- * Initializing method.
14
- * @static
15
- */
16
- static function init() {
17
- if ( SnS_Admin::$parent_slug == SnS_Admin::MENU_SLUG ) $menu_title = __( 'Global', 'scripts-n-styles' );
18
- else $menu_title = __( 'Scripts n Styles', 'scripts-n-styles' );
19
-
20
- $hook_suffix = add_submenu_page( SnS_Admin::$parent_slug, __( 'Scripts n Styles', 'scripts-n-styles' ), $menu_title, 'unfiltered_html', SnS_Admin::MENU_SLUG, array( 'SnS_Form', 'page' ) );
21
-
22
- add_action( "load-$hook_suffix", array( __CLASS__, 'admin_load' ) );
23
- add_action( "load-$hook_suffix", array( 'SnS_Admin', 'help' ) );
24
- add_action( "load-$hook_suffix", array( 'SnS_Form', 'take_action' ), 49 );
25
- add_action( "admin_print_styles-$hook_suffix", array( __CLASS__, 'admin_enqueue_scripts' ) );
26
- }
27
-
28
- static function admin_enqueue_scripts() {
29
- $options = get_option( 'SnS_options' );
30
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
31
-
32
- wp_enqueue_style( 'chosen' );
33
- wp_enqueue_style( 'sns-options' );
34
-
35
- wp_enqueue_script( 'sns-global-page' );
36
- wp_localize_script( 'sns-global-page', '_SnS_options', array( 'theme' => $cm_theme ) );
37
- }
38
- /**
39
- * Settings Page
40
- * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
41
- */
42
- static function admin_load() {
43
-
44
- register_setting(
45
- SnS_Admin::OPTION_GROUP,
46
- 'SnS_options' );
47
-
48
- add_settings_section(
49
- 'global_styles',
50
- __( 'Blog Wide CSS Styles', 'scripts-n-styles' ),
51
- array( __CLASS__, 'global_styles_section' ),
52
- SnS_Admin::MENU_SLUG );
53
-
54
- add_settings_section(
55
- 'global_scripts',
56
- __( 'Blog Wide JavaScript', 'scripts-n-styles' ),
57
- array( __CLASS__, 'global_scripts_section' ),
58
- SnS_Admin::MENU_SLUG );
59
-
60
- add_settings_field(
61
- 'less',
62
- __( '<strong>LESS:</strong> ', 'scripts-n-styles' ),
63
- array( __CLASS__, 'less_fields' ),
64
- SnS_Admin::MENU_SLUG,
65
- 'global_styles',
66
- array( 'label_for' => 'less' ) );
67
- add_settings_field(
68
- 'coffee',
69
- __( '<strong>CoffeeScript:</strong> ', 'scripts-n-styles' ),
70
- array( __CLASS__, 'coffee_fields' ),
71
- SnS_Admin::MENU_SLUG,
72
- 'global_scripts',
73
- array( 'label_for' => 'coffee' ) );
74
- add_settings_field(
75
- 'styles',
76
- __( '<strong>CSS Styles:</strong> ', 'scripts-n-styles' ),
77
- array( 'SnS_Form', 'textarea' ),
78
- SnS_Admin::MENU_SLUG,
79
- 'global_styles',
80
- array(
81
- 'label_for' => 'styles',
82
- 'setting' => 'SnS_options',
83
- 'class' => 'code css',
84
- 'wrap_class' => 'style',
85
- 'rows' => 5,
86
- 'cols' => 40,
87
- 'style' => 'min-width: 500px; width:97%;',
88
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">The "Styles" will be included <strong>verbatim</strong> in <code>&lt;style></code> tags in the <code>&lt;head></code> element of your html.</span>', 'scripts-n-styles' )
89
- ) );
90
- add_settings_field(
91
- 'scripts_in_head',
92
- __( '<strong>Scripts</strong><br />(for the <code>head</code> element): ', 'scripts-n-styles' ),
93
- array( 'SnS_Form', 'textarea' ),
94
- SnS_Admin::MENU_SLUG,
95
- 'global_scripts',
96
- array(
97
- 'label_for' => 'scripts_in_head',
98
- 'setting' => 'SnS_options',
99
- 'class' => 'code js',
100
- 'wrap_class' => 'script',
101
- 'rows' => 5,
102
- 'cols' => 40,
103
- 'style' => 'min-width: 500px; width:97%;',
104
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">The "Scripts (in head)" will be included <strong>verbatim</strong> in <code>&lt;script></code> tags in the <code>&lt;head></code> element of your html.</span>', 'scripts-n-styles' )
105
- ) );
106
- add_settings_field(
107
- 'scripts',
108
- __( '<strong>Scripts</strong><br />(end of the <code>body</code> tag):', 'scripts-n-styles' ),
109
- array( 'SnS_Form', 'textarea' ),
110
- SnS_Admin::MENU_SLUG,
111
- 'global_scripts',
112
- array(
113
- 'label_for' => 'scripts',
114
- 'setting' => 'SnS_options',
115
- 'class' => 'code js',
116
- 'wrap_class' => 'script',
117
- 'rows' => 5,
118
- 'cols' => 40,
119
- 'style' => 'min-width: 500px; width:97%;',
120
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">The "Scripts" will be included <strong>verbatim</strong> in <code>&lt;script></code> tags at the bottom of the <code>&lt;body></code> element of your html.</span>', 'scripts-n-styles' )
121
- ) );
122
- add_settings_field(
123
- 'enqueue_scripts',
124
- __( '<strong>Enqueue Scripts</strong>: ', 'scripts-n-styles' ),
125
- array( 'SnS_Form', 'select' ),
126
- SnS_Admin::MENU_SLUG,
127
- 'global_scripts',
128
- array(
129
- 'label_for' => 'enqueue_scripts',
130
- 'setting' => 'SnS_options',
131
- 'choices' => Scripts_n_Styles::get_wp_registered(),
132
- 'size' => 5,
133
- 'style' => 'height: auto;',
134
- 'multiple' => true,
135
- 'show_current' => __( 'Currently Enqueued Scripts: ', 'scripts-n-styles' )
136
- ) );
137
- add_filter( 'sns_options_pre_update_option', array( __CLASS__, 'enqueue_scripts'), 10, 5 );
138
- }
139
- static function enqueue_scripts( $value, $page, $action, $new, $old ) {
140
- if ( empty( $new['enqueue_scripts'] ) && ! empty( $old['enqueue_scripts'] ) )
141
- unset( $value['enqueue_scripts'] );
142
- return $value;
143
- }
144
-
145
- static function less_fields() {
146
- $options = get_option( 'SnS_options' );
147
- $less = isset( $options[ 'less' ] ) ? $options[ 'less' ] : '';
148
- $compiled = isset( $options[ 'compiled' ] ) ? $options[ 'compiled' ] : '';
149
- ?>
150
- <div style="overflow: hidden;">
151
- <div style="width: 49%; float: left; overflow: hidden; margin-right: 2%;" class="less">
152
- <textarea id="less" name="SnS_options[less]" style="min-width: 250px; width:47%; float: left" class="code less" rows="5" cols="40"><?php echo esc_textarea( $less ) ?></textarea>
153
- </div>
154
- <div style="width: 49%; float: left; overflow: hidden;" class="style">
155
- <textarea id="compiled" name="SnS_options[compiled]" style="min-width: 250px; width:47%;" class="code css" rows="5" cols="40"><?php echo esc_textarea( $compiled ) ?></textarea>
156
- <div id="compiled_error" style="display: none" class="error settings-error below-h2"></div>
157
- </div>
158
- </div>
159
- <?php
160
- }
161
- static function coffee_fields() {
162
- $options = get_option( 'SnS_options' );
163
- $coffee = isset( $options[ 'coffee' ] ) ? $options[ 'coffee' ] : '';
164
- $compiled = isset( $options[ 'coffee_compiled' ] ) ? $options[ 'coffee_compiled' ] : '';
165
- ?>
166
- <div style="overflow: hidden;">
167
- <div style="width: 49%; float: left; overflow: hidden; margin-right: 2%;" class="coffee">
168
- <textarea id="coffee" name="SnS_options[coffee]" style="min-width: 250px; width:47%; float: left" class="code coffee" rows="5" cols="40"><?php echo esc_textarea( $coffee ) ?></textarea>
169
- </div>
170
- <div style="width: 49%; float: left; overflow: hidden;" class="script">
171
- <textarea id="coffee_compiled" name="SnS_options[coffee_compiled]" style="min-width: 250px; width:47%;" class="code js" rows="5" cols="40"><?php echo esc_textarea( $compiled ) ?></textarea>
172
- <div id="coffee_compiled_error" style="display: none" class="error settings-error below-h2"></div>
173
- </div>
174
- </div>
175
- <?php
176
- }
177
-
178
- /**
179
- * Settings Page
180
- * Outputs Description text for the Global Section.
181
- */
182
- static function global_scripts_section() {
183
- ?>
184
- <div style="max-width: 55em;">
185
- <p><?php _e( 'Code entered here will be included in <em>every page (and post) of your site</em>, including the homepage and archives. The code will appear <strong>before</strong> Scripts that were registered individually.', 'scripts-n-styles' )?></p>
186
- </div>
187
- <?php
188
- }
189
-
190
- /**
191
- * Settings Page
192
- * Outputs Description text for the Global Section.
193
- */
194
- static function global_styles_section() {
195
- ?>
196
- <div style="max-width: 55em;">
197
- <p><?php _e( 'Code entered here will be included in <em>every page (and post) of your site</em>, including the homepage and archives. The code will appear <strong>before</strong> Styles that were registered individually.', 'scripts-n-styles' )?></p>
198
- </div>
199
- <?php
200
- }
201
- }
202
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-hoops-page.php DELETED
@@ -1,194 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Hoops_Page
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- class SnS_Hoops_Page
11
- {
12
- /**
13
- * Constants
14
- */
15
- const MENU_SLUG = 'sns_hoops';
16
-
17
- /**
18
- * Initializing method.
19
- * @static
20
- */
21
- static function init() {
22
- $hook_suffix = add_submenu_page( SnS_Admin::$parent_slug, __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Hoops' ), 'unfiltered_html', self::MENU_SLUG, array( 'SnS_Form', 'page' ) );
23
-
24
- add_action( "load-$hook_suffix", array( __CLASS__, 'admin_load' ) );
25
- add_action( "load-$hook_suffix", array( 'SnS_Admin', 'help' ) );
26
- add_action( "load-$hook_suffix", array( 'SnS_Form', 'take_action' ), 49 );
27
- add_action( "admin_print_styles-$hook_suffix", array( __CLASS__, 'admin_enqueue_scripts' ) );
28
-
29
- // Make the page into a tab.
30
- if ( SnS_Admin::MENU_SLUG != SnS_Admin::$parent_slug ) {
31
- remove_submenu_page( SnS_Admin::$parent_slug, self::MENU_SLUG );
32
- add_filter( 'parent_file', array( __CLASS__, 'parent_file') );
33
- }
34
- }
35
- static function parent_file( $parent_file ) {
36
- global $plugin_page, $submenu_file;
37
- if ( self::MENU_SLUG == $plugin_page ) $submenu_file = SnS_Admin::MENU_SLUG;
38
- return $parent_file;
39
- }
40
-
41
- static function admin_enqueue_scripts() {
42
- $options = get_option( 'SnS_options' );
43
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
44
-
45
- wp_enqueue_style( 'sns-options' );
46
- wp_enqueue_style( 'codemirror-theme' );
47
-
48
- wp_enqueue_script( 'sns-hoops-page' );
49
- wp_localize_script( 'sns-hoops-page', '_SnS_options', array( 'theme' => $cm_theme ) );
50
- }
51
- /**
52
- * Settings Page
53
- * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
54
- */
55
- static function admin_load() {
56
- // added here to not effect other pages.
57
- add_filter( 'sns_options_pre_update_option', array( __CLASS__, 'new_hoops') );
58
-
59
- register_setting(
60
- SnS_Admin::OPTION_GROUP,
61
- 'SnS_options' );
62
-
63
- add_settings_section(
64
- 'hoops_section',
65
- __( 'The Hoops Shortcodes', 'scripts-n-styles' ),
66
- array( __CLASS__, 'hoops_section' ),
67
- SnS_Admin::MENU_SLUG );
68
- }
69
- static function new_hoops( $options ) {
70
- // Get Hoops. (Shouldn't be empty.)
71
- $hoops = $options[ 'hoops' ];
72
-
73
- /*
74
- add_settings_error( 'sns_hoops', 'settings_updated', '<pre>'
75
- . '$hoops '
76
- . print_r(
77
- $hoops, true ) . '</pre>', 'updated' );
78
- */
79
-
80
- // take out new. (Also shouldn't be empty.)
81
- $new = $hoops[ 'new' ];
82
- unset( $hoops[ 'new' ] );
83
-
84
- // Get Shortcodes. (Could be empty.)
85
- $shortcodes = empty( $hoops[ 'shortcodes' ] ) ? array() : $hoops[ 'shortcodes' ];
86
-
87
- // prune shortcodes with blank values.
88
- foreach( $shortcodes as $key => $value ){
89
- if ( empty( $value ) )
90
- unset( $shortcodes[ $key ] );
91
- }
92
-
93
- // Add new (if not empty).
94
- if ( ! empty( $new[ 'code' ] ) ) {
95
- $name = empty( $new[ 'name' ] ) ? '' : $new[ 'name' ];
96
-
97
- if ( '' == $name ) {
98
- // If blank, find next index..
99
- $name = 0;
100
- while ( isset( $shortcodes[ $name ] ) )
101
- $name++;
102
- } else if ( isset( $shortcodes[ $name ] ) ) {
103
- // To make sure not to overwrite.
104
- $countr = 1;
105
- while ( isset( $shortcodes[ $name . '_' . $countr ] ) )
106
- $countr++;
107
- $name .= '_' . $countr;
108
- }
109
-
110
- // Add new to shortcodes.
111
- $shortcodes[ $name ] = $new[ 'code' ];
112
- }
113
-
114
- // Put in Shortcodes... if not empty.
115
- if ( empty( $shortcodes ) ) {
116
- if ( isset( $hoops[ 'shortcodes' ] ) )
117
- unset( $hoops[ 'shortcodes' ] );
118
- } else {
119
- $hoops[ 'shortcodes' ] = $shortcodes;
120
- }
121
-
122
- // Put in Hoops... if not empty.
123
- if ( empty( $hoops ) ) {
124
- if ( isset( $options[ 'hoops' ] ) )
125
- unset( $options[ 'hoops' ] );
126
- } else {
127
- $options[ 'hoops' ] = $hoops;
128
- }
129
-
130
- return $options; // Finish Filter.
131
- }
132
-
133
- /**
134
- * Settings Page
135
- * Outputs Description text for the Global Section.
136
- */
137
- static function hoops_section() {
138
- echo '<div style="max-width: 55em;">';
139
- _e( '<p>"Hoops" are shortcodes invented to get around some limitations of vanilla WordPress.</p>'
140
- . '<p> Normally, certain HTML is very problematic to use in the Post Editor, because it either gets '
141
- . 'jumbled during Switching between HTML and Visual Tabs, stripped out by WPAutoP (rare) or stripped '
142
- . 'out because the User doesn&#8217;t have the proper Permissions.</p>'
143
- . '<p>With Hoops, an Admin user (who has `unfiltered_html` and `manage_options` capablilities) can '
144
- . 'write and approve snippets of HTML for other users to use via Shortcodes.</p>', 'scripts-n-styles' );
145
- echo '</div>';
146
-
147
- $options = get_option( 'SnS_options' );
148
-
149
- $meta_name = 'SnS_options[hoops]';
150
- $hoops = isset( $options[ 'hoops' ] ) ? $options[ 'hoops' ] : array();
151
- $shortcodes = isset( $hoops[ 'shortcodes' ] ) ? $hoops[ 'shortcodes' ] : array();
152
- ?>
153
- <div id="sns-shortcodes">
154
- <h4>Add New: </h4>
155
- <div class="sns-less-ide" style="overflow: hidden">
156
- <div class="widget sns-shortcodes"><div class="inside">
157
- <label style="display:inline" for="<?php echo $meta_name; ?>">Name: </label>
158
- <input id="<?php echo $meta_name; ?>" name="<?php echo $meta_name . '[new][name]'; ?>" type="text" />
159
- <?php /** / ?>
160
- <a class="button" href="#" id="sns-ajax-add-shortcode">Add New</a>
161
- <?php /**/ ?>
162
- <textarea id="<?php echo $meta_name; ?>_new" class="code htmlmixed" name="<?php echo $meta_name . '[new][code]'; ?>" rows="5" cols="40" style="width: 98%;"></textarea>
163
- </div></div>
164
- </div>
165
-
166
- <?php if ( ! empty( $shortcodes ) ) { ?>
167
- <h4>Existing Codes: </h4>
168
- <div id="sns-shortcodes-wrap">
169
- <?php if ( ! empty( $shortcodes ) ) { ?>
170
- <?php foreach ( $shortcodes as $key => $value ) { ?>
171
-
172
- <div class="sns-less-ide" style="overflow: hidden">
173
- <div class="widget sns-shortcodes"><div class="sns-collapsed inside">
174
- <span class="sns-collapsed-btn"></span>
175
- <p style="margin-bottom: 0;">[hoops name="<?php echo $key ?>"]</p>
176
- <textarea class="code htmlmixed" data-sns-shortcode-key="<?php echo $key ?>" name="<?php echo $meta_name . '[shortcodes][' . $key . ']'; ?>" rows="5" cols="40" style="width: 98%;"><?php echo esc_textarea( $value ); ?></textarea>
177
- <?php /** / ?>
178
- <div class="sns-ajax-wrap">
179
- <a class="sns-ajax-delete-shortcode button" href="#">Delete</a> &nbsp;
180
- <a class="sns-ajax-update-shortcode button" href="#">Update</a>
181
- <span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>
182
- </div>
183
- <?php /**/ ?>
184
- </div></div>
185
- </div>
186
- <?php } ?>
187
- <?php } ?>
188
- </div>
189
- <?php } ?>
190
- </div>
191
- <?php
192
- }
193
- }
194
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-list-usage.php DELETED
@@ -1,176 +0,0 @@
1
- <?php
2
- if ( ! class_exists( 'WP_List_Table' ) ) require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
3
-
4
- class SnS_List_Usage extends WP_List_Table {
5
-
6
- function ajax_user_can() {
7
- return current_user_can( 'unfiltered_html' ) && current_user_can( 'manage_options' );
8
- }
9
-
10
- function column_default( $post, $column_name ) {
11
- $return = '';
12
- switch( $column_name ){
13
- case 'status':
14
- return $post->post_status;
15
- case 'ID':
16
- case 'post_type':
17
- return $post->$column_name;
18
- case 'script_data':
19
- if ( isset( $post->sns_scripts[ 'scripts_in_head' ] ) ) {
20
- $return .= '<div>' . __( 'Scripts (head)', 'scripts-n-styles' ) . '</div>';
21
- }
22
- if ( isset( $post->sns_scripts[ 'scripts' ] ) ) {
23
- $return .= '<div>' . __( 'Scripts', 'scripts-n-styles' ) . '</div>';
24
- }
25
- if ( isset( $post->sns_scripts[ 'enqueue_scripts' ] ) ) {
26
- $return .= '<div>' . __( 'Enqueued Scripts', 'scripts-n-styles' ) . '</div>';
27
- }
28
- return $return;
29
- case 'style_data':
30
- if ( isset( $post->sns_styles[ 'classes_mce' ] ) ) {
31
- $return .= '<div>' . __( 'TinyMCE Formats', 'scripts-n-styles' ) . '</div>';
32
- }
33
- if ( isset( $post->sns_styles[ 'styles' ] ) ) {
34
- $return .= '<div>' . __( 'Styles', 'scripts-n-styles' ) . '</div>';
35
- }
36
- if ( isset( $post->sns_styles[ 'classes_post' ] ) ) {
37
- $return .= '<div>' . __( 'Post Classes', 'scripts-n-styles' ) . '</div>';
38
- }
39
- if ( isset( $post->sns_styles[ 'classes_body' ] ) ) {
40
- $return .= '<div>' . __( 'Body Classes', 'scripts-n-styles' ) . '</div>';
41
- }
42
- return $return;
43
- default:
44
- return print_r( $post, true );
45
- }
46
- }
47
-
48
- function column_title( $post ) {
49
- $edit_link = esc_url( get_edit_post_link( $post->ID ) );
50
- $edit_title = esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $post->post_title ) );
51
-
52
- $actions = array(
53
- 'edit' => sprintf( '<a title="%s" href="%s">%s</a>', $edit_title, $edit_link, __( 'Edit' ) ),
54
- );
55
-
56
- $return = '<strong>';
57
- if ( $this->ajax_user_can() && $post->post_status != 'trash' ) {
58
- $return .= '<a class="row-title"';
59
- $return .= ' href="'. $edit_link .'"';
60
- $return .= ' title="'. $edit_title .'">';
61
- $return .= $post->post_title;
62
- $return .= '</a>';
63
- } else {
64
- $return .= $post->post_title;
65
- }
66
- $this->_post_states( $post );
67
- $return .= '</strong>';
68
- $return .= $this->row_actions( $actions );
69
-
70
- return $return;
71
- }
72
-
73
- function get_columns() {
74
- $columns = array(
75
- 'title' => __( 'Title' ),
76
- 'ID' => __( 'ID' ),
77
- 'status' => __( 'Status' ),
78
- 'post_type' => __( 'Post Type', 'scripts-n-styles' ),
79
- 'script_data' => __( 'Script Data', 'scripts-n-styles' ),
80
- 'style_data' => __( 'Style Data', 'scripts-n-styles' )
81
- );
82
-
83
- return $columns;
84
- }
85
-
86
- function prepare_items() {
87
- $screen_id = get_current_screen()->id;
88
- $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen_id}_per_page" ) );
89
-
90
- $this->_column_headers = array(
91
- $this->get_columns(),
92
- array(),
93
- $this->get_sortable_columns()
94
- );
95
-
96
- /**
97
- * Get Relavent Posts.
98
- */
99
- $posts = get_posts( array(
100
- 'numberposts' => -1,
101
- 'post_type' => 'any',
102
- 'post_status' => 'any',
103
- 'orderby' => 'ID',
104
- 'order' => 'ASC',
105
- 'meta_key' => '_SnS'
106
- ) );
107
-
108
- $items = $this->_add_meta_data( $posts );
109
-
110
- $total_items = count( $items );
111
-
112
- /**
113
- * Reduce items to current page's posts.
114
- */
115
- $this->items = array_slice(
116
- $items,
117
- ( ( $this->get_pagenum() - 1 ) * $per_page ),
118
- $per_page
119
- );
120
-
121
- $this->set_pagination_args( compact( 'total_items', 'per_page' ) );
122
- }
123
-
124
- function _post_states( $post ) {
125
- $post_states = array();
126
- $return = '';
127
- if ( isset($_GET[ 'post_status' ]) )
128
- $post_status = $_GET[ 'post_status' ];
129
- else
130
- $post_status = '';
131
-
132
- if ( ! empty( $post->post_password ) )
133
- $post_states[ 'protected' ] = __( 'Password protected' );
134
- if ( 'private' == $post->post_status && 'private' != $post_status )
135
- $post_states[ 'private' ] = __( 'Private' );
136
- if ( 'draft' == $post->post_status && 'draft' != $post_status )
137
- $post_states[ 'draft' ] = __( 'Draft' );
138
- if ( 'pending' == $post->post_status && 'pending' != $post_status )
139
- /* translators: post state */
140
- $post_states[ 'pending' ] = _x( 'Pending', 'post state' );
141
- if ( is_sticky($post->ID) )
142
- $post_states[ 'sticky' ] = __( 'Sticky' );
143
-
144
- $post_states = apply_filters( 'display_post_states', $post_states );
145
-
146
- if ( ! empty( $post_states ) ) {
147
- $state_count = count( $post_states );
148
- $i = 0;
149
- $return .= ' - ';
150
- foreach ( $post_states as $state ) {
151
- ++$i;
152
- ( $i == $state_count ) ? $sep = '' : $sep = ', ';
153
- $return .= "<span class='post-state'>$state$sep</span>";
154
- }
155
- }
156
-
157
- if ( get_post_format( $post->ID ) )
158
- $return .= ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
159
-
160
- return $return;
161
- }
162
-
163
- function _add_meta_data( $posts ) {
164
- foreach( $posts as $post) {
165
- $SnS = get_post_meta( $post->ID, '_SnS', true );
166
- $styles = isset( $SnS[ 'styles' ] ) ? $SnS[ 'styles' ]: array();
167
- $scripts = isset( $SnS[ 'scripts' ] ) ? $SnS[ 'scripts' ]: array();
168
- if ( ! empty( $styles ) )
169
- $post->sns_styles = $styles;
170
- if ( ! empty( $scripts ) )
171
- $post->sns_scripts = $scripts;
172
- }
173
- return $posts;
174
- }
175
- }
176
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-meta-box.php DELETED
@@ -1,422 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Admin_Meta_Box
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- class SnS_Admin_Meta_Box
11
- {
12
- /*
13
- * Constants
14
- */
15
- const NONCE_NAME = 'scripts_n_styles_noncename';
16
-
17
- static $post_types;
18
-
19
- /**
20
- * Initializing method.
21
- */
22
- static function init() {
23
- add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
24
- add_action( 'save_post', array( __CLASS__, 'save_post' ) );
25
- }
26
-
27
- static function mce_buttons_2( $buttons ) {
28
- global $post;
29
- $SnS = get_post_meta( $post->ID, '_SnS', true );
30
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
31
-
32
- if ( ! empty( $styles[ 'classes_mce' ] ) )
33
- array_unshift( $buttons, 'styleselect' );
34
-
35
- return $buttons;
36
- }
37
- static function tiny_mce_before_init( $initArray ) {
38
- global $post;
39
- $SnS = get_post_meta( $post->ID, '_SnS', true );
40
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
41
-
42
- // Add div as a format option, should probably use a string replace thing here.
43
- // Better yet, a setting for adding these. Postpone for now.
44
- //$initArray['theme_advanced_blockformats'] = "p,address,pre,h1,h2,h3,h4,h5,h6,div";
45
-
46
- if ( ( ! empty( $styles[ 'classes_body' ] ) || ! empty( $styles[ 'classes_post' ] ) ) && ! isset( $initArray['body_class'] ) )
47
- $initArray['body_class'] = '';
48
-
49
- // Add body_class (and/or maybe post_class) values... somewhat problematic.
50
- if ( ! empty( $styles[ 'classes_body' ] ) )
51
- $initArray['body_class'] .= ' ' . $styles[ 'classes_body' ];
52
- if ( ! empty( $styles[ 'classes_post' ] ) )
53
- $initArray['body_class'] .= ' ' . $styles[ 'classes_post' ];
54
-
55
- // In case Themes or plugins have added style_formats, not tested.
56
- if ( isset( $initArray['style_formats'] ) )
57
- $style_formats = json_decode( $initArray['style_formats'], true );
58
- else
59
- $style_formats = array();
60
-
61
- if ( ! empty( $styles[ 'classes_mce' ] ) )
62
- foreach ( $styles[ 'classes_mce' ] as $format )
63
- $style_formats[] = $format;
64
-
65
- if ( ! empty( $style_formats ) )
66
- $initArray['style_formats'] = json_encode( $style_formats );
67
-
68
- return $initArray;
69
- }
70
-
71
- /**
72
- * Admin Action: 'mce_css'
73
- * Adds a styles sheet to TinyMCE via ajax that contains the current styles data.
74
- */
75
- static function mce_css( $mce_css ) {
76
- global $post;
77
- $url = admin_url( 'admin-ajax.php' );
78
- $url = wp_nonce_url( $url, 'sns_tinymce_styles' );
79
- $url = add_query_arg( 'post_id', $post->ID, $url );
80
- $url = add_query_arg( 'action', 'sns_tinymce_styles', $url );
81
- $mce_css .= ',' . $url;
82
- return $mce_css;
83
- }
84
-
85
- /**
86
- * Admin Action: 'add_meta_boxes'
87
- * Main Meta Box function. Checks restriction options and display options, calls add_meta_box() and adds actions for adding admin CSS and JavaScript.
88
- */
89
- static function add_meta_boxes() {
90
- if ( current_user_can( 'unfiltered_html' ) ) {
91
- $post_type = get_current_screen()->post_type;
92
- if ( in_array( $post_type, get_post_types( array('show_ui' => true, 'public' => true ) ) ) ) {
93
- add_meta_box( 'SnS_meta_box', __( 'Scripts n Styles', 'scripts-n-styles' ), array( __CLASS__, 'admin_meta_box' ), $post_type, 'normal', 'high' );
94
- add_filter( 'default_hidden_meta_boxes', array( __CLASS__, 'default_hidden_meta_boxes' ) );
95
- add_action( "admin_print_styles", array( __CLASS__, 'meta_box_styles'));
96
- add_action( "admin_print_scripts", array( __CLASS__, 'meta_box_scripts'));
97
- add_filter( 'contextual_help', array( 'SnS_Admin', 'help' ) );
98
- add_filter( 'mce_buttons_2', array( __CLASS__, 'mce_buttons_2' ) );
99
- add_filter( 'tiny_mce_before_init', array( __CLASS__, 'tiny_mce_before_init' ) );
100
- add_filter( 'mce_css', array( __CLASS__, 'mce_css' ) );
101
- }
102
- }
103
- }
104
-
105
- static function default_hidden_meta_boxes( $hidden ) {
106
- $options = get_option( 'SnS_options' );
107
- if ( ! ( isset( $options[ 'metabox' ] ) && 'yes' == $options[ 'metabox' ] ) ) {
108
- $hidden[] = 'SnS_meta_box';
109
- $hidden[] = 'SnS_shortcode';
110
- }
111
- return $hidden;
112
- }
113
-
114
- /**
115
- * Admin Action: 'add_meta_boxes'
116
- * Outputs the Meta Box. Only called on callback from add_meta_box() during the add_meta_boxes action.
117
- * @param unknown_type WordPress Post object.
118
- */
119
- static function admin_meta_box( $post ) {
120
- $registered_handles = Scripts_n_Styles::get_wp_registered();
121
- $SnS = get_post_meta( $post->ID, '_SnS', true );
122
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
123
- $scripts = isset( $SnS['scripts'] ) ? $SnS[ 'scripts' ]: array();
124
-
125
- $position = get_user_option( "current_sns_tab" );
126
- if ( ! in_array( $position, array( 's0', 's1', 's2', 's3', 's4', 's5' ) ) ) $position = 's0';
127
- wp_nonce_field( Scripts_n_Styles::$file, self::NONCE_NAME );
128
- ?>
129
- <ul class="wp-tab-bar">
130
- <li<?php echo ( 's0' == $position ) ? ' class="wp-tab-active"': ''; ?>><a href="#SnS_scripts-tab"><?php _e( 'Scripts', 'scripts-n-styles' ) ?></a></li>
131
- <li<?php echo ( 's1' == $position ) ? ' class="wp-tab-active"': ''; ?>><a href="#SnS_styles-tab"><?php _e( 'Styles', 'scripts-n-styles' ) ?></a></li>
132
- <li<?php echo ( 's2' == $position ) ? ' class="wp-tab-active"': ''; ?>><a href="#SnS_classes_body-tab"><?php _e( 'Classes', 'scripts-n-styles' ) ?></a></li>
133
- <li<?php echo ( 's3' == $position ) ? ' class="wp-tab-active"': ''; ?>><a href="#SnS_enqueue_scripts-tab"><?php _e( 'Include Scripts', 'scripts-n-styles' ) ?></a></li>
134
- <li<?php echo ( 's4' == $position ) ? ' class="wp-tab-active"': ''; ?>><a href="#SnS_shortcodes-tab"><?php _e( 'Shortcodes', 'scripts-n-styles' ) ?></a></li>
135
- <li<?php echo ( 's5' == $position ) ? ' class="wp-tab-active"': ''; ?> style="display:none"><a href="#SnS_post_styles-tab"><?php _e( 'Dropdown', 'scripts-n-styles' ) ?></a></li>
136
- </ul>
137
-
138
- <div class="wp-tab-panel" id="SnS_scripts-tab">
139
- <p><em><?php _e( "This code will be included <strong>verbatim</strong> in <code>&lt;script></code> tags at the end of your page's (or post's)", 'scripts-n-styles' ) ?> ...</em></p>
140
- <label for="SnS_scripts_in_head" class="title"><?php _e( '<strong>Scripts</strong> (for the <code>head</code> element):', 'scripts-n-styles' ) ?> </label>
141
- <div class="script">
142
- <textarea class="codemirror js" name="SnS_scripts_in_head" id="SnS_scripts_in_head" rows="5" cols="40" style="width: 98%;"><?php echo isset( $scripts[ 'scripts_in_head' ] ) ? esc_textarea( $scripts[ 'scripts_in_head' ] ) : ''; ?></textarea>
143
- </div>
144
- <p><em>... <code>&lt;/head></code> <?php _e( 'tag', 'scripts-n-styles' ) ?>.</em></p>
145
- <label for="SnS_scripts" class="title"><strong>Scripts</strong>: </label>
146
- <div class="script">
147
- <textarea class="codemirror js" name="SnS_scripts" id="SnS_scripts" rows="5" cols="40" style="width: 98%;"><?php echo isset( $scripts[ 'scripts' ] ) ? esc_textarea( $scripts[ 'scripts' ] ) : ''; ?></textarea>
148
- </div>
149
- <p><em>... <code>&lt;/body></code> <?php _e( 'tag', 'scripts-n-styles' ) ?>.</em></p>
150
- </div>
151
-
152
- <div class="wp-tab-panel" id="SnS_styles-tab">
153
- <label for="SnS_styles" class="title"><?php _e( '<strong>Styles</strong>:', 'scripts-n-styles' ) ?> </label>
154
- <div class="style">
155
- <textarea class="codemirror css" name="SnS_styles" id="SnS_styles" rows="5" cols="40" style="width: 98%;"><?php echo isset( $styles[ 'styles' ] ) ? esc_textarea( $styles[ 'styles' ] ) : ''; ?></textarea>
156
- </div>
157
- <p><em><?php _e( 'This code will be included <strong>verbatim</strong> in <code>&lt;style></code> tags in the <code>&lt;head></code> tag of your page (or post).', 'scripts-n-styles' ) ?></em></p>
158
- </div>
159
-
160
- <div class="wp-tab-panel" id="SnS_classes_body-tab">
161
- <strong class="title"><?php _e( 'Classes', 'scripts-n-styles' ) ?></strong>
162
- <div id="sns-classes">
163
- <p>
164
- <label for="SnS_classes_body"><?php _e( '<strong>Body Classes</strong>:', 'scripts-n-styles' ) ?> </label>
165
- <input name="SnS_classes_body" id="SnS_classes_body" type="text" class="code" style="width: 99%;"
166
- value="<?php echo isset( $styles[ 'classes_body' ] ) ? esc_attr( $styles[ 'classes_body' ] ) : ''; ?>" />
167
- </p>
168
- <p>
169
- <label for="SnS_classes_post"><strong>Post Classes</strong>: </label>
170
- <input name="SnS_classes_post" id="SnS_classes_post" type="text" class="code" style="width: 99%;"
171
- value="<?php echo isset( $styles[ 'classes_post' ] ) ? esc_attr( $styles[ 'classes_post' ] ) : ''; ?>" />
172
- </p>
173
- <p><em><?php _e( 'These <strong>space separated</strong> class names will be added to the <code>body_class()</code> or <code>post_class()</code> function (provided your theme uses these functions).', 'scripts-n-styles' ) ?></em></p>
174
- </div>
175
- </div>
176
- <?php
177
- /*
178
- * Note: Styles Dropdown section only makes sense when Javascript is enabled. (Otherwise, no TinyMCE.)
179
- */
180
- ?>
181
- <div class="wp-tab-panel" id="SnS_post_styles-tab" style="display: none;">
182
- <strong class="title"><?php _e( 'Post Styles', 'scripts-n-styles' ) ?></strong>
183
- <div id="mce-dropdown-names">
184
- <h4><?php _e( 'The Styles Dropdown', 'scripts-n-styles' ) ?></h4>
185
- <div id="add-mce-dropdown-names">
186
- <p><?php _e( 'Add (or update) a class for the "Styles" drop-down:', 'scripts-n-styles' ) ?></p>
187
- <p class="sns-mce-title">
188
- <label for="SnS_classes_mce_title"><?php _e( 'Title:', 'scripts-n-styles' ) ?></label>
189
- <input name="SnS_classes_mce_title" id="SnS_classes_mce_title"
190
- value="" type="text" class="code" style="width: 80px;" />
191
- </p>
192
- <p class="sns-mce-type">
193
- <label for="SnS_classes_mce_type"><?php _e( 'Type:', 'scripts-n-styles' ) ?></label>
194
- <select name="SnS_classes_mce_type" id="SnS_classes_mce_type" style="width: 80px;">
195
- <option value="inline"><?php _ex( 'Inline', 'css type', 'scripts-n-styles' ) ?></option>
196
- <option value="block"><?php _ex( 'Block', 'css type', 'scripts-n-styles' ) ?></option>
197
- <option value="selector"><?php _ex( 'Selector:', 'css type', 'scripts-n-styles' ) ?></option>
198
- </select>
199
- </p>
200
- <p class="sns-mce-element">
201
- <label for="SnS_classes_mce_element"><?php _e( 'Element:', 'scripts-n-styles' ) ?></label>
202
- <input name="SnS_classes_mce_element" id="SnS_classes_mce_element"
203
- value="" type="text" class="code" style="width: 80px;" />
204
- </p>
205
- <p class="sns-mce-classes">
206
- <label for="SnS_classes_mce_classes"><?php _e( 'Classes:', 'scripts-n-styles' ) ?></label>
207
- <input name="SnS_classes_mce_classes" id="SnS_classes_mce_classes"
208
- value="" type="text" class="code" style="width: 80px;" />
209
- </p>
210
- <p class="sns-mce-wrapper" style="display: none;">
211
- <label for="SnS_classes_mce_wrapper"><?php _e( 'Wrapper:', 'scripts-n-styles' ) ?></label>
212
- <input name="SnS_classes_mce_wrapper" id="SnS_classes_mce_wrapper" type="checkbox" value="true" />
213
- </p>
214
- </div>
215
-
216
- <div id="delete-mce-dropdown-names" style="display: none;">
217
- <p id="instructions-mce-dropdown-names"><?php _e( 'Classes currently in the dropdown:', 'scripts-n-styles' ) ?></p>
218
- </div>
219
- </div>
220
- </div>
221
-
222
- <div class="wp-tab-panel" id="SnS_enqueue_scripts-tab">
223
- <strong class="title">Include Scripts</strong>
224
- <select name="SnS_enqueue_scripts[]" id="SnS_enqueue_scripts" size="5" multiple="multiple" style="height: auto; float: left; margin: 6px 10px 8px 0;">
225
- <?php
226
- if ( ! empty( $scripts[ 'enqueue_scripts' ] ) && is_array( $scripts[ 'enqueue_scripts' ] ) ) {
227
- foreach ( $registered_handles as $value ) { ?>
228
- <option value="<?php echo esc_attr( $value ) ?>"<?php foreach ( $scripts[ 'enqueue_scripts' ] as $handle ) selected( $handle, $value ); ?>><?php echo esc_html( $value ) ?></option>
229
- <?php }
230
- } else {
231
- foreach ( $registered_handles as $value ) { ?>
232
- <option value="<?php echo esc_attr( $value ) ?>"><?php echo esc_html( $value ) ?></option>
233
- <?php }
234
- } ?>
235
- </select>
236
- <?php if ( ! empty( $scripts[ 'enqueue_scripts' ] ) && is_array( $scripts[ 'enqueue_scripts' ] ) ) { ?>
237
- <p><?php _e( 'Currently Enqueued Scripts:', 'scripts-n-styles' ) ?>
238
- <?php foreach ( $scripts[ 'enqueue_scripts' ] as $handle ) echo '<code>' . esc_html( $handle ) . '</code> '; ?>
239
- </p>
240
- <?php } ?>
241
- <p><em><?php _e( 'The chosen scripts will be enqueued and placed before your codes if your code is dependant on certain scripts (like jQuery).', 'scripts-n-styles' ) ?></em></p>
242
- </div>
243
-
244
- <div class="wp-tab-panel" id="SnS_shortcodes-tab">
245
- <strong class="title">Shortcodes</strong>
246
- <div id="sns-add-shortcode">
247
- <?php
248
- $meta_name = 'SnS_shortcodes';
249
- $SnS = get_post_meta( $post->ID, '_SnS', true );
250
- $shortcodes = isset( $SnS['shortcodes'] ) ? $SnS[ 'shortcodes' ] : array();
251
- ?>
252
- <label for="<?php echo $meta_name; ?>">Name: </label>
253
- <input id="<?php echo $meta_name; ?>" name="<?php echo $meta_name . '[new][name]'; ?>" type="text" />
254
- <textarea id="<?php echo $meta_name; ?>_new" class="codemirror htmlmixed" name="<?php echo $meta_name . '[new][value]'; ?>" rows="5" cols="40" style="width: 98%;"></textarea>
255
- </div>
256
- <div id="sns-shortcodes">
257
- <h4>Existing Codes: </h4>
258
- <div id="sns-shortcodes-wrap">
259
- <?php if ( ! empty( $shortcodes ) ) { ?>
260
- <?php foreach ( $shortcodes as $key => $value ) { ?>
261
- <div class="sns-shortcode widget"><div class="inside">
262
- <p>[hoops name="<?php echo $key ?>"]</p>
263
- <textarea class="codemirror htmlmixed" data-sns-shortcode-key="<?php echo $key ?>" name="<?php echo $meta_name . '[existing][' . $key . ']'; ?>" rows="5" cols="40" style="width: 98%;"><?php echo esc_textarea( $value ); ?></textarea>
264
- </div></div>
265
- <?php } ?>
266
- <?php } ?>
267
- </div>
268
- </div>
269
- </div>
270
- <?php
271
- }
272
-
273
- static function current_classes( $type, $post_id ) {
274
- if ( 'body' == $type ) {
275
- global $wp_query, $pagenow;
276
-
277
- if ( 'post-new.php' == $pagenow ) {
278
- echo join( ' ', get_body_class( '', $post_id ) );
279
- echo ' ' . __( '(plus others once saved.)', 'scripts-n-styles' );
280
- return;
281
- }
282
- // This returns more of what actually get used on the theme side.
283
- $save = $wp_query;
284
- $param = ( 'page' == get_post_type( $post_id ) ) ? 'page_id': 'p';
285
- $wp_query = new WP_Query( "$param=$post_id" );
286
- echo join( ' ', get_body_class( '', $post_id ) );
287
- $wp_query = $save;
288
-
289
- } else {
290
- echo join( ' ', get_post_class( '', $post_id ) );
291
- }
292
- }
293
-
294
- /**
295
- * Admin Action: 'admin_print_styles' Action added during 'add_meta_boxes' (which restricts output to Edit Screens).
296
- * Enqueues the CSS for admin styling of the Meta Box.
297
- */
298
- static function meta_box_styles() {
299
- wp_enqueue_style( 'chosen' );
300
- wp_enqueue_style( 'sns-meta-box' );
301
- }
302
-
303
- /**
304
- * Admin Action: 'admin_print_styles' Action added during 'add_meta_boxes' (which restricts output to Edit Screens).
305
- * Enqueues the JavaScript for the admin Meta Box.
306
- */
307
- static function meta_box_scripts() {
308
- $options = get_option( 'SnS_options' );
309
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
310
-
311
- wp_enqueue_script( 'sns-meta-box' );
312
- wp_localize_script( 'sns-meta-box', 'codemirror_options', array( 'theme' => $cm_theme ) );
313
- }
314
-
315
- /**
316
- * Admin Action: 'save_post'
317
- * Saves the values entered in the Meta Box when a post is saved (on the Edit Screen only, excluding autosaves) if the user has permission.
318
- * @param int $post_id ID value of the WordPress post.
319
- */
320
- static function save_post( $post_id ) {
321
- if ( ! isset( $_POST[ self::NONCE_NAME ] ) || ! wp_verify_nonce( $_POST[ self::NONCE_NAME ], Scripts_n_Styles::$file )
322
- || ! current_user_can( 'unfiltered_html' )
323
- || wp_is_post_revision( $post_id ) // is needed for get_post_meta compatibility.
324
- || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
325
- ) return;
326
-
327
- /*
328
- NOTE: There is no current_user_can( 'edit_post' ) check here, because as far as I
329
- can tell, in /wp-admin/post.php the calls edit_post(), write_post(), post_preview(),
330
- wp_untrash_post(), etc., the check is already done prior to the 'save_post' action,
331
- which is where this function is called. Other calls are from other pages so the
332
- NONCE covers those cases, and that leaves autosave, which is also checked here.
333
- */
334
-
335
- $SnS = get_post_meta( $post_id, '_SnS', true );
336
- $SnS = is_array( $SnS ) ? $SnS: array(); // Something changed in PHP 7/WP 4.8
337
- $scripts = isset( $SnS['scripts'] ) ? $SnS[ 'scripts' ]: array();
338
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
339
-
340
- $scripts = self::maybe_set( $scripts, 'scripts_in_head' );
341
- $scripts = self::maybe_set( $scripts, 'scripts' );
342
- $scripts = self::maybe_set( $scripts, 'enqueue_scripts' );
343
- $styles = self::maybe_set( $styles, 'styles' );
344
- $styles = self::maybe_set( $styles, 'classes_body' );
345
- $styles = self::maybe_set( $styles, 'classes_post' );
346
-
347
- $shortcodes = array();
348
- $SnS_shortcodes = isset( $_REQUEST[ 'SnS_shortcodes' ] ) ? $_REQUEST[ 'SnS_shortcodes' ]: array();
349
-
350
- $existing_shortcodes = isset( $SnS_shortcodes[ 'existing' ] ) ? $SnS_shortcodes[ 'existing' ]: array();
351
- foreach ( $existing_shortcodes as $key => $value )
352
- if ( ! empty( $value ) )
353
- $shortcodes[ $key ] = $value;
354
-
355
- $new_shortcode = isset( $SnS_shortcodes[ 'new' ] ) ? $SnS_shortcodes[ 'new' ]: array();
356
- if ( ! empty( $new_shortcode[ 'value' ] ) ) {
357
-
358
- $key = ( isset( $new_shortcode[ 'name' ] ) ) ? $new_shortcode[ 'name' ] : '';
359
-
360
- if ( '' == $key ) {
361
- $key = count( $shortcodes );
362
- while ( isset( $shortcodes[ $key ] ) )
363
- $key++;
364
- }
365
-
366
- if ( isset( $shortcodes[ $key ] ) ) {
367
- $countr = 1;
368
- while ( isset( $shortcodes[ $key . '_' . $countr ] ) )
369
- $countr++;
370
- $key .= '_' . $countr;
371
- }
372
-
373
- $shortcodes[ $key ] = $new_shortcode[ 'value' ];
374
-
375
- }
376
-
377
- // This one isn't posted, it's ajax only. Cleanup anyway.
378
- if ( isset( $styles[ 'classes_mce' ] ) && empty( $styles[ 'classes_mce' ] ) )
379
- unset( $styles[ 'classes_mce' ] );
380
-
381
- if ( empty( $scripts ) ) {
382
- if ( isset( $SnS['scripts'] ) )
383
- unset( $SnS['scripts'] );
384
- } else {
385
- $SnS['scripts'] = $scripts;
386
- }
387
-
388
- if ( empty( $styles ) ) {
389
- if ( isset( $SnS['styles'] ) )
390
- unset( $SnS['styles'] );
391
- } else {
392
- $SnS['styles'] = $styles;
393
- }
394
-
395
- if ( empty( $shortcodes ) ) {
396
- if ( isset( $SnS['shortcodes'] ) )
397
- unset( $SnS['shortcodes'] );
398
- } else {
399
- $SnS['shortcodes'] = $shortcodes;
400
- }
401
-
402
- if ( empty( $SnS ) )
403
- delete_post_meta( $post_id, '_SnS' );
404
- else
405
- update_post_meta( $post_id, '_SnS', $SnS );
406
- }
407
-
408
- /**
409
- * maybe_set()
410
- * Filters $o and Checks if the sent data $i is empty (intended to clear). If not, updates.
411
- */
412
- static function maybe_set( $o, $i, $p = 'SnS_' ) {
413
- if ( ! is_array( $o ) ) return array();
414
- if ( empty( $_REQUEST[ $p . $i ] ) ) {
415
- if ( isset( $o[ $i ] ) ) unset( $o[ $i ] );
416
- } else {
417
- $o[ $i ] = $_REQUEST[ $p . $i ];
418
- }
419
- return $o;
420
- }
421
- }
422
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-settings-page.php DELETED
@@ -1,187 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Settings_Page
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- class SnS_Settings_Page
11
- {
12
- /**
13
- * Constants
14
- */
15
- const MENU_SLUG = 'sns_settings';
16
-
17
- /**
18
- * Initializing method.
19
- * @static
20
- */
21
- static function init() {
22
- $hook_suffix = add_submenu_page( SnS_Admin::$parent_slug, __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Settings' ), 'unfiltered_html', self::MENU_SLUG, array( 'SnS_Form', 'page' ) );
23
-
24
- add_action( "load-$hook_suffix", array( __CLASS__, 'admin_load' ) );
25
- add_action( "load-$hook_suffix", array( 'SnS_Admin', 'help' ) );
26
- add_action( "load-$hook_suffix", array( 'SnS_Form', 'take_action' ), 49 );
27
- add_action( "admin_print_styles-$hook_suffix", array( __CLASS__, 'admin_enqueue_scripts' ) );
28
-
29
- // Make the page into a tab.
30
- if ( SnS_Admin::MENU_SLUG != SnS_Admin::$parent_slug ) {
31
- remove_submenu_page( SnS_Admin::$parent_slug, self::MENU_SLUG );
32
- add_filter( 'parent_file', array( __CLASS__, 'parent_file') );
33
- }
34
- }
35
- static function parent_file( $parent_file ) {
36
- global $plugin_page, $submenu_file;
37
- if ( self::MENU_SLUG == $plugin_page ) $submenu_file = SnS_Admin::MENU_SLUG;
38
- return $parent_file;
39
- }
40
-
41
- static function admin_enqueue_scripts() {
42
- $options = get_option( 'SnS_options' );
43
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : '';
44
-
45
- wp_enqueue_style( 'sns-options' );
46
-
47
- wp_enqueue_script( 'sns-settings-page' );
48
- wp_localize_script( 'sns-settings-page', 'codemirror_options', array( 'theme' => $cm_theme ) );
49
- }
50
-
51
- /**
52
- * Settings Page
53
- * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
54
- */
55
- static function admin_load() {
56
- wp_enqueue_style( 'sns-options' );
57
-
58
- register_setting(
59
- SnS_Admin::OPTION_GROUP,
60
- 'SnS_options' );
61
-
62
- add_settings_section(
63
- 'settings',
64
- __( 'Scripts n Styles Settings', 'scripts-n-styles' ),
65
- array( __CLASS__, 'settings_section' ),
66
- SnS_Admin::MENU_SLUG );
67
-
68
- add_settings_field(
69
- 'metabox',
70
- __( '<strong>Hide Metabox by default</strong>: ', 'scripts-n-styles' ),
71
- array( 'SnS_Form', 'radio' ),
72
- SnS_Admin::MENU_SLUG,
73
- 'settings',
74
- array(
75
- 'label_for' => 'metabox',
76
- 'setting' => 'SnS_options',
77
- 'choices' => array( 'yes', 'no' ),
78
- 'layout' => 'horizontal',
79
- 'default' => 'yes',
80
- 'legend' => __( 'Hide Metabox by default', 'scripts-n-styles' ),
81
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">This is overridable via Screen Options on each edit screen.</span>', 'scripts-n-styles' )
82
- ) );
83
-
84
- add_settings_field(
85
- 'menu_position',
86
- __( '<strong>Menu Position</strong>: ', 'scripts-n-styles' ),
87
- array( 'SnS_Form', 'radio' ),
88
- SnS_Admin::MENU_SLUG,
89
- 'settings',
90
- array(
91
- 'label_for' => 'menu_position',
92
- 'setting' => 'SnS_options',
93
- 'choices' => array( 'menu', 'object', 'utility', 'tools.php', 'options-general.php', 'themes.php' ),
94
- 'default' => 'tools.php',
95
- 'legend' => __( 'Theme', 'scripts-n-styles' ),
96
- 'layout' => 'vertical',
97
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">Some people are fussy about where the menu goes, so I made an option.</span>', 'scripts-n-styles' ),
98
- ) );
99
-
100
- add_settings_section(
101
- 'demo',
102
- __( 'Code Mirror Demo', 'scripts-n-styles' ),
103
- array( __CLASS__, 'demo_section' ),
104
- SnS_Admin::MENU_SLUG );
105
-
106
- add_settings_field(
107
- 'cm_theme',
108
- __( '<strong>Theme</strong>: ', 'scripts-n-styles' ),
109
- array( 'SnS_Form', 'radio' ),
110
- SnS_Admin::MENU_SLUG,
111
- 'demo',
112
- array(
113
- 'label_for' => 'cm_theme',
114
- 'setting' => 'SnS_options',
115
- 'choices' => Scripts_n_Styles::$cm_themes,
116
- 'default' => 'default',
117
- 'legend' => __( 'Theme', 'scripts-n-styles' ),
118
- 'layout' => 'horizontal',
119
- 'description' => '',
120
- ) );
121
- add_settings_field(
122
- 'hoops_widget',
123
- __( '<strong>Hoops Widgets</strong>: ', 'scripts-n-styles' ),
124
- array( 'SnS_Form', 'radio' ),
125
- SnS_Admin::MENU_SLUG,
126
- 'settings',
127
- array(
128
- 'label_for' => 'hoops_widget',
129
- 'setting' => 'SnS_options',
130
- 'choices' => array( 'yes', 'no' ),
131
- 'layout' => 'horizontal',
132
- 'default' => 'no',
133
- 'legend' => __( 'Shortcode Widgets', 'scripts-n-styles' ),
134
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">This enables Hoops shortcodes to be used via a "Hoops" Text Widget.</span>', 'scripts-n-styles' )
135
- ) );
136
- add_settings_field(
137
- 'delete_data_uninstall',
138
- __( '<strong>Delete Data When Uninstalling</strong>: ', 'scripts-n-styles' ),
139
- array( 'SnS_Form', 'radio' ),
140
- SnS_Admin::MENU_SLUG,
141
- 'settings',
142
- array(
143
- 'label_for' => 'delete_data_uninstall',
144
- 'setting' => 'SnS_options',
145
- 'choices' => array( 'yes', 'no' ),
146
- 'layout' => 'horizontal',
147
- 'default' => 'no',
148
- 'legend' => __( 'Delete Data When Uninstalling', 'scripts-n-styles' ),
149
- 'description' => __( '<span class="description" style="max-width: 500px; display: inline-block;">Should the plugin clean up after itself and delete all of its saved data.</span>', 'scripts-n-styles' )
150
- ) );
151
- }
152
-
153
- /**
154
- * Settings Page
155
- * Outputs Description text for the Global Section.
156
- */
157
- static function settings_section() {
158
- ?>
159
- <div style="max-width: 55em;">
160
- <p><?php _e( 'Control how and where Scripts n Styles menus and metaboxes appear. These options are here because sometimes users really care about this stuff. Feel free to adjust to your liking. :-)', 'scripts-n-styles' ) ?></p>
161
- </div>
162
- <?php
163
- }
164
-
165
- /**
166
- * Settings Page
167
- * Outputs Description text for the Global Section.
168
- */
169
- static function demo_section() {
170
- ?>
171
- <div style="max-width: 55em;">
172
- <textarea id="codemirror_demo" name="code" style="min-width: 500px; width:97%;" rows="5" cols="40">
173
- <?php echo esc_textarea( '<?php
174
- function hello($who) {
175
- return "Hello " . $who;
176
- }
177
- ?>
178
- <p>The program says <?= hello("World") ?>.</p>
179
- <script>
180
- alert("And here is some JS code"); // also colored
181
- </script>' ); ?>
182
- </textarea>
183
- </div>
184
- <?php
185
- }
186
- }
187
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-theme-page.php DELETED
@@ -1,171 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Theme_Page
4
- *
5
- * Allows WordPress admin users the ability to edit theme CSS
6
- * and LESS directly in the admin via CodeMirror.
7
- *
8
- * On the `wp_enqueue_scripts` action, use `wp_enqueue_style( 'theme_style', get_stylesheet_uri() );` to add your style.css instead of inline.
9
- * On the `after_setup_theme` action, use `add_theme_support( 'scripts-n-styles', array( '/less/variables.less', '/less/mixins.less' ) );` but use the appropriate file locations.
10
- *
11
- */
12
-
13
- class SnS_Theme_Page
14
- {
15
- /**
16
- * Constants
17
- */
18
- const MENU_SLUG = 'sns_theme';
19
-
20
- static $files = array();
21
-
22
- /**
23
- * Initializing method.
24
- * @static
25
- */
26
- static function init() {
27
- $hook_suffix = add_submenu_page( SnS_Admin::$parent_slug, __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Theme' ), 'unfiltered_html', self::MENU_SLUG, array( 'SnS_Form', 'page' ) );
28
-
29
- add_action( "load-$hook_suffix", array( __CLASS__, 'admin_load' ) );
30
- add_action( "load-$hook_suffix", array( 'SnS_Admin', 'help' ) );
31
- add_action( "load-$hook_suffix", array( 'SnS_Form', 'take_action' ), 49 );
32
- add_action( "admin_print_styles-$hook_suffix", array( __CLASS__, 'admin_enqueue_scripts' ) );
33
-
34
- // Make the page into a tab.
35
- if ( SnS_Admin::MENU_SLUG != SnS_Admin::$parent_slug ) {
36
- remove_submenu_page( SnS_Admin::$parent_slug, self::MENU_SLUG );
37
- add_filter( 'parent_file', array( __CLASS__, 'parent_file') );
38
- }
39
- }
40
- static function parent_file( $parent_file ) {
41
- global $plugin_page, $submenu_file;
42
- if ( self::MENU_SLUG == $plugin_page ) $submenu_file = SnS_Admin::MENU_SLUG;
43
- return $parent_file;
44
- }
45
-
46
- static function admin_enqueue_scripts() {
47
- $options = get_option( 'SnS_options' );
48
- $cm_theme = isset( $options[ 'cm_theme' ] ) ? $options[ 'cm_theme' ] : 'default';
49
-
50
- wp_enqueue_style( 'sns-options' );
51
- wp_enqueue_style( 'codemirror-theme' );
52
-
53
- wp_enqueue_script( 'sns-theme-page' );
54
- wp_localize_script( 'sns-theme-page', '_SnS_options', array( 'theme' => $cm_theme ) );
55
- }
56
- /**
57
- * Settings Page
58
- * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
59
- */
60
- static function admin_load() {
61
- // added here to not effect other pages. Theme page requires JavaScript (less.js) or it doesn't make sense to save.
62
- add_filter( 'sns_show_submit_button', '__return_false' );
63
-
64
- register_setting(
65
- SnS_Admin::OPTION_GROUP,
66
- 'SnS_options' );
67
-
68
- add_settings_section(
69
- 'theme',
70
- __( 'Scripts n Styles Theme Files', 'scripts-n-styles' ),
71
- array( __CLASS__, 'less_fields' ),
72
- SnS_Admin::MENU_SLUG );
73
- }
74
-
75
- static function less_fields() {
76
- $files = array();
77
- $support_files = get_theme_support( 'scripts-n-styles' );
78
-
79
- if ( is_child_theme() )
80
- $root = get_stylesheet_directory();
81
- else
82
- $root = get_template_directory();
83
-
84
- foreach( $support_files[0] as $file ) {
85
- if ( is_file( $root . $file ) )
86
- $files[] = $root . $file;
87
- }
88
-
89
- $slug = get_stylesheet();
90
- $options = get_option( 'SnS_options' );
91
- // Stores data on a theme by theme basis.
92
- $theme = isset( $options[ 'themes' ][ $slug ] ) ? $options[ 'themes' ][ $slug ] : array();
93
- $stored = isset( $theme[ 'less' ] ) ? $theme[ 'less' ] : array(); // is an array of stored imported less file data
94
- $compiled = isset( $theme[ 'compiled' ] ) ? $theme[ 'compiled' ] : ''; // the complete compiled down css
95
- $slug = esc_attr( $slug );
96
-
97
- $open_theme_panels = json_decode( get_user_option( 'sns_open_theme_panels', get_current_user_id() ), true );
98
-
99
- ?>
100
- <div style="overflow: hidden">
101
- <div id="less_area" style="width: 49%; float: left; overflow: hidden; margin-right: 2%;">
102
- <?php
103
- foreach ( $files as $file ) {
104
- $name = basename( $file );
105
- $raw = file_get_contents( $file );
106
- if ( isset( $stored[ $name ] ) ) {
107
- $source = $stored[ $name ];
108
- $less = isset( $source ) ? $source : '';
109
- $compiled = isset( $compiled ) ? $compiled : '';
110
- } else {
111
- $less = $raw;
112
- $compiled = '';
113
- }
114
- $name = esc_attr( $name );
115
- $lead_break = 0 == strpos( $less, PHP_EOL ) ? PHP_EOL : '';
116
- if ( isset( $open_theme_panels[ $name ] ) )
117
- $collapse = $open_theme_panels[ $name ] == 'yes' ? 'sns-collapsed ' : '';
118
- else
119
- $collapse = $less == $raw ? 'sns-collapsed ': '';
120
- ?>
121
- <div class="sns-less-ide" style="overflow: hidden">
122
- <div class="widget"><div class="<?php echo $collapse; ?>inside">
123
- <span class="sns-collapsed-btn"></span>
124
- <label style="margin-bottom: 0;"><?php echo $name ?></label>
125
- <textarea data-file-name="<?php echo $name ?>" data-raw="<?php echo esc_attr( $raw ) ?>"
126
- name="SnS_options[themes][<?php echo $slug ?>][less][<?php echo $name ?>]"
127
- style="min-width: 250px; width:47%;"
128
- class="code less" rows="5" cols="40"><?php echo $lead_break . esc_textarea( $less ) ?></textarea>
129
- <div class="sns-ajax-wrap">
130
- <a class="sns-ajax-load button" href="#">Load Source File</a>
131
- <a class="sns-ajax-save button" href="#">Save All Changes</a>
132
- <span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>
133
- <div class="single-status"><div class="updated settings-error below-h2"></div></div>
134
- </div>
135
- </div></div>
136
- </div>
137
- <?php
138
- }
139
- ?>
140
- </div>
141
- <div id="css_area" class="sns-less-ide" style="width: 49%; float: left; overflow: hidden;">
142
- <div id="compile_status" style="display: none" class="updated settings-error below-h2">
143
- <p><span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>
144
- <span class="status-text">Keystokes detected. 1 second delay, then compiling...</span></p>
145
- </div>
146
- <div class="widget"><div class="sns-collapsed inside">
147
- <span class="sns-collapsed-btn"></span>
148
- <label style="margin-bottom: 0;">Preview Window</label>
149
- <textarea
150
- name="SnS_options[themes][<?php echo $slug ?>][compiled]"
151
- style="min-width: 250px; width:47%;"
152
- class="code css" rows="5" cols="40"><?php echo esc_textarea( $compiled ) ?></textarea>
153
- </div></div>
154
- <div id="compiled_error" class="error settings-error below-h2"></div>
155
- </div>
156
- <?php
157
- }
158
-
159
- /**
160
- * Settings Page
161
- * Outputs Description text for the Global Section.
162
- */
163
- static function global_section() {
164
- ?>
165
- <div style="max-width: 55em;">
166
- <p><?php _e( 'Code entered here will be included in <em>every page (and post) of your site</em>, including the homepage and archives. The code will appear <strong>before</strong> Scripts and Styles registered individually.', 'scripts-n-styles' )?></p>
167
- </div>
168
- <?php
169
- }
170
- }
171
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-sns-usage-page.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- /**
3
- * SnS_Settings_Page
4
- *
5
- * Allows WordPress admin users the ability to add custom CSS
6
- * and JavaScript directly to individual Post, Pages or custom
7
- * post types.
8
- */
9
-
10
- class SnS_Usage_Page
11
- {
12
- /**
13
- * Constants
14
- */
15
- const MENU_SLUG = 'sns_usage';
16
-
17
- /**
18
- * Initializing method.
19
- * @static
20
- */
21
- static function init() {
22
- $hook_suffix = add_submenu_page( SnS_Admin::$parent_slug, __( 'Scripts n Styles', 'scripts-n-styles' ), __( 'Usage', 'scripts-n-styles' ), 'unfiltered_html', self::MENU_SLUG, array( 'SnS_Form', 'page' ) );
23
-
24
- add_action( "load-$hook_suffix", array( __CLASS__, 'admin_load' ) );
25
- add_action( "load-$hook_suffix", array( 'SnS_Admin', 'help' ) );
26
- add_action( "admin_print_styles-$hook_suffix", array( __CLASS__, 'admin_enqueue_scripts' ) );
27
-
28
- // Make the page into a tab.
29
- if ( SnS_Admin::MENU_SLUG != SnS_Admin::$parent_slug ) {
30
- remove_submenu_page( SnS_Admin::$parent_slug, self::MENU_SLUG );
31
- add_filter( 'parent_file', array( __CLASS__, 'parent_file') );
32
- }
33
- }
34
- static function parent_file( $parent_file ) {
35
- global $plugin_page, $submenu_file;
36
- if ( self::MENU_SLUG == $plugin_page ) $submenu_file = SnS_Admin::MENU_SLUG;
37
- return $parent_file;
38
- }
39
-
40
- static function admin_enqueue_scripts() {
41
- wp_enqueue_style( 'sns-options' );
42
- }
43
-
44
- /**
45
- * Settings Page
46
- * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
47
- */
48
- static function admin_load() {
49
-
50
- add_screen_option( 'per_page', array( 'label' => __( 'Per Page' ), 'default' => 20 ) );
51
- add_filter( 'set-screen-option', array( __CLASS__, 'set_screen_option' ), 10, 3 );
52
- // hack for core limitation: see http://core.trac.wordpress.org/ticket/18954
53
- set_screen_options();
54
-
55
- add_settings_section(
56
- 'usage',
57
- __( 'Scripts n Styles Usage', 'scripts-n-styles' ),
58
- array( __CLASS__, 'usage_section' ),
59
- SnS_Admin::MENU_SLUG );
60
- }
61
-
62
- static function set_screen_option( $false, $option, $value ) {
63
- $screen_id = get_current_screen()->id;
64
- $this_option = str_replace( '-', '_', "{$screen_id}_per_page" );
65
- if ( $this_option != $option )
66
- return false;
67
-
68
- $value = (int) $value;
69
- if ( $value < 1 || $value > 999 )
70
- return false;
71
-
72
- return $value;
73
- }
74
-
75
- /**
76
- * Settings Page
77
- * Outputs the Usage Section.
78
- */
79
- static function usage_section() { ?>
80
- <div style="max-width: 55em;">
81
- <p><?php _e( 'The following table shows content that utilizes Scripts n Styles.', 'scripts-n-styles' ) ?></p>
82
- </div>
83
- <?php
84
- require_once( 'class-sns-list-usage.php' );
85
- $usageTable = new SnS_List_Usage();
86
- $usageTable->prepare_items();
87
- $usageTable->display();
88
- }
89
- }
90
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class.SnS_Admin.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Scripts n Styles Admin Class
4
+ *
5
+ * Allows WordPress admin users the ability to add custom CSS
6
+ * and JavaScript directly to individual Post, Pages or custom
7
+ * post types.
8
+ */
9
+
10
+ class SnS_Admin
11
+ {
12
+ /**#@+
13
+ * Constants
14
+ */
15
+ const MENU_SLUG = 'Scripts-n-Styles';
16
+ const VERSION = '1.0.3-beta';
17
+ /**#@-*/
18
+
19
+ /**
20
+ * Initializing method.
21
+ * @static
22
+ */
23
+ static function init() {
24
+ add_action( 'admin_menu', array( __CLASS__, 'admin_meta_box' ) );
25
+ add_action( 'admin_menu', array( __CLASS__, 'settings_page' ) );
26
+
27
+ $plugin_file = plugin_basename( Scripts_n_Styles::$file );
28
+ add_filter( "plugin_action_links_$plugin_file", array( __CLASS__, 'plugin_action_links') );
29
+
30
+ register_activation_hook( Scripts_n_Styles::$file, array( __CLASS__, 'upgrade' ) );
31
+ }
32
+
33
+ /**
34
+ * Utility Method: Sets defaults if not previously set. Sets stored 'version' to VERSION.
35
+ */
36
+ static function upgrade() {
37
+ $options = get_option( 'SnS_options' );
38
+
39
+ if ( ! isset( $options[ 'show_usage' ] ) )
40
+ $options[ 'show_usage' ] = 'no';
41
+ $options[ 'version' ] = self::VERSION;
42
+
43
+ update_option( 'SnS_options', $options );
44
+ }
45
+
46
+ /**
47
+ * Utility Method: Compares VERSION to stored 'version' value.
48
+ */
49
+ static function upgrade_check() {
50
+ if ( ! isset( $options[ 'version' ] ) || version_compare( self::VERSION, $options[ 'version' ], '>' ) )
51
+ self::upgrade();
52
+ }
53
+
54
+ /**
55
+ * Adds link to the Settings Page in the WordPress "Plugin Action Links" array.
56
+ * @param array $actions
57
+ * @return array
58
+ */
59
+ static function plugin_action_links( $actions ) {
60
+ $actions[ 'settings' ] = '<a href="' . menu_page_url( self::MENU_SLUG, false ) . '"/>Settings</a>';
61
+ return $actions;
62
+ }
63
+
64
+ /**
65
+ * Settings Page
66
+ * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
67
+ */
68
+ static function admin_meta_box() {
69
+ include_once( 'class.SnS_Admin_Meta_Box.php' );
70
+ SnS_Admin_Meta_Box::init();
71
+ }
72
+
73
+ /**
74
+ * Settings Page
75
+ * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
76
+ */
77
+ static function settings_page() {
78
+ /* NOTE: Even when Scripts n Styles is not restricted by 'manage_options', Editors still can't submit the option page */
79
+ include_once( 'class.SnS_Settings_Page.php' );
80
+ SnS_Settings_Page::init();
81
+ }
82
+ }
83
+
84
+ ?>
includes/class.SnS_Admin_Meta_Box.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * SnS_Admin_Meta_Box
4
+ *
5
+ * Allows WordPress admin users the ability to add custom CSS
6
+ * and JavaScript directly to individual Post, Pages or custom
7
+ * post types.
8
+ */
9
+
10
+ // $hook_suffix = 'tools_page_Scripts-n-Styles'; // kept here for reference
11
+ // $plugin_file = 'scripts-n-styles/scripts-n-styles.php'; // kept here for reference
12
+
13
+ class SnS_Admin_Meta_Box
14
+ {
15
+ /*
16
+ * Constants
17
+ */
18
+ const NONCE_NAME = 'scripts_n_styles_noncename';
19
+
20
+ static $post_types;
21
+
22
+ /**
23
+ * Initializing method. Checks if is_admin() and registers action hooks for admin if true. Sets filters and actions for Theme side functions.
24
+ * @static
25
+ */
26
+ static function init() {
27
+ add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
28
+ add_action( 'save_post', array( __CLASS__, 'save_post' ) );
29
+ }
30
+
31
+ /**
32
+ * Admin Action: 'add_meta_boxes'
33
+ * Main Meta Box function. Checks restriction options and display options, calls add_meta_box() and adds actions for adding admin CSS and JavaScript.
34
+ */
35
+ static function add_meta_boxes() {
36
+ if ( current_user_can( 'unfiltered_html' ) ) {
37
+ self::$post_types = get_post_types( array('show_ui' => true, 'publicly_queryable' => true) );
38
+ foreach ( self::$post_types as $post_type ) {
39
+ add_meta_box( 'uFp_meta_box', 'Scripts n Styles', array( __CLASS__, 'meta_box' ), $post_type, 'normal', 'high' );
40
+ }
41
+ add_filter( 'default_hidden_meta_boxes', array( __CLASS__, 'default_hidden_meta_boxes' ) );
42
+ add_action( "admin_print_styles", array( __CLASS__, 'meta_box_styles'));
43
+ add_action( "admin_print_scripts", array( __CLASS__, 'meta_box_scripts'));
44
+ add_filter( 'contextual_help', array( __CLASS__, 'contextual_help_filter' ), 10, 3 );
45
+ }
46
+ }
47
+ static function default_hidden_meta_boxes( $hidden ) {
48
+ $hidden[] = 'uFp_meta_box';
49
+ return $hidden;
50
+ }
51
+
52
+ function contextual_help_filter( $text, $screen_id, $screen ) {
53
+ if ( in_array( $screen->post_type, self::$post_types ) )
54
+ $text .= '<p>In default (non MultiSite) WordPress installs, both <em>Administrators</em> and
55
+ <em>Editors</em> can access <em>Scripts-n-Styles</em> on individual edit screens.
56
+ Only <em>Administrators</em> can access this Options Page. In MultiSite WordPress installs, only <em>"Super Admin"</em> users can access either
57
+ <em>Scripts-n-Styles</em> on individual edit screens or this Options Page. If other plugins change capabilities (specifically "unfiltered_html"),
58
+ other users can be granted access.</p>';
59
+ return $text;
60
+ }
61
+
62
+
63
+ /**
64
+ * Admin Action: 'add_meta_boxes'
65
+ * Outputs the Meta Box. Only called on callback from add_meta_box() during the add_meta_boxes action.
66
+ * @param unknown_type WordPress Post object.
67
+ */
68
+ static function meta_box( $post ) {
69
+ $registered_handles = Scripts_n_Styles::get_wp_registered();
70
+ $styles = get_post_meta( $post->ID, 'uFp_styles', true );
71
+ $scripts = get_post_meta( $post->ID, 'uFp_scripts', true );
72
+ ?>
73
+ <div class="tabs-horizontal">
74
+ <ul class="wp-tab-bar" style="display: none;">
75
+ <li><a href="#uFp_scripts-tab">Scripts (bottom)</a></li>
76
+ <li><a href="#uFp_styles-tab">Styles</a></li>
77
+ <li><a href="#uFp_scripts_in_head-tab">Scripts (top)</a></li>
78
+ <li><a href="#uFp_classes_body-tab">Classes</a></li>
79
+ <?php /** / ?>
80
+ <li><a href="#uFp_enqueue_scripts-tab">Include Scripts</a></li>
81
+ <?php /**/ ?>
82
+ </ul>
83
+
84
+ <div id="uFp_scripts-tab">
85
+ <input type="hidden" name="<?php echo self::NONCE_NAME ?>" id="<?php echo self::NONCE_NAME ?>" value="<?php echo wp_create_nonce( Scripts_n_Styles::$file ) ?>" />
86
+ <p>
87
+ <label for="uFp_scripts" class="title"><strong>Scripts</strong>: </label>
88
+ <textarea class="code js" name="uFp_scripts" id="uFp_scripts" rows="5" cols="40" style="width: 98%;"><?php echo isset( $scripts[ 'scripts' ] ) ? $scripts[ 'scripts' ] : ''; ?></textarea>
89
+ <em>This code will be included <strong>verbatim</strong> in <code>&lt;script></code> tags at the end of your page's (or post's) <code>&lt;body></code> tag.</em>
90
+ </p>
91
+ </div>
92
+
93
+ <div id="uFp_styles-tab">
94
+ <p>
95
+ <label for="uFp_styles" class="title"><strong>Styles</strong>: </label>
96
+ <textarea class="code css" name="uFp_styles" id="uFp_styles" rows="5" cols="40" style="width: 98%;"><?php echo isset( $styles[ 'styles' ] ) ? $styles[ 'styles' ] : ''; ?></textarea>
97
+ <em>This code will be included <strong>verbatim</strong> in <code>&lt;style></code> tags in the <code>&lt;head></code> tag of your page (or post).</em>
98
+ </p>
99
+ </div>
100
+
101
+ <div id="uFp_scripts_in_head-tab">
102
+ <p>
103
+ <label for="uFp_scripts_in_head" class="title"><strong>Scripts</strong> (for the <code>head</code> element): </label>
104
+ <textarea class="codemirror js" name="uFp_scripts_in_head" id="uFp_scripts_in_head" rows="5" cols="40" style="width: 98%;"><?php echo isset( $scripts[ 'scripts_in_head' ] ) ? $scripts[ 'scripts_in_head' ] : ''; ?></textarea>
105
+ <em>This code will be included <strong>verbatim</strong> in <code>&lt;script></code> tags at the end of your page's (or post's) <code>&lt;head></code> tag.</em>
106
+ </p>
107
+ </div>
108
+
109
+ <div id="uFp_classes_body-tab">
110
+ <strong class="title">Classes</strong>
111
+ <p>
112
+ <label for="uFp_classes_body">body classes: </label>
113
+ <input style="width: 99%;" name="uFp_classes_body" id="uFp_classes_body" value="<?php echo isset( $styles[ 'classes_body' ] ) ? $styles[ 'classes_body' ] : ''; ?>" type="text" class="code" />
114
+ </p>
115
+ <p>
116
+ <label for="uFp_classes_post">post classes: </label>
117
+ <input style="width: 99%;" name="uFp_classes_post" id="uFp_classes_post" value="<?php echo isset( $styles[ 'classes_post' ] ) ? $styles[ 'classes_post' ] : ''; ?>" type="text" class="code" />
118
+ </p>
119
+ <p><em>These <strong>space separated</strong> class names will be pushed into the <code>body_class()</code> or <code>post_class()</code> function (provided your theme uses these functions).</em></p>
120
+ </div>
121
+
122
+ <?php /** / ?>
123
+ <div id="uFp_enqueue_scripts-tab">
124
+ <strong class="title">Include Scripts</strong>
125
+ <select name="uFp_enqueue_scripts[]" id="uFp_enqueue_scripts" size="5" multiple="multiple" style="height: auto; float: left; margin: 6px 10px 8px 0;">
126
+ <?php // This is a bit intense here...
127
+ if ( ! empty( $scripts[ 'enqueue_scripts' ] ) && is_array( $scripts[ 'enqueue_scripts' ] ) ) {
128
+ foreach ( $registered_handles as $value ) { ?>
129
+ <option value="<?php echo $value ?>"<?php foreach ( $scripts[ 'enqueue_scripts' ] as $handle ) selected( $handle, $value ); ?>><?php echo $value ?></option>
130
+ <?php }
131
+ } else {
132
+ foreach ( $registered_handles as $value ) { ?>
133
+ <option value="<?php echo $value ?>"><?php echo $value ?></option>
134
+ <?php }
135
+ } ?>
136
+ </select>
137
+ <?php if ( ! empty( $scripts[ 'enqueue_scripts' ] ) && is_array( $scripts[ 'enqueue_scripts' ] ) ) { ?>
138
+ <p>Currently Enqueued Scripts:
139
+ <?php foreach ( $scripts[ 'enqueue_scripts' ] as $handle ) echo '<code>' . $handle . '</code> '; ?>
140
+ </p>
141
+ <?php } ?>
142
+ <p><em>The chosen scripts will be enqueued and placed before your codes if your code is dependant on certain scripts (like jQuery).</em></p>
143
+ <p>NOTE: Not all Scripts in the list are appropriate for use in themes. This is merely a generated list of all currently available registered scripts. It's possible some scripts could be registered only on the "front end" and therefore not listed here.</p>
144
+ </div>
145
+ <?php /**/ ?>
146
+ </div>
147
+ <?php
148
+ }
149
+
150
+ /**
151
+ * Admin Action: 'admin_print_styles' Action added during 'add_meta_boxes' (which restricts output to Edit Screens).
152
+ * Enqueues the CSS for admin styling of the Meta Box.
153
+ */
154
+ static function meta_box_styles() {
155
+ wp_enqueue_style( 'sns-meta-box-styles', plugins_url( 'css/meta-box-styles.css', Scripts_n_Styles::$file), array( 'codemirror-default' ), SnS_Admin::VERSION );
156
+ wp_enqueue_style( 'codemirror', plugins_url( 'libraries/codemirror/lib/codemirror.css', Scripts_n_Styles::$file), array(), '2.1' );
157
+ wp_enqueue_style( 'codemirror-default', plugins_url( 'libraries/codemirror/theme/default.css', Scripts_n_Styles::$file), array( 'codemirror' ), '2.1' );
158
+ }
159
+
160
+ /**
161
+ * Admin Action: 'admin_print_styles' Action added during 'add_meta_boxes' (which restricts output to Edit Screens).
162
+ * Enqueues the JavaScript for the admin Meta Box.
163
+ */
164
+ static function meta_box_scripts() {
165
+ wp_enqueue_script( 'sns-meta-box-scripts', plugins_url( 'js/meta-box-scripts.js', Scripts_n_Styles::$file), array( 'jquery-ui-tabs', 'codemirror-css', 'codemirror-javascript' ), SnS_Admin::VERSION, true );
166
+ wp_enqueue_script( 'codemirror', plugins_url( 'libraries/codemirror/lib/codemirror.js', Scripts_n_Styles::$file), array(), '2.1' );
167
+ wp_enqueue_script( 'codemirror-css', plugins_url( 'libraries/codemirror/mode/css.js', Scripts_n_Styles::$file), array( 'codemirror' ), '2.1' );
168
+ wp_enqueue_script( 'codemirror-javascript', plugins_url( 'libraries/codemirror/mode/javascript.js', Scripts_n_Styles::$file), array( 'codemirror' ), '2.1' );
169
+ }
170
+
171
+ /**
172
+ * Admin Action: 'save_post'
173
+ * Saves the values entered in the Meta Box when a post is saved (on the Edit Screen only, excluding autosaves) if the user has permission.
174
+ * @param int $post_id ID value of the WordPress post.
175
+ */
176
+ static function save_post( $post_id ) {
177
+ if ( isset( $_POST[ self::NONCE_NAME ] ) && wp_verify_nonce( $_POST[ self::NONCE_NAME ], Scripts_n_Styles::$file )
178
+ && current_user_can( 'unfiltered_html' )
179
+ && ! ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
180
+
181
+ /*
182
+ NOTE: There is no current_user_can( 'edit_post' ) check here, because as far as I
183
+ can tell, in /wp-admin/post.php the calls edit_post(), write_post(), post_preview(),
184
+ wp_untrash_post(), etc., the check is already done prior to the 'save_post' action,
185
+ which is where this function is called. Other calls are from other pages so the
186
+ NONCE covers those cases, and that leaves autosave, which is also checked here.
187
+ */
188
+
189
+ $scripts = array();
190
+ $styles = array();
191
+
192
+ if ( ! empty( $_POST[ 'uFp_scripts' ] ) )
193
+ $scripts[ 'scripts' ] = $_POST[ 'uFp_scripts' ];
194
+
195
+ if ( ! empty( $_POST[ 'uFp_styles' ] ) )
196
+ $styles[ 'styles' ] = $_POST[ 'uFp_styles' ];
197
+
198
+ if ( ! empty( $_POST[ 'uFp_scripts_in_head' ] ) )
199
+ $scripts[ 'scripts_in_head' ] = $_POST[ 'uFp_scripts_in_head' ];
200
+
201
+ if ( ! empty( $_POST[ 'uFp_classes_body' ] ) )
202
+ $styles[ 'classes_body' ] = $_POST[ 'uFp_classes_body' ];
203
+
204
+ if ( ! empty( $_POST[ 'uFp_classes_post' ] ) )
205
+ $styles[ 'classes_post' ] = $_POST[ 'uFp_classes_post' ];
206
+
207
+ if ( ! empty( $_POST[ 'uFp_enqueue_scripts' ] ) )
208
+ $scripts[ 'enqueue_scripts' ] = $_POST[ 'uFp_enqueue_scripts' ];
209
+
210
+ update_post_meta( $post_id, 'uFp_scripts', $scripts );
211
+ update_post_meta( $post_id, 'uFp_styles', $styles );
212
+ }
213
+ }
214
+ }
215
+ ?>
includes/class.SnS_Settings_Page.php ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * SnS_Settings_Page
4
+ *
5
+ * Allows WordPress admin users the ability to add custom CSS
6
+ * and JavaScript directly to individual Post, Pages or custom
7
+ * post types.
8
+ */
9
+
10
+ // $hook_suffix = 'tools_page_Scripts-n-Styles'; // kept here for reference
11
+ // $plugin_file = 'scripts-n-styles/scripts-n-styles.php'; // kept here for reference
12
+
13
+ class SnS_Settings_Page
14
+ {
15
+ /**
16
+ * Constants
17
+ */
18
+ const OPTION_GROUP = 'scripts_n_styles';
19
+
20
+ /**
21
+ * Initializing method.
22
+ * @static
23
+ */
24
+ static function init() {
25
+ /* NOTE: Even when Scripts n Styles is not restricted by 'manage_options', Editors still can't submit the option page */
26
+ if ( current_user_can( 'manage_options' ) ) { // if they can't, they won't be able to save anyway.
27
+ $hook_suffix = add_management_page(
28
+ 'Scripts n Styles Settings', // $page_title (string) (required) The text to be displayed in the title tags of the page when the menu is selected
29
+ 'Scripts n Styles', // $menu_title (string) (required) The text to be used for the menu
30
+ 'unfiltered_html', // $capability (string) (required) The capability required for this menu to be displayed to the user.
31
+ SnS_Admin::MENU_SLUG, // $menu_slug (string) (required) The slug name to refer to this menu by (should be unique for this menu).
32
+ array( __CLASS__, 'options_page' ) // $function (callback) (optional) The function to be called to output the content for this page.
33
+ );
34
+ Scripts_n_Styles::$hook_suffix = $hook_suffix;
35
+ add_action( "load-$hook_suffix", array( __CLASS__, 'init_options_page' ) );
36
+ add_action( "load-options.php", array( __CLASS__, 'init_options_page' ) );
37
+
38
+ add_action( "admin_print_styles-$hook_suffix", array( __CLASS__, 'options_styles'));
39
+ add_action( "admin_print_scripts-$hook_suffix", array( __CLASS__, 'options_scripts'));
40
+
41
+ add_contextual_help( $hook_suffix, self::contextual_help() );
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Settings Page help
47
+ */
48
+ function contextual_help() {
49
+ $contextual_help = '<p>In default (non MultiSite) WordPress installs, both <em>Administrators</em> and
50
+ <em>Editors</em> can access <em>Scripts-n-Styles</em> on individual edit screens.
51
+ Only <em>Administrators</em> can access this Options Page. In MultiSite WordPress installs, only <em>"Super Admin"</em> users can access either
52
+ <em>Scripts-n-Styles</em> on individual edit screens or this Options Page. If other plugins change capabilities (specifically "unfiltered_html"),
53
+ other users can be granted access.</p>';
54
+ return $contextual_help;
55
+ }
56
+
57
+ /**
58
+ * Settings Page
59
+ * Adds Admin Menu Item via WordPress' "Administration Menus" API. Also hook actions to register options via WordPress' Settings API.
60
+ */
61
+ static function init_options_page() {
62
+ register_setting(
63
+ self::OPTION_GROUP, // $option_group (string) (required) A settings group name. Can be anything.
64
+ 'SnS_options' // $option_name (string) (required) The name of an option to sanitize and save.
65
+ );
66
+ register_setting(
67
+ self::OPTION_GROUP,
68
+ 'SnS_enqueue_scripts'
69
+ );
70
+ add_settings_section(
71
+ 'global',
72
+ 'Global Scripts n Styles',
73
+ array( __CLASS__, 'global_section' ),
74
+ SnS_Admin::MENU_SLUG
75
+ );
76
+ add_settings_field(
77
+ 'scripts',
78
+ '<label for="scripts"><strong>Scripts:</strong> </label>',
79
+ array( __CLASS__, 'scripts_field' ),
80
+ SnS_Admin::MENU_SLUG,
81
+ 'global'
82
+ );
83
+ add_settings_field(
84
+ 'styles',
85
+ '<label for="styles"><strong>Styles:</strong> </label>',
86
+ array( __CLASS__, 'styles_field' ),
87
+ SnS_Admin::MENU_SLUG,
88
+ 'global'
89
+ );
90
+ add_settings_field(
91
+ 'scripts_in_head',
92
+ '<label for="scripts_in_head"><strong>Scripts</strong><br />(for the <code>head</code> element): </label>',
93
+ array( __CLASS__, 'scripts_in_head_field' ),
94
+ SnS_Admin::MENU_SLUG,
95
+ 'global'
96
+ );
97
+ /*add_settings_field(
98
+ 'enqueue_scripts',
99
+ '<label for="enqueue_scripts"><strong>Enqueue Scripts</strong>: </label>',
100
+ array( __CLASS__, 'enqueue_scripts_field' ),
101
+ SnS_Admin::MENU_SLUG,
102
+ 'global'
103
+ );*/
104
+ add_settings_section(
105
+ 'usage',
106
+ 'Scripts n Styles Usage',
107
+ array( __CLASS__, 'usage_section' ),
108
+ SnS_Admin::MENU_SLUG
109
+ );
110
+ }
111
+
112
+ /**
113
+ * Settings Page
114
+ * Adds CSS styles to the Scripts n Styles Admin Page.
115
+ */
116
+ static function options_styles() {
117
+ wp_enqueue_style( 'sns-options-styles', plugins_url('css/options-styles.css', Scripts_n_Styles::$file), array( 'codemirror-default' ), SnS_Admin::VERSION );
118
+ wp_enqueue_style( 'codemirror', plugins_url( 'libraries/codemirror/lib/codemirror.css', Scripts_n_Styles::$file), array(), '2.1' );
119
+ wp_enqueue_style( 'codemirror-default', plugins_url( 'libraries/codemirror/theme/default.css', Scripts_n_Styles::$file), array( 'codemirror' ), '2.1' );
120
+ }
121
+
122
+ /**
123
+ * Settings Page
124
+ * Adds JavaScript to the Scripts n Styles Admin Page.
125
+ */
126
+ static function options_scripts() {
127
+ wp_enqueue_script( 'sns-options-scripts', plugins_url('js/options-scripts.js', Scripts_n_Styles::$file), array( 'jquery', 'codemirror-css', 'codemirror-javascript' ), SnS_Admin::VERSION, true );
128
+ wp_enqueue_script( 'codemirror', plugins_url( 'libraries/codemirror/lib/codemirror.js', Scripts_n_Styles::$file), array(), '2.1' );
129
+ wp_enqueue_script( 'codemirror-css', plugins_url( 'libraries/codemirror/mode/css.js', Scripts_n_Styles::$file), array( 'codemirror' ), '2.1' );
130
+ wp_enqueue_script( 'codemirror-javascript', plugins_url( 'libraries/codemirror/mode/javascript.js', Scripts_n_Styles::$file), array( 'codemirror' ), '2.1' );
131
+ }
132
+
133
+ /**
134
+ * Settings Page
135
+ * Outputs Description text for the Global Section.
136
+ */
137
+ static function global_section() {
138
+ ?>
139
+ <div style="max-width: 55em;">
140
+ <p>Code entered here will be included in <em>every page (and post) of your site</em>, including the homepage and archives. The code will appear <strong>before</strong> Scripts and Styles registered individually.</p>
141
+ </div>
142
+ <?php
143
+ }
144
+
145
+ /**
146
+ * Settings Page
147
+ * Outputs the Usage Section.
148
+ */
149
+ static function usage_section() {
150
+ $options = get_option( 'SnS_options' );
151
+
152
+ $all_posts = get_posts( array( 'numberposts' => -1, 'post_type' => 'any', 'post_status' => 'any' ) );
153
+ $sns_posts = array();
154
+ foreach( $all_posts as $post) {
155
+ $temp_styles = get_post_meta( $post->ID, 'uFp_styles', true );
156
+ $temp_scripts = get_post_meta( $post->ID, 'uFp_scripts', true );
157
+ if ( ! empty( $temp_styles ) || ! empty( $temp_scripts ) )
158
+ $sns_posts[] = $post;
159
+ }
160
+
161
+ if ( ! empty( $sns_posts ) ) {
162
+ ?>
163
+ <table cellspacing="0" class="widefat">
164
+ <thead>
165
+ <tr>
166
+ <th>Title</th>
167
+ <th>ID</th>
168
+ <th>Status</th>
169
+ <th>Post Type</th>
170
+ </tr>
171
+ </thead>
172
+ <tbody>
173
+ <?php foreach( $sns_posts as $post) {
174
+ $temp_styles = get_post_meta( $post->ID, 'uFp_styles', true );
175
+ $temp_scripts = get_post_meta( $post->ID, 'uFp_scripts', true );
176
+ if ( ! empty( $temp_styles ) || ! empty( $temp_scripts ) ) { ?>
177
+ <tr>
178
+ <td>
179
+ <strong><a class="row-title" title="Edit &#8220;<?php echo esc_attr( $post->post_title ); ?>&#8221;" href="<?php echo esc_url( get_edit_post_link( $post->ID ) ); ?>"><?php echo $post->post_title; ?></a></strong>
180
+ <div class="row-actions"><span class="edit"><a title="Edit this item" href="<?php echo esc_url( get_edit_post_link( $post->ID ) ); ?>">Edit</a></span></div>
181
+ </td>
182
+ <td><?php echo $post->ID; ?></td>
183
+ <td><?php echo $post->post_status; ?></td>
184
+ <td><?php echo $post->post_type; ?></td>
185
+ </tr>
186
+ <?php }
187
+ } ?>
188
+ </tbody>
189
+ <tfoot>
190
+ <tr>
191
+ <th>Title</th>
192
+ <th>ID</th>
193
+ <th>Status</th>
194
+ <th>Post Type</th>
195
+ </tr>
196
+ </tfoot>
197
+ </table>
198
+ <?php
199
+ } else {
200
+ ?>
201
+ <div style="max-width: 55em;">
202
+ <p>No content items are currently using Scripts-n-Styles data.</p>
203
+ </div>
204
+ <?php
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Settings Page
210
+ * Outputs a textarea for setting 'scripts'.
211
+ */
212
+ static function scripts_field() {
213
+ $options = get_option( 'SnS_options' );
214
+ ?><textarea style="min-width: 500px; width:97%;" class="code js" rows="5" cols="40" name="SnS_options[scripts]" id="scripts"><?php echo isset( $options[ 'scripts' ] ) ? $options[ 'scripts' ] : ''; ?></textarea><br />
215
+ <span class="description" style="max-width: 500px; display: inline-block;">The "Scripts" will be included <strong>verbatim</strong> in <code>&lt;script></code> tags at the bottom of the <code>&lt;body></code> element of your html.</span>
216
+ <?php
217
+ }
218
+
219
+ /**
220
+ * Settings Page
221
+ * Outputs a textarea for setting 'styles'.
222
+ */
223
+ static function styles_field() {
224
+ $options = get_option( 'SnS_options' );
225
+ ?><textarea style="min-width: 500px; width:97%;" class="code css" rows="5" cols="40" name="SnS_options[styles]" id="styles"><?php echo isset( $options[ 'styles' ] ) ? $options[ 'styles' ] : ''; ?></textarea><br />
226
+ <span class="description" style="max-width: 500px; display: inline-block;">The "Styles" will be included <strong>verbatim</strong> in <code>&lt;style></code> tags in the <code>&lt;head></code> element of your html.</span><?php
227
+ }
228
+
229
+ /**
230
+ * Settings Page
231
+ * Outputs a textarea for setting 'scripts_in_head'.
232
+ */
233
+ static function scripts_in_head_field() {
234
+ $options = get_option( 'SnS_options' );
235
+ ?><textarea style="min-width: 500px; width:97%;" class="code js" rows="5" cols="40" name="SnS_options[scripts_in_head]" id="scripts_in_head"><?php echo isset( $options[ 'scripts_in_head' ] ) ? $options[ 'scripts_in_head' ] : ''; ?></textarea><br />
236
+ <span class="description" style="max-width: 500px; display: inline-block;">The "Scripts (in head)" will be included <strong>verbatim</strong> in <code>&lt;script></code> tags in the <code>&lt;head></code> element of your html.</span>
237
+ <?php
238
+ }
239
+
240
+ /**
241
+ * Settings Page
242
+ * Outputs a select element for selecting options to set $sns_enqueue_scripts.
243
+ */
244
+ static function enqueue_scripts_field() {
245
+ $registered_handles = Scripts_n_Styles::get_wp_registered();
246
+ $sns_enqueue_scripts = get_option( 'SnS_enqueue_scripts' );
247
+ if ( ! is_array( $sns_enqueue_scripts ) ) $sns_enqueue_scripts = array();
248
+ ?>
249
+ <select name="SnS_enqueue_scripts[]" id="enqueue_scripts" size="5" multiple="multiple" style="height: auto;">
250
+ <?php foreach ( $registered_handles as $value ) { ?>
251
+ <option value="<?php echo $value ?>"<?php foreach ( $sns_enqueue_scripts as $handle ) selected( $handle, $value ); ?>><?php echo $value ?></option>
252
+ <?php } ?>
253
+ </select>
254
+ <?php if ( ! empty( $sns_enqueue_scripts ) && is_array( $sns_enqueue_scripts ) ) { ?>
255
+ <p>Currently Enqueued Scripts:
256
+ <?php foreach ( $sns_enqueue_scripts as $handle ) echo '<code>' . $handle . '</code> '; ?>
257
+ </p>
258
+ <?php }
259
+ }
260
+
261
+ /**
262
+ * Settings Page
263
+ * Outputs the Admin Page and calls the Settings registered with the Settings API in init_options_page().
264
+ */
265
+ static function options_page() {
266
+ SnS_Admin::upgrade_check();
267
+ global $title;
268
+ ?>
269
+ <div class="wrap">
270
+ <?php screen_icon(); ?>
271
+ <h2><?php echo esc_html($title); ?></h2>
272
+ <form action="options.php" method="post" autocomplete="off">
273
+ <?php settings_fields( self::OPTION_GROUP ); ?>
274
+ <?php do_settings_sections( SnS_Admin::MENU_SLUG ); ?>
275
+ <?php submit_button(); ?>
276
+ </form>
277
+ </div>
278
+ <?php
279
+ }
280
+ }
281
+ ?>
js/code-editor.js DELETED
@@ -1,114 +0,0 @@
1
- // Options JavaScript
2
-
3
- jQuery( document ).ready( function( $ ) {
4
- if ( 'plugin-editor' == pagenow )
5
- $.ajax({
6
- type: "POST",
7
- url: ajaxurl,
8
- data: {
9
- _ajax_nonce: sns_plugin_editor_options.nonce,
10
- action: sns_plugin_editor_options.action,
11
- file: $('input[name="file"]').val(),
12
- plugin: $('input[name="plugin"]').val()
13
- },
14
- success: function( data ) {
15
- $('#templateside > ul').html( data.ul );
16
- if ( ! data.need_update ) return;
17
-
18
- var warning = "<p><strong>Warning:</strong> Making changes to active plugins is not recommended. If your changes cause a fatal error, the plugin will be automatically deactivated.</p>";
19
- if ( data.active ) {
20
- $('p.submit').before(warning);
21
- $('.fileedit-sub .alignleft big').html( 'Editing <strong>' + $('.fileedit-sub .alignleft big strong').html() + '</strong> (active)' );
22
- }
23
- $('#plugin').val( data.plugin );
24
- console.dir( data );
25
- }
26
- });
27
- });
28
- jQuery( document ).ready( function( $ ) {
29
- var theme = codemirror_options.theme ? codemirror_options.theme: 'default',
30
- file = $( 'input[name="file"]' ).val(),
31
- $new = $( '#newcontent' ),
32
- $template = $( '#template' ),
33
- $wpbody = $( '#wpbody-content' ),
34
- $documentation = $( '#documentation' ),
35
- $submit = $( 'p.submit' ).first(),
36
- $warning = $( '#documentation + p:not(.submit)' ).first(),
37
- $templateside = $( '#templateside' ),
38
- templateOffset, bottomPadding, docHeight, submitHeight, resizeTimer, fileType, cmheight;
39
-
40
- fileType = file.slice( file.lastIndexOf(".")+1 );
41
-
42
- templateOffset = parseInt( jQuery('#template').offset().top ),
43
- bottomPadding = parseInt( $('#wpbody-content').css('padding-bottom') );
44
- docHeight = ( $documentation.length ) ? parseInt( $documentation.height() )
45
- + parseInt( $documentation.css('padding-top') )
46
- + parseInt( $documentation.css('padding-bottom') )
47
- + parseInt( $documentation.css('margin-top') )
48
- + parseInt( $documentation.css('margin-bottom') )
49
- : 0;
50
- warningHeight = ( $warning.length ) ? parseInt( $warning.height() )
51
- + parseInt( $warning.css('padding-top') )
52
- + parseInt( $warning.css('padding-bottom') )
53
- + parseInt( $warning.css('margin-top') )
54
- + parseInt( $warning.css('margin-bottom') )
55
- : 0;
56
- submitHeight = parseInt( $submit.height() )
57
- + parseInt( $submit.css('padding-top') )
58
- + parseInt( $submit.css('padding-bottom') )
59
- + parseInt( $submit.css('margin-top') )
60
- + parseInt( $submit.css('margin-bottom') );
61
- templateside = parseInt( $templateside.height() );
62
-
63
- var config = {
64
- lineNumbers: true,
65
- theme: theme,
66
- //viewportMargin: Infinity
67
- };
68
-
69
- switch ( fileType ) {
70
- case "md":
71
- config.mode = "gfm";
72
- break;
73
- case "js":
74
- config.mode = "javascript";
75
- break;
76
- case "css":
77
- config.mode = "css";
78
- break;
79
- case "less":
80
- config.mode = "less";
81
- break;
82
- case "coffee":
83
- config.mode = "coffeescript";
84
- break;
85
- case "html":
86
- case "htm":
87
- config.mode = "html";
88
- break;
89
- case "php":
90
- config.mode = "php";
91
- break;
92
- default:
93
- config.mode = "markdown";
94
- break;
95
- }
96
-
97
- CodeMirror.commands.save = function (){ jQuery('#submit').click(); };
98
-
99
- var cmeditor = CodeMirror.fromTextArea( $new.get(0), config );
100
-
101
- $(window).resize(function(){
102
- clearTimeout(resizeTimer);
103
- resizeTimer = setTimeout( cmresizer, 100 );
104
- });
105
- function cmresizer() {
106
- cmheight = Math.max( 300, $(window).height() - ( templateOffset + bottomPadding + docHeight + warningHeight + submitHeight + 40 ) );
107
- if ( cmheight > templateside )
108
- cmeditor.setSize( null, cmheight );
109
- else
110
- cmeditor.setSize( null, $(window).height() - ( templateOffset + docHeight + warningHeight + submitHeight ) );
111
- }
112
- cmresizer();
113
-
114
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/global-page.js DELETED
@@ -1,130 +0,0 @@
1
- // Options JavaScript
2
-
3
- jQuery( document ).ready( function( $ ) {
4
- var compiled, source;
5
- var theme = _SnS_options.theme ? _SnS_options.theme: 'default';
6
- var lessMirror, lessOutput, errorLine, errorText, errors, loaded,
7
- coffeeMirror, coffeeOutput, coffee_errorLine, coffee_errorText, coffee_errors, coffee_loaded,
8
- lessMirrorConfig = { gutters: ["note-gutter", "CodeMirror-linenumbers"],
9
- lineNumbers: true, mode: "text/x-less", theme: theme, indentWithTabs: true },
10
- coffeeMirrorConfig = { lineNumbers: true, mode: "text/x-coffeescript", theme: theme };
11
-
12
- var parser = new( less.Parser )({});
13
- $("#enqueue_scripts").data( 'placeholder', 'Enqueue Registered Scripts...' ).width(350).chosen();
14
- $(".chosen-container-multi .chosen-choices .search-field input").height('26px');
15
- $(".chosen-container .chosen-results").css( 'max-height', '176px');
16
-
17
- //CodeMirror.commands.save = saveLessMirror;
18
-
19
- $( "textarea.js" ).not( '#coffee_compiled' ).each( function() {
20
- CodeMirror.fromTextArea( this, { lineNumbers: true, mode: "javascript", theme: theme } );
21
- });
22
-
23
- $( "textarea.css" ).not( '#compiled' ).each( function() {
24
- CodeMirror.fromTextArea( this, { lineNumbers: true, mode: "css", theme: theme } );
25
- });
26
-
27
- lessOutput = CodeMirror.fromTextArea( $( '#compiled' ).get(0), { lineNumbers: true, mode: "css", theme: theme, readOnly: true } );
28
- coffeeOutput = CodeMirror.fromTextArea( $( '#coffee_compiled' ).get(0), { lineNumbers: true, mode: "javascript", theme: theme, readOnly: true } );
29
-
30
- $( "textarea.less" ).each( function() {
31
- lessMirror = CodeMirror.fromTextArea( this, lessMirrorConfig );
32
- lessMirror.on( "change", compile );
33
- });
34
- $( "textarea.coffee" ).each( function() {
35
- coffeeMirror = CodeMirror.fromTextArea( this, coffeeMirrorConfig );
36
- coffeeMirror.on( "change", coffee_compile );
37
- });
38
- $('#coffee').parent().append('<label><input type="checkbox" id="coffee_spacing"> Double Spaced</label>');
39
- $('#coffee_spacing').change( coffee_compile );
40
- compile();
41
- coffee_compile();
42
- loaded = true;
43
- coffee_loaded = true;
44
- $( "#less" ).closest('form').submit( compile );
45
- $( "#coffee" ).closest('form').submit( coffee_compile );
46
-
47
- //function saveLessMirror(){
48
- // Ajax Save.
49
- //}
50
-
51
- function compile() {
52
- lessMirror.save();
53
- parser.parse( lessMirror.getValue(), function ( err, tree ) {
54
- if ( err ){
55
- doError( err );
56
- } else {
57
- try {
58
- $( '#compiled_error' ).hide();
59
- lessOutput.setValue( tree.toCSS() );
60
- lessOutput.save();
61
- $( '#compiled' ).next( '.CodeMirror' ).show();
62
- lessOutput.refresh();
63
- clearCompileError();
64
- }
65
- catch ( err ) {
66
- doError( err );
67
- }
68
- }
69
- });
70
- }
71
- function coffee_compile() {
72
- coffeeMirror.save();
73
- try {
74
- $( '#coffee_compiled_error' ).hide();
75
- source = $('#coffee').val();
76
- if ( '' == source || ' ' == source ) {
77
- coffeeOutput.setValue( '' );
78
- } else {
79
- compiled = CoffeeScript.compile( source );
80
- trimmed = $('#coffee_spacing').is(':checked') ? compiled : compiled.replace(/(\n\n)/gm,"\n");
81
- coffeeOutput.setValue( trimmed );
82
- }
83
- coffeeOutput.save();
84
-
85
- $( '#coffee_compiled' ).next( '.CodeMirror' ).show();
86
- }
87
- catch ( err ) {
88
- console.dir( err );
89
- $( '#coffee_compiled' ).next( '.CodeMirror' ).hide();
90
- if ( coffee_loaded ) {
91
- $( '#coffee_compiled_error' ).removeClass( 'error' ).addClass( 'updated' );
92
- $( '#coffee_compiled_error' ).show().html( "<p><strong>Warning: &nbsp; </strong>" + err.message + "</p>" );
93
- } else {
94
- $( '#coffee_compiled_error' ).show().html( "<p><strong>Error: &nbsp; </strong>" + err.message + "</p>" );
95
- }
96
- }
97
- }
98
- function doError( err ) {
99
- //console.dir( err );
100
- $( '#compiled' ).next( '.CodeMirror' ).hide();
101
- if ( loaded ) {
102
- $( '#compiled_error' ).removeClass( 'error' ).addClass( 'updated' );
103
- $( '#compiled_error' ).show().html( "<p><strong>Warning: &nbsp; </strong>" + err.message + "</p>" );
104
- } else {
105
- $( '#compiled_error' ).show().html( "<p><strong>Error: &nbsp; </strong>" + err.message + "</p>" );
106
- }
107
- clearCompileError();
108
-
109
- errorLine = lessMirror.setGutterMarker( err.line - 1, 'note-gutter', document.createTextNode("*") );
110
- //lessMirror.setLineClass( errorLine, "cm-error");
111
-
112
- var pos = lessMirror.posFromIndex( err.index + 1 );
113
- var token = lessMirror.getTokenAt( pos );
114
- var start = lessMirror.posFromIndex( err.index );
115
- var end = lessMirror.posFromIndex( err.index + token.string.length )
116
- errorText = lessMirror.markText( start, end, { className: "cm-error" } );
117
-
118
- lessOutput.setValue( "" );
119
- lessOutput.save();
120
- }
121
- function clearCompileError() {
122
- if ( errorLine ) {
123
- lessMirror.clearGutter( 'note-gutter' );
124
- //lessMirror.setLineClass( errorLine, null );
125
- errorLine = false;
126
- }
127
- if ( errorText ) errorText.clear();
128
- errorText = false;
129
- }
130
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/hoops-page.js DELETED
@@ -1,105 +0,0 @@
1
- // Options JavaScript
2
-
3
- jQuery( document ).ready( function( $ ) { "use strict"
4
- var collection = []
5
- , context = "#sns-shortcodes"
6
- , theme = _SnS_options.theme ? _SnS_options.theme: 'default'
7
- , $form
8
- , config;
9
-
10
- config = {
11
- mode: "text/html",
12
- theme: theme,
13
- lineNumbers: true,
14
- tabMode: "shift",
15
- indentUnit: 4,
16
- indentWithTabs: true,
17
- enterMode: "keep",
18
- matchBrackets: true
19
- };
20
-
21
- CodeMirror.commands.save = function() {
22
- $form.submit();
23
- };
24
-
25
- // Each "IDE"
26
- $( ".sns-less-ide", context ).each( function() {
27
- var $text = $('.code',this);
28
- var ide = {
29
- data : $text.val(),
30
- name : $text.data('sns-shortcode-key'),
31
- $text : $text,
32
- cm : CodeMirror.fromTextArea( $text.get(0), config )
33
- };
34
- if ( $text.parent().hasClass( 'sns-collapsed' ) )
35
- ide.cm.toTextArea();
36
- collection.push( ide );
37
- });
38
-
39
- // Collapsable
40
- $( context ).on( "click", '.sns-collapsed-btn, .sns-collapsed-btn + label', function( event ){
41
- var $this = $( this )
42
- , collapsed
43
- , fileName
44
- , thisIDE;
45
- $this.parent().toggleClass( 'sns-collapsed' );
46
- fileName = $this.siblings( '.code' ).data( 'sns-shortcode-key' );
47
- collapsed = $this.parent().hasClass( 'sns-collapsed' );
48
- $(collection).each(function(index, element) {
49
- if ( element.name == fileName )
50
- thisIDE = element;
51
- });
52
- if ( collapsed ) {
53
- thisIDE.cm.toTextArea();
54
- } else {
55
- thisIDE.cm = CodeMirror.fromTextArea( thisIDE.$text.get(0), config );
56
- }
57
- });
58
- $( '.sns-ajax-loading' ).hide();
59
- /*
60
- $form = $( context ).closest( 'form' );
61
- $form.submit( function( event ){
62
- event.preventDefault();
63
- $.ajax({
64
- type: "POST",
65
- url: window.location,
66
- data: $(this).serialize()+'&ajaxsubmit=1',
67
- cache: false,
68
- success: saved
69
- });
70
- });
71
- // Save
72
- $( context ).on( "click", ".sns-ajax-save", function( event ){
73
- event.preventDefault();
74
- $( this ).nextAll( '.sns-ajax-loading' ).show();
75
- $form.submit();
76
- });*/
77
- /*
78
- function saved( data ) {
79
- $(data).insertAfter( '#icon-sns + h2' ).delay(3000).fadeOut();
80
- $( '.sns-ajax-loading' ).hide();
81
- }
82
-
83
- * Expects return data.
84
- $('#sns-ajax-add-shortcode').click(function( event ){
85
- event.preventDefault();
86
- $(this).next().show();
87
- $(collection).each(function (){ this.save(); });
88
-
89
- var args = { _ajax_nonce: nonce };
90
-
91
- args.action = 'sns_hoops';
92
- args.subaction = 'add';
93
- args.name = $( '#SnS_shortcodes' ).val();
94
- args.shortcode = $( '#SnS_shortcodes_new' ).val();
95
-
96
- $.post( ajaxurl, args, function( data ) { refreshShortcodes( data ); } );
97
- });
98
- $('#SnS_shortcodes').keypress(function( event ) {
99
- if ( event.which == 13 ) {
100
- event.preventDefault();
101
- $("#sns-ajax-add-shortcode").click();
102
- }
103
- });
104
- */
105
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/meta-box-scripts.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Meta Box JavaScript
2
+
3
+ jQuery( document ).ready( function( $ ) {
4
+ $( "#uFp_meta_box" ).tabs().find( ".wp-tab-bar" ).show();
5
+
6
+ $( "textarea.js" ).each( function() {
7
+ CodeMirror.fromTextArea( this, { lineNumbers: true, mode: "javascript" } );
8
+ });
9
+ $( "textarea.css" ).each( function() {
10
+ CodeMirror.fromTextArea( this, { lineNumbers: true, mode: "css" } );
11
+ });
12
+ });
js/meta-box.js DELETED
@@ -1,588 +0,0 @@
1
- jQuery( document ).ready( function( $ ) {
2
-
3
- var context = '#SnS_meta_box',
4
- currentCodeMirror = [], keys = [],
5
- nonce = $( '#scripts_n_styles_noncename' ).val(),
6
- theme = codemirror_options.theme ? codemirror_options.theme: 'default';
7
-
8
- // For CPTs that don't have an editor, prevent "tinyMCEPreInit is 'undefined'"
9
- var initDatas = ( typeof tinyMCEPreInit !== 'undefined' && tinyMCEPreInit.mceInit ) ? tinyMCEPreInit.mceInit: false;
10
- for ( var prop in initDatas ) {
11
- keys.push( prop );
12
- }
13
-
14
- var mceBodyClass = getMCEBodyClasses();
15
-
16
- $("#SnS_enqueue_scripts").data( 'placeholder', 'Enqueue Registered Scripts...' ).chosen({ width: "356px" });
17
- $(".chosen-container-multi .chosen-choices .search-field input").height('26px');
18
- $(".chosen-container .chosen-results").css( 'max-height', '176px');
19
-
20
- //$('textarea', context).attr('autocomplete','off');
21
-
22
- // Refresh when panel becomes unhidden
23
- $( '#adv-settings' ).on( 'click', context + '-hide', refreshCodeMirrors );
24
- $( context ).on( 'click', '.hndle, .handlediv', refreshCodeMirrors );
25
-
26
- // add tab-switch handler
27
- $( context ).on( 'click', '.wp-tab-bar a', onTabSwitch );
28
-
29
- // activate first run
30
- $( '.wp-tab-active a', context ).click();
31
-
32
- // must run before ajax click handlers are added.
33
- setupAjaxUI();
34
-
35
- refreshDeleteBtns();
36
-
37
-
38
-
39
- $('#sns-ajax-update-scripts').click(function( event ){
40
- event.preventDefault();
41
- $(this).next().show();
42
- $(currentCodeMirror).each(function (){ this.save(); });
43
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
44
-
45
- args.action = 'sns_scripts';
46
- args.scripts = $( '#SnS_scripts' ).val();
47
- args.scripts_in_head = $( '#SnS_scripts_in_head' ).val();
48
-
49
- $.post( ajaxurl, args, function() { refreshMCE(); } );
50
- });
51
-
52
- $('#sns-ajax-update-styles').click(function( event ){
53
- event.preventDefault();
54
- $(this).next().show();
55
- $(currentCodeMirror).each(function (){ this.save(); });
56
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
57
-
58
- args.action = 'sns_styles';
59
- args.styles = $( '#SnS_styles' ).val();
60
-
61
- $.post( ajaxurl, args, function() { refreshMCE(); } );
62
- });
63
-
64
- /*
65
- * Expects return data.
66
- */
67
- $('#sns-ajax-update-classes').click(function( event ){
68
- event.preventDefault();
69
- $(this).next().show();
70
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
71
-
72
- args.action = 'sns_classes';
73
- args.classes_body = $( '#SnS_classes_body' ).val();
74
- args.classes_post = $( '#SnS_classes_post' ).val();
75
-
76
- $.post( ajaxurl, args, function( data ) { refreshBodyClass( data ); } );
77
- });
78
- $('#SnS_classes_body, #SnS_classes_body').keypress(function( event ) {
79
- if ( event.which == 13 ) {
80
- event.preventDefault();
81
- $("#sns-ajax-update-classes").click();
82
- }
83
- });
84
-
85
- /*
86
- * Expects return data.
87
- */
88
- $('#sns-ajax-update-dropdown').click(function( event ){
89
- event.preventDefault();
90
- $(this).next().show();
91
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
92
-
93
- args.action = 'sns_dropdown';
94
- var format = {};
95
- format.title = $( '#SnS_classes_mce_title' ).val();
96
- format.classes = $( '#SnS_classes_mce_classes' ).val();
97
- switch ( $( '#SnS_classes_mce_type' ).val() ) {
98
- case 'inline':
99
- format.inline = $( '#SnS_classes_mce_element' ).val();
100
- break;
101
- case 'block':
102
- format.block = $( '#SnS_classes_mce_element' ).val();
103
- if ( $( '#SnS_classes_mce_wrapper' ).prop('checked') )
104
- format.wrapper = true;
105
- break;
106
- case 'selector':
107
- format.selector = $( '#SnS_classes_mce_element' ).val();
108
- break;
109
- default:
110
- return;
111
- }
112
- args.format = format;
113
-
114
- $.post( ajaxurl, args, function( data ) { refreshStyleFormats( data ); } );
115
- });
116
- $('#SnS_classes_mce_classes, #SnS_classes_mce_element, #SnS_classes_mce_title').keypress(function( event ) {
117
- if ( event.which == 13 ) {
118
- event.preventDefault();
119
- $("#sns-ajax-update-dropdown").click();
120
- }
121
- });
122
-
123
- /*
124
- * Expects return data.
125
- */
126
- $('#delete-mce-dropdown-names').on( "click", ".sns-ajax-delete", function( event ){
127
- event.preventDefault();
128
- $(this).next().show();
129
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
130
-
131
- args.action = 'sns_delete_class';
132
- args.delete = $( this ).attr( 'id' );
133
-
134
- $.post( ajaxurl, args, function( data ) { refreshStyleFormats( data ); } );
135
- });
136
-
137
-
138
-
139
- /*
140
- * Expects return data.
141
- */
142
- $('#sns-ajax-add-shortcode').click(function( event ){
143
- event.preventDefault();
144
- $(this).next().show();
145
- $(currentCodeMirror).each(function (){ this.save(); });
146
-
147
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
148
-
149
- args.action = 'sns_shortcodes';
150
- args.subaction = 'add';
151
- args.name = $( '#SnS_shortcodes' ).val();
152
- args.shortcode = $( '#SnS_shortcodes_new' ).val();
153
-
154
- $.post( ajaxurl, args, function( data ) { refreshShortcodes( data ); } );
155
- });
156
- $('#SnS_shortcodes').keypress(function( event ) {
157
- if ( event.which == 13 ) {
158
- event.preventDefault();
159
- $("#sns-ajax-add-shortcode").click();
160
- }
161
- });
162
-
163
- $('#sns-shortcodes').on( "click", ".sns-ajax-delete-shortcode", function( event ){
164
- event.preventDefault();
165
- if($(this).data('lock'))return;else $(this).data('lock',true);
166
-
167
- $(this).next().show();
168
- $(currentCodeMirror).each(function (){ this.save(); });
169
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
170
-
171
- args.action = 'sns_shortcodes';
172
- args.subaction = 'delete';
173
- args.name = $( this ).parent().siblings('textarea').attr( 'data-sns-shortcode-key' );
174
-
175
- $.post( ajaxurl, args, function( data ) { refreshShortcodes( data ); } );
176
- });
177
- $('#sns-shortcodes').on( "click", ".sns-ajax-update-shortcode", function( event ){
178
- event.preventDefault();
179
- $(this).next().show();
180
- $(currentCodeMirror).each(function (){ this.save(); });
181
- var args = { _ajax_nonce: nonce, post_id: $( '#post_ID' ).val(), };
182
-
183
- args.action = 'sns_shortcodes';
184
- args.subaction = 'update';
185
- args.name = $( this ).parent().siblings('textarea').attr( 'data-sns-shortcode-key' );
186
- args.shortcode = $( this ).parent().siblings('textarea').val();
187
-
188
- $.post( ajaxurl, args, function( data ) { refreshShortcodes( data ); } );
189
- });
190
-
191
- /*
192
- * Returns the body_class of TinyMCE minus the Scripts n Styles values.
193
- */
194
- function getMCEBodyClasses() {
195
- var t = [], a = [];
196
- $(keys).each(function(index, element) {
197
- var data = initDatas[element];
198
- if ( data.body_class )
199
- t = data.body_class.split(' ');
200
-
201
- var bc = $('#SnS_classes_body').val().split(' ');
202
- var pc = $('#SnS_classes_post').val().split(' ');
203
- var p;
204
- for ( var i = 0; i < t.length; i++ ) {
205
- p = $.inArray( bc[i], t )
206
- if ( -1 != p )
207
- t.splice( p, 1 );
208
- }
209
- for ( var i = 0; i < t.length; i++ ) {
210
- p = $.inArray( pc[i], t )
211
- if ( -1 != p )
212
- t.splice( p, 1 );
213
- }
214
- t = t.join(' ');
215
-
216
- a[element] = t;
217
- });
218
- return a;
219
- }
220
-
221
- /*
222
- * Builds and Adds the DOM for AJAX functionality.
223
- */
224
- function setupAjaxUI() {
225
- // set up ajax ui. (need to come up with a better ID naming scheme.)
226
- $('#SnS_scripts-tab').append(
227
- '<div class="sns-ajax-wrap">'
228
- + '<a id="sns-ajax-update-scripts" href="#" class="button">Update Scripts</a>'
229
- + ' '
230
- + '<span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>'
231
- + '</div>'
232
- );
233
-
234
- $('#SnS_styles-tab').append(
235
- '<div class="sns-ajax-wrap">'
236
- + '<a id="sns-ajax-update-styles" href="#" class="button">Update Styles</a>'
237
- + ' '
238
- + '<span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>'
239
- + '</div>'
240
- );
241
-
242
- $('#sns-classes').append(
243
- '<div class="sns-ajax-wrap">'
244
- + '<a id="sns-ajax-update-classes" href="#" class="button">Update Classes</a>'
245
- + ' '
246
- + '<span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>'
247
- + '</div>'
248
- );
249
-
250
- $('#add-mce-dropdown-names').append(
251
- '<div class="sns-ajax-wrap">'
252
- + '<a id="sns-ajax-update-dropdown" href="#" class="button">Add Class</a>'
253
- + ' '
254
- + '<span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>'
255
- + '</div>'
256
- );
257
-
258
- $('#SnS_shortcodes').after(
259
- ' &nbsp; '
260
- + '<a id="sns-ajax-add-shortcode" href="#" class="button">Add New</a>'
261
- + ' '
262
- + '<span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>'
263
- );
264
- $('#sns-shortcodes .sns-shortcode .inside').append(
265
- '<div class="sns-ajax-wrap">'
266
- + '<a class="sns-ajax-delete-shortcode button" href="#">Delete</a>'
267
- + ' &nbsp; '
268
- + '<a class="sns-ajax-update-shortcode button" href="#">Update</a>'
269
- + ' '
270
- + '<span class="sns-ajax-loading"><span class="spinner" style="display: inline-block;"></span></span>'
271
- + '</div>'
272
- );
273
-
274
- $( '.sns-ajax-loading' ).hide();
275
-
276
- if ( $( '#SnS_classes_mce_type').val() == 'block' ) {
277
- $('#add-mce-dropdown-names .sns-mce-wrapper').show();
278
- } else {
279
- $('#add-mce-dropdown-names .sns-mce-wrapper').hide();
280
- }
281
-
282
- $( '#SnS_classes_mce_type' ).change(function() {
283
- if ( $(this).val() == 'block' ) {
284
- $('#add-mce-dropdown-names .sns-mce-wrapper').show();
285
- } else {
286
- $('#add-mce-dropdown-names .sns-mce-wrapper').hide();
287
- }
288
- });
289
-
290
- $( '.wp-tab-bar li', context ).show();
291
- }
292
-
293
- /*
294
- * Main Tab Switch Handler.
295
- */
296
- function onTabSwitch( event ) {
297
- event.preventDefault();
298
-
299
- clearCodeMirrors();
300
-
301
- /*
302
- * There is a weird bug where if clearCodeMirrors() is called right before
303
- * loadCodeMirrors(), loading the page with the Styles tab active, and
304
- * then switching to the Script tab, you can lose data from the second
305
- * CodeMirror if leaving and returning to that tab. I've no idea what's
306
- * going on there. Leaving code inbetween them is a fraggle, but working,
307
- * workaround. Maybe has to do with execution time? No idea.
308
- */
309
-
310
- // switch active classes
311
- $( '.wp-tab-active', context ).removeClass( 'wp-tab-active' );
312
- $( this ).parent( 'li' ).addClass( 'wp-tab-active' );
313
-
314
- $( '.wp-tabs-panel-active', context ).hide().removeClass( 'wp-tabs-panel-active' );
315
- $( $( this ).attr( 'href' ) ).show().addClass( 'wp-tabs-panel-active' );
316
-
317
- loadCodeMirrors();
318
-
319
- $.post( ajaxurl, {
320
- action: 'sns_update_tab',
321
- _ajax_nonce: nonce,
322
- active_tab: $( '.wp-tab-bar li', context ).index( $( this ).parent( 'li' ).get(0) )
323
- }
324
- );
325
- }
326
-
327
- /*
328
- * CodeMirror Utilities.
329
- */
330
- function clearCodeMirrors() {
331
- $(currentCodeMirror).each(function (){
332
- this.toTextArea();
333
- });
334
- currentCodeMirror = [];
335
- }
336
- function refreshCodeMirrors() {
337
- $(currentCodeMirror).each( function(){
338
- this.refresh();
339
- });
340
- }
341
- function loadCodeMirrors() {
342
- // collect codemirrors
343
- var settings;
344
- // loop codemirrors
345
- $( '.wp-tabs-panel-active textarea.codemirror', context ).each(function (){
346
- if ( $(this).hasClass( 'js' ) )
347
- settings = {
348
- mode: "text/javascript",
349
- theme: theme,
350
- lineNumbers: true,
351
- tabMode: "shift",
352
- indentUnit: 4,
353
- indentWithTabs: true
354
- };
355
- else if ( $(this).hasClass( 'css' ) )
356
- settings = {
357
- mode: "text/css",
358
- theme: theme,
359
- lineNumbers: true,
360
- tabMode: "shift",
361
- indentUnit: 4,
362
- indentWithTabs: true
363
- };
364
- else if ( $(this).hasClass( 'less' ) )
365
- settings = {
366
- mode: "text/x-less",
367
- theme: theme,
368
- lineNumbers: true,
369
- tabMode: "shift",
370
- indentUnit: 4,
371
- indentWithTabs: true,
372
- };
373
- else if ( $(this).hasClass( 'htmlmixed' ) )
374
- settings = {
375
- mode: "text/html",
376
- theme: theme,
377
- lineNumbers: true,
378
- tabMode: "shift",
379
- indentUnit: 4,
380
- indentWithTabs: true,
381
- enterMode: "keep",
382
- matchBrackets: true
383
- };
384
- /*else if ( $(this).hasClass( 'php' ) )
385
- settings = {
386
- mode: "application/x-httpd-php",
387
- lineNumbers: true,
388
- tabMode: "shift",
389
- indentUnit: 4,
390
- indentWithTabs: true,
391
- enterMode: "keep",
392
- matchBrackets: true
393
- };*/
394
- else
395
- return;
396
-
397
- // initialize and store active codemirrors
398
- currentCodeMirror.push( CodeMirror.fromTextArea( this, settings ) );
399
- });
400
- }
401
-
402
- /*
403
- * Refresh after AJAX.
404
- */
405
- function refreshDeleteBtns() {
406
- $(keys).each(function(index, key) {
407
- var initData = initDatas[key]
408
-
409
- // responsible for clearing out Delete Buttons, and Adding new ones.
410
- // initData should always contain the latest settings.
411
- if ( initData.style_formats && initData.style_formats.length ) {
412
- $( '#delete-mce-dropdown-names .sns-ajax-delete-p' ).remove();
413
- $( '#delete-mce-dropdown-names', context ).show();
414
- var formats = initData.style_formats;
415
- for ( var i = 0; i < formats.length; i++ ) {
416
- var deleteBtn = {};
417
- if ( formats[i].inline ) {
418
- deleteBtn.element = formats[i].inline;
419
- deleteBtn.wrapper = '';
420
- } else if ( formats[i].block ) {
421
- deleteBtn.element = formats[i].block;
422
- if ( formats[i].wrapper )
423
- deleteBtn.wrapper = ' (wrapper)';
424
- else
425
- deleteBtn.wrapper = '';
426
- } else if ( formats[i].selector ) {
427
- deleteBtn.element = formats[i].selector;
428
- deleteBtn.wrapper = '';
429
- } else {
430
- alert( 'ERROR!' );
431
- }
432
- deleteBtn.title = formats[i].title;
433
- deleteBtn.classes = formats[i].classes;
434
- $( '#instructions-mce-dropdown-names', context ).after(
435
- '<p class="sns-ajax-delete-p"><a title="delete" class="sns-ajax-delete" id="'
436
- + deleteBtn.title + '">X</a> "'
437
- + deleteBtn.title + '" <code>&lt;'
438
- + deleteBtn.element + ' class="'
439
- + deleteBtn.classes + '"&gt;</code>'
440
- + deleteBtn.wrapper + '</p>'
441
- );
442
- }
443
- } else {
444
- $( '#delete-mce-dropdown-names', context ).hide();
445
- }
446
- });
447
- }
448
- function refreshBodyClass( data ) {
449
- $(keys).each(function(index, key) {
450
- initDatas[key].body_class = mceBodyClass[key] + ' ' + data.classes_body + ' ' + data.classes_post;
451
- });
452
- refreshMCE();
453
- }
454
- function refreshStyleFormats( data ) {
455
- $(keys).each(function(index, key) {
456
- var initData = initDatas[key]
457
- // error check
458
- //console.log(data.classes_mce);
459
- if ( typeof data.classes_mce === 'undefined' ) {
460
- alert( data );
461
- /*$( '.sns-ajax-loading' ).hide();
462
- return;*/ // Don't block
463
- } else if ( data.classes_mce.length && data.classes_mce != 'Empty' ) {
464
- var style_formats = [];
465
-
466
- for ( var i = 0; i < data.classes_mce.length; i++ ) { // loop returned classes_mce
467
- var format = {};
468
- format.title = data.classes_mce[i].title;
469
-
470
- if ( data.classes_mce[i].inline )
471
- format.inline = data.classes_mce[i].inline;
472
- else if ( data.classes_mce[i].block ) {
473
- format.block = data.classes_mce[i].block;
474
- if (data.classes_mce[i].wrapper)
475
- format.wrapper = true;
476
- } else if ( data.classes_mce[i].selector )
477
- format.selector = data.classes_mce[i].selector;
478
- else
479
- alert('dropdown format has bad type.');
480
-
481
- format.classes = data.classes_mce[i].classes;
482
- style_formats.push( format );
483
- }
484
- initData.style_formats = style_formats;
485
-
486
- if ( initData.toolbar2.indexOf( "styleselect" ) == -1 ) {
487
- var tempString = "styleselect,";
488
- initData.toolbar2 = tempString.concat(initData.toolbar2);
489
- }
490
-
491
- $( '#delete-mce-dropdown-names', context ).show();
492
- } else {
493
- delete initData.style_formats;
494
- initData.toolbar2 = initData.toolbar2.replace("styleselect,", "");
495
-
496
- $( '#delete-mce-dropdown-names', context ).hide();
497
- }
498
- });
499
- refreshDeleteBtns();
500
- refreshMCE();
501
- }
502
- if ( 0 == $( '.sns-shortcode', '#sns-shortcodes' ).length )
503
- $( 'h4', '#sns-shortcodes' ).hide();
504
- function refreshShortcodes( data ) {
505
- if ( data.code ) {
506
- switch ( data.code ) {
507
- case 2:
508
- console.log( data.message );
509
- break;
510
- case 3:
511
- $( 'textarea[data-sns-shortcode-key=' + data.message + ']', '#sns-shortcodes' ).closest('.sns-shortcode').slideUp(function(){
512
- $(this).remove();
513
- if ( 0 == $( '.sns-shortcode', '#sns-shortcodes' ).length )
514
- $( 'h4', '#sns-shortcodes' ).slideUp();
515
- });
516
- break;
517
- }
518
- } else {
519
- if ( 0 == data.indexOf( "<" ) ) {
520
- $('#sns-shortcodes-wrap').prepend( data ).find( '.widget' ).hide().slideDown();
521
- $( '.codemirror-new' ).parent().prepend( '<span class="sns-collapsed-shortcode-btn"></span>' );
522
- var codemirrorNew = $( '.codemirror-new' ).removeClass('codemirror-new').addClass('codemirror').get(0);
523
- currentCodeMirror.push( CodeMirror.fromTextArea( codemirrorNew, {
524
- mode: "text/html",
525
- theme: theme,
526
- lineNumbers: true,
527
- tabMode: "shift",
528
- indentUnit: 4,
529
- indentWithTabs: true,
530
- enterMode: "keep",
531
- matchBrackets: true
532
- } ) );
533
- if ( 0 == $( 'h4', '#sns-shortcodes' ).length )
534
- $( '#sns-shortcodes' ).prepend('<h4>Existing Codes: </h4>');
535
- if ( ! $( 'h4', '#sns-shortcodes' ).is( ":visible" ) )
536
- $( 'h4', '#sns-shortcodes' ).slideDown();
537
- clearCodeMirrors();
538
- $('#SnS_shortcodes').val('');
539
- $('#SnS_shortcodes_new').val('');
540
- loadCodeMirrors();
541
-
542
- } else if ( 0 == data.indexOf( "empty value." ) ) {
543
- console.log('empty value');
544
- } else if ( 0 == data.indexOf( "Use delete instead." ) ) {
545
- console.log('Use delete instead');
546
- } else {
547
- alert( 'Scripts n Styles: ' + '\n\n' + 'Sorry, there was an AJAX error: (' + data + ')' + '\n\n' + 'Please use the post update button instead.' );
548
- }
549
- }
550
- $( '.sns-ajax-loading' ).hide();
551
- }
552
- addShortcodeBtns();
553
- function addShortcodeBtns() {
554
- $( '.sns-shortcode > .inside > p' ).before('<span class="sns-collapsed-shortcode-btn"></span>');
555
- $('#sns-shortcodes-wrap').on("click",'.sns-collapsed-shortcode-btn', function(event){
556
- $(this).parent().toggleClass('sns-collapsed-shortcode');
557
- });
558
- $('.sns-collapsed-shortcode-btn').click();
559
- }
560
- function refreshMCE() {
561
- $( tinyMCE.editors ).each( function( index, ed ){
562
- // If Visual has been activated.
563
- if ( ed ) {
564
- if ( ed.isHidden() ) {
565
- refreshMCEhelper( ed );
566
- } else {
567
- $('#'+ed.id+'-html').click(); // 3.3
568
-
569
- refreshMCEhelper( ed );
570
-
571
- $('#'+ed.id+'-tmce').click(); // 3.3
572
- }
573
- }
574
- });
575
- $( '.sns-ajax-loading' ).hide();
576
- }
577
- function refreshMCEhelper( ed ) {
578
- ed.save();
579
- ed.destroy();
580
- ed.remove();
581
- if ( initDatas[ed.id] && initDatas[ed.id].wpautop )
582
- $('#'+ed.id).val( switchEditors.wpautop( $('#'+ed.id).val() ) );
583
- ed = new tinymce.Editor( ed.id, initDatas[ed.id], tinymce.EditorManager );
584
- ed.render();
585
- ed.hide();
586
- }
587
-
588
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/options-scripts.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Options JavaScript
2
+
3
+ jQuery( document ).ready( function( $ ) {
4
+ $( "textarea.js" ).each( function() {
5
+ CodeMirror.fromTextArea( this, { lineNumbers: true, mode: "javascript" } );
6
+ });
7
+ $( "textarea.css" ).each( function() {
8
+ CodeMirror.fromTextArea( this, { lineNumbers: true, mode: "css" } );
9
+ });
10
+ });
js/settings-page.js DELETED
@@ -1,18 +0,0 @@
1
- // Options JavaScript
2
-
3
- jQuery( document ).ready( function( $ ) {
4
- var theme = codemirror_options.theme ? codemirror_options.theme: 'default';
5
- var editor = CodeMirror.fromTextArea(document.getElementById("codemirror_demo"), {
6
- lineNumbers: true,
7
- matchBrackets: true,
8
- mode: "application/x-httpd-php",
9
- indentUnit: 4,
10
- indentWithTabs: true,
11
- enterMode: "keep",
12
- tabMode: "shift",
13
- theme: theme
14
- });
15
- $('input[name="SnS_options[cm_theme]"]').change( function(){
16
- editor.setOption("theme", $(this).val());
17
- });
18
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/theme-page.js DELETED
@@ -1,276 +0,0 @@
1
- // Options JavaScript
2
-
3
- jQuery( document ).ready( function( $ ) { "use strict"
4
- var collection = []
5
- , context = "#less_area"
6
- , theme = _SnS_options.theme ? _SnS_options.theme: 'default'
7
- , timeout = _SnS_options.timeout || 1000
8
- , loaded = false
9
- , preview = false
10
- , compiled
11
- , $error, $status, $form, $css
12
- , onChange
13
- , errorMarker, errorText, errorMirror
14
- , config;
15
-
16
- // Prevent keystoke compile buildup
17
- onChange = function onChange( cm ){
18
- $status.show();
19
- cm.save();
20
- if ( timeout ) {
21
- clearTimeout( _SnS_options.theme_compiler_timer );
22
- _SnS_options.theme_compiler_timer = setTimeout( _SnS_options.theme_compiler, timeout );
23
- } else {
24
- compile();
25
- }
26
- }
27
- config = {
28
- gutters: ["note-gutter", "CodeMirror-linenumbers"],
29
- lineNumbers: true,
30
- mode: "text/x-less",
31
- theme: theme,
32
- indentWithTabs: true,
33
- tabSize: 4,
34
- indentUnit: 4
35
- };
36
-
37
- CodeMirror.commands.save = function() {
38
- $form.submit();
39
- };
40
-
41
- // Each "IDE"
42
- $( ".sns-less-ide", context ).each( function() {
43
- var $text = $('.code',this);
44
- var ide = {
45
- name : $text.data('file-name'),
46
- raw : $text.data('raw'),
47
- data : $text.val(),
48
- $text : $text,
49
- lines : 0,
50
- startLine : 0,
51
- endLine : 0,
52
- startChars : 0,
53
- endChars : 0,
54
- errorLine : null,
55
- errorText : null,
56
- cm : CodeMirror.fromTextArea( $text.get(0), config )
57
- };
58
- ide.cm.on( "change", onChange );
59
- if ( $text.parent().hasClass( 'sns-collapsed' ) )
60
- ide.cm.toTextArea();
61
- collection.push( ide );
62
- });
63
-
64
- // Collapsable
65
- $( context ).on( "click", '.sns-collapsed-btn, .sns-collapsed-btn + label', function( event ){
66
- var $this = $( this )
67
- , collapsed
68
- , fileName
69
- , thisIDE;
70
- $this.parent().toggleClass( 'sns-collapsed' );
71
- fileName = $this.siblings( '.code' ).data( 'file-name' );
72
- collapsed = $this.parent().hasClass( 'sns-collapsed' );
73
- $(collection).each(function(index, element) {
74
- if ( element.name == fileName )
75
- thisIDE = element;
76
- });
77
- if ( collapsed ) {
78
- thisIDE.cm.toTextArea();
79
- } else {
80
- thisIDE.cm = CodeMirror.fromTextArea( thisIDE.$text.get(0), config );
81
- thisIDE.cm.on( "change", onChange );
82
- }
83
- $.post( ajaxurl,
84
- { action: 'sns_open_theme_panels'
85
- , _ajax_nonce: $( '#_wpnonce' ).val()
86
- , 'file-name': fileName
87
- , 'collapsed': collapsed ? 'yes' : 'no'
88
- }
89
- );
90
- });
91
- $( '#css_area' ).on( "click", '.sns-collapsed-btn, .sns-collapsed-btn + label', function( event ){
92
- var $this = $( this ).parent();
93
- $this.toggleClass( 'sns-collapsed' );
94
- preview = ! $this.hasClass( 'sns-collapsed' );
95
- if ( preview )
96
- compiled = createCSSEditor();
97
- else
98
- compiled.toTextArea();
99
- });
100
-
101
- $( '.single-status' ).hide();
102
- $( '.sns-ajax-loading' ).hide();
103
-
104
- // Load
105
- $( context ).on( "click", ".sns-ajax-load", function( event ){
106
- event.preventDefault();
107
- $( this ).nextAll( '.sns-ajax-loading' ).show();
108
- var name = $( this ).parent().prevAll( '.code' ).data( 'file-name' );
109
- $( collection ).each( function( index, element ){
110
- if ( element.name == name ) {
111
- element.cm.setValue( element.raw );
112
- return;
113
- }
114
- });
115
- compile();
116
- $( '.sns-ajax-loading' ).hide();
117
- $( this ).nextAll( '.single-status' )
118
- .show().delay(3000).fadeOut()
119
- .children('.settings-error').text( 'Original Source File Loaded.' );
120
- });
121
-
122
- // Save
123
- $( context ).on( "click", ".sns-ajax-save", function( event ){
124
- event.preventDefault();
125
- $( this ).nextAll( '.sns-ajax-loading' ).show();
126
- $form.submit();
127
- });
128
- function saved( data ) {
129
- $(data).insertAfter( '#icon-sns + h2' ).delay(3000).fadeOut();
130
- $( '.sns-ajax-loading' ).hide();
131
- }
132
-
133
- // The CSS output side.
134
- $css = $( '.css', "#css_area" );
135
- if ( preview ) {
136
- compiled = createCSSEditor();
137
- }
138
-
139
- $error = $( "#compiled_error" );
140
- $status = $( "#compile_status" );
141
-
142
- // Start.
143
- compile();
144
- loaded = true;
145
-
146
- $form = $( "#less_area" ).closest( 'form' );
147
- $form.submit( function( event ){
148
- event.preventDefault();
149
- compile();
150
- $.ajax({
151
- type: "POST",
152
- url: window.location,
153
- data: $(this).serialize()+'&ajaxsubmit=1',
154
- cache: false,
155
- success: saved
156
- });
157
- });
158
- function createCSSEditor() {
159
- return CodeMirror.fromTextArea(
160
- $css.get(0),
161
- { lineNumbers: true, mode: "css", theme: theme, indentWithTabs: true, tabSize: 4, indentUnit: 4 }
162
- );
163
- }
164
- function compile() {
165
- var lessValue = '';
166
- var totalLines = 0;
167
- var totalChars = 0;
168
- var compiledValue;
169
- $( collection ).each(function(){
170
- //this.cm.save();
171
- lessValue += "\n" + this.$text.val();
172
-
173
- this.lines = this.cm.lineCount();
174
- this.startLine = totalLines;
175
- totalLines += this.lines;
176
- this.endLine = totalLines;
177
-
178
- this.chars = this.$text.val().length + 1;
179
- this.startChars = totalChars;
180
- totalChars += this.chars;
181
- this.endChars = totalChars;
182
- });
183
-
184
- var parser = new( less.Parser )({});
185
- parser.parse( lessValue, function ( err, tree ) {
186
- if ( err ){
187
- doError( err );
188
- } else {
189
- try {
190
- $error.hide();
191
- if ( preview ) {
192
- $( compiled.getWrapperElement() ).show();
193
- compiledValue = tree.toCSS();
194
- compiled.setValue( compiledValue );
195
- compiled.save();
196
- compiled.refresh();
197
- } else {
198
- compiledValue = tree.toCSS({ compress: true });
199
- $css.val( compiledValue );
200
- }
201
- clearCompileError();
202
- }
203
- catch ( err ) {
204
- doError( err );
205
- }
206
- }
207
- });
208
- clearTimeout( _SnS_options.theme_compiler_timer );
209
- $status.hide();
210
- }
211
- function doError( err ) {
212
- var pos, token, start, end, errLine, fileName, errMessage, errIndex;
213
- errLine = err.line-1;
214
-
215
- errorMirror = null;
216
- $( collection ).each(function( i ){
217
- if ( this.startLine <= errLine && errLine < this.endLine ) {
218
- errorMirror = this.cm;
219
- errLine = errLine - this.startLine -1;
220
- fileName = this.name;
221
- errIndex = err.index - this.startChars;
222
- return;
223
- }
224
- });
225
- if ( preview )
226
- $( compiled.getWrapperElement()).hide();
227
- var errMessage = '';
228
-
229
- errMessage = " &nbsp; <em>LESS " + err.type +" Error</em> on line " + ( errLine + 1 ) + " of " + fileName + ". <br />" + err.message + "</p>";
230
-
231
- if ( loaded ) {
232
- $error
233
- .removeClass( 'error' )
234
- .addClass( 'updated' )
235
- .show()
236
- .html( "<p><strong>Warning:</strong>" + errMessage + "</p>" );
237
- } else {
238
- $error
239
- .show()
240
- .html( "<p><strong>Error: &nbsp; </strong>" + errMessage + "</p>" );
241
- }
242
-
243
- clearCompileError();
244
-
245
- if (!errorMirror) return;
246
-
247
- errorMarker = errorMirror.setGutterMarker( errLine, 'note-gutter', $('<span></span>').addClass('cm-error').css('marginLeft','4px').text('✖').get(0) );
248
-
249
- //errorMirror.addLineClass( errLine, "wrap", cm-error" );
250
-
251
- pos = errorMirror.posFromIndex( errIndex );
252
- token = errorMirror.getTokenAt( pos );
253
- start = errorMirror.posFromIndex( errIndex - 1 );
254
- end = errorMirror.posFromIndex( errIndex + token.string.length - 1 );
255
- errorText = errorMirror.markText( start, end, { className: "cm-error" } );
256
- if ( preview ) {
257
- //compiled.setValue( "" );
258
- //compiled.save();
259
- //compiled.refresh();
260
- }
261
- }
262
- function clearCompileError() {
263
- if ( errorMarker ) {
264
- $( collection ).each(function( i ){
265
- this.cm.clearGutter( 'note-gutter' );
266
- });
267
- //errorMirror.removeLineClass( errLine, "wrap", "cm-error" );
268
- errorMarker = false;
269
- }
270
- if ( errorText ) {
271
- errorText.clear();
272
- errorText = false;
273
- }
274
- }
275
- _SnS_options.theme_compiler = compile;
276
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/scripts-n-styles.pot DELETED
@@ -1,398 +0,0 @@
1
- # Copyright (C) 2010 Scripts n Styles
2
- # This file is distributed under the same license as the Scripts n Styles package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Scripts n Styles 3.0\n"
6
- "Report-Msgid-Bugs-To: http://wordpress.org/tag/scripts-n-styles\n"
7
- "POT-Creation-Date: 2011-12-09 20:46:53+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=UTF-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
-
15
- #. #-#-#-#-# plugin.pot (Scripts n Styles 3.0) #-#-#-#-#
16
- #. Plugin Name of the plugin/theme
17
- #: includes/class.SnS_Admin_Meta_Box.php:97
18
- #: includes/class.SnS_Settings_Page.php:22
19
- #: includes/class.SnS_Usage_Page.php:22 includes/class.SnS_Global_Page.php:18
20
- #: includes/class.SnS_Global_Page.php:20 includes/class.SnS_Admin.php:64
21
- #: includes/class.SnS_Admin.php:67 includes/class.SnS_Admin.php:70
22
- #: includes/class.SnS_Admin.php:106 includes/class.SnS_Admin.php:126
23
- msgid "Scripts n Styles"
24
- msgstr ""
25
-
26
- #: includes/class.SnS_Admin_Meta_Box.php:133
27
- #: includes/class.SnS_List_Usage.php:23
28
- msgid "Scripts"
29
- msgstr ""
30
-
31
- #: includes/class.SnS_Admin_Meta_Box.php:134
32
- #: includes/class.SnS_List_Usage.php:34
33
- msgid "Styles"
34
- msgstr ""
35
-
36
- #: includes/class.SnS_Admin_Meta_Box.php:135
37
- #: includes/class.SnS_Admin_Meta_Box.php:156
38
- msgid "Classes"
39
- msgstr ""
40
-
41
- #: includes/class.SnS_Admin_Meta_Box.php:136
42
- msgid "Include Scripts"
43
- msgstr ""
44
-
45
- #: includes/class.SnS_Admin_Meta_Box.php:140
46
- msgid ""
47
- "This code will be included <strong>verbatim</strong> in <code>&lt;script></"
48
- "code> tags at the end of your page's (or post's)"
49
- msgstr ""
50
-
51
- #: includes/class.SnS_Admin_Meta_Box.php:141
52
- msgid "<strong>Scripts</strong> (for the <code>head</code> element):"
53
- msgstr ""
54
-
55
- #: includes/class.SnS_Admin_Meta_Box.php:143
56
- #: includes/class.SnS_Admin_Meta_Box.php:146
57
- msgid "tag"
58
- msgstr ""
59
-
60
- #: includes/class.SnS_Admin_Meta_Box.php:150
61
- msgid "<strong>Styles</strong>:"
62
- msgstr ""
63
-
64
- #: includes/class.SnS_Admin_Meta_Box.php:152
65
- msgid ""
66
- "This code will be included <strong>verbatim</strong> in <code>&lt;style></"
67
- "code> tags in the <code>&lt;head></code> tag of your page (or post)."
68
- msgstr ""
69
-
70
- #: includes/class.SnS_Admin_Meta_Box.php:159
71
- msgid "<strong>Body Classes</strong>:"
72
- msgstr ""
73
-
74
- #: includes/class.SnS_Admin_Meta_Box.php:162
75
- #: includes/class.SnS_Admin_Meta_Box.php:168
76
- msgid "Standard:"
77
- msgstr ""
78
-
79
- #: includes/class.SnS_Admin_Meta_Box.php:170
80
- msgid ""
81
- "These <strong>space separated</strong> class names will be added to the "
82
- "<code>body_class()</code> or <code>post_class()</code> function (provided "
83
- "your theme uses these functions)."
84
- msgstr ""
85
-
86
- #: includes/class.SnS_Admin_Meta_Box.php:179
87
- msgid "The Styles Dropdown"
88
- msgstr ""
89
-
90
- #: includes/class.SnS_Admin_Meta_Box.php:181
91
- msgid "Add (or update) a class for the \"Styles\" drop-down:"
92
- msgstr ""
93
-
94
- #: includes/class.SnS_Admin_Meta_Box.php:183
95
- msgid "Title:"
96
- msgstr ""
97
-
98
- #: includes/class.SnS_Admin_Meta_Box.php:188
99
- msgid "Type:"
100
- msgstr ""
101
-
102
- #: includes/class.SnS_Admin_Meta_Box.php:190
103
- msgctxt "css type"
104
- msgid "Inline"
105
- msgstr ""
106
-
107
- #: includes/class.SnS_Admin_Meta_Box.php:191
108
- msgctxt "css type"
109
- msgid "Block"
110
- msgstr ""
111
-
112
- #: includes/class.SnS_Admin_Meta_Box.php:192
113
- msgctxt "css type"
114
- msgid "Selector:"
115
- msgstr ""
116
-
117
- #: includes/class.SnS_Admin_Meta_Box.php:196
118
- msgid "Element:"
119
- msgstr ""
120
-
121
- #: includes/class.SnS_Admin_Meta_Box.php:201
122
- msgid "Classes:"
123
- msgstr ""
124
-
125
- #: includes/class.SnS_Admin_Meta_Box.php:206
126
- msgid "Wrapper:"
127
- msgstr ""
128
-
129
- #: includes/class.SnS_Admin_Meta_Box.php:212
130
- msgid "Classes currently in the dropdown:"
131
- msgstr ""
132
-
133
- #: includes/class.SnS_Admin_Meta_Box.php:232
134
- msgid "Currently Enqueued Scripts:"
135
- msgstr ""
136
-
137
- #: includes/class.SnS_Admin_Meta_Box.php:236
138
- msgid ""
139
- "The chosen scripts will be enqueued and placed before your codes if your "
140
- "code is dependant on certain scripts (like jQuery)."
141
- msgstr ""
142
-
143
- #: includes/class.SnS_Admin_Meta_Box.php:247
144
- msgid "(plus others once saved.)"
145
- msgstr ""
146
-
147
- #: includes/class.SnS_Settings_Page.php:22 includes/class.SnS_Admin.php:91
148
- #: includes/class.SnS_Admin.php:202
149
- msgid "Settings"
150
- msgstr ""
151
-
152
- #: includes/class.SnS_Settings_Page.php:77
153
- msgid "Scripts n Styles Settings"
154
- msgstr ""
155
-
156
- #: includes/class.SnS_Settings_Page.php:83
157
- msgid "<strong>Menu Position</strong>: "
158
- msgstr ""
159
-
160
- #: includes/class.SnS_Settings_Page.php:97
161
- msgid "<strong>CodeMirror Theme</strong>: "
162
- msgstr ""
163
-
164
- #: includes/class.SnS_Settings_Page.php:111
165
- msgid "<strong>Hide Metabox by default</strong>: "
166
- msgstr ""
167
-
168
- #: includes/class.SnS_Settings_Page.php:120
169
- msgid "Hide Metabox by default"
170
- msgstr ""
171
-
172
- #: includes/class.SnS_Settings_Page.php:121
173
- msgid ""
174
- "<span class=\"description\" style=\"max-width: 500px; display: inline-block;"
175
- "\">This is overridable via Screen Options on each edit screen.</span>"
176
- msgstr ""
177
-
178
- #: includes/class.SnS_Settings_Page.php:126
179
- msgid "Code Mirror Demo"
180
- msgstr ""
181
-
182
- #: includes/class.SnS_Settings_Page.php:138
183
- msgid ""
184
- "Control how and where Scripts n Styles menus and metaboxes appear. These "
185
- "options are here because sometimes users really care about this stuff. Feel "
186
- "free to adjust to your liking. :-)"
187
- msgstr ""
188
-
189
- #: includes/class.SnS_List_Usage.php:20
190
- msgid "Scripts (head)"
191
- msgstr ""
192
-
193
- #: includes/class.SnS_List_Usage.php:26
194
- msgid "Enqueued Scripts"
195
- msgstr ""
196
-
197
- #: includes/class.SnS_List_Usage.php:31
198
- msgid "TinyMCE Formats"
199
- msgstr ""
200
-
201
- #: includes/class.SnS_List_Usage.php:37
202
- msgid "Post Classes"
203
- msgstr ""
204
-
205
- #: includes/class.SnS_List_Usage.php:40
206
- msgid "Body Classes"
207
- msgstr ""
208
-
209
- #: includes/class.SnS_List_Usage.php:50
210
- msgid "Edit &#8220;%s&#8221;"
211
- msgstr ""
212
-
213
- #: includes/class.SnS_List_Usage.php:53
214
- msgid "Edit"
215
- msgstr ""
216
-
217
- #: includes/class.SnS_List_Usage.php:75
218
- msgid "Title"
219
- msgstr ""
220
-
221
- #: includes/class.SnS_List_Usage.php:76
222
- msgid "ID"
223
- msgstr ""
224
-
225
- #: includes/class.SnS_List_Usage.php:77
226
- msgid "Status"
227
- msgstr ""
228
-
229
- #: includes/class.SnS_List_Usage.php:78
230
- msgid "Post Type"
231
- msgstr ""
232
-
233
- #: includes/class.SnS_List_Usage.php:79
234
- msgid "Script Data"
235
- msgstr ""
236
-
237
- #: includes/class.SnS_List_Usage.php:80
238
- msgid "Style Data"
239
- msgstr ""
240
-
241
- #: includes/class.SnS_List_Usage.php:133
242
- msgid "Password protected"
243
- msgstr ""
244
-
245
- #: includes/class.SnS_List_Usage.php:135
246
- msgid "Private"
247
- msgstr ""
248
-
249
- #: includes/class.SnS_List_Usage.php:137
250
- msgid "Draft"
251
- msgstr ""
252
-
253
- #. translators: post state
254
- #: includes/class.SnS_List_Usage.php:140
255
- msgctxt "post state"
256
- msgid "Pending"
257
- msgstr ""
258
-
259
- #: includes/class.SnS_List_Usage.php:142
260
- msgid "Sticky"
261
- msgstr ""
262
-
263
- #: includes/class.SnS_Usage_Page.php:22 includes/class.SnS_Admin.php:92
264
- msgid "Usage"
265
- msgstr ""
266
-
267
- #: includes/class.SnS_Usage_Page.php:47
268
- msgid "Per Page"
269
- msgstr ""
270
-
271
- #: includes/class.SnS_Usage_Page.php:54
272
- msgid "Scripts n Styles Usage"
273
- msgstr ""
274
-
275
- #: includes/class.SnS_Usage_Page.php:78
276
- msgid "The following table shows content that utilizes Scripts n Styles."
277
- msgstr ""
278
-
279
- #: includes/class.SnS_Global_Page.php:17 includes/class.SnS_Admin.php:90
280
- msgid "Global"
281
- msgstr ""
282
-
283
- #: includes/class.SnS_Global_Page.php:53
284
- msgid "Global Scripts n Styles"
285
- msgstr ""
286
-
287
- #: includes/class.SnS_Global_Page.php:59
288
- msgid "<strong>Scripts:</strong> "
289
- msgstr ""
290
-
291
- #: includes/class.SnS_Global_Page.php:70
292
- msgid ""
293
- "<span class=\"description\" style=\"max-width: 500px; display: inline-block;"
294
- "\">The \"Scripts\" will be included <strong>verbatim</strong> in <code>&lt;"
295
- "script></code> tags at the bottom of the <code>&lt;body></code> element of "
296
- "your html.</span>"
297
- msgstr ""
298
-
299
- #: includes/class.SnS_Global_Page.php:74
300
- msgid "<strong>Styles:</strong> "
301
- msgstr ""
302
-
303
- #: includes/class.SnS_Global_Page.php:85
304
- msgid ""
305
- "<span class=\"description\" style=\"max-width: 500px; display: inline-block;"
306
- "\">The \"Styles\" will be included <strong>verbatim</strong> in <code>&lt;"
307
- "style></code> tags in the <code>&lt;head></code> element of your html.</span>"
308
- msgstr ""
309
-
310
- #: includes/class.SnS_Global_Page.php:89
311
- msgid "<strong>Scripts</strong><br />(for the <code>head</code> element): "
312
- msgstr ""
313
-
314
- #: includes/class.SnS_Global_Page.php:100
315
- msgid ""
316
- "<span class=\"description\" style=\"max-width: 500px; display: inline-block;"
317
- "\">The \"Scripts (in head)\" will be included <strong>verbatim</strong> in "
318
- "<code>&lt;script></code> tags in the <code>&lt;head></code> element of your "
319
- "html.</span>"
320
- msgstr ""
321
-
322
- #: includes/class.SnS_Global_Page.php:104
323
- msgid "<strong>Enqueue Scripts</strong>: "
324
- msgstr ""
325
-
326
- #: includes/class.SnS_Global_Page.php:115
327
- msgid "Currently Enqueued Scripts: "
328
- msgstr ""
329
-
330
- #: includes/class.SnS_Global_Page.php:126
331
- msgid ""
332
- "Code entered here will be included in <em>every page (and post) of your "
333
- "site</em>, including the homepage and archives. The code will appear "
334
- "<strong>before</strong> Scripts and Styles registered individually."
335
- msgstr ""
336
-
337
- #: includes/class.SnS_Form.php:105
338
- msgid "Cheatin&#8217; uh?"
339
- msgstr ""
340
-
341
- #: includes/class.SnS_Form.php:108 includes/class.SnS_Form.php:135
342
- msgid "Settings saved."
343
- msgstr ""
344
-
345
- #: includes/class.SnS_Admin.php:109 includes/class.SnS_Admin.php:129
346
- msgid ""
347
- "<p>In default (non MultiSite) WordPress installs, both <em>Administrators</"
348
- "em> and \r\n"
349
- "\t\t\t\t\t\t<em>Editors</em> can access <em>Scripts-n-Styles</em> on "
350
- "individual edit screens. \r\n"
351
- "\t\t\t\t\t\tOnly <em>Administrators</em> can access this Options Page. In "
352
- "MultiSite WordPress installs, only \r\n"
353
- "\t\t\t\t\t\t<em>\"Super Admin\"</em> users can access either\r\n"
354
- "\t\t\t\t\t\t<em>Scripts-n-Styles</em> on individual edit screens or this "
355
- "Options Page. If other plugins change \r\n"
356
- "\t\t\t\t\t\tcapabilities (specifically \"unfiltered_html\"), \r\n"
357
- "\t\t\t\t\t\tother users can be granted access.</p>"
358
- msgstr ""
359
-
360
- #: includes/class.SnS_Admin.php:119
361
- msgid "For more information:"
362
- msgstr ""
363
-
364
- #: includes/class.SnS_Admin.php:120
365
- msgid ""
366
- "<a href=\"http://wordpress.org/extend/plugins/scripts-n-styles/faq/\" target="
367
- "\"_blank\">Frequently Asked Questions</a>"
368
- msgstr ""
369
-
370
- #: includes/class.SnS_Admin.php:121
371
- msgid ""
372
- "<a href=\"https://github.com/unFocus/Scripts-n-Styles\" target=\"_blank"
373
- "\">Source on github</a>"
374
- msgstr ""
375
-
376
- #: includes/class.SnS_Admin.php:122
377
- msgid ""
378
- "<a href=\"http://wordpress.org/tags/scripts-n-styles\" target=\"_blank"
379
- "\">Support Forums</a>"
380
- msgstr ""
381
-
382
- #. Plugin URI of the plugin/theme
383
- msgid "http://www.unfocus.com/projects/scripts-n-styles/"
384
- msgstr ""
385
-
386
- #. Description of the plugin/theme
387
- msgid ""
388
- "Allows WordPress admin users the ability to add custom CSS and JavaScript "
389
- "directly to individual Post, Pages or custom post types."
390
- msgstr ""
391
-
392
- #. Author of the plugin/theme
393
- msgid "unFocus Projects"
394
- msgstr ""
395
-
396
- #. Author URI of the plugin/theme
397
- msgid "http://www.unfocus.com/"
398
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libraries/codemirror/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (C) 2011 by Marijn Haverbeke <marijnh@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
libraries/codemirror/lib/codemirror.css ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .CodeMirror {
2
+ line-height: 1em;
3
+ font-family: monospace;
4
+ }
5
+
6
+ .CodeMirror-scroll {
7
+ overflow: auto;
8
+ height: 300px;
9
+ }
10
+
11
+ .CodeMirror-gutter {
12
+ position: absolute; left: 0; top: 0;
13
+ background-color: #f7f7f7;
14
+ border-right: 1px solid #eee;
15
+ min-width: 2em;
16
+ height: 100%;
17
+ }
18
+ .CodeMirror-gutter-text {
19
+ color: #aaa;
20
+ text-align: right;
21
+ padding: .4em .2em .4em .4em;
22
+ }
23
+ .CodeMirror-lines {
24
+ padding: .4em;
25
+ }
26
+
27
+ .CodeMirror pre {
28
+ -moz-border-radius: 0;
29
+ -webkit-border-radius: 0;
30
+ -o-border-radius: 0;
31
+ border-radius: 0;
32
+ border-width: 0; margin: 0; padding: 0; background: transparent;
33
+ font-family: inherit;
34
+ font-size: inherit;
35
+ padding: 0; margin: 0;
36
+ white-space: pre;
37
+ word-wrap: normal;
38
+ }
39
+
40
+ .CodeMirror textarea {
41
+ font-family: inherit !important;
42
+ font-size: inherit !important;
43
+ }
44
+
45
+ .CodeMirror-cursor {
46
+ z-index: 10;
47
+ position: absolute;
48
+ visibility: hidden;
49
+ border-left: 1px solid black !important;
50
+ }
51
+ .CodeMirror-focused .CodeMirror-cursor {
52
+ visibility: visible;
53
+ }
54
+
55
+ span.CodeMirror-selected {
56
+ background: #ccc !important;
57
+ color: HighlightText !important;
58
+ }
59
+ .CodeMirror-focused span.CodeMirror-selected {
60
+ background: Highlight !important;
61
+ }
62
+
63
+ .CodeMirror-matchingbracket {color: #0f0 !important;}
64
+ .CodeMirror-nonmatchingbracket {color: #f22 !important;}
libraries/codemirror/lib/codemirror.js ADDED
@@ -0,0 +1,2071 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // All functions that need access to the editor's state live inside
2
+ // the CodeMirror function. Below that, at the bottom of the file,
3
+ // some utilities are defined.
4
+
5
+ // CodeMirror is the only global var we claim
6
+ var CodeMirror = (function() {
7
+ // This is the function that produces an editor instance. It's
8
+ // closure is used to store the editor state.
9
+ function CodeMirror(place, givenOptions) {
10
+ // Determine effective options based on given values and defaults.
11
+ var options = {}, defaults = CodeMirror.defaults;
12
+ for (var opt in defaults)
13
+ if (defaults.hasOwnProperty(opt))
14
+ options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
15
+
16
+ var targetDocument = options["document"];
17
+ // The element in which the editor lives.
18
+ var wrapper = targetDocument.createElement("div");
19
+ wrapper.className = "CodeMirror";
20
+ // This mess creates the base DOM structure for the editor.
21
+ wrapper.innerHTML =
22
+ '<div style="overflow: hidden; position: relative; width: 1px; height: 0px;">' + // Wraps and hides input textarea
23
+ '<textarea style="position: absolute; width: 2px;" wrap="off"></textarea></div>' +
24
+ '<div class="CodeMirror-scroll cm-s-' + options.theme + '">' +
25
+ '<div style="position: relative">' + // Set to the height of the text, causes scrolling
26
+ '<div style="position: absolute; height: 0; width: 0; overflow: hidden;"></div>' +
27
+ '<div style="position: relative">' + // Moved around its parent to cover visible view
28
+ '<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' +
29
+ // Provides positioning relative to (visible) text origin
30
+ '<div class="CodeMirror-lines"><div style="position: relative">' +
31
+ '<pre class="CodeMirror-cursor">&#160;</pre>' + // Absolutely positioned blinky cursor
32
+ '<div></div>' + // This DIV contains the actual code
33
+ '</div></div></div></div></div>';
34
+ if (place.appendChild) place.appendChild(wrapper); else place(wrapper);
35
+ // I've never seen more elegant code in my life.
36
+ var inputDiv = wrapper.firstChild, input = inputDiv.firstChild,
37
+ scroller = wrapper.lastChild, code = scroller.firstChild,
38
+ measure = code.firstChild, mover = measure.nextSibling,
39
+ gutter = mover.firstChild, gutterText = gutter.firstChild,
40
+ lineSpace = gutter.nextSibling.firstChild,
41
+ cursor = lineSpace.firstChild, lineDiv = cursor.nextSibling;
42
+ if (options.tabindex != null) input.tabindex = options.tabindex;
43
+ if (!options.gutter && !options.lineNumbers) gutter.style.display = "none";
44
+
45
+ // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval.
46
+ var poll = new Delayed(), highlight = new Delayed(), blinker;
47
+
48
+ // mode holds a mode API object. lines an array of Line objects
49
+ // (see Line constructor), work an array of lines that should be
50
+ // parsed, and history the undo history (instance of History
51
+ // constructor).
52
+ var mode, lines = [new Line("")], work, history = new History(), focused;
53
+ loadMode();
54
+ // The selection. These are always maintained to point at valid
55
+ // positions. Inverted is used to remember that the user is
56
+ // selecting bottom-to-top.
57
+ var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false};
58
+ // Selection-related flags. shiftSelecting obviously tracks
59
+ // whether the user is holding shift. reducedSelection is a hack
60
+ // to get around the fact that we can't create inverted
61
+ // selections. See below.
62
+ var shiftSelecting, reducedSelection, lastDoubleClick;
63
+ // Variables used by startOperation/endOperation to track what
64
+ // happened during the operation.
65
+ var updateInput, changes, textChanged, selectionChanged, leaveInputAlone;
66
+ // Current visible range (may be bigger than the view window).
67
+ var showingFrom = 0, showingTo = 0, lastHeight = 0, curKeyId = null;
68
+ // editing will hold an object describing the things we put in the
69
+ // textarea, to help figure out whether something changed.
70
+ // bracketHighlighted is used to remember that a backet has been
71
+ // marked.
72
+ var editing, bracketHighlighted;
73
+ // Tracks the maximum line length so that the horizontal scrollbar
74
+ // can be kept static when scrolling.
75
+ var maxLine = "";
76
+
77
+ // Initialize the content. Somewhat hacky (delayed prepareInput)
78
+ // to work around browser issues.
79
+ operation(function(){setValue(options.value || ""); updateInput = false;})();
80
+ setTimeout(prepareInput, 20);
81
+
82
+ // Register our event handlers.
83
+ connect(scroller, "mousedown", operation(onMouseDown));
84
+ // Gecko browsers fire contextmenu *after* opening the menu, at
85
+ // which point we can't mess with it anymore. Context menu is
86
+ // handled in onMouseDown for Gecko.
87
+ if (!gecko) connect(scroller, "contextmenu", operation(onContextMenu));
88
+ connect(code, "dblclick", operation(onDblClick));
89
+ connect(scroller, "scroll", function() {updateDisplay([]); if (options.onScroll) options.onScroll(instance);});
90
+ connect(window, "resize", function() {updateDisplay(true);});
91
+ connect(input, "keyup", operation(onKeyUp));
92
+ connect(input, "keydown", operation(onKeyDown));
93
+ connect(input, "keypress", operation(onKeyPress));
94
+ connect(input, "focus", onFocus);
95
+ connect(input, "blur", onBlur);
96
+
97
+ connect(scroller, "dragenter", function(e){e.stop();});
98
+ connect(scroller, "dragover", function(e){e.stop();});
99
+ connect(scroller, "drop", operation(onDrop));
100
+ connect(scroller, "paste", function(){focusInput(); fastPoll();});
101
+ connect(input, "paste", function(){fastPoll();});
102
+ connect(input, "cut", function(){fastPoll();});
103
+
104
+ // IE throws unspecified error in certain cases, when
105
+ // trying to access activeElement before onload
106
+ var hasFocus; try { hasFocus = (targetDocument.activeElement == input); } catch(e) { }
107
+ if (hasFocus) onFocus();
108
+ else onBlur();
109
+
110
+ function isLine(l) {return l >= 0 && l < lines.length;}
111
+ // The instance object that we'll return. Mostly calls out to
112
+ // local functions in the CodeMirror function. Some do some extra
113
+ // range checking and/or clipping. operation is used to wrap the
114
+ // call so that changes it makes are tracked, and the display is
115
+ // updated afterwards.
116
+ var instance = {
117
+ getValue: getValue,
118
+ setValue: operation(setValue),
119
+ getSelection: getSelection,
120
+ replaceSelection: operation(replaceSelection),
121
+ focus: function(){focusInput(); onFocus(); prepareInput(); fastPoll();},
122
+ setOption: function(option, value) {
123
+ options[option] = value;
124
+ if (option == "lineNumbers" || option == "gutter") gutterChanged();
125
+ else if (option == "mode" || option == "indentUnit") loadMode();
126
+ else if (option == "readOnly" && value == "nocursor") input.blur();
127
+ else if (option == "theme") scroller.className = scroller.className.replace(/cm-s-\w+/, "cm-s-" + value);
128
+ },
129
+ getOption: function(option) {return options[option];},
130
+ undo: operation(undo),
131
+ redo: operation(redo),
132
+ indentLine: operation(function(n) {if (isLine(n)) indentLine(n, "smart");}),
133
+ historySize: function() {return {undo: history.done.length, redo: history.undone.length};},
134
+ matchBrackets: operation(function(){matchBrackets(true);}),
135
+ getTokenAt: function(pos) {
136
+ pos = clipPos(pos);
137
+ return lines[pos.line].getTokenAt(mode, getStateBefore(pos.line), pos.ch);
138
+ },
139
+ cursorCoords: function(start){
140
+ if (start == null) start = sel.inverted;
141
+ return pageCoords(start ? sel.from : sel.to);
142
+ },
143
+ charCoords: function(pos){return pageCoords(clipPos(pos));},
144
+ coordsChar: function(coords) {
145
+ var off = eltOffset(lineSpace);
146
+ var line = clipLine(Math.min(lines.length - 1, showingFrom + Math.floor((coords.y - off.top) / lineHeight())));
147
+ return clipPos({line: line, ch: charFromX(clipLine(line), coords.x - off.left)});
148
+ },
149
+ getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);},
150
+ markText: operation(function(a, b, c){return operation(markText(a, b, c));}),
151
+ setMarker: addGutterMarker,
152
+ clearMarker: removeGutterMarker,
153
+ setLineClass: operation(setLineClass),
154
+ lineInfo: lineInfo,
155
+ addWidget: function(pos, node, scroll) {
156
+ var pos = localCoords(clipPos(pos), true);
157
+ node.style.top = (showingFrom * lineHeight() + pos.yBot + paddingTop()) + "px";
158
+ node.style.left = (pos.x + paddingLeft()) + "px";
159
+ code.appendChild(node);
160
+ if (scroll)
161
+ scrollIntoView(pos.x, pos.yBot, pos.x + node.offsetWidth, pos.yBot + node.offsetHeight);
162
+ },
163
+
164
+ lineCount: function() {return lines.length;},
165
+ getCursor: function(start) {
166
+ if (start == null) start = sel.inverted;
167
+ return copyPos(start ? sel.from : sel.to);
168
+ },
169
+ somethingSelected: function() {return !posEq(sel.from, sel.to);},
170
+ setCursor: operation(function(line, ch) {
171
+ if (ch == null && typeof line.line == "number") setCursor(line.line, line.ch);
172
+ else setCursor(line, ch);
173
+ }),
174
+ setSelection: operation(function(from, to) {setSelection(clipPos(from), clipPos(to || from));}),
175
+ getLine: function(line) {if (isLine(line)) return lines[line].text;},
176
+ setLine: operation(function(line, text) {
177
+ if (isLine(line)) replaceRange(text, {line: line, ch: 0}, {line: line, ch: lines[line].text.length});
178
+ }),
179
+ removeLine: operation(function(line) {
180
+ if (isLine(line)) replaceRange("", {line: line, ch: 0}, clipPos({line: line+1, ch: 0}));
181
+ }),
182
+ replaceRange: operation(replaceRange),
183
+ getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));},
184
+
185
+ operation: function(f){return operation(f)();},
186
+ refresh: function(){updateDisplay(true);},
187
+ getInputField: function(){return input;},
188
+ getWrapperElement: function(){return wrapper;}
189
+ };
190
+
191
+ function setValue(code) {
192
+ history = null;
193
+ var top = {line: 0, ch: 0};
194
+ updateLines(top, {line: lines.length - 1, ch: lines[lines.length-1].text.length},
195
+ splitLines(code), top, top);
196
+ history = new History();
197
+ }
198
+ function getValue(code) {
199
+ var text = [];
200
+ for (var i = 0, l = lines.length; i < l; ++i)
201
+ text.push(lines[i].text);
202
+ return text.join("\n");
203
+ }
204
+
205
+ function onMouseDown(e) {
206
+ var ld = lastDoubleClick; lastDoubleClick = null;
207
+ // First, see if this is a click in the gutter
208
+ for (var n = e.target(); n != wrapper; n = n.parentNode)
209
+ if (n.parentNode == gutterText) {
210
+ if (options.onGutterClick)
211
+ options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom);
212
+ return e.stop();
213
+ }
214
+
215
+ if (gecko && e.button() == 3) onContextMenu(e);
216
+ if (e.button() != 1) return;
217
+ // For button 1, if it was clicked inside the editor
218
+ // (posFromMouse returning non-null), we have to adjust the
219
+ // selection.
220
+ var start = posFromMouse(e), last = start, going;
221
+ if (!start) {if (e.target() == scroller) e.stop(); return;}
222
+
223
+ if (!focused) onFocus();
224
+ e.stop();
225
+ if (ld && +new Date - ld < 400) return selectLine(start.line);
226
+
227
+ setCursor(start.line, start.ch, true);
228
+ // And then we have to see if it's a drag event, in which case
229
+ // the dragged-over text must be selected.
230
+ function end() {
231
+ focusInput();
232
+ updateInput = true;
233
+ move(); up();
234
+ }
235
+ function extend(e) {
236
+ var cur = posFromMouse(e, true);
237
+ if (cur && !posEq(cur, last)) {
238
+ if (!focused) onFocus();
239
+ last = cur;
240
+ setSelectionUser(start, cur);
241
+ updateInput = false;
242
+ var visible = visibleLines();
243
+ if (cur.line >= visible.to || cur.line < visible.from)
244
+ going = setTimeout(operation(function(){extend(e);}), 150);
245
+ }
246
+ }
247
+
248
+ var move = connect(targetDocument, "mousemove", operation(function(e) {
249
+ clearTimeout(going);
250
+ e.stop();
251
+ extend(e);
252
+ }), true);
253
+ var up = connect(targetDocument, "mouseup", operation(function(e) {
254
+ clearTimeout(going);
255
+ var cur = posFromMouse(e);
256
+ if (cur) setSelectionUser(start, cur);
257
+ e.stop();
258
+ end();
259
+ }), true);
260
+ }
261
+ function onDblClick(e) {
262
+ var pos = posFromMouse(e);
263
+ if (!pos) return;
264
+ selectWordAt(pos);
265
+ e.stop();
266
+ lastDoubleClick = +new Date;
267
+ }
268
+ function onDrop(e) {
269
+ var pos = posFromMouse(e, true), files = e.e.dataTransfer.files;
270
+ if (!pos || options.readOnly) return;
271
+ if (files && files.length && window.FileReader && window.File) {
272
+ var n = files.length, text = Array(n), read = 0;
273
+ for (var i = 0; i < n; ++i) loadFile(files[i], i);
274
+ function loadFile(file, i) {
275
+ var reader = new FileReader;
276
+ reader.onload = function() {
277
+ text[i] = reader.result;
278
+ if (++read == n) replaceRange(text.join(""), clipPos(pos), clipPos(pos));
279
+ };
280
+ reader.readAsText(file);
281
+ }
282
+ }
283
+ else {
284
+ try {
285
+ var text = e.e.dataTransfer.getData("Text");
286
+ if (text) replaceRange(text, pos, pos);
287
+ }
288
+ catch(e){}
289
+ }
290
+ }
291
+ function onKeyDown(e) {
292
+ if (!focused) onFocus();
293
+
294
+ var code = e.e.keyCode;
295
+ // IE does strange things with escape.
296
+ if (ie && code == 27) { e.e.returnValue = false; }
297
+ // Tries to detect ctrl on non-mac, cmd on mac.
298
+ var mod = (mac ? e.e.metaKey : e.e.ctrlKey) && !e.e.altKey, anyMod = e.e.ctrlKey || e.e.altKey || e.e.metaKey;
299
+ if (code == 16 || e.e.shiftKey) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from);
300
+ else shiftSelecting = null;
301
+ // First give onKeyEvent option a chance to handle this.
302
+ if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return;
303
+
304
+ if (code == 33 || code == 34) {scrollPage(code == 34); return e.stop();} // page up/down
305
+ if (mod && ((code == 36 || code == 35) || // ctrl-home/end
306
+ mac && (code == 38 || code == 40))) { // cmd-up/down
307
+ scrollEnd(code == 36 || code == 38); return e.stop();
308
+ }
309
+ if (mod && code == 65) {selectAll(); return e.stop();} // ctrl-a
310
+ if (!options.readOnly) {
311
+ if (!anyMod && code == 13) {return;} // enter
312
+ if (!anyMod && code == 9 && handleTab(e.e.shiftKey)) return e.stop(); // tab
313
+ if (mod && code == 90) {undo(); return e.stop();} // ctrl-z
314
+ if (mod && ((e.e.shiftKey && code == 90) || code == 89)) {redo(); return e.stop();} // ctrl-shift-z, ctrl-y
315
+ }
316
+
317
+ // Key id to use in the movementKeys map. We also pass it to
318
+ // fastPoll in order to 'self learn'. We need this because
319
+ // reducedSelection, the hack where we collapse the selection to
320
+ // its start when it is inverted and a movement key is pressed
321
+ // (and later restore it again), shouldn't be used for
322
+ // non-movement keys.
323
+ curKeyId = (mod ? "c" : "") + code;
324
+ if (sel.inverted && movementKeys.hasOwnProperty(curKeyId)) {
325
+ var range = selRange(input);
326
+ if (range) {
327
+ reducedSelection = {anchor: range.start};
328
+ setSelRange(input, range.start, range.start);
329
+ }
330
+ }
331
+ fastPoll(curKeyId);
332
+ }
333
+ function onKeyUp(e) {
334
+ if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return;
335
+ if (reducedSelection) {
336
+ reducedSelection = null;
337
+ updateInput = true;
338
+ }
339
+ if (e.e.keyCode == 16) shiftSelecting = null;
340
+ }
341
+ function onKeyPress(e) {
342
+ if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return;
343
+ if (options.electricChars && mode.electricChars) {
344
+ var ch = String.fromCharCode(e.e.charCode == null ? e.e.keyCode : e.e.charCode);
345
+ if (mode.electricChars.indexOf(ch) > -1)
346
+ setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 50);
347
+ }
348
+ var code = e.e.keyCode;
349
+ // Re-stop tab and enter. Necessary on some browsers.
350
+ if (code == 13) {if (!options.readOnly) handleEnter(); e.stop();}
351
+ else if (!e.e.ctrlKey && !e.e.altKey && !e.e.metaKey && code == 9 && options.tabMode != "default") e.stop();
352
+ else fastPoll(curKeyId);
353
+ }
354
+
355
+ function onFocus() {
356
+ if (options.readOnly == "nocursor") return;
357
+ if (!focused && options.onFocus) options.onFocus(instance);
358
+ focused = true;
359
+ slowPoll();
360
+ if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
361
+ wrapper.className += " CodeMirror-focused";
362
+ restartBlink();
363
+ }
364
+ function onBlur() {
365
+ if (focused && options.onBlur) options.onBlur(instance);
366
+ clearInterval(blinker);
367
+ shiftSelecting = null;
368
+ focused = false;
369
+ wrapper.className = wrapper.className.replace(" CodeMirror-focused", "");
370
+ }
371
+
372
+ // Replace the range from from to to by the strings in newText.
373
+ // Afterwards, set the selection to selFrom, selTo.
374
+ function updateLines(from, to, newText, selFrom, selTo) {
375
+ if (history) {
376
+ var old = [];
377
+ for (var i = from.line, e = to.line + 1; i < e; ++i) old.push(lines[i].text);
378
+ history.addChange(from.line, newText.length, old);
379
+ while (history.done.length > options.undoDepth) history.done.shift();
380
+ }
381
+ updateLinesNoUndo(from, to, newText, selFrom, selTo);
382
+ if (newText.length < 5)
383
+ highlightLines(from.line, from.line + newText.length)
384
+ }
385
+ function unredoHelper(from, to) {
386
+ var change = from.pop();
387
+ if (change) {
388
+ var replaced = [], end = change.start + change.added;
389
+ for (var i = change.start; i < end; ++i) replaced.push(lines[i].text);
390
+ to.push({start: change.start, added: change.old.length, old: replaced});
391
+ var pos = clipPos({line: change.start + change.old.length - 1,
392
+ ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])});
393
+ updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: lines[end-1].text.length}, change.old, pos, pos);
394
+ }
395
+ }
396
+ function undo() {unredoHelper(history.done, history.undone);}
397
+ function redo() {unredoHelper(history.undone, history.done);}
398
+
399
+ function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
400
+ var recomputeMaxLength = false, maxLineLength = maxLine.length;
401
+ for (var i = from.line; i <= to.line; ++i) {
402
+ if (lines[i].text.length == maxLineLength) {recomputeMaxLength = true; break;}
403
+ }
404
+
405
+ var nlines = to.line - from.line, firstLine = lines[from.line], lastLine = lines[to.line];
406
+ // First adjust the line structure, taking some care to leave highlighting intact.
407
+ if (firstLine == lastLine) {
408
+ if (newText.length == 1)
409
+ firstLine.replace(from.ch, to.ch, newText[0]);
410
+ else {
411
+ lastLine = firstLine.split(to.ch, newText[newText.length-1]);
412
+ var spliceargs = [from.line + 1, nlines];
413
+ firstLine.replace(from.ch, firstLine.text.length, newText[0]);
414
+ for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i]));
415
+ spliceargs.push(lastLine);
416
+ lines.splice.apply(lines, spliceargs);
417
+ }
418
+ }
419
+ else if (newText.length == 1) {
420
+ firstLine.replace(from.ch, firstLine.text.length, newText[0] + lastLine.text.slice(to.ch));
421
+ lines.splice(from.line + 1, nlines);
422
+ }
423
+ else {
424
+ var spliceargs = [from.line + 1, nlines - 1];
425
+ firstLine.replace(from.ch, firstLine.text.length, newText[0]);
426
+ lastLine.replace(0, to.ch, newText[newText.length-1]);
427
+ for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i]));
428
+ lines.splice.apply(lines, spliceargs);
429
+ }
430
+
431
+
432
+ for (var i = from.line, e = i + newText.length; i < e; ++i) {
433
+ var l = lines[i].text;
434
+ if (l.length > maxLineLength) {
435
+ maxLine = l; maxLineLength = l.length;
436
+ recomputeMaxLength = false;
437
+ }
438
+ }
439
+ if (recomputeMaxLength) {
440
+ maxLineLength = 0; maxLine = "";
441
+ for (var i = 0, e = lines.length; i < e; ++i) {
442
+ var l = lines[i].text;
443
+ if (l.length > maxLineLength) {
444
+ maxLineLength = l.length; maxLine = l;
445
+ }
446
+ }
447
+ }
448
+
449
+ // Add these lines to the work array, so that they will be
450
+ // highlighted. Adjust work lines if lines were added/removed.
451
+ var newWork = [], lendiff = newText.length - nlines - 1;
452
+ for (var i = 0, l = work.length; i < l; ++i) {
453
+ var task = work[i];
454
+ if (task < from.line) newWork.push(task);
455
+ else if (task > to.line) newWork.push(task + lendiff);
456
+ }
457
+ if (newText.length) newWork.push(from.line);
458
+ work = newWork;
459
+ startWorker(100);
460
+ // Remember that these lines changed, for updating the display
461
+ changes.push({from: from.line, to: to.line + 1, diff: lendiff});
462
+ textChanged = {from: from, to: to, text: newText};
463
+
464
+ // Update the selection
465
+ function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;}
466
+ setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line));
467
+
468
+ // Make sure the scroll-size div has the correct height.
469
+ code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
470
+ }
471
+
472
+ function replaceRange(code, from, to) {
473
+ from = clipPos(from);
474
+ if (!to) to = from; else to = clipPos(to);
475
+ code = splitLines(code);
476
+ function adjustPos(pos) {
477
+ if (posLess(pos, from)) return pos;
478
+ if (!posLess(to, pos)) return end;
479
+ var line = pos.line + code.length - (to.line - from.line) - 1;
480
+ var ch = pos.ch;
481
+ if (pos.line == to.line)
482
+ ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0));
483
+ return {line: line, ch: ch};
484
+ }
485
+ var end;
486
+ replaceRange1(code, from, to, function(end1) {
487
+ end = end1;
488
+ return {from: adjustPos(sel.from), to: adjustPos(sel.to)};
489
+ });
490
+ return end;
491
+ }
492
+ function replaceSelection(code, collapse) {
493
+ replaceRange1(splitLines(code), sel.from, sel.to, function(end) {
494
+ if (collapse == "end") return {from: end, to: end};
495
+ else if (collapse == "start") return {from: sel.from, to: sel.from};
496
+ else return {from: sel.from, to: end};
497
+ });
498
+ }
499
+ function replaceRange1(code, from, to, computeSel) {
500
+ var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length;
501
+ var newSel = computeSel({line: from.line + code.length - 1, ch: endch});
502
+ updateLines(from, to, code, newSel.from, newSel.to);
503
+ }
504
+
505
+ function getRange(from, to) {
506
+ var l1 = from.line, l2 = to.line;
507
+ if (l1 == l2) return lines[l1].text.slice(from.ch, to.ch);
508
+ var code = [lines[l1].text.slice(from.ch)];
509
+ for (var i = l1 + 1; i < l2; ++i) code.push(lines[i].text);
510
+ code.push(lines[l2].text.slice(0, to.ch));
511
+ return code.join("\n");
512
+ }
513
+ function getSelection() {
514
+ return getRange(sel.from, sel.to);
515
+ }
516
+
517
+ var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll
518
+ function slowPoll() {
519
+ if (pollingFast) return;
520
+ poll.set(2000, function() {
521
+ startOperation();
522
+ readInput();
523
+ if (focused) slowPoll();
524
+ endOperation();
525
+ });
526
+ }
527
+ function fastPoll(keyId) {
528
+ var missed = false;
529
+ pollingFast = true;
530
+ function p() {
531
+ startOperation();
532
+ var changed = readInput();
533
+ if (changed == "moved" && keyId) movementKeys[keyId] = true;
534
+ if (!changed && !missed) {missed = true; poll.set(80, p);}
535
+ else {pollingFast = false; slowPoll();}
536
+ endOperation();
537
+ }
538
+ poll.set(20, p);
539
+ }
540
+
541
+ // Inspects the textarea, compares its state (content, selection)
542
+ // to the data in the editing variable, and updates the editor
543
+ // content or cursor if something changed.
544
+ function readInput() {
545
+ if (leaveInputAlone) return;
546
+ var changed = false, text = input.value, sr = selRange(input);
547
+ if (!sr) return false;
548
+ var changed = editing.text != text, rs = reducedSelection;
549
+ var moved = changed || sr.start != editing.start || sr.end != (rs ? editing.start : editing.end);
550
+ if (!moved && !rs) return false;
551
+ if (changed) {
552
+ shiftSelecting = reducedSelection = null;
553
+ if (options.readOnly) {updateInput = true; return "changed";}
554
+ }
555
+
556
+ // Compute selection start and end based on start/end offsets in textarea
557
+ function computeOffset(n, startLine) {
558
+ var pos = 0;
559
+ for (;;) {
560
+ var found = text.indexOf("\n", pos);
561
+ if (found == -1 || (text.charAt(found-1) == "\r" ? found - 1 : found) >= n)
562
+ return {line: startLine, ch: n - pos};
563
+ ++startLine;
564
+ pos = found + 1;
565
+ }
566
+ }
567
+ var from = computeOffset(sr.start, editing.from),
568
+ to = computeOffset(sr.end, editing.from);
569
+ // Here we have to take the reducedSelection hack into account,
570
+ // so that you can, for example, press shift-up at the start of
571
+ // your selection and have the right thing happen.
572
+ if (rs) {
573
+ var head = sr.start == rs.anchor ? to : from;
574
+ var tail = shiftSelecting ? sel.to : sr.start == rs.anchor ? from : to;
575
+ if (sel.inverted = posLess(head, tail)) { from = head; to = tail; }
576
+ else { reducedSelection = null; from = tail; to = head; }
577
+ }
578
+
579
+ // In some cases (cursor on same line as before), we don't have
580
+ // to update the textarea content at all.
581
+ if (from.line == to.line && from.line == sel.from.line && from.line == sel.to.line && !shiftSelecting)
582
+ updateInput = false;
583
+
584
+ // Magic mess to extract precise edited range from the changed
585
+ // string.
586
+ if (changed) {
587
+ var start = 0, end = text.length, len = Math.min(end, editing.text.length);
588
+ var c, line = editing.from, nl = -1;
589
+ while (start < len && (c = text.charAt(start)) == editing.text.charAt(start)) {
590
+ ++start;
591
+ if (c == "\n") {line++; nl = start;}
592
+ }
593
+ var ch = nl > -1 ? start - nl : start, endline = editing.to - 1, edend = editing.text.length;
594
+ for (;;) {
595
+ c = editing.text.charAt(edend);
596
+ if (text.charAt(end) != c) {++end; ++edend; break;}
597
+ if (c == "\n") endline--;
598
+ if (edend <= start || end <= start) break;
599
+ --end; --edend;
600
+ }
601
+ var nl = editing.text.lastIndexOf("\n", edend - 1), endch = nl == -1 ? edend : edend - nl - 1;
602
+ updateLines({line: line, ch: ch}, {line: endline, ch: endch}, splitLines(text.slice(start, end)), from, to);
603
+ if (line != endline || from.line != line) updateInput = true;
604
+ }
605
+ else setSelection(from, to);
606
+
607
+ editing.text = text; editing.start = sr.start; editing.end = sr.end;
608
+ return changed ? "changed" : moved ? "moved" : false;
609
+ }
610
+
611
+ // Set the textarea content and selection range to match the
612
+ // editor state.
613
+ function prepareInput() {
614
+ var text = [];
615
+ var from = Math.max(0, sel.from.line - 1), to = Math.min(lines.length, sel.to.line + 2);
616
+ for (var i = from; i < to; ++i) text.push(lines[i].text);
617
+ text = input.value = text.join(lineSep);
618
+ var startch = sel.from.ch, endch = sel.to.ch;
619
+ for (var i = from; i < sel.from.line; ++i)
620
+ startch += lineSep.length + lines[i].text.length;
621
+ for (var i = from; i < sel.to.line; ++i)
622
+ endch += lineSep.length + lines[i].text.length;
623
+ editing = {text: text, from: from, to: to, start: startch, end: endch};
624
+ setSelRange(input, startch, reducedSelection ? startch : endch);
625
+ }
626
+ function focusInput() {
627
+ if (options.readOnly != "nocursor") input.focus();
628
+ }
629
+
630
+ function scrollCursorIntoView() {
631
+ var cursor = localCoords(sel.inverted ? sel.from : sel.to);
632
+ return scrollIntoView(cursor.x, cursor.y, cursor.x, cursor.yBot);
633
+ }
634
+ function scrollIntoView(x1, y1, x2, y2) {
635
+ var pl = paddingLeft(), pt = paddingTop(), lh = lineHeight();
636
+ y1 += pt; y2 += pt; x1 += pl; x2 += pl;
637
+ var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true;
638
+ if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1 - 2*lh); scrolled = true;}
639
+ else if (y2 > screentop + screen) {scroller.scrollTop = y2 + lh - screen; scrolled = true;}
640
+
641
+ var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft;
642
+ if (x1 < screenleft) {
643
+ if (x1 < 50) x1 = 0;
644
+ scroller.scrollLeft = Math.max(0, x1 - 10);
645
+ scrolled = true;
646
+ }
647
+ else if (x2 > screenw + screenleft) {
648
+ scroller.scrollLeft = x2 + 10 - screenw;
649
+ scrolled = true;
650
+ if (x2 > code.clientWidth) result = false;
651
+ }
652
+ if (scrolled && options.onScroll) options.onScroll(instance);
653
+ return result;
654
+ }
655
+
656
+ function visibleLines() {
657
+ var lh = lineHeight(), top = scroller.scrollTop - paddingTop();
658
+ return {from: Math.min(lines.length, Math.max(0, Math.floor(top / lh))),
659
+ to: Math.min(lines.length, Math.ceil((top + scroller.clientHeight) / lh))};
660
+ }
661
+ // Uses a set of changes plus the current scroll position to
662
+ // determine which DOM updates have to be made, and makes the
663
+ // updates.
664
+ function updateDisplay(changes) {
665
+ if (!scroller.clientWidth) {
666
+ showingFrom = showingTo = 0;
667
+ return;
668
+ }
669
+ // First create a range of theoretically intact lines, and punch
670
+ // holes in that using the change info.
671
+ var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];
672
+ for (var i = 0, l = changes.length || 0; i < l; ++i) {
673
+ var change = changes[i], intact2 = [], diff = change.diff || 0;
674
+ for (var j = 0, l2 = intact.length; j < l2; ++j) {
675
+ var range = intact[j];
676
+ if (change.to <= range.from)
677
+ intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});
678
+ else if (range.to <= change.from)
679
+ intact2.push(range);
680
+ else {
681
+ if (change.from > range.from)
682
+ intact2.push({from: range.from, to: change.from, domStart: range.domStart})
683
+ if (change.to < range.to)
684
+ intact2.push({from: change.to + diff, to: range.to + diff,
685
+ domStart: range.domStart + (change.to - range.from)});
686
+ }
687
+ }
688
+ intact = intact2;
689
+ }
690
+
691
+ // Then, determine which lines we'd want to see, and which
692
+ // updates have to be made to get there.
693
+ var visible = visibleLines();
694
+ var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),
695
+ to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),
696
+ updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;
697
+
698
+ for (var i = 0, l = intact.length; i < l; ++i) {
699
+ var range = intact[i];
700
+ if (range.to <= from) continue;
701
+ if (range.from >= to) break;
702
+ if (range.domStart > domPos || range.from > pos) {
703
+ updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});
704
+ changedLines += range.from - pos;
705
+ }
706
+ pos = range.to;
707
+ domPos = range.domStart + (range.to - range.from);
708
+ }
709
+ if (domPos != domEnd || pos != to) {
710
+ changedLines += Math.abs(to - pos);
711
+ updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});
712
+ }
713
+
714
+ if (!updates.length) return;
715
+ lineDiv.style.display = "none";
716
+ // If more than 30% of the screen needs update, just do a full
717
+ // redraw (which is quicker than patching)
718
+ if (changedLines > (visible.to - visible.from) * .3)
719
+ refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));
720
+ // Otherwise, only update the stuff that needs updating.
721
+ else
722
+ patchDisplay(updates);
723
+ lineDiv.style.display = "";
724
+
725
+ // Position the mover div to align with the lines it's supposed
726
+ // to be showing (which will cover the visible display)
727
+ var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;
728
+ showingFrom = from; showingTo = to;
729
+ mover.style.top = (from * lineHeight()) + "px";
730
+ if (different) {
731
+ lastHeight = scroller.clientHeight;
732
+ code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
733
+ updateGutter();
734
+ }
735
+
736
+ var textWidth = stringWidth(maxLine);
737
+ lineSpace.style.width = textWidth > scroller.clientWidth ? textWidth + "px" : "";
738
+
739
+ // Since this is all rather error prone, it is honoured with the
740
+ // only assertion in the whole file.
741
+ if (lineDiv.childNodes.length != showingTo - showingFrom)
742
+ throw new Error("BAD PATCH! " + JSON.stringify(updates) + " size=" + (showingTo - showingFrom) +
743
+ " nodes=" + lineDiv.childNodes.length);
744
+ updateCursor();
745
+ }
746
+
747
+ function refreshDisplay(from, to) {
748
+ var html = [], start = {line: from, ch: 0}, inSel = posLess(sel.from, start) && !posLess(sel.to, start);
749
+ for (var i = from; i < to; ++i) {
750
+ var ch1 = null, ch2 = null;
751
+ if (inSel) {
752
+ ch1 = 0;
753
+ if (sel.to.line == i) {inSel = false; ch2 = sel.to.ch;}
754
+ }
755
+ else if (sel.from.line == i) {
756
+ if (sel.to.line == i) {ch1 = sel.from.ch; ch2 = sel.to.ch;}
757
+ else {inSel = true; ch1 = sel.from.ch;}
758
+ }
759
+ html.push(lines[i].getHTML(ch1, ch2, true));
760
+ }
761
+ lineDiv.innerHTML = html.join("");
762
+ }
763
+ function patchDisplay(updates) {
764
+ // Slightly different algorithm for IE (badInnerHTML), since
765
+ // there .innerHTML on PRE nodes is dumb, and discards
766
+ // whitespace.
767
+ var sfrom = sel.from.line, sto = sel.to.line, off = 0,
768
+ scratch = badInnerHTML && targetDocument.createElement("div");
769
+ for (var i = 0, e = updates.length; i < e; ++i) {
770
+ var rec = updates[i];
771
+ var extra = (rec.to - rec.from) - rec.domSize;
772
+ var nodeAfter = lineDiv.childNodes[rec.domStart + rec.domSize + off] || null;
773
+ if (badInnerHTML)
774
+ for (var j = Math.max(-extra, rec.domSize); j > 0; --j)
775
+ lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild);
776
+ else if (extra) {
777
+ for (var j = Math.max(0, extra); j > 0; --j)
778
+ lineDiv.insertBefore(targetDocument.createElement("pre"), nodeAfter);
779
+ for (var j = Math.max(0, -extra); j > 0; --j)
780
+ lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild);
781
+ }
782
+ var node = lineDiv.childNodes[rec.domStart + off], inSel = sfrom < rec.from && sto >= rec.from;
783
+ for (var j = rec.from; j < rec.to; ++j) {
784
+ var ch1 = null, ch2 = null;
785
+ if (inSel) {
786
+ ch1 = 0;
787
+ if (sto == j) {inSel = false; ch2 = sel.to.ch;}
788
+ }
789
+ else if (sfrom == j) {
790
+ if (sto == j) {ch1 = sel.from.ch; ch2 = sel.to.ch;}
791
+ else {inSel = true; ch1 = sel.from.ch;}
792
+ }
793
+ if (badInnerHTML) {
794
+ scratch.innerHTML = lines[j].getHTML(ch1, ch2, true);
795
+ lineDiv.insertBefore(scratch.firstChild, nodeAfter);
796
+ }
797
+ else {
798
+ node.innerHTML = lines[j].getHTML(ch1, ch2, false);
799
+ node.className = lines[j].className || "";
800
+ node = node.nextSibling;
801
+ }
802
+ }
803
+ off += extra;
804
+ }
805
+ }
806
+
807
+ function updateGutter() {
808
+ if (!options.gutter && !options.lineNumbers) return;
809
+ var hText = mover.offsetHeight, hEditor = scroller.clientHeight;
810
+ gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px";
811
+ var html = [];
812
+ for (var i = showingFrom; i < Math.max(showingTo, showingFrom + 1); ++i) {
813
+ var marker = lines[i].gutterMarker;
814
+ var text = options.lineNumbers ? i + options.firstLineNumber : null;
815
+ if (marker && marker.text)
816
+ text = marker.text.replace("%N%", text != null ? text : "");
817
+ else if (text == null)
818
+ text = "\u00a0";
819
+ html.push((marker && marker.style ? '<pre class="' + marker.style + '">' : "<pre>"), text, "</pre>");
820
+ }
821
+ gutter.style.display = "none";
822
+ gutterText.innerHTML = html.join("");
823
+ var minwidth = String(lines.length).length, firstNode = gutterText.firstChild, val = eltText(firstNode), pad = "";
824
+ while (val.length + pad.length < minwidth) pad += "\u00a0";
825
+ if (pad) firstNode.insertBefore(targetDocument.createTextNode(pad), firstNode.firstChild);
826
+ gutter.style.display = "";
827
+ lineSpace.style.marginLeft = gutter.offsetWidth + "px";
828
+ }
829
+ function updateCursor() {
830
+ var head = sel.inverted ? sel.from : sel.to, lh = lineHeight();
831
+ var x = charX(head.line, head.ch) + "px", y = (head.line - showingFrom) * lh + "px";
832
+ inputDiv.style.top = (head.line * lh - scroller.scrollTop) + "px";
833
+ if (posEq(sel.from, sel.to)) {
834
+ cursor.style.top = y; cursor.style.left = x;
835
+ cursor.style.display = "";
836
+ }
837
+ else cursor.style.display = "none";
838
+ }
839
+
840
+ function setSelectionUser(from, to) {
841
+ var sh = shiftSelecting && clipPos(shiftSelecting);
842
+ if (sh) {
843
+ if (posLess(sh, from)) from = sh;
844
+ else if (posLess(to, sh)) to = sh;
845
+ }
846
+ setSelection(from, to);
847
+ }
848
+ // Update the selection. Last two args are only used by
849
+ // updateLines, since they have to be expressed in the line
850
+ // numbers before the update.
851
+ function setSelection(from, to, oldFrom, oldTo) {
852
+ if (posEq(sel.from, from) && posEq(sel.to, to)) return;
853
+ if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}
854
+
855
+ if (posEq(from, to)) sel.inverted = false;
856
+ else if (posEq(from, sel.to)) sel.inverted = false;
857
+ else if (posEq(to, sel.from)) sel.inverted = true;
858
+
859
+ // Some ugly logic used to only mark the lines that actually did
860
+ // see a change in selection as changed, rather than the whole
861
+ // selected range.
862
+ if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;}
863
+ if (posEq(from, to)) {
864
+ if (!posEq(sel.from, sel.to))
865
+ changes.push({from: oldFrom, to: oldTo + 1});
866
+ }
867
+ else if (posEq(sel.from, sel.to)) {
868
+ changes.push({from: from.line, to: to.line + 1});
869
+ }
870
+ else {
871
+ if (!posEq(from, sel.from)) {
872
+ if (from.line < oldFrom)
873
+ changes.push({from: from.line, to: Math.min(to.line, oldFrom) + 1});
874
+ else
875
+ changes.push({from: oldFrom, to: Math.min(oldTo, from.line) + 1});
876
+ }
877
+ if (!posEq(to, sel.to)) {
878
+ if (to.line < oldTo)
879
+ changes.push({from: Math.max(oldFrom, from.line), to: oldTo + 1});
880
+ else
881
+ changes.push({from: Math.max(from.line, oldTo), to: to.line + 1});
882
+ }
883
+ }
884
+ sel.from = from; sel.to = to;
885
+ selectionChanged = true;
886
+ }
887
+ function setCursor(line, ch, user) {
888
+ var pos = clipPos({line: line, ch: ch || 0});
889
+ (user ? setSelectionUser : setSelection)(pos, pos);
890
+ }
891
+
892
+ function clipLine(n) {return Math.max(0, Math.min(n, lines.length-1));}
893
+ function clipPos(pos) {
894
+ if (pos.line < 0) return {line: 0, ch: 0};
895
+ if (pos.line >= lines.length) return {line: lines.length-1, ch: lines[lines.length-1].text.length};
896
+ var ch = pos.ch, linelen = lines[pos.line].text.length;
897
+ if (ch == null || ch > linelen) return {line: pos.line, ch: linelen};
898
+ else if (ch < 0) return {line: pos.line, ch: 0};
899
+ else return pos;
900
+ }
901
+
902
+ function scrollPage(down) {
903
+ var linesPerPage = Math.floor(scroller.clientHeight / lineHeight()), head = sel.inverted ? sel.from : sel.to;
904
+ setCursor(head.line + (Math.max(linesPerPage - 1, 1) * (down ? 1 : -1)), head.ch, true);
905
+ }
906
+ function scrollEnd(top) {
907
+ var pos = top ? {line: 0, ch: 0} : {line: lines.length - 1, ch: lines[lines.length-1].text.length};
908
+ setSelectionUser(pos, pos);
909
+ }
910
+ function selectAll() {
911
+ var endLine = lines.length - 1;
912
+ setSelection({line: 0, ch: 0}, {line: endLine, ch: lines[endLine].text.length});
913
+ }
914
+ function selectWordAt(pos) {
915
+ var line = lines[pos.line].text;
916
+ var start = pos.ch, end = pos.ch;
917
+ while (start > 0 && /\w/.test(line.charAt(start - 1))) --start;
918
+ while (end < line.length && /\w/.test(line.charAt(end))) ++end;
919
+ setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end});
920
+ }
921
+ function selectLine(line) {
922
+ setSelectionUser({line: line, ch: 0}, {line: line, ch: lines[line].text.length});
923
+ }
924
+ function handleEnter() {
925
+ replaceSelection("\n", "end");
926
+ if (options.enterMode != "flat")
927
+ indentLine(sel.from.line, options.enterMode == "keep" ? "prev" : "smart");
928
+ }
929
+ function handleTab(shift) {
930
+ shiftSelecting = null;
931
+ switch (options.tabMode) {
932
+ case "default":
933
+ return false;
934
+ case "indent":
935
+ for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, "smart");
936
+ break;
937
+ case "classic":
938
+ if (posEq(sel.from, sel.to)) {
939
+ if (shift) indentLine(sel.from.line, "smart");
940
+ else replaceSelection("\t", "end");
941
+ break;
942
+ }
943
+ case "shift":
944
+ for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, shift ? "subtract" : "add");
945
+ break;
946
+ }
947
+ return true;
948
+ }
949
+
950
+ function indentLine(n, how) {
951
+ if (how == "smart") {
952
+ if (!mode.indent) how = "prev";
953
+ else var state = getStateBefore(n);
954
+ }
955
+
956
+ var line = lines[n], curSpace = line.indentation(), curSpaceString = line.text.match(/^\s*/)[0], indentation;
957
+ if (how == "prev") {
958
+ if (n) indentation = lines[n-1].indentation();
959
+ else indentation = 0;
960
+ }
961
+ else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length));
962
+ else if (how == "add") indentation = curSpace + options.indentUnit;
963
+ else if (how == "subtract") indentation = curSpace - options.indentUnit;
964
+ indentation = Math.max(0, indentation);
965
+ var diff = indentation - curSpace;
966
+
967
+ if (!diff) {
968
+ if (sel.from.line != n && sel.to.line != n) return;
969
+ var indentString = curSpaceString;
970
+ }
971
+ else {
972
+ var indentString = "", pos = 0;
973
+ if (options.indentWithTabs)
974
+ for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";}
975
+ while (pos < indentation) {++pos; indentString += " ";}
976
+ }
977
+
978
+ replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length});
979
+ }
980
+
981
+ function loadMode() {
982
+ mode = CodeMirror.getMode(options, options.mode);
983
+ for (var i = 0, l = lines.length; i < l; ++i)
984
+ lines[i].stateAfter = null;
985
+ work = [0];
986
+ startWorker();
987
+ }
988
+ function gutterChanged() {
989
+ var visible = options.gutter || options.lineNumbers;
990
+ gutter.style.display = visible ? "" : "none";
991
+ if (visible) updateGutter();
992
+ else lineDiv.parentNode.style.marginLeft = 0;
993
+ }
994
+
995
+ function markText(from, to, className) {
996
+ from = clipPos(from); to = clipPos(to);
997
+ var accum = [];
998
+ function add(line, from, to, className) {
999
+ var line = lines[line], mark = line.addMark(from, to, className);
1000
+ mark.line = line;
1001
+ accum.push(mark);
1002
+ }
1003
+ if (from.line == to.line) add(from.line, from.ch, to.ch, className);
1004
+ else {
1005
+ add(from.line, from.ch, null, className);
1006
+ for (var i = from.line + 1, e = to.line; i < e; ++i)
1007
+ add(i, 0, null, className);
1008
+ add(to.line, 0, to.ch, className);
1009
+ }
1010
+ changes.push({from: from.line, to: to.line + 1});
1011
+ return function() {
1012
+ var start, end;
1013
+ for (var i = 0; i < accum.length; ++i) {
1014
+ var mark = accum[i], found = indexOf(lines, mark.line);
1015
+ mark.line.removeMark(mark);
1016
+ if (found > -1) {
1017
+ if (start == null) start = found;
1018
+ end = found;
1019
+ }
1020
+ }
1021
+ if (start != null) changes.push({from: start, to: end + 1});
1022
+ };
1023
+ }
1024
+
1025
+ function addGutterMarker(line, text, className) {
1026
+ if (typeof line == "number") line = lines[clipLine(line)];
1027
+ line.gutterMarker = {text: text, style: className};
1028
+ updateGutter();
1029
+ return line;
1030
+ }
1031
+ function removeGutterMarker(line) {
1032
+ if (typeof line == "number") line = lines[clipLine(line)];
1033
+ line.gutterMarker = null;
1034
+ updateGutter();
1035
+ }
1036
+ function setLineClass(line, className) {
1037
+ if (typeof line == "number") {
1038
+ var no = line;
1039
+ line = lines[clipLine(line)];
1040
+ }
1041
+ else {
1042
+ var no = indexOf(lines, line);
1043
+ if (no == -1) return null;
1044
+ }
1045
+ if (line.className != className) {
1046
+ line.className = className;
1047
+ changes.push({from: no, to: no + 1});
1048
+ }
1049
+ return line;
1050
+ }
1051
+
1052
+ function lineInfo(line) {
1053
+ if (typeof line == "number") {
1054
+ var n = line;
1055
+ line = lines[line];
1056
+ if (!line) return null;
1057
+ }
1058
+ else {
1059
+ var n = indexOf(lines, line);
1060
+ if (n == -1) return null;
1061
+ }
1062
+ var marker = line.gutterMarker;
1063
+ return {line: n, text: line.text, markerText: marker && marker.text, markerClass: marker && marker.style};
1064
+ }
1065
+
1066
+ function stringWidth(str) {
1067
+ measure.innerHTML = "<pre><span>x</span></pre>";
1068
+ measure.firstChild.firstChild.firstChild.nodeValue = str;
1069
+ return measure.firstChild.firstChild.offsetWidth || 10;
1070
+ }
1071
+ // These are used to go from pixel positions to character
1072
+ // positions, taking varying character widths into account.
1073
+ function charX(line, pos) {
1074
+ if (pos == 0) return 0;
1075
+ measure.innerHTML = "<pre><span>" + lines[line].getHTML(null, null, false, pos) + "</span></pre>";
1076
+ return measure.firstChild.firstChild.offsetWidth;
1077
+ }
1078
+ function charFromX(line, x) {
1079
+ if (x <= 0) return 0;
1080
+ var lineObj = lines[line], text = lineObj.text;
1081
+ function getX(len) {
1082
+ measure.innerHTML = "<pre><span>" + lineObj.getHTML(null, null, false, len) + "</span></pre>";
1083
+ return measure.firstChild.firstChild.offsetWidth;
1084
+ }
1085
+ var from = 0, fromX = 0, to = text.length, toX;
1086
+ // Guess a suitable upper bound for our search.
1087
+ var estimated = Math.min(to, Math.ceil(x / stringWidth("x")));
1088
+ for (;;) {
1089
+ var estX = getX(estimated);
1090
+ if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));
1091
+ else {toX = estX; to = estimated; break;}
1092
+ }
1093
+ if (x > toX) return to;
1094
+ // Try to guess a suitable lower bound as well.
1095
+ estimated = Math.floor(to * 0.8); estX = getX(estimated);
1096
+ if (estX < x) {from = estimated; fromX = estX;}
1097
+ // Do a binary search between these bounds.
1098
+ for (;;) {
1099
+ if (to - from <= 1) return (toX - x > x - fromX) ? from : to;
1100
+ var middle = Math.ceil((from + to) / 2), middleX = getX(middle);
1101
+ if (middleX > x) {to = middle; toX = middleX;}
1102
+ else {from = middle; fromX = middleX;}
1103
+ }
1104
+ }
1105
+
1106
+ function localCoords(pos, inLineWrap) {
1107
+ var lh = lineHeight(), line = pos.line - (inLineWrap ? showingFrom : 0);
1108
+ return {x: charX(pos.line, pos.ch), y: line * lh, yBot: (line + 1) * lh};
1109
+ }
1110
+ function pageCoords(pos) {
1111
+ var local = localCoords(pos, true), off = eltOffset(lineSpace);
1112
+ return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot};
1113
+ }
1114
+
1115
+ function lineHeight() {
1116
+ var nlines = lineDiv.childNodes.length;
1117
+ if (nlines) return (lineDiv.offsetHeight / nlines) || 1;
1118
+ measure.innerHTML = "<pre>x</pre>";
1119
+ return measure.firstChild.offsetHeight || 1;
1120
+ }
1121
+ function paddingTop() {return lineSpace.offsetTop;}
1122
+ function paddingLeft() {return lineSpace.offsetLeft;}
1123
+
1124
+ function posFromMouse(e, liberal) {
1125
+ var offW = eltOffset(scroller, true), x = e.e.clientX, y = e.e.clientY;
1126
+ // This is a mess of a heuristic to try and determine whether a
1127
+ // scroll-bar was clicked or not, and to return null if one was
1128
+ // (and !liberal).
1129
+ if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight))
1130
+ return null;
1131
+ var offL = eltOffset(lineSpace, true);
1132
+ var line = showingFrom + Math.floor((y - offL.top) / lineHeight());
1133
+ return clipPos({line: line, ch: charFromX(clipLine(line), x - offL.left)});
1134
+ }
1135
+ function onContextMenu(e) {
1136
+ var pos = posFromMouse(e);
1137
+ if (!pos || window.opera) return; // Opera is difficult.
1138
+ if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))
1139
+ setCursor(pos.line, pos.ch);
1140
+
1141
+ var oldCSS = input.style.cssText;
1142
+ input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.pageY() - 1) +
1143
+ "px; left: " + (e.pageX() - 1) + "px; z-index: 1000; background: white; " +
1144
+ "border-width: 0; outline: none; overflow: hidden; opacity: .05;";
1145
+ var val = input.value = getSelection();
1146
+ focusInput();
1147
+ setSelRange(input, 0, input.value.length);
1148
+ leaveInputAlone = true;
1149
+ function rehide() {
1150
+ if (input.value != val) operation(replaceSelection)(input.value, "end");
1151
+ input.style.cssText = oldCSS;
1152
+ leaveInputAlone = false;
1153
+ prepareInput();
1154
+ slowPoll();
1155
+ }
1156
+
1157
+ if (gecko) {
1158
+ e.stop()
1159
+ var mouseup = connect(window, "mouseup", function() {
1160
+ mouseup();
1161
+ setTimeout(rehide, 20);
1162
+ }, true);
1163
+ }
1164
+ else {
1165
+ setTimeout(rehide, 50);
1166
+ }
1167
+ }
1168
+
1169
+ // Cursor-blinking
1170
+ function restartBlink() {
1171
+ clearInterval(blinker);
1172
+ var on = true;
1173
+ cursor.style.visibility = "";
1174
+ blinker = setInterval(function() {
1175
+ cursor.style.visibility = (on = !on) ? "" : "hidden";
1176
+ }, 650);
1177
+ }
1178
+
1179
+ var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
1180
+ function matchBrackets(autoclear) {
1181
+ var head = sel.inverted ? sel.from : sel.to, line = lines[head.line], pos = head.ch - 1;
1182
+ var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
1183
+ if (!match) return;
1184
+ var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles;
1185
+ for (var off = pos + 1, i = 0, e = st.length; i < e; i+=2)
1186
+ if ((off -= st[i].length) <= 0) {var style = st[i+1]; break;}
1187
+
1188
+ var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
1189
+ function scan(line, from, to) {
1190
+ if (!line.text) return;
1191
+ var st = line.styles, pos = forward ? 0 : line.text.length - 1, cur;
1192
+ for (var i = forward ? 0 : st.length - 2, e = forward ? st.length : -2; i != e; i += 2*d) {
1193
+ var text = st[i];
1194
+ if (st[i+1] != null && st[i+1] != style) {pos += d * text.length; continue;}
1195
+ for (var j = forward ? 0 : text.length - 1, te = forward ? text.length : -1; j != te; j += d, pos+=d) {
1196
+ if (pos >= from && pos < to && re.test(cur = text.charAt(j))) {
1197
+ var match = matching[cur];
1198
+ if (match.charAt(1) == ">" == forward) stack.push(cur);
1199
+ else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
1200
+ else if (!stack.length) return {pos: pos, match: true};
1201
+ }
1202
+ }
1203
+ }
1204
+ }
1205
+ for (var i = head.line, e = forward ? Math.min(i + 50, lines.length) : Math.max(-1, i - 50); i != e; i+=d) {
1206
+ var line = lines[i], first = i == head.line;
1207
+ var found = scan(line, first && forward ? pos + 1 : 0, first && !forward ? pos : line.text.length);
1208
+ if (found) {
1209
+ var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
1210
+ var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style),
1211
+ two = markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style);
1212
+ var clear = operation(function(){one(); two();});
1213
+ if (autoclear) setTimeout(clear, 800);
1214
+ else bracketHighlighted = clear;
1215
+ break;
1216
+ }
1217
+ }
1218
+ }
1219
+
1220
+ // Finds the line to start with when starting a parse. Tries to
1221
+ // find a line with a stateAfter, so that it can start with a
1222
+ // valid state. If that fails, it returns the line with the
1223
+ // smallest indentation, which tends to need the least context to
1224
+ // parse correctly.
1225
+ function findStartLine(n) {
1226
+ var minindent, minline;
1227
+ for (var search = n, lim = n - 40; search > lim; --search) {
1228
+ if (search == 0) return 0;
1229
+ var line = lines[search-1];
1230
+ if (line.stateAfter) return search;
1231
+ var indented = line.indentation();
1232
+ if (minline == null || minindent > indented) {
1233
+ minline = search;
1234
+ minindent = indented;
1235
+ }
1236
+ }
1237
+ return minline;
1238
+ }
1239
+ function getStateBefore(n) {
1240
+ var start = findStartLine(n), state = start && lines[start-1].stateAfter;
1241
+ if (!state) state = startState(mode);
1242
+ else state = copyState(mode, state);
1243
+ for (var i = start; i < n; ++i) {
1244
+ var line = lines[i];
1245
+ line.highlight(mode, state);
1246
+ line.stateAfter = copyState(mode, state);
1247
+ }
1248
+ if (!lines[n].stateAfter) work.push(n);
1249
+ return state;
1250
+ }
1251
+ function highlightLines(start, end) {
1252
+ var state = getStateBefore(start);
1253
+ for (var i = start; i < end; ++i) {
1254
+ var line = lines[i];
1255
+ line.highlight(mode, state);
1256
+ line.stateAfter = copyState(mode, state);
1257
+ }
1258
+ }
1259
+ function highlightWorker() {
1260
+ var end = +new Date + options.workTime;
1261
+ var foundWork = work.length;
1262
+ while (work.length) {
1263
+ if (!lines[showingFrom].stateAfter) var task = showingFrom;
1264
+ else var task = work.pop();
1265
+ if (task >= lines.length) continue;
1266
+ var start = findStartLine(task), state = start && lines[start-1].stateAfter;
1267
+ if (state) state = copyState(mode, state);
1268
+ else state = startState(mode);
1269
+
1270
+ var unchanged = 0;
1271
+ for (var i = start, l = lines.length; i < l; ++i) {
1272
+ var line = lines[i], hadState = line.stateAfter;
1273
+ if (+new Date > end) {
1274
+ work.push(i);
1275
+ startWorker(options.workDelay);
1276
+ changes.push({from: task, to: i});
1277
+ return;
1278
+ }
1279
+ var changed = line.highlight(mode, state);
1280
+ line.stateAfter = copyState(mode, state);
1281
+ if (changed || !hadState) unchanged = 0;
1282
+ else if (++unchanged > 3) break;
1283
+ }
1284
+ changes.push({from: task, to: i});
1285
+ }
1286
+ if (foundWork && options.onHighlightComplete)
1287
+ options.onHighlightComplete(instance);
1288
+ }
1289
+ function startWorker(time) {
1290
+ if (!work.length) return;
1291
+ highlight.set(time, operation(highlightWorker));
1292
+ }
1293
+
1294
+ // Operations are used to wrap changes in such a way that each
1295
+ // change won't have to update the cursor and display (which would
1296
+ // be awkward, slow, and error-prone), but instead updates are
1297
+ // batched and then all combined and executed at once.
1298
+ function startOperation() {
1299
+ updateInput = null; changes = []; textChanged = selectionChanged = false;
1300
+ }
1301
+ function endOperation() {
1302
+ var reScroll = false;
1303
+ if (selectionChanged) reScroll = !scrollCursorIntoView();
1304
+ if (changes.length) updateDisplay(changes);
1305
+ else if (selectionChanged) updateCursor();
1306
+ if (reScroll) scrollCursorIntoView();
1307
+ if (selectionChanged) restartBlink();
1308
+
1309
+ // updateInput can be set to a boolean value to force/prevent an
1310
+ // update.
1311
+ if (!leaveInputAlone && (updateInput === true || (updateInput !== false && selectionChanged)))
1312
+ prepareInput();
1313
+
1314
+ if (selectionChanged && options.matchBrackets)
1315
+ setTimeout(operation(function() {
1316
+ if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;}
1317
+ matchBrackets(false);
1318
+ }), 20);
1319
+ var tc = textChanged; // textChanged can be reset by cursoractivity callback
1320
+ if (selectionChanged && options.onCursorActivity)
1321
+ options.onCursorActivity(instance);
1322
+ if (tc && options.onChange && instance)
1323
+ options.onChange(instance, tc);
1324
+ }
1325
+ var nestedOperation = 0;
1326
+ function operation(f) {
1327
+ return function() {
1328
+ if (!nestedOperation++) startOperation();
1329
+ try {var result = f.apply(this, arguments);}
1330
+ finally {if (!--nestedOperation) endOperation();}
1331
+ return result;
1332
+ };
1333
+ }
1334
+
1335
+ function SearchCursor(query, pos, caseFold) {
1336
+ this.atOccurrence = false;
1337
+ if (caseFold == null) caseFold = typeof query == "string" && query == query.toLowerCase();
1338
+
1339
+ if (pos && typeof pos == "object") pos = clipPos(pos);
1340
+ else pos = {line: 0, ch: 0};
1341
+ this.pos = {from: pos, to: pos};
1342
+
1343
+ // The matches method is filled in based on the type of query.
1344
+ // It takes a position and a direction, and returns an object
1345
+ // describing the next occurrence of the query, or null if no
1346
+ // more matches were found.
1347
+ if (typeof query != "string") // Regexp match
1348
+ this.matches = function(reverse, pos) {
1349
+ if (reverse) {
1350
+ var line = lines[pos.line].text.slice(0, pos.ch), match = line.match(query), start = 0;
1351
+ while (match) {
1352
+ var ind = line.indexOf(match[0]);
1353
+ start += ind;
1354
+ line = line.slice(ind + 1);
1355
+ var newmatch = line.match(query);
1356
+ if (newmatch) match = newmatch;
1357
+ else break;
1358
+ start++;
1359
+ }
1360
+ }
1361
+ else {
1362
+ var line = lines[pos.line].text.slice(pos.ch), match = line.match(query),
1363
+ start = match && pos.ch + line.indexOf(match[0]);
1364
+ }
1365
+ if (match)
1366
+ return {from: {line: pos.line, ch: start},
1367
+ to: {line: pos.line, ch: start + match[0].length},
1368
+ match: match};
1369
+ };
1370
+ else { // String query
1371
+ if (caseFold) query = query.toLowerCase();
1372
+ var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
1373
+ var target = query.split("\n");
1374
+ // Different methods for single-line and multi-line queries
1375
+ if (target.length == 1)
1376
+ this.matches = function(reverse, pos) {
1377
+ var line = fold(lines[pos.line].text), len = query.length, match;
1378
+ if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)
1379
+ : (match = line.indexOf(query, pos.ch)) != -1)
1380
+ return {from: {line: pos.line, ch: match},
1381
+ to: {line: pos.line, ch: match + len}};
1382
+ };
1383
+ else
1384
+ this.matches = function(reverse, pos) {
1385
+ var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(lines[ln].text);
1386
+ var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
1387
+ if (reverse ? offsetA >= pos.ch || offsetA != match.length
1388
+ : offsetA <= pos.ch || offsetA != line.length - match.length)
1389
+ return;
1390
+ for (;;) {
1391
+ if (reverse ? !ln : ln == lines.length - 1) return;
1392
+ line = fold(lines[ln += reverse ? -1 : 1].text);
1393
+ match = target[reverse ? --idx : ++idx];
1394
+ if (idx > 0 && idx < target.length - 1) {
1395
+ if (line != match) return;
1396
+ else continue;
1397
+ }
1398
+ var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
1399
+ if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
1400
+ return;
1401
+ var start = {line: pos.line, ch: offsetA}, end = {line: ln, ch: offsetB};
1402
+ return {from: reverse ? end : start, to: reverse ? start : end};
1403
+ }
1404
+ };
1405
+ }
1406
+ }
1407
+
1408
+ SearchCursor.prototype = {
1409
+ findNext: function() {return this.find(false);},
1410
+ findPrevious: function() {return this.find(true);},
1411
+
1412
+ find: function(reverse) {
1413
+ var self = this, pos = clipPos(reverse ? this.pos.from : this.pos.to);
1414
+ function savePosAndFail(line) {
1415
+ var pos = {line: line, ch: 0};
1416
+ self.pos = {from: pos, to: pos};
1417
+ self.atOccurrence = false;
1418
+ return false;
1419
+ }
1420
+
1421
+ for (;;) {
1422
+ if (this.pos = this.matches(reverse, pos)) {
1423
+ this.atOccurrence = true;
1424
+ return this.pos.match || true;
1425
+ }
1426
+ if (reverse) {
1427
+ if (!pos.line) return savePosAndFail(0);
1428
+ pos = {line: pos.line-1, ch: lines[pos.line-1].text.length};
1429
+ }
1430
+ else {
1431
+ if (pos.line == lines.length - 1) return savePosAndFail(lines.length);
1432
+ pos = {line: pos.line+1, ch: 0};
1433
+ }
1434
+ }
1435
+ },
1436
+
1437
+ from: function() {if (this.atOccurrence) return copyPos(this.pos.from);},
1438
+ to: function() {if (this.atOccurrence) return copyPos(this.pos.to);}
1439
+ };
1440
+
1441
+ for (var ext in extensions)
1442
+ if (extensions.propertyIsEnumerable(ext) &&
1443
+ !instance.propertyIsEnumerable(ext))
1444
+ instance[ext] = extensions[ext];
1445
+ return instance;
1446
+ } // (end of function CodeMirror)
1447
+
1448
+ // The default configuration options.
1449
+ CodeMirror.defaults = {
1450
+ value: "",
1451
+ mode: null,
1452
+ theme: "default",
1453
+ indentUnit: 2,
1454
+ indentWithTabs: false,
1455
+ tabMode: "classic",
1456
+ enterMode: "indent",
1457
+ electricChars: true,
1458
+ onKeyEvent: null,
1459
+ lineNumbers: false,
1460
+ gutter: false,
1461
+ firstLineNumber: 1,
1462
+ readOnly: false,
1463
+ onChange: null,
1464
+ onCursorActivity: null,
1465
+ onGutterClick: null,
1466
+ onHighlightComplete: null,
1467
+ onFocus: null, onBlur: null, onScroll: null,
1468
+ matchBrackets: false,
1469
+ workTime: 100,
1470
+ workDelay: 200,
1471
+ undoDepth: 40,
1472
+ tabindex: null,
1473
+ document: window.document
1474
+ };
1475
+
1476
+ // Known modes, by name and by MIME
1477
+ var modes = {}, mimeModes = {};
1478
+ CodeMirror.defineMode = function(name, mode) {
1479
+ if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name;
1480
+ modes[name] = mode;
1481
+ };
1482
+ CodeMirror.defineMIME = function(mime, spec) {
1483
+ mimeModes[mime] = spec;
1484
+ };
1485
+ CodeMirror.getMode = function(options, spec) {
1486
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
1487
+ spec = mimeModes[spec];
1488
+ if (typeof spec == "string")
1489
+ var mname = spec, config = {};
1490
+ else if (spec != null)
1491
+ var mname = spec.name, config = spec;
1492
+ var mfactory = modes[mname];
1493
+ if (!mfactory) {
1494
+ if (window.console) console.warn("No mode " + mname + " found, falling back to plain text.");
1495
+ return CodeMirror.getMode(options, "text/plain");
1496
+ }
1497
+ return mfactory(options, config || {});
1498
+ }
1499
+ CodeMirror.listModes = function() {
1500
+ var list = [];
1501
+ for (var m in modes)
1502
+ if (modes.propertyIsEnumerable(m)) list.push(m);
1503
+ return list;
1504
+ };
1505
+ CodeMirror.listMIMEs = function() {
1506
+ var list = [];
1507
+ for (var m in mimeModes)
1508
+ if (mimeModes.propertyIsEnumerable(m)) list.push(m);
1509
+ return list;
1510
+ };
1511
+
1512
+ var extensions = {};
1513
+ CodeMirror.defineExtension = function(name, func) {
1514
+ extensions[name] = func;
1515
+ };
1516
+
1517
+ CodeMirror.fromTextArea = function(textarea, options) {
1518
+ if (!options) options = {};
1519
+ options.value = textarea.value;
1520
+ if (!options.tabindex && textarea.tabindex)
1521
+ options.tabindex = textarea.tabindex;
1522
+
1523
+ function save() {textarea.value = instance.getValue();}
1524
+ if (textarea.form) {
1525
+ // Deplorable hack to make the submit method do the right thing.
1526
+ var rmSubmit = connect(textarea.form, "submit", save, true);
1527
+ if (typeof textarea.form.submit == "function") {
1528
+ var realSubmit = textarea.form.submit;
1529
+ function wrappedSubmit() {
1530
+ save();
1531
+ textarea.form.submit = realSubmit;
1532
+ textarea.form.submit();
1533
+ textarea.form.submit = wrappedSubmit;
1534
+ }
1535
+ textarea.form.submit = wrappedSubmit;
1536
+ }
1537
+ }
1538
+
1539
+ textarea.style.display = "none";
1540
+ var instance = CodeMirror(function(node) {
1541
+ textarea.parentNode.insertBefore(node, textarea.nextSibling);
1542
+ }, options);
1543
+ instance.save = save;
1544
+ instance.toTextArea = function() {
1545
+ save();
1546
+ textarea.parentNode.removeChild(instance.getWrapperElement());
1547
+ textarea.style.display = "";
1548
+ if (textarea.form) {
1549
+ rmSubmit();
1550
+ if (typeof textarea.form.submit == "function")
1551
+ textarea.form.submit = realSubmit;
1552
+ }
1553
+ };
1554
+ return instance;
1555
+ };
1556
+
1557
+ // Utility functions for working with state. Exported because modes
1558
+ // sometimes need to do this.
1559
+ function copyState(mode, state) {
1560
+ if (state === true) return state;
1561
+ if (mode.copyState) return mode.copyState(state);
1562
+ var nstate = {};
1563
+ for (var n in state) {
1564
+ var val = state[n];
1565
+ if (val instanceof Array) val = val.concat([]);
1566
+ nstate[n] = val;
1567
+ }
1568
+ return nstate;
1569
+ }
1570
+ CodeMirror.startState = startState;
1571
+ function startState(mode, a1, a2) {
1572
+ return mode.startState ? mode.startState(a1, a2) : true;
1573
+ }
1574
+ CodeMirror.copyState = copyState;
1575
+
1576
+ // The character stream used by a mode's parser.
1577
+ function StringStream(string) {
1578
+ this.pos = this.start = 0;
1579
+ this.string = string;
1580
+ }
1581
+ StringStream.prototype = {
1582
+ eol: function() {return this.pos >= this.string.length;},
1583
+ sol: function() {return this.pos == 0;},
1584
+ peek: function() {return this.string.charAt(this.pos);},
1585
+ next: function() {
1586
+ if (this.pos < this.string.length)
1587
+ return this.string.charAt(this.pos++);
1588
+ },
1589
+ eat: function(match) {
1590
+ var ch = this.string.charAt(this.pos);
1591
+ if (typeof match == "string") var ok = ch == match;
1592
+ else var ok = ch && (match.test ? match.test(ch) : match(ch));
1593
+ if (ok) {++this.pos; return ch;}
1594
+ },
1595
+ eatWhile: function(match) {
1596
+ var start = this.start;
1597
+ while (this.eat(match)){}
1598
+ return this.pos > start;
1599
+ },
1600
+ eatSpace: function() {
1601
+ var start = this.pos;
1602
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
1603
+ return this.pos > start;
1604
+ },
1605
+ skipToEnd: function() {this.pos = this.string.length;},
1606
+ skipTo: function(ch) {
1607
+ var found = this.string.indexOf(ch, this.pos);
1608
+ if (found > -1) {this.pos = found; return true;}
1609
+ },
1610
+ backUp: function(n) {this.pos -= n;},
1611
+ column: function() {return countColumn(this.string, this.start);},
1612
+ indentation: function() {return countColumn(this.string);},
1613
+ match: function(pattern, consume, caseInsensitive) {
1614
+ if (typeof pattern == "string") {
1615
+ function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
1616
+ if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
1617
+ if (consume !== false) this.pos += pattern.length;
1618
+ return true;
1619
+ }
1620
+ }
1621
+ else {
1622
+ var match = this.string.slice(this.pos).match(pattern);
1623
+ if (match && consume !== false) this.pos += match[0].length;
1624
+ return match;
1625
+ }
1626
+ },
1627
+ current: function(){return this.string.slice(this.start, this.pos);}
1628
+ };
1629
+ CodeMirror.StringStream = StringStream;
1630
+
1631
+ // Line objects. These hold state related to a line, including
1632
+ // highlighting info (the styles array).
1633
+ function Line(text, styles) {
1634
+ this.styles = styles || [text, null];
1635
+ this.stateAfter = null;
1636
+ this.text = text;
1637
+ this.marked = this.gutterMarker = this.className = null;
1638
+ }
1639
+ Line.prototype = {
1640
+ // Replace a piece of a line, keeping the styles around it intact.
1641
+ replace: function(from, to, text) {
1642
+ var st = [], mk = this.marked;
1643
+ copyStyles(0, from, this.styles, st);
1644
+ if (text) st.push(text, null);
1645
+ copyStyles(to, this.text.length, this.styles, st);
1646
+ this.styles = st;
1647
+ this.text = this.text.slice(0, from) + text + this.text.slice(to);
1648
+ this.stateAfter = null;
1649
+ if (mk) {
1650
+ var diff = text.length - (to - from), end = this.text.length;
1651
+ function fix(n) {return n <= Math.min(to, to + diff) ? n : n + diff;}
1652
+ for (var i = 0; i < mk.length; ++i) {
1653
+ var mark = mk[i], del = false;
1654
+ if (mark.from >= end) del = true;
1655
+ else {mark.from = fix(mark.from); if (mark.to != null) mark.to = fix(mark.to);}
1656
+ if (del || mark.from >= mark.to) {mk.splice(i, 1); i--;}
1657
+ }
1658
+ }
1659
+ },
1660
+ // Split a line in two, again keeping styles intact.
1661
+ split: function(pos, textBefore) {
1662
+ var st = [textBefore, null];
1663
+ copyStyles(pos, this.text.length, this.styles, st);
1664
+ return new Line(textBefore + this.text.slice(pos), st);
1665
+ },
1666
+ addMark: function(from, to, style) {
1667
+ var mk = this.marked, mark = {from: from, to: to, style: style};
1668
+ if (this.marked == null) this.marked = [];
1669
+ this.marked.push(mark);
1670
+ this.marked.sort(function(a, b){return a.from - b.from;});
1671
+ return mark;
1672
+ },
1673
+ removeMark: function(mark) {
1674
+ var mk = this.marked;
1675
+ if (!mk) return;
1676
+ for (var i = 0; i < mk.length; ++i)
1677
+ if (mk[i] == mark) {mk.splice(i, 1); break;}
1678
+ },
1679
+ // Run the given mode's parser over a line, update the styles
1680
+ // array, which contains alternating fragments of text and CSS
1681
+ // classes.
1682
+ highlight: function(mode, state) {
1683
+ var stream = new StringStream(this.text), st = this.styles, pos = 0;
1684
+ var changed = false, curWord = st[0], prevWord;
1685
+ if (this.text == "" && mode.blankLine) mode.blankLine(state);
1686
+ while (!stream.eol()) {
1687
+ var style = mode.token(stream, state);
1688
+ var substr = this.text.slice(stream.start, stream.pos);
1689
+ stream.start = stream.pos;
1690
+ if (pos && st[pos-1] == style)
1691
+ st[pos-2] += substr;
1692
+ else if (substr) {
1693
+ if (!changed && (st[pos+1] != style || (pos && st[pos-2] != prevWord))) changed = true;
1694
+ st[pos++] = substr; st[pos++] = style;
1695
+ prevWord = curWord; curWord = st[pos];
1696
+ }
1697
+ // Give up when line is ridiculously long
1698
+ if (stream.pos > 5000) {
1699
+ st[pos++] = this.text.slice(stream.pos); st[pos++] = null;
1700
+ break;
1701
+ }
1702
+ }
1703
+ if (st.length != pos) {st.length = pos; changed = true;}
1704
+ if (pos && st[pos-2] != prevWord) changed = true;
1705
+ // Short lines with simple highlights always count as changed,
1706
+ // because they are likely to highlight the same way in various
1707
+ // contexts.
1708
+ return changed || (st.length < 5 && this.text.length < 10);
1709
+ },
1710
+ // Fetch the parser token for a given character. Useful for hacks
1711
+ // that want to inspect the mode state (say, for completion).
1712
+ getTokenAt: function(mode, state, ch) {
1713
+ var txt = this.text, stream = new StringStream(txt);
1714
+ while (stream.pos < ch && !stream.eol()) {
1715
+ stream.start = stream.pos;
1716
+ var style = mode.token(stream, state);
1717
+ }
1718
+ return {start: stream.start,
1719
+ end: stream.pos,
1720
+ string: stream.current(),
1721
+ className: style || null,
1722
+ state: state};
1723
+ },
1724
+ indentation: function() {return countColumn(this.text);},
1725
+ // Produces an HTML fragment for the line, taking selection,
1726
+ // marking, and highlighting into account.
1727
+ getHTML: function(sfrom, sto, includePre, endAt) {
1728
+ var html = [];
1729
+ if (includePre)
1730
+ html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");
1731
+ function span(text, style) {
1732
+ if (!text) return;
1733
+ if (style) html.push('<span class="cm-', style, '">', htmlEscape(text), "</span>");
1734
+ else html.push(htmlEscape(text));
1735
+ }
1736
+ var st = this.styles, allText = this.text, marked = this.marked;
1737
+ if (sfrom == sto) sfrom = null;
1738
+ var len = allText.length;
1739
+ if (endAt != null) len = Math.min(endAt, len);
1740
+
1741
+ if (!allText && endAt == null)
1742
+ span(" ", sfrom != null && sto == null ? "CodeMirror-selected" : null);
1743
+ else if (!marked && sfrom == null)
1744
+ for (var i = 0, ch = 0; ch < len; i+=2) {
1745
+ var str = st[i], l = str.length;
1746
+ if (ch + l > len) str = str.slice(0, len - ch);
1747
+ ch += l;
1748
+ span(str, st[i+1]);
1749
+ }
1750
+ else {
1751
+ var pos = 0, i = 0, text = "", style, sg = 0;
1752
+ var markpos = -1, mark = null;
1753
+ function nextMark() {
1754
+ if (marked) {
1755
+ markpos += 1;
1756
+ mark = (markpos < marked.length) ? marked[markpos] : null;
1757
+ }
1758
+ }
1759
+ nextMark();
1760
+ while (pos < len) {
1761
+ var upto = len;
1762
+ var extraStyle = "";
1763
+ if (sfrom != null) {
1764
+ if (sfrom > pos) upto = sfrom;
1765
+ else if (sto == null || sto > pos) {
1766
+ extraStyle = " CodeMirror-selected";
1767
+ if (sto != null) upto = Math.min(upto, sto);
1768
+ }
1769
+ }
1770
+ while (mark && mark.to != null && mark.to <= pos) nextMark();
1771
+ if (mark) {
1772
+ if (mark.from > pos) upto = Math.min(upto, mark.from);
1773
+ else {
1774
+ extraStyle += " " + mark.style;
1775
+ if (mark.to != null) upto = Math.min(upto, mark.to);
1776
+ }
1777
+ }
1778
+ for (;;) {
1779
+ var end = pos + text.length;
1780
+ var apliedStyle = style;
1781
+ if (extraStyle) apliedStyle = style ? style + extraStyle : extraStyle;
1782
+ span(end > upto ? text.slice(0, upto - pos) : text, apliedStyle);
1783
+ if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
1784
+ pos = end;
1785
+ text = st[i++]; style = st[i++];
1786
+ }
1787
+ }
1788
+ if (sfrom != null && sto == null) span(" ", "CodeMirror-selected");
1789
+ }
1790
+ if (includePre) html.push("</pre>");
1791
+ return html.join("");
1792
+ }
1793
+ };
1794
+ // Utility used by replace and split above
1795
+ function copyStyles(from, to, source, dest) {
1796
+ for (var i = 0, pos = 0, state = 0; pos < to; i+=2) {
1797
+ var part = source[i], end = pos + part.length;
1798
+ if (state == 0) {
1799
+ if (end > from) dest.push(part.slice(from - pos, Math.min(part.length, to - pos)), source[i+1]);
1800
+ if (end >= from) state = 1;
1801
+ }
1802
+ else if (state == 1) {
1803
+ if (end > to) dest.push(part.slice(0, to - pos), source[i+1]);
1804
+ else dest.push(part, source[i+1]);
1805
+ }
1806
+ pos = end;
1807
+ }
1808
+ }
1809
+
1810
+ // The history object 'chunks' changes that are made close together
1811
+ // and at almost the same time into bigger undoable units.
1812
+ function History() {
1813
+ this.time = 0;
1814
+ this.done = []; this.undone = [];
1815
+ }
1816
+ History.prototype = {
1817
+ addChange: function(start, added, old) {
1818
+ this.undone.length = 0;
1819
+ var time = +new Date, last = this.done[this.done.length - 1];
1820
+ if (time - this.time > 400 || !last ||
1821
+ last.start > start + added || last.start + last.added < start - last.added + last.old.length)
1822
+ this.done.push({start: start, added: added, old: old});
1823
+ else {
1824
+ var oldoff = 0;
1825
+ if (start < last.start) {
1826
+ for (var i = last.start - start - 1; i >= 0; --i)
1827
+ last.old.unshift(old[i]);
1828
+ last.added += last.start - start;
1829
+ last.start = start;
1830
+ }
1831
+ else if (last.start < start) {
1832
+ oldoff = start - last.start;
1833
+ added += oldoff;
1834
+ }
1835
+ for (var i = last.added - oldoff, e = old.length; i < e; ++i)
1836
+ last.old.push(old[i]);
1837
+ if (last.added < added) last.added = added;
1838
+ }
1839
+ this.time = time;
1840
+ }
1841
+ };
1842
+
1843
+ // Event stopping compatibility wrapper.
1844
+ function stopEvent() {
1845
+ if (this.preventDefault) {this.preventDefault(); this.stopPropagation();}
1846
+ else {this.returnValue = false; this.cancelBubble = true;}
1847
+ }
1848
+ // Ensure an event has a stop method.
1849
+ function addStop(event) {
1850
+ if (!event.stop) event.stop = stopEvent;
1851
+ return event;
1852
+ }
1853
+
1854
+ // Event wrapper, exposing the few operations we need.
1855
+ function Event(orig) {this.e = orig;}
1856
+ Event.prototype = {
1857
+ stop: function() {stopEvent.call(this.e);},
1858
+ target: function() {return this.e.target || this.e.srcElement;},
1859
+ button: function() {
1860
+ if (this.e.which) return this.e.which;
1861
+ else if (this.e.button & 1) return 1;
1862
+ else if (this.e.button & 2) return 3;
1863
+ else if (this.e.button & 4) return 2;
1864
+ },
1865
+ pageX: function() {
1866
+ if (this.e.pageX != null) return this.e.pageX;
1867
+ var doc = this.target().ownerDocument;
1868
+ return this.e.clientX + doc.body.scrollLeft + doc.documentElement.scrollLeft;
1869
+ },
1870
+ pageY: function() {
1871
+ if (this.e.pageY != null) return this.e.pageY;
1872
+ var doc = this.target().ownerDocument;
1873
+ return this.e.clientY + doc.body.scrollTop + doc.documentElement.scrollTop;
1874
+ }
1875
+ };
1876
+
1877
+ // Event handler registration. If disconnect is true, it'll return a
1878
+ // function that unregisters the handler.
1879
+ function connect(node, type, handler, disconnect) {
1880
+ function wrapHandler(event) {handler(new Event(event || window.event));}
1881
+ if (typeof node.addEventListener == "function") {
1882
+ node.addEventListener(type, wrapHandler, false);
1883
+ if (disconnect) return function() {node.removeEventListener(type, wrapHandler, false);};
1884
+ }
1885
+ else {
1886
+ node.attachEvent("on" + type, wrapHandler);
1887
+ if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);};
1888
+ }
1889
+ }
1890
+
1891
+ function Delayed() {this.id = null;}
1892
+ Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}};
1893
+
1894
+ // Some IE versions don't preserve whitespace when setting the
1895
+ // innerHTML of a PRE tag.
1896
+ var badInnerHTML = (function() {
1897
+ var pre = document.createElement("pre");
1898
+ pre.innerHTML = " "; return !pre.innerHTML;
1899
+ })();
1900
+
1901
+ var gecko = /gecko\/\d{7}/i.test(navigator.userAgent);
1902
+ var ie = /MSIE \d/.test(navigator.userAgent);
1903
+ var safari = /Apple Computer/.test(navigator.vendor);
1904
+
1905
+ var lineSep = "\n";
1906
+ // Feature-detect whether newlines in textareas are converted to \r\n
1907
+ (function () {
1908
+ var te = document.createElement("textarea");
1909
+ te.value = "foo\nbar";
1910
+ if (te.value.indexOf("\r") > -1) lineSep = "\r\n";
1911
+ }());
1912
+
1913
+ var tabSize = 8;
1914
+ var mac = /Mac/.test(navigator.platform);
1915
+ var movementKeys = {};
1916
+ for (var i = 35; i <= 40; ++i)
1917
+ movementKeys[i] = movementKeys["c" + i] = true;
1918
+
1919
+ // Counts the column offset in a string, taking tabs into account.
1920
+ // Used mostly to find indentation.
1921
+ function countColumn(string, end) {
1922
+ if (end == null) {
1923
+ end = string.search(/[^\s\u00a0]/);
1924
+ if (end == -1) end = string.length;
1925
+ }
1926
+ for (var i = 0, n = 0; i < end; ++i) {
1927
+ if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
1928
+ else ++n;
1929
+ }
1930
+ return n;
1931
+ }
1932
+
1933
+ // Find the position of an element by following the offsetParent chain.
1934
+ // If screen==true, it returns screen (rather than page) coordinates.
1935
+ function eltOffset(node, screen) {
1936
+ var doc = node.ownerDocument.body;
1937
+ var x = 0, y = 0, hitDoc = false;
1938
+ for (var n = node; n; n = n.offsetParent) {
1939
+ x += n.offsetLeft; y += n.offsetTop;
1940
+ // Fixed-position elements don't have the document in their offset chain
1941
+ if (n == doc) hitDoc = true;
1942
+ }
1943
+ var e = screen && hitDoc ? null : doc;
1944
+ for (var n = node.parentNode; n != e; n = n.parentNode)
1945
+ if (n.scrollLeft != null) { x -= n.scrollLeft; y -= n.scrollTop;}
1946
+ return {left: x, top: y};
1947
+ }
1948
+ // Get a node's text content.
1949
+ function eltText(node) {
1950
+ return node.textContent || node.innerText || node.nodeValue || "";
1951
+ }
1952
+
1953
+ // Operations on {line, ch} objects.
1954
+ function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}
1955
+ function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}
1956
+ function copyPos(x) {return {line: x.line, ch: x.ch};}
1957
+
1958
+ function htmlEscape(str) {
1959
+ return str.replace(/[<>&]/g, function(str) {
1960
+ return str == "&" ? "&amp;" : str == "<" ? "&lt;" : "&gt;";
1961
+ });
1962
+ }
1963
+ CodeMirror.htmlEscape = htmlEscape;
1964
+
1965
+ // Used to position the cursor after an undo/redo by finding the
1966
+ // last edited character.
1967
+ function editEnd(from, to) {
1968
+ if (!to) return from ? from.length : 0;
1969
+ if (!from) return to.length;
1970
+ for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)
1971
+ if (from.charAt(i) != to.charAt(j)) break;
1972
+ return j + 1;
1973
+ }
1974
+
1975
+ function indexOf(collection, elt) {
1976
+ if (collection.indexOf) return collection.indexOf(elt);
1977
+ for (var i = 0, e = collection.length; i < e; ++i)
1978
+ if (collection[i] == elt) return i;
1979
+ return -1;
1980
+ }
1981
+
1982
+ // See if "".split is the broken IE version, if so, provide an
1983
+ // alternative way to split lines.
1984
+ if ("\n\nb".split(/\n/).length != 3)
1985
+ var splitLines = function(string) {
1986
+ var pos = 0, nl, result = [];
1987
+ while ((nl = string.indexOf("\n", pos)) > -1) {
1988
+ result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl));
1989
+ pos = nl + 1;
1990
+ }
1991
+ result.push(string.slice(pos));
1992
+ return result;
1993
+ };
1994
+ else
1995
+ var splitLines = function(string){return string.split(/\r?\n/);};
1996
+ CodeMirror.splitLines = splitLines;
1997
+
1998
+ // Sane model of finding and setting the selection in a textarea
1999
+ if (window.getSelection) {
2000
+ var selRange = function(te) {
2001
+ try {return {start: te.selectionStart, end: te.selectionEnd};}
2002
+ catch(e) {return null;}
2003
+ };
2004
+ if (safari)
2005
+ // On Safari, selection set with setSelectionRange are in a sort
2006
+ // of limbo wrt their anchor. If you press shift-left in them,
2007
+ // the anchor is put at the end, and the selection expanded to
2008
+ // the left. If you press shift-right, the anchor ends up at the
2009
+ // front. This is not what CodeMirror wants, so it does a
2010
+ // spurious modify() call to get out of limbo.
2011
+ var setSelRange = function(te, start, end) {
2012
+ if (start == end)
2013
+ te.setSelectionRange(start, end);
2014
+ else {
2015
+ te.setSelectionRange(start, end - 1);
2016
+ window.getSelection().modify("extend", "forward", "character");
2017
+ }
2018
+ };
2019
+ else
2020
+ var setSelRange = function(te, start, end) {
2021
+ try {te.setSelectionRange(start, end);}
2022
+ catch(e) {} // Fails on Firefox when textarea isn't part of the document
2023
+ };
2024
+ }
2025
+ // IE model. Don't ask.
2026
+ else {
2027
+ var selRange = function(te) {
2028
+ try {var range = te.ownerDocument.selection.createRange();}
2029
+ catch(e) {return null;}
2030
+ if (!range || range.parentElement() != te) return null;
2031
+ var val = te.value, len = val.length, localRange = te.createTextRange();
2032
+ localRange.moveToBookmark(range.getBookmark());
2033
+ var endRange = te.createTextRange();
2034
+ endRange.collapse(false);
2035
+
2036
+ if (localRange.compareEndPoints("StartToEnd", endRange) > -1)
2037
+ return {start: len, end: len};
2038
+
2039
+ var start = -localRange.moveStart("character", -len);
2040
+ for (var i = val.indexOf("\r"); i > -1 && i < start; i = val.indexOf("\r", i+1), start++) {}
2041
+
2042
+ if (localRange.compareEndPoints("EndToEnd", endRange) > -1)
2043
+ return {start: start, end: len};
2044
+
2045
+ var end = -localRange.moveEnd("character", -len);
2046
+ for (var i = val.indexOf("\r"); i > -1 && i < end; i = val.indexOf("\r", i+1), end++) {}
2047
+ return {start: start, end: end};
2048
+ };
2049
+ var setSelRange = function(te, start, end) {
2050
+ var range = te.createTextRange();
2051
+ range.collapse(true);
2052
+ var endrange = range.duplicate();
2053
+ var newlines = 0, txt = te.value;
2054
+ for (var pos = txt.indexOf("\n"); pos > -1 && pos < start; pos = txt.indexOf("\n", pos + 1))
2055
+ ++newlines;
2056
+ range.move("character", start - newlines);
2057
+ for (; pos > -1 && pos < end; pos = txt.indexOf("\n", pos + 1))
2058
+ ++newlines;
2059
+ endrange.move("character", end - newlines);
2060
+ range.setEndPoint("EndToEnd", endrange);
2061
+ range.select();
2062
+ };
2063
+ }
2064
+
2065
+ CodeMirror.defineMode("null", function() {
2066
+ return {token: function(stream) {stream.skipToEnd();}};
2067
+ });
2068
+ CodeMirror.defineMIME("text/plain", "null");
2069
+
2070
+ return CodeMirror;
2071
+ })();
libraries/codemirror/lib/overlay.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Utility function that allows modes to be combined. The mode given
2
+ // as the base argument takes care of most of the normal mode
3
+ // functionality, but a second (typically simple) mode is used, which
4
+ // can override the style of text. Both modes get to parse all of the
5
+ // text, but when both assign a non-null style to a piece of code, the
6
+ // overlay wins, unless the combine argument was true, in which case
7
+ // the styles are combined.
8
+
9
+ CodeMirror.overlayParser = function(base, overlay, combine) {
10
+ return {
11
+ startState: function() {
12
+ return {
13
+ base: CodeMirror.startState(base),
14
+ overlay: CodeMirror.startState(overlay),
15
+ basePos: 0, baseCur: null,
16
+ overlayPos: 0, overlayCur: null
17
+ };
18
+ },
19
+ copyState: function(state) {
20
+ return {
21
+ base: CodeMirror.copyState(base, state.base),
22
+ overlay: CodeMirror.copyState(overlay, state.overlay),
23
+ basePos: state.basePos, baseCur: null,
24
+ overlayPos: state.overlayPos, overlayCur: null
25
+ };
26
+ },
27
+
28
+ token: function(stream, state) {
29
+ if (stream.start == state.basePos) {
30
+ state.baseCur = base.token(stream, state.base);
31
+ state.basePos = stream.pos;
32
+ }
33
+ if (stream.start == state.overlayPos) {
34
+ stream.pos = stream.start;
35
+ state.overlayCur = overlay.token(stream, state.overlay);
36
+ state.overlayPos = stream.pos;
37
+ }
38
+ stream.pos = Math.min(state.basePos, state.overlayPos);
39
+ if (stream.eol()) state.basePos = state.overlayPos = 0;
40
+
41
+ if (state.overlayCur == null) return state.baseCur;
42
+ if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur;
43
+ else return state.overlayCur;
44
+ },
45
+
46
+ indent: function(state, textAfter) {
47
+ return base.indent(state.base, textAfter);
48
+ },
49
+ electricChars: base.electricChars
50
+ };
51
+ };
libraries/codemirror/lib/runmode.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CodeMirror.runMode = function(string, modespec, callback) {
2
+ var mode = CodeMirror.getMode({indentUnit: 2}, modespec);
3
+ var isNode = callback.nodeType == 1;
4
+ if (isNode) {
5
+ var node = callback, accum = [];
6
+ callback = function(string, style) {
7
+ if (string == "\n")
8
+ accum.push("<br>");
9
+ else if (style)
10
+ accum.push("<span class=\"cm-" + CodeMirror.htmlEscape(style) + "\">" + CodeMirror.htmlEscape(string) + "</span>");
11
+ else
12
+ accum.push(CodeMirror.htmlEscape(string));
13
+ }
14
+ }
15
+ var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
16
+ for (var i = 0, e = lines.length; i < e; ++i) {
17
+ if (i) callback("\n");
18
+ var stream = new CodeMirror.StringStream(lines[i]);
19
+ while (!stream.eol()) {
20
+ var style = mode.token(stream, state);
21
+ callback(stream.current(), style);
22
+ stream.start = stream.pos;
23
+ }
24
+ }
25
+ if (isNode)
26
+ node.innerHTML = accum.join("");
27
+ };
libraries/codemirror/mode/css.js ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CodeMirror.defineMode("css", function(config) {
2
+ var indentUnit = config.indentUnit, type;
3
+ function ret(style, tp) {type = tp; return style;}
4
+
5
+ function tokenBase(stream, state) {
6
+ var ch = stream.next();
7
+ if (ch == "@") {stream.eatWhile(/\w/); return ret("meta", stream.current());}
8
+ else if (ch == "/" && stream.eat("*")) {
9
+ state.tokenize = tokenCComment;
10
+ return tokenCComment(stream, state);
11
+ }
12
+ else if (ch == "<" && stream.eat("!")) {
13
+ state.tokenize = tokenSGMLComment;
14
+ return tokenSGMLComment(stream, state);
15
+ }
16
+ else if (ch == "=") ret(null, "compare");
17
+ else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
18
+ else if (ch == "\"" || ch == "'") {
19
+ state.tokenize = tokenString(ch);
20
+ return state.tokenize(stream, state);
21
+ }
22
+ else if (ch == "#") {
23
+ stream.eatWhile(/\w/);
24
+ return ret("atom", "hash");
25
+ }
26
+ else if (ch == "!") {
27
+ stream.match(/^\s*\w*/);
28
+ return ret("keyword", "important");
29
+ }
30
+ else if (/\d/.test(ch)) {
31
+ stream.eatWhile(/[\w.%]/);
32
+ return ret("number", "unit");
33
+ }
34
+ else if (/[,.+>*\/]/.test(ch)) {
35
+ return ret(null, "select-op");
36
+ }
37
+ else if (/[;{}:\[\]]/.test(ch)) {
38
+ return ret(null, ch);
39
+ }
40
+ else {
41
+ stream.eatWhile(/[\w\\\-_]/);
42
+ return ret("variable", "variable");
43
+ }
44
+ }
45
+
46
+ function tokenCComment(stream, state) {
47
+ var maybeEnd = false, ch;
48
+ while ((ch = stream.next()) != null) {
49
+ if (maybeEnd && ch == "/") {
50
+ state.tokenize = tokenBase;
51
+ break;
52
+ }
53
+ maybeEnd = (ch == "*");
54
+ }
55
+ return ret("comment", "comment");
56
+ }
57
+
58
+ function tokenSGMLComment(stream, state) {
59
+ var dashes = 0, ch;
60
+ while ((ch = stream.next()) != null) {
61
+ if (dashes >= 2 && ch == ">") {
62
+ state.tokenize = tokenBase;
63
+ break;
64
+ }
65
+ dashes = (ch == "-") ? dashes + 1 : 0;
66
+ }
67
+ return ret("comment", "comment");
68
+ }
69
+
70
+ function tokenString(quote) {
71
+ return function(stream, state) {
72
+ var escaped = false, ch;
73
+ while ((ch = stream.next()) != null) {
74
+ if (ch == quote && !escaped)
75
+ break;
76
+ escaped = !escaped && ch == "\\";
77
+ }
78
+ if (!escaped) state.tokenize = tokenBase;
79
+ return ret("string", "string");
80
+ };
81
+ }
82
+
83
+ return {
84
+ startState: function(base) {
85
+ return {tokenize: tokenBase,
86
+ baseIndent: base || 0,
87
+ stack: []};
88
+ },
89
+
90
+ token: function(stream, state) {
91
+ if (stream.eatSpace()) return null;
92
+ var style = state.tokenize(stream, state);
93
+
94
+ var context = state.stack[state.stack.length-1];
95
+ if (type == "hash" && context == "rule") style = "atom";
96
+ else if (style == "variable") {
97
+ if (context == "rule") style = "number";
98
+ else if (!context || context == "@media{") style = "tag";
99
+ }
100
+
101
+ if (context == "rule" && /^[\{\};]$/.test(type))
102
+ state.stack.pop();
103
+ if (type == "{") {
104
+ if (context == "@media") state.stack[state.stack.length-1] = "@media{";
105
+ else state.stack.push("{");
106
+ }
107
+ else if (type == "}") state.stack.pop();
108
+ else if (type == "@media") state.stack.push("@media");
109
+ else if (context == "{" && type != "comment") state.stack.push("rule");
110
+ return style;
111
+ },
112
+
113
+ indent: function(state, textAfter) {
114
+ var n = state.stack.length;
115
+ if (/^\}/.test(textAfter))
116
+ n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
117
+ return state.baseIndent + n * indentUnit;
118
+ },
119
+
120
+ electricChars: "}"
121
+ };
122
+ });
123
+
124
+ CodeMirror.defineMIME("text/css", "css");
libraries/codemirror/mode/htmlmixed.js ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
2
+ var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true});
3
+ var jsMode = CodeMirror.getMode(config, "javascript");
4
+ var cssMode = CodeMirror.getMode(config, "css");
5
+
6
+ function html(stream, state) {
7
+ var style = htmlMode.token(stream, state.htmlState);
8
+ if (style == "tag" && stream.current() == ">" && state.htmlState.context) {
9
+ if (/^script$/i.test(state.htmlState.context.tagName)) {
10
+ state.token = javascript;
11
+ state.localState = jsMode.startState(htmlMode.indent(state.htmlState, ""));
12
+ }
13
+ else if (/^style$/i.test(state.htmlState.context.tagName)) {
14
+ state.token = css;
15
+ state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
16
+ }
17
+ }
18
+ return style;
19
+ }
20
+ function maybeBackup(stream, pat, style) {
21
+ var cur = stream.current();
22
+ var close = cur.search(pat);
23
+ if (close > -1) stream.backUp(cur.length - close);
24
+ return style;
25
+ }
26
+ function javascript(stream, state) {
27
+ if (stream.match(/^<\/\s*script\s*>/i, false)) {
28
+ state.token = html;
29
+ state.curState = null;
30
+ return html(stream, state);
31
+ }
32
+ return maybeBackup(stream, /<\/\s*script\s*>/,
33
+ jsMode.token(stream, state.localState));
34
+ }
35
+ function css(stream, state) {
36
+ if (stream.match(/^<\/\s*style\s*>/i, false)) {
37
+ state.token = html;
38
+ state.localState = null;
39
+ return html(stream, state);
40
+ }
41
+ return maybeBackup(stream, /<\/\s*style\s*>/,
42
+ cssMode.token(stream, state.localState));
43
+ }
44
+
45
+ return {
46
+ startState: function() {
47
+ var state = htmlMode.startState();
48
+ return {token: html, localState: null, htmlState: state};
49
+ },
50
+
51
+ copyState: function(state) {
52
+ if (state.localState)
53
+ var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState);
54
+ return {token: state.token, localState: local, htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
55
+ },
56
+
57
+ token: function(stream, state) {
58
+ return state.token(stream, state);
59
+ },
60
+
61
+ indent: function(state, textAfter) {
62
+ if (state.token == html || /^\s*<\//.test(textAfter))
63
+ return htmlMode.indent(state.htmlState, textAfter);
64
+ else if (state.token == javascript)
65
+ return jsMode.indent(state.localState, textAfter);
66
+ else
67
+ return cssMode.indent(state.localState, textAfter);
68
+ },
69
+
70
+ electricChars: "/{}:"
71
+ }
72
+ });
73
+
74
+ CodeMirror.defineMIME("text/html", "htmlmixed");
libraries/codemirror/mode/javascript.js ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CodeMirror.defineMode("javascript", function(config, parserConfig) {
2
+ var indentUnit = config.indentUnit;
3
+ var jsonMode = parserConfig.json;
4
+
5
+ // Tokenizer
6
+
7
+ var keywords = function(){
8
+ function kw(type) {return {type: type, style: "keyword"};}
9
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
10
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"};
11
+ return {
12
+ "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
13
+ "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C,
14
+ "var": kw("var"), "function": kw("function"), "catch": kw("catch"),
15
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
16
+ "in": operator, "typeof": operator, "instanceof": operator,
17
+ "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom
18
+ };
19
+ }();
20
+
21
+ var isOperatorChar = /[+\-*&%=<>!?|]/;
22
+
23
+ function chain(stream, state, f) {
24
+ state.tokenize = f;
25
+ return f(stream, state);
26
+ }
27
+
28
+ function nextUntilUnescaped(stream, end) {
29
+ var escaped = false, next;
30
+ while ((next = stream.next()) != null) {
31
+ if (next == end && !escaped)
32
+ return false;
33
+ escaped = !escaped && next == "\\";
34
+ }
35
+ return escaped;
36
+ }
37
+
38
+ // Used as scratch variables to communicate multiple values without
39
+ // consing up tons of objects.
40
+ var type, content;
41
+ function ret(tp, style, cont) {
42
+ type = tp; content = cont;
43
+ return style;
44
+ }
45
+
46
+ function jsTokenBase(stream, state) {
47
+ var ch = stream.next();
48
+ if (ch == '"' || ch == "'")
49
+ return chain(stream, state, jsTokenString(ch));
50
+ else if (/[\[\]{}\(\),;\:\.]/.test(ch))
51
+ return ret(ch);
52
+ else if (ch == "0" && stream.eat(/x/i)) {
53
+ stream.eatWhile(/[\da-f]/i);
54
+ return ret("number", "atom");
55
+ }
56
+ else if (/\d/.test(ch)) {
57
+ stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
58
+ return ret("number", "atom");
59
+ }
60
+ else if (ch == "/") {
61
+ if (stream.eat("*")) {
62
+ return chain(stream, state, jsTokenComment);
63
+ }
64
+ else if (stream.eat("/")) {
65
+ stream.skipToEnd();
66
+ return ret("comment", "comment");
67
+ }
68
+ else if (state.reAllowed) {
69
+ nextUntilUnescaped(stream, "/");
70
+ stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla
71
+ return ret("regexp", "string");
72
+ }
73
+ else {
74
+ stream.eatWhile(isOperatorChar);
75
+ return ret("operator", null, stream.current());
76
+ }
77
+ }
78
+ else if (isOperatorChar.test(ch)) {
79
+ stream.eatWhile(isOperatorChar);
80
+ return ret("operator", null, stream.current());
81
+ }
82
+ else {
83
+ stream.eatWhile(/[\w\$_]/);
84
+ var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
85
+ return known ? ret(known.type, known.style, word) :
86
+ ret("variable", "variable", word);
87
+ }
88
+ }
89
+
90
+ function jsTokenString(quote) {
91
+ return function(stream, state) {
92
+ if (!nextUntilUnescaped(stream, quote))
93
+ state.tokenize = jsTokenBase;
94
+ return ret("string", "string");
95
+ };
96
+ }
97
+
98
+ function jsTokenComment(stream, state) {
99
+ var maybeEnd = false, ch;
100
+ while (ch = stream.next()) {
101
+ if (ch == "/" && maybeEnd) {
102
+ state.tokenize = jsTokenBase;
103
+ break;
104
+ }
105
+ maybeEnd = (ch == "*");
106
+ }
107
+ return ret("comment", "comment");
108
+ }
109
+
110
+ // Parser
111
+
112
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
113
+
114
+ function JSLexical(indented, column, type, align, prev, info) {
115
+ this.indented = indented;
116
+ this.column = column;
117
+ this.type = type;
118
+ this.prev = prev;
119
+ this.info = info;
120
+ if (align != null) this.align = align;
121
+ }
122
+
123
+ function inScope(state, varname) {
124
+ for (var v = state.localVars; v; v = v.next)
125
+ if (v.name == varname) return true;
126
+ }
127
+
128
+ function parseJS(state, style, type, content, stream) {
129
+ var cc = state.cc;
130
+ // Communicate our context to the combinators.
131
+ // (Less wasteful than consing up a hundred closures on every call.)
132
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
133
+
134
+ if (!state.lexical.hasOwnProperty("align"))
135
+ state.lexical.align = true;
136
+
137
+ while(true) {
138
+ var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
139
+ if (combinator(type, content)) {
140
+ while(cc.length && cc[cc.length - 1].lex)
141
+ cc.pop()();
142
+ if (cx.marked) return cx.marked;
143
+ if (type == "variable" && inScope(state, content)) return "variable-2";
144
+ return style;
145
+ }
146
+ }
147
+ }
148
+
149
+ // Combinator utils
150
+
151
+ var cx = {state: null, column: null, marked: null, cc: null};
152
+ function pass() {
153
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
154
+ }
155
+ function cont() {
156
+ pass.apply(null, arguments);
157
+ return true;
158
+ }
159
+ function register(varname) {
160
+ var state = cx.state;
161
+ if (state.context) {
162
+ cx.marked = "def";
163
+ for (var v = state.localVars; v; v = v.next)
164
+ if (v.name == varname) return;
165
+ state.localVars = {name: varname, next: state.localVars};
166
+ }
167
+ }
168
+
169
+ // Combinators
170
+
171
+ var defaultVars = {name: "this", next: {name: "arguments"}};
172
+ function pushcontext() {
173
+ if (!cx.state.context) cx.state.localVars = defaultVars;
174
+ cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
175
+ }
176
+ function popcontext() {
177
+ cx.state.localVars = cx.state.context.vars;
178
+ cx.state.context = cx.state.context.prev;
179
+ }
180
+ function pushlex(type, info) {
181
+ var result = function() {
182
+ var state = cx.state;
183
+ state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info)
184
+ };
185
+ result.lex = true;
186
+ return result;
187
+ }
188
+ function poplex() {
189
+ var state = cx.state;
190
+ if (state.lexical.prev) {
191
+ if (state.lexical.type == ")")
192
+ state.indented = state.lexical.indented;
193
+ state.lexical = state.lexical.prev;
194
+ }
195
+ }
196
+ poplex.lex = true;
197
+
198
+ function expect(wanted) {
199
+ return function expecting(type) {
200
+ if (type == wanted) return cont();
201
+ else if (wanted == ";") return pass();
202
+ else return cont(arguments.callee);
203
+ };
204
+ }
205
+
206
+ function statement(type) {
207
+ if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
208
+ if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
209
+ if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
210
+ if (type == "{") return cont(pushlex("}"), block, poplex);
211
+ if (type == ";") return cont();
212
+ if (type == "function") return cont(functiondef);
213
+ if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
214
+ poplex, statement, poplex);
215
+ if (type == "variable") return cont(pushlex("stat"), maybelabel);
216
+ if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
217
+ block, poplex, poplex);
218
+ if (type == "case") return cont(expression, expect(":"));
219
+ if (type == "default") return cont(expect(":"));
220
+ if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
221
+ statement, poplex, popcontext);
222
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
223
+ }
224
+ function expression(type) {
225
+ if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
226
+ if (type == "function") return cont(functiondef);
227
+ if (type == "keyword c") return cont(expression);
228
+ if (type == "(") return cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
229
+ if (type == "operator") return cont(expression);
230
+ if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
231
+ if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
232
+ return cont();
233
+ }
234
+ function maybeoperator(type, value) {
235
+ if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
236
+ if (type == "operator") return cont(expression);
237
+ if (type == ";") return;
238
+ if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
239
+ if (type == ".") return cont(property, maybeoperator);
240
+ if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
241
+ }
242
+ function maybelabel(type) {
243
+ if (type == ":") return cont(poplex, statement);
244
+ return pass(maybeoperator, expect(";"), poplex);
245
+ }
246
+ function property(type) {
247
+ if (type == "variable") {cx.marked = "property"; return cont();}
248
+ }
249
+ function objprop(type) {
250
+ if (type == "variable") cx.marked = "property";
251
+ if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
252
+ }
253
+ function commasep(what, end) {
254
+ function proceed(type) {
255
+ if (type == ",") return cont(what, proceed);
256
+ if (type == end) return cont();
257
+ return cont(expect(end));
258
+ }
259
+ return function commaSeparated(type) {
260
+ if (type == end) return cont();
261
+ else return pass(what, proceed);
262
+ };
263
+ }
264
+ function block(type) {
265
+ if (type == "}") return cont();
266
+ return pass(statement, block);
267
+ }
268
+ function vardef1(type, value) {
269
+ if (type == "variable"){register(value); return cont(vardef2);}
270
+ return cont();
271
+ }
272
+ function vardef2(type, value) {
273
+ if (value == "=") return cont(expression, vardef2);
274
+ if (type == ",") return cont(vardef1);
275
+ }
276
+ function forspec1(type) {
277
+ if (type == "var") return cont(vardef1, forspec2);
278
+ if (type == ";") return pass(forspec2);
279
+ if (type == "variable") return cont(formaybein);
280
+ return pass(forspec2);
281
+ }
282
+ function formaybein(type, value) {
283
+ if (value == "in") return cont(expression);
284
+ return cont(maybeoperator, forspec2);
285
+ }
286
+ function forspec2(type, value) {
287
+ if (type == ";") return cont(forspec3);
288
+ if (value == "in") return cont(expression);
289
+ return cont(expression, expect(";"), forspec3);
290
+ }
291
+ function forspec3(type) {
292
+ if (type != ")") cont(expression);
293
+ }
294
+ function functiondef(type, value) {
295
+ if (type == "variable") {register(value); return cont(functiondef);}
296
+ if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext);
297
+ }
298
+ function funarg(type, value) {
299
+ if (type == "variable") {register(value); return cont();}
300
+ }
301
+
302
+ // Interface
303
+
304
+ return {
305
+ startState: function(basecolumn) {
306
+ return {
307
+ tokenize: jsTokenBase,
308
+ reAllowed: true,
309
+ cc: [],
310
+ lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
311
+ localVars: null,
312
+ context: null,
313
+ indented: 0
314
+ };
315
+ },
316
+
317
+ token: function(stream, state) {
318
+ if (stream.sol()) {
319
+ if (!state.lexical.hasOwnProperty("align"))
320
+ state.lexical.align = false;
321
+ state.indented = stream.indentation();
322
+ }
323
+ if (stream.eatSpace()) return null;
324
+ var style = state.tokenize(stream, state);
325
+ if (type == "comment") return style;
326
+ state.reAllowed = type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/);
327
+ return parseJS(state, style, type, content, stream);
328
+ },
329
+
330
+ indent: function(state, textAfter) {
331
+ if (state.tokenize != jsTokenBase) return 0;
332
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical,
333
+ type = lexical.type, closing = firstChar == type;
334
+ if (type == "vardef") return lexical.indented + 4;
335
+ else if (type == "form" && firstChar == "{") return lexical.indented;
336
+ else if (type == "stat" || type == "form") return lexical.indented + indentUnit;
337
+ else if (lexical.info == "switch" && !closing)
338
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
339
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
340
+ else return lexical.indented + (closing ? 0 : indentUnit);
341
+ },
342
+
343
+ electricChars: ":{}"
344
+ };
345
+ });
346
+
347
+ CodeMirror.defineMIME("text/javascript", "javascript");
348
+ CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
libraries/codemirror/mode/xml.js ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ CodeMirror.defineMode("xml", function(config, parserConfig) {
2
+ var indentUnit = config.indentUnit;
3
+ var Kludges = parserConfig.htmlMode ? {
4
+ autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true,
5
+ "meta": true, "col": true, "frame": true, "base": true, "area": true},
6
+ doNotIndent: {"pre": true, "!cdata": true},
7
+ allowUnquoted: true
8
+ } : {autoSelfClosers: {}, doNotIndent: {"!cdata": true}, allowUnquoted: false};
9
+ var alignCDATA = parserConfig.alignCDATA;
10
+
11
+ // Return variables for tokenizers
12
+ var tagName, type;
13
+
14
+ function inText(stream, state) {
15
+ function chain(parser) {
16
+ state.tokenize = parser;
17
+ return parser(stream, state);
18
+ }
19
+
20
+ var ch = stream.next();
21
+ if (ch == "<") {
22
+ if (stream.eat("!")) {
23
+ if (stream.eat("[")) {
24
+ if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
25
+ else return null;
26
+ }
27
+ else if (stream.match("--")) return chain(inBlock("comment", "-->"));
28
+ else if (stream.match("DOCTYPE")) {
29
+ stream.eatWhile(/[\w\._\-]/);
30
+ return chain(inBlock("meta", ">"));
31
+ }
32
+ else return null;
33
+ }
34
+ else if (stream.eat("?")) {
35
+ stream.eatWhile(/[\w\._\-]/);
36
+ state.tokenize = inBlock("meta", "?>");
37
+ return "meta";
38
+ }
39
+ else {
40
+ type = stream.eat("/") ? "closeTag" : "openTag";
41
+ stream.eatSpace();
42
+ tagName = "";
43
+ var c;
44
+ while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
45
+ state.tokenize = inTag;
46
+ return "tag";
47
+ }
48
+ }
49
+ else if (ch == "&") {
50
+ stream.eatWhile(/[^;]/);
51
+ stream.eat(";");
52
+ return "atom";
53
+ }
54
+ else {
55
+ stream.eatWhile(/[^&<]/);
56
+ return null;
57
+ }
58
+ }
59
+
60
+ function inTag(stream, state) {
61
+ var ch = stream.next();
62
+ if (ch == ">" || (ch == "/" && stream.eat(">"))) {
63
+ state.tokenize = inText;
64
+ type = ch == ">" ? "endTag" : "selfcloseTag";
65
+ return "tag";
66
+ }
67
+ else if (ch == "=") {
68
+ type = "equals";
69
+ return null;
70
+ }
71
+ else if (/[\'\"]/.test(ch)) {
72
+ state.tokenize = inAttribute(ch);
73
+ return state.tokenize(stream, state);
74
+ }
75
+ else {
76
+ stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);
77
+ return "word";
78
+ }
79
+ }
80
+
81
+ function inAttribute(quote) {
82
+ return function(stream, state) {
83
+ while (!stream.eol()) {
84
+ if (stream.next() == quote) {
85
+ state.tokenize = inTag;
86
+ break;
87
+ }
88
+ }
89
+ return "string";
90
+ };
91
+ }
92
+
93
+ function inBlock(style, terminator) {
94
+ return function(stream, state) {
95
+ while (!stream.eol()) {
96
+ if (stream.match(terminator)) {
97
+ state.tokenize = inText;
98
+ break;
99
+ }
100
+ stream.next();
101
+ }
102
+ return style;
103
+ };
104
+ }
105
+
106
+ var curState, setStyle;
107
+ function pass() {
108
+ for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
109
+ }
110
+ function cont() {
111
+ pass.apply(null, arguments);
112
+ return true;
113
+ }
114
+
115
+ function pushContext(tagName, startOfLine) {
116
+ var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
117
+ curState.context = {
118
+ prev: curState.context,
119
+ tagName: tagName,
120
+ indent: curState.indented,
121
+ startOfLine: startOfLine,
122
+ noIndent: noIndent
123
+ };
124
+ }
125
+ function popContext() {
126
+ if (curState.context) curState.context = curState.context.prev;
127
+ }
128
+
129
+ function element(type) {
130
+ if (type == "openTag") {curState.tagName = tagName; return cont(attributes, endtag(curState.startOfLine));}
131
+ else if (type == "closeTag") {popContext(); return cont(endclosetag);}
132
+ else if (type == "string") {
133
+ if (!curState.context || curState.context.name != "!cdata") pushContext("!cdata");
134
+ if (curState.tokenize == inText) popContext();
135
+ return cont();
136
+ }
137
+ else return cont();
138
+ }
139
+ function endtag(startOfLine) {
140
+ return function(type) {
141
+ if (type == "selfcloseTag" ||
142
+ (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase())))
143
+ return cont();
144
+ if (type == "endTag") {pushContext(curState.tagName, startOfLine); return cont();}
145
+ return cont();
146
+ };
147
+ }
148
+ function endclosetag(type) {
149
+ if (type == "endTag") return cont();
150
+ return pass();
151
+ }
152
+
153
+ function attributes(type) {
154
+ if (type == "word") {setStyle = "attribute"; return cont(attributes);}
155
+ if (type == "equals") return cont(attvalue, attributes);
156
+ return pass();
157
+ }
158
+ function attvalue(type) {
159
+ if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
160
+ if (type == "string") return cont();
161
+ return pass();
162
+ }
163
+
164
+ return {
165
+ startState: function() {
166
+ return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
167
+ },
168
+
169
+ token: function(stream, state) {
170
+ if (stream.sol()) {
171
+ state.startOfLine = true;
172
+ state.indented = stream.indentation();
173
+ }
174
+ if (stream.eatSpace()) return null;
175
+
176
+ setStyle = type = tagName = null;
177
+ var style = state.tokenize(stream, state);
178
+ if ((style || type) && style != "xml-comment") {
179
+ curState = state;
180
+ while (true) {
181
+ var comb = state.cc.pop() || element;
182
+ if (comb(type || style)) break;
183
+ }
184
+ }
185
+ state.startOfLine = false;
186
+ return setStyle || style;
187
+ },
188
+
189
+ indent: function(state, textAfter) {
190
+ var context = state.context;
191
+ if (context && context.noIndent) return 0;
192
+ if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
193
+ if (context && /^<\//.test(textAfter))
194
+ context = context.prev;
195
+ while (context && !context.startOfLine)
196
+ context = context.prev;
197
+ if (context) return context.indent + indentUnit;
198
+ else return 0;
199
+ },
200
+
201
+ electricChars: "/"
202
+ };
203
+ });
204
+
205
+ CodeMirror.defineMIME("application/xml", "xml");
206
+ CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
libraries/codemirror/theme/default.css ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cm-s-default span.cm-keyword {color: #708;}
2
+ .cm-s-default span.cm-atom {color: #219;}
3
+ .cm-s-default span.cm-number {color: #164;}
4
+ .cm-s-default span.cm-def {color: #00f;}
5
+ .cm-s-default span.cm-variable {color: black;}
6
+ .cm-s-default span.cm-variable-2 {color: #05a;}
7
+ .cm-s-default span.cm-variable-3 {color: #0a5;}
8
+ .cm-s-default span.cm-property {color: black;}
9
+ .cm-s-default span.cm-operator {color: black;}
10
+ .cm-s-default span.cm-comment {color: #a50;}
11
+ .cm-s-default span.cm-string {color: #a11;}
12
+ .cm-s-default span.cm-meta {color: #555;}
13
+ .cm-s-default span.cm-error {color: #f00;}
14
+ .cm-s-default span.cm-qualifier {color: #555;}
15
+ .cm-s-default span.cm-builtin {color: #30a;}
16
+ .cm-s-default span.cm-bracket {color: #cc7;}
17
+ .cm-s-default span.cm-tag {color: #170;}
18
+ .cm-s-default span.cm-attribute {color: #00c;}
libraries/codemirror/theme/elegant.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
2
+ .cm-s-elegant span.cm-comment {color: #262;font-style: italic;}
3
+ .cm-s-elegant span.cm-meta {color: #555;font-style: italic;}
4
+ .cm-s-elegant span.cm-variable {color: black;}
5
+ .cm-s-elegant span.cm-variable-2 {color: #b11;}
6
+ .cm-s-elegant span.cm-qualifier {color: #555;}
7
+ .cm-s-elegant span.cm-keyword {color: #730;}
8
+ .cm-s-elegant span.cm-builtin {color: #30a;}
9
+ .cm-s-elegant span.cm-error {background-color: #fdd;}
libraries/codemirror/theme/neat.css ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ .cm-s-neat span.cm-comment { color: #a86; }
2
+ .cm-s-neat span.cm-keyword { font-weight: bold; color: blue; }
3
+ .cm-s-neat span.cm-string { color: #a22; }
4
+ .cm-s-neat span.cm-builtin { font-weight: bold; color: #077; }
5
+ .cm-s-neat span.cm-special { font-weight: bold; color: #0aa; }
6
+ .cm-s-neat span.cm-variable { color: black; }
7
+ .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; }
8
+ .cm-s-neat span.cm-meta {color: #555;}
libraries/codemirror/theme/night.css ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Loosely based on the Midnight Textmate theme */
2
+
3
+ .cm-s-night { background: #0a001f; color: #f8f8f8; }
4
+ .cm-s-night span.CodeMirror-selected { background: #a8f !important; }
5
+ .cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
6
+ .cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; }
7
+ .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; }
8
+
9
+ .cm-s-night span.cm-comment { color: #6900a1; }
10
+ .cm-s-night span.cm-atom { color: #845dc4; }
11
+ .cm-s-night span.cm-number { color: #ffd500; }
12
+ .cm-s-night span.cm-keyword { color: #599eff; }
13
+ .cm-s-night span.cm-string { color: #37f14a; }
14
+ .cm-s-night span.cm-meta { color: #7678e2; }
15
+ .cm-s-night span.cm-variable-2 { color: #99b2ff; }
16
+ .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { white; }
17
+ .cm-s-night span.cm-error { color: #9d1e15; }
18
+ .cm-s-night span.cm-bracket { color: #8da6ce; }
19
+ .cm-s-night span.cm-comment { color: #6900a1; }
20
+ .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
license.txt CHANGED
@@ -1,674 +1,281 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
 
 
 
3
 
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
  Everyone is permitted to copy and distribute verbatim copies
6
  of this license document, but changing it is not allowed.
7
 
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
 
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
 
20
  your programs, too.
21
 
22
  When we speak of free software, we are referring to freedom, not
23
  price. Our General Public Licenses are designed to make sure that you
24
  have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
 
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
 
34
  For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
 
68
  The precise terms and conditions for copying, distribution and
69
  modification follow.
70
 
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
  this License.
486
 
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
  otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
  be similar in spirit to the present version, but may differ in detail to
568
  address new problems or concerns.
569
 
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- <one line to give the program's name and a brief idea of what it does.>
635
- Copyright (C) <year> <name of author>
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- <program> Copyright (C) <year> <name of author>
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
6
 
 
7
  Everyone is permitted to copy and distribute verbatim copies
8
  of this license document, but changing it is not allowed.
9
 
10
+ Preamble
 
 
 
11
 
12
+ The licenses for most software are designed to take away your
13
+ freedom to share and change it. By contrast, the GNU General Public
14
+ License is intended to guarantee your freedom to share and change free
15
+ software--to make sure the software is free for all its users. This
16
+ General Public License applies to most of the Free Software
17
+ Foundation's software and to any other program whose authors commit to
18
+ using it. (Some other Free Software Foundation software is covered by
19
+ the GNU Library General Public License instead.) You can apply it to
20
  your programs, too.
21
 
22
  When we speak of free software, we are referring to freedom, not
23
  price. Our General Public Licenses are designed to make sure that you
24
  have the freedom to distribute copies of free software (and charge for
25
+ this service if you wish), that you receive source code or can get it
26
+ if you want it, that you can change the software or use pieces of it
27
+ in new free programs; and that you know you can do these things.
28
 
29
+ To protect your rights, we need to make restrictions that forbid
30
+ anyone to deny you these rights or to ask you to surrender the rights.
31
+ These restrictions translate to certain responsibilities for you if you
32
+ distribute copies of the software, or if you modify it.
33
 
34
  For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must give the recipients all the rights that
36
+ you have. You must make sure that they, too, receive or can get the
37
+ source code. And you must show them these terms so they know their
38
+ rights.
39
+
40
+ We protect your rights with two steps: (1) copyright the software, and
41
+ (2) offer you this license which gives you legal permission to copy,
42
+ distribute and/or modify the software.
43
+
44
+ Also, for each author's protection and ours, we want to make certain
45
+ that everyone understands that there is no warranty for this free
46
+ software. If the software is modified by someone else and passed on, we
47
+ want its recipients to know that what they have is not the original, so
48
+ that any problems introduced by others will not reflect on the original
49
+ authors' reputations.
50
+
51
+ Finally, any free program is threatened constantly by software
52
+ patents. We wish to avoid the danger that redistributors of a free
53
+ program will individually obtain patent licenses, in effect making the
54
+ program proprietary. To prevent this, we have made it clear that any
55
+ patent must be licensed for everyone's free use or not licensed at all.
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  The precise terms and conditions for copying, distribution and
58
  modification follow.
59
 
60
+ GNU GENERAL PUBLIC LICENSE
61
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
+
63
+ 0. This License applies to any program or other work which contains
64
+ a notice placed by the copyright holder saying it may be distributed
65
+ under the terms of this General Public License. The "Program", below,
66
+ refers to any such program or work, and a "work based on the Program"
67
+ means either the Program or any derivative work under copyright law:
68
+ that is to say, a work containing the Program or a portion of it,
69
+ either verbatim or with modifications and/or translated into another
70
+ language. (Hereinafter, translation is included without limitation in
71
+ the term "modification".) Each licensee is addressed as "you".
72
+
73
+ Activities other than copying, distribution and modification are not
74
+ covered by this License; they are outside its scope. The act of
75
+ running the Program is not restricted, and the output from the Program
76
+ is covered only if its contents constitute a work based on the
77
+ Program (independent of having been made by running the Program).
78
+ Whether that is true depends on what the Program does.
79
+
80
+ 1. You may copy and distribute verbatim copies of the Program's
81
+ source code as you receive it, in any medium, provided that you
82
+ conspicuously and appropriately publish on each copy an appropriate
83
+ copyright notice and disclaimer of warranty; keep intact all the
84
+ notices that refer to this License and to the absence of any warranty;
85
+ and give any other recipients of the Program a copy of this License
86
+ along with the Program.
87
+
88
+ You may charge a fee for the physical act of transferring a copy, and
89
+ you may at your option offer warranty protection in exchange for a fee.
90
+
91
+ 2. You may modify your copy or copies of the Program or any portion
92
+ of it, thus forming a work based on the Program, and copy and
93
+ distribute such modifications or work under the terms of Section 1
94
+ above, provided that you also meet all of these conditions:
95
+
96
+ a) You must cause the modified files to carry prominent notices
97
+ stating that you changed the files and the date of any change.
98
+
99
+ b) You must cause any work that you distribute or publish, that in
100
+ whole or in part contains or is derived from the Program or any
101
+ part thereof, to be licensed as a whole at no charge to all third
102
+ parties under the terms of this License.
103
+
104
+ c) If the modified program normally reads commands interactively
105
+ when run, you must cause it, when started running for such
106
+ interactive use in the most ordinary way, to print or display an
107
+ announcement including an appropriate copyright notice and a
108
+ notice that there is no warranty (or else, saying that you provide
109
+ a warranty) and that users may redistribute the program under
110
+ these conditions, and telling the user how to view a copy of this
111
+ License. (Exception: if the Program itself is interactive but
112
+ does not normally print such an announcement, your work based on
113
+ the Program is not required to print an announcement.)
114
+
115
+ These requirements apply to the modified work as a whole. If
116
+ identifiable sections of that work are not derived from the Program,
117
+ and can be reasonably considered independent and separate works in
118
+ themselves, then this License, and its terms, do not apply to those
119
+ sections when you distribute them as separate works. But when you
120
+ distribute the same sections as part of a whole which is a work based
121
+ on the Program, the distribution of the whole must be on the terms of
122
+ this License, whose permissions for other licensees extend to the
123
+ entire whole, and thus to each and every part regardless of who wrote it.
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  this License.
196
 
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
  be similar in spirit to the present version, but may differ in detail to
240
  address new problems or concerns.
241
 
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file
screenshot-4.png DELETED
Binary file
screenshot-5.png DELETED
Binary file
screenshot-6.png DELETED
Binary file
scripts-n-styles.php CHANGED
@@ -5,478 +5,312 @@ Plugin URI: http://www.unfocus.com/projects/scripts-n-styles/
5
  Description: Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
6
  Author: unFocus Projects
7
  Author URI: http://www.unfocus.com/
8
- Version: 3.4.1
9
- License: GPLv3 or later
10
- Text Domain: scripts-n-styles
11
  */
 
12
 
13
- /* The Scripts n Styles WordPress Plugin
14
- Copyright (c) 2010-2017 Kenneth Newman <http://www.unfocus.com/>
15
- Copyright (c) 2012 Kevin Newman <http://www.unfocus.com/>
16
- Copyright (c) 2012-2013 adcSTUDIO LLC <http://www.adcstudio.com/>
17
-
18
- Scripts n Styles is free software; you can redistribute it and/or
19
- modify it under the terms of the GNU General Public License
20
- as published by the Free Software Foundation; either version 3
21
- of the License, or (at your option) any later version.
22
-
23
- Scripts n Styles is distributed in the hope that it will be useful,
24
  but WITHOUT ANY WARRANTY; without even the implied warranty of
25
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26
  GNU General Public License for more details.
27
-
28
  You should have received a copy of the GNU General Public License
29
- along with this program. If not, see <http://www.gnu.org/licenses/>.
30
-
31
- This file incorporates work covered by other licenses and permissions.
32
  */
33
 
34
- if ( version_compare( PHP_VERSION, '5.4', '<' ) ) :
35
- function sns_disable_update( $value ) {
36
- if( isset( $value->response[plugin_basename( __FILE__ )] ) ) {
37
- unset( $value->response[plugin_basename( __FILE__ )] );
38
- }
39
- return $value;
40
- }
41
- add_filter( 'site_transient_update_plugins', 'sns_disable_update' );
42
- endif;
43
-
44
  /**
45
  * Scripts n Styles
46
- *
47
  * Allows WordPress admin users the ability to add custom CSS
48
  * and JavaScript directly to individual Post, Pages or custom
49
  * post types.
50
- *
51
  * NOTE: No user except the "Super Admin" can use this plugin in MultiSite. I'll add features for MultiSite later, perhaps the ones below...
52
- * The "Super Admin" user has exclusive 'unfiltered_html' capabilities in MultiSite. Also, options.php checks for is_super_admin()
53
- * so the 'manage_options' capability for blog admins is insufficient to pass the check to manage options directly.
54
- *
55
- * The Tentative plan is for Super Admins to create Snippets or Shortcodes approved for use by users with certain capabilities
56
  * ('unfiltered_html' and/or 'manage_options'). The 'unfiltered_html' capability can be granted via another plugin. This plugin will
57
  * not deal with granting any capabilities.
58
- *
59
  * @package Scripts_n_Styles
60
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
61
  * @author unFocus Projects
62
  * @link http://www.unfocus.com/ Author URI
63
- * @version 3.4.1
64
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
65
- * @copyright Copyright (c) 2010 - 2013, Kenneth Newman
66
- * @copyright Copyright (c) 2012, Kevin Newman
67
- * @copyright Copyright (c) 2012 - 2013, adcSTUDIO LLC
68
- *
69
  * @todo Create ability to add and register scripts and styles for enqueueing (via Options page).
70
  * @todo Create selection on Option page of which to pick registered scripts to make available on edit screens.
 
71
  * @todo Create shortcode registration on Options page to make those snippets available on edit screens.
72
- * @todo Add Error messaging.
73
- * @todo Clean up tiny_mce_before_init in SnS_Admin_Meta_Box.
 
 
 
 
74
  */
75
 
76
  class Scripts_n_Styles
77
  {
78
- /**#@+
79
- * @static
80
- */
81
- const VERSION = '3.4.1';
82
  static $file = __FILE__;
83
- static $cm_themes = array( 'default', '3024-day', '3024-night', 'ambiance',
84
- 'base16-dark', 'base16-light',
85
- 'blackboard', 'cobalt', 'eclipse',
86
- 'elegant', 'erlang-dark', 'lesser-dark', 'midnight', 'monokai',
87
- 'neat', 'night', 'paraiso-dark', 'paraiso-light', 'rubyblue',
88
- 'solarized', 'the-matrix', 'tomorrow-night-eighties', 'twilight', 'vibrant-ink',
89
- 'xq-dark', 'xq-light' );
90
- /**#@-*/
91
-
92
- /**
93
  * Initializing method. Checks if is_admin() and registers action hooks for admin if true. Sets filters and actions for Theme side functions.
94
- * @static
95
- */
96
  static function init() {
 
97
  if ( is_admin() && ! ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) ) {
98
  /* NOTE: Setting the DISALLOW_UNFILTERED_HTML constant to
99
  true in the wp-config.php would effectively disable this
100
  plugin's admin because no user would have the capability.
101
  */
102
- include_once( 'includes/class-sns-admin.php' );
103
  SnS_Admin::init();
 
104
  }
105
- //register_theme_directory( WP_PLUGIN_DIR . "/" . basename( dirname( __FILE__ ) ) . '/theme/' );
106
- add_action( 'plugins_loaded', array( __CLASS__, 'upgrade_check' ) );
107
-
108
  add_filter( 'body_class', array( __CLASS__, 'body_classes' ) );
109
  add_filter( 'post_class', array( __CLASS__, 'post_classes' ) );
110
-
111
  add_action( 'wp_head', array( __CLASS__, 'styles' ), 11 );
112
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ), 11 );
113
  add_action( 'wp_head', array( __CLASS__, 'scripts_in_head' ), 11 );
114
  add_action( 'wp_footer', array( __CLASS__, 'scripts' ), 11 );
115
-
116
- add_action( 'plugins_loaded', array( __CLASS__, 'add_shortcodes' ) );
117
- add_action( 'widgets_init', array( __CLASS__, 'add_widget' ) );
118
-
119
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'register' ) );
120
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'register' ) );
121
-
122
- add_action( 'wp_print_styles', array( __CLASS__, 'theme_style' ) );
123
- add_action( 'wp_ajax_sns_theme_css', array( __CLASS__, 'theme_css' ) );
124
- add_action( 'wp_ajax_nopriv_sns_theme_css', array( __CLASS__, 'theme_css' ) );
125
- }
126
- static function theme_style() {
127
- if ( current_theme_supports( 'scripts-n-styles' ) ) {
128
- $options = get_option( 'SnS_options' );
129
- $slug = get_stylesheet();
130
-
131
- if ( ! empty( $options[ 'themes' ][ $slug ][ 'compiled' ] ) ) {
132
- wp_deregister_style( 'theme_style' );
133
- wp_enqueue_style( 'theme_style', add_query_arg( array( 'action' => 'sns_theme_css' ), admin_url( "admin-ajax.php" ) ) );
134
- }
135
- }
136
- }
137
- static function theme_css() {
138
- $options = get_option( 'SnS_options' );
139
- $slug = get_stylesheet();
140
- $compiled = $options[ 'themes' ][ $slug ][ 'compiled' ];
141
- header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + 864000 ) . ' GMT');
142
- header("Cache-Control: public, max-age=864000");
143
- header('Content-Type: text/css; charset=UTF-8');
144
- echo $compiled;
145
- die();
146
  }
147
- static function add_widget() {
148
- $options = get_option( 'SnS_options' );
149
- if ( isset( $options[ 'hoops_widget' ] ) && 'yes' == $options[ 'hoops_widget' ] )
150
- register_widget( 'SnS_Widget' );
151
- }
152
- static function add_shortcodes() {
153
- add_shortcode( 'sns_shortcode', array( __CLASS__, 'shortcode' ) );
154
- add_shortcode( 'hoops', array( __CLASS__, 'shortcode' ) );
155
- }
156
- static function shortcode( $atts, $content = null, $tag ) {
157
  global $post;
158
- extract( shortcode_atts( array( 'name' => 0, ), $atts ) );
159
- $output = '';
160
-
161
- $options = get_option( 'SnS_options' );
162
- $hoops = isset( $options['hoops']['shortcodes'] ) ? $options['hoops']['shortcodes'] : array();
163
-
164
- if ( isset( $post->ID ) ) {
165
- $SnS = get_post_meta( $post->ID, '_SnS', true );
166
- $shortcodes = isset( $SnS['shortcodes'] ) ? $SnS[ 'shortcodes' ]: array();
167
- }
168
-
169
- if ( isset( $shortcodes[ $name ] ) )
170
- $output .= $shortcodes[ $name ];
171
- else if ( isset( $hoops[ $name ] ) )
172
- $output .= $hoops[ $name ];
173
-
174
- if ( ! empty( $content ) && empty( $output ) )
175
- $output = $content;
176
- $output = do_shortcode( $output );
177
-
178
- return $output;
179
  }
180
- static function hoops_widget( $atts, $content = null, $tag ) {
181
- $options = get_option( 'SnS_options' );
182
- $hoops = $options['hoops']['shortcodes'];
183
-
184
- extract( shortcode_atts( array( 'name' => 0, ), $atts ) );
185
- $output = '';
186
-
187
- $shortcodes = isset( $SnS['shortcodes'] ) ? $SnS[ 'shortcodes' ]: array();
188
-
189
- if ( isset( $hoops[ $name ] ) )
190
- $output .= $hoops[ $name ];
191
-
192
- if ( ! empty( $content ) && empty( $output ) )
193
- $output = $content;
194
- $output = do_shortcode( $output );
195
-
196
- return $output;
197
  }
198
-
199
- /**
200
  * Utility Method
201
- */
202
  static function get_wp_registered() {
203
- /* This is a collection of scripts that are listed as registered after running `wp_head` and `wp_footer` actions on the theme side. */
204
  return array(
205
- 'utils', 'common', 'sack', 'quicktags', 'colorpicker', 'editor', 'wp-fullscreen', 'wp-ajax-response', 'wp-pointer', 'autosave',
206
- 'heartbeat', 'wp-auth-check', 'wp-lists', 'prototype', 'scriptaculous-root', 'scriptaculous-builder', 'scriptaculous-dragdrop',
207
- 'scriptaculous-effects', 'scriptaculous-slider', 'scriptaculous-sound', 'scriptaculous-controls', 'scriptaculous', 'cropper',
208
- 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-effects-core', 'jquery-effects-blind', 'jquery-effects-bounce',
209
- 'jquery-effects-clip', 'jquery-effects-drop', 'jquery-effects-explode', 'jquery-effects-fade', 'jquery-effects-fold',
210
- 'jquery-effects-highlight', 'jquery-effects-pulsate', 'jquery-effects-scale', 'jquery-effects-shake', 'jquery-effects-slide',
211
- 'jquery-effects-transfer', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker',
212
- 'jquery-ui-dialog', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', 'jquery-ui-position',
213
- 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', 'jquery-ui-slider', 'jquery-ui-sortable',
214
- 'jquery-ui-spinner', 'jquery-ui-tabs', 'jquery-ui-tooltip', 'jquery-ui-widget', 'jquery-form', 'jquery-color', 'suggest',
215
- 'schedule', 'jquery-query', 'jquery-serialize-object', 'jquery-hotkeys', 'jquery-table-hotkeys', 'jquery-touch-punch',
216
- 'jquery-masonry', 'thickbox', 'jcrop', 'swfobject', 'plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight',
217
- 'plupload-html4', 'plupload-all', 'plupload-handlers', 'wp-plupload', 'swfupload', 'swfupload-swfobject', 'swfupload-queue',
218
- 'swfupload-speed', 'swfupload-all', 'swfupload-handlers', 'comment-reply', 'json2', 'underscore', 'backbone', 'wp-util',
219
- 'wp-backbone', 'revisions', 'imgareaselect', 'mediaelement', 'wp-mediaelement', 'password-strength-meter', 'user-profile',
220
- 'user-suggest', 'admin-bar', 'wplink', 'wpdialogs', 'wpdialogs-popup', 'word-count', 'media-upload', 'hoverIntent', 'customize-base',
221
- 'customize-loader', 'customize-preview', 'customize-controls', 'accordion', 'shortcode', 'media-models', 'media-views',
222
- 'media-editor', 'mce-view', 'less.js', 'coffeescript', 'chosen', 'coffeelint', 'mustache', 'html5shiv', 'html5shiv-printshiv',
223
- 'google-diff-match-patch', 'codemirror'
224
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  }
226
- static function register() {
227
- $dir = plugins_url( '/', __FILE__);
228
-
229
- $vendor = $dir . 'vendor/';
230
- wp_register_script( 'less.js', $vendor . 'less.min.js', array(), '1.4.2-min' );
231
- wp_register_script( 'coffeescript', $vendor . 'coffee-script.js', array(), '1.6.3-min' );
232
- wp_register_script( 'chosen', $vendor . 'chosen/chosen.jquery.min.js', array( 'jquery' ), '1.0.0', true );
233
- wp_register_style( 'chosen', $vendor . 'chosen/chosen.min.css', array(), '1.0.0' );
234
- //wp_register_script( 'coffeelint', $vendor . 'coffeelint.js', array(), '0.5.6' );
235
- //wp_register_script( 'mustache', $vendor . 'chosen/jquery.mustache.min.js', array( 'jquery' ), '0.7.2', true );
236
- //wp_register_script( 'html5shiv', $vendor . 'html5shiv.js', array(), '3.6.2' );
237
- //wp_register_script( 'html5shiv-printshiv', $vendor . 'html5shiv-printshiv.js', array(), '3.6.2' );
238
-
239
- //wp_register_script( 'google-diff-match-patch', $vendor . 'codemirror/diff_match_patch.js', array() );
240
- wp_register_script( 'codemirror', $vendor . 'codemirror/codemirror-compressed.js', array( /*'google-diff-match-patch'*/ ), '3.16' );
241
- wp_register_style( 'codemirror', $vendor . 'codemirror/codemirror-compressed.css', array(), '3.16' );
242
-
243
- $js = $dir . 'js/';
244
- wp_register_script( 'sns-global-page', $js . 'global-page.js', array( 'jquery', 'codemirror', 'less.js', 'coffeescript', 'chosen' ), self::VERSION, true );
245
- wp_register_script( 'sns-theme-page', $js . 'theme-page.js', array( 'jquery', 'codemirror', 'less.js', ), self::VERSION, true );
246
- wp_register_script( 'sns-hoops-page', $js . 'hoops-page.js', array( 'jquery', 'codemirror' ), self::VERSION, true );
247
- wp_register_script( 'sns-settings-page', $js . 'settings-page.js', array( 'jquery', 'codemirror' ), self::VERSION, true );
248
- wp_register_script( 'sns-meta-box', $js . 'meta-box.js', array( 'editor', 'jquery-ui-tabs', 'codemirror', 'chosen' ), self::VERSION, true );
249
- wp_register_script( 'sns-code-editor', $js . 'code-editor.js', array( 'editor', 'jquery-ui-tabs', 'codemirror' ), self::VERSION, true );
250
-
251
- $css = $dir . 'css/';
252
- wp_register_style( 'sns-options', $css . 'options-styles.css', array( 'codemirror' ), self::VERSION );
253
- wp_register_style( 'sns-meta-box', $css . 'meta-box.css', array( 'codemirror' ), self::VERSION );
254
- wp_register_style( 'sns-code-editor', $css . 'code-editor.css', array( 'codemirror' ), self::VERSION );
255
- }
256
-
257
- /**
258
  * Theme Action: 'wp_head()'
259
  * Outputs the globally and individually set Styles in the Theme's head element.
260
- */
261
  static function styles() {
262
  // Global
263
  $options = get_option( 'SnS_options' );
264
  if ( ! empty( $options ) && ! empty( $options[ 'styles' ] ) ) {
265
- ?><style type="text/css" id="sns_global_styles"><?php
266
  echo $options[ 'styles' ];
267
  ?></style><?php
268
  }
269
- if ( ! empty( $options ) && ! empty( $options[ 'compiled' ] ) ) {
270
- ?><style type="text/css" id="sns_global_less_compiled"><?php
271
- echo $options[ 'compiled' ];
272
- ?></style><?php
273
- }
274
-
275
  if ( ! is_singular() ) return;
276
  // Individual
277
- global $post;
278
- $SnS = get_post_meta( $post->ID, '_SnS', true );
279
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
280
  if ( ! empty( $styles ) && ! empty( $styles[ 'styles' ] ) ) {
281
- ?><style type="text/css" id="sns_styles"><?php
282
  echo $styles[ 'styles' ];
283
  ?></style><?php
284
  }
285
  }
286
-
287
- /**
288
  * Theme Action: 'wp_footer()'
289
  * Outputs the globally and individually set Scripts at the end of the Theme's body element.
290
- */
291
  static function scripts() {
292
  // Global
293
  $options = get_option( 'SnS_options' );
294
  if ( ! empty( $options ) && ! empty( $options[ 'scripts' ] ) ) {
295
- ?><script type="text/javascript" id="sns_global_scripts"><?php
296
  echo $options[ 'scripts' ];
297
  ?></script><?php
298
  }
299
- if ( ! empty( $options ) && ! empty( $options[ 'coffee_compiled' ] ) ) {
300
- ?><script type="text/javascript" id="sns_global_coffee_compiled"><?php
301
- echo $options[ 'coffee_compiled' ];
302
- ?></script><?php
303
- }
304
-
305
  if ( ! is_singular() ) return;
306
  // Individual
307
- global $post;
308
- $SnS = get_post_meta( $post->ID, '_SnS', true );
309
- $scripts = isset( $SnS['scripts'] ) ? $SnS[ 'scripts' ]: array();
310
  if ( ! empty( $scripts ) && ! empty( $scripts[ 'scripts' ] ) ) {
311
- ?><script type="text/javascript" id="sns_scripts"><?php
312
  echo $scripts[ 'scripts' ];
313
  ?></script><?php
314
  }
315
  }
316
-
317
- /**
318
  * Theme Action: 'wp_head()'
319
  * Outputs the globally and individually set Scripts in the Theme's head element.
320
- */
321
  static function scripts_in_head() {
322
  // Global
323
  $options = get_option( 'SnS_options' );
324
- if ( ! empty( $options ) && ! empty( $options[ 'scripts_in_head' ] ) ) {
325
- ?><script type="text/javascript" id="sns_global_scripts_in_head"><?php
326
  echo $options[ 'scripts_in_head' ];
327
  ?></script><?php
328
  }
329
-
330
  if ( ! is_singular() ) return;
331
  // Individual
332
- global $post;
333
- $SnS = get_post_meta( $post->ID, '_SnS', true );
334
- $scripts = isset( $SnS['scripts'] ) ? $SnS[ 'scripts' ]: array();
335
  if ( ! empty( $scripts ) && ! empty( $scripts[ 'scripts_in_head' ] ) ) {
336
- ?><script type="text/javascript" id="sns_scripts_in_head"><?php
337
  echo $scripts[ 'scripts_in_head' ];
338
  ?></script><?php
339
  }
340
  }
341
-
342
- /**
343
  * Theme Filter: 'body_class()'
344
  * Adds classes to the Theme's body tag.
345
  * @uses self::get_styles()
346
- * @param array $classes
347
- * @return array $classes
348
- */
349
  static function body_classes( $classes ) {
350
- if ( ! is_singular() || is_admin() ) return $classes;
351
-
352
- global $post;
353
- $SnS = get_post_meta( $post->ID, '_SnS', true );
354
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
355
  if ( ! empty( $styles ) && ! empty( $styles[ 'classes_body' ] ) )
356
  $classes = array_merge( $classes, explode( " ", $styles[ 'classes_body' ] ) );
357
-
358
  return $classes;
359
  }
360
-
361
- /**
362
  * Theme Filter: 'post_class()'
363
  * Adds classes to the Theme's post container.
364
- * @param array $classes
365
- * @return array $classes
366
- */
 
367
  static function post_classes( $classes ) {
368
- if ( ! is_singular() || is_admin() ) return $classes;
369
-
370
- global $post;
371
- $SnS = get_post_meta( $post->ID, '_SnS', true );
372
- $styles = isset( $SnS['styles'] ) ? $SnS[ 'styles' ]: array();
373
-
374
  if ( ! empty( $styles ) && ! empty( $styles[ 'classes_post' ] ) )
375
  $classes = array_merge( $classes, explode( " ", $styles[ 'classes_post' ] ) );
376
-
377
  return $classes;
378
  }
379
-
380
- /**
381
  * Theme Action: 'wp_enqueue_scripts'
382
  * Enqueues chosen Scripts.
383
- */
 
 
384
  static function enqueue_scripts() {
385
  // Global
386
- $options = get_option( 'SnS_options' );
387
- if ( ! isset( $options[ 'enqueue_scripts' ] ) )
388
- $enqueue_scripts = array();
389
- else
390
- $enqueue_scripts = $options[ 'enqueue_scripts' ];
391
-
392
- foreach ( $enqueue_scripts as $handle )
393
- wp_enqueue_script( $handle );
394
 
 
 
 
 
 
395
  if ( ! is_singular() ) return;
396
  // Individual
397
- global $post;
398
- $SnS = get_post_meta( $post->ID, '_SnS', true );
399
- $scripts = isset( $SnS['scripts'] ) ? $SnS[ 'scripts' ]: array();
400
-
401
  if ( ! empty( $scripts[ 'enqueue_scripts' ] ) && is_array( $scripts[ 'enqueue_scripts' ] ) ) {
402
  foreach ( $scripts[ 'enqueue_scripts' ] as $handle )
403
  wp_enqueue_script( $handle );
404
  }
405
  }
406
-
407
- /**
408
- * Utility Method: Compares VERSION to stored 'version' value.
409
- */
410
- static function upgrade_check() {
411
- $options = get_option( 'SnS_options' );
412
- if ( ! isset( $options[ 'version' ] ) || version_compare( self::VERSION, $options[ 'version' ], '>' ) ) {
413
- include_once( 'includes/class-sns-admin.php' );
414
- SnS_Admin::upgrade();
415
- }
416
- }
417
  }
418
 
419
  Scripts_n_Styles::init();
420
 
421
- class SnS_Widget extends WP_Widget
422
- {
423
- function __construct() {
424
- $widget_ops = array( 'classname' => 'sns_widget_text', 'description' => __( 'Arbitrary text or HTML (including "hoops" shortcodes)', 'scripts-n-styles' ) );
425
- $control_ops = array( 'width' => 400, 'height' => 350 );
426
- parent::__construct( 'sns_hoops', __( 'Hoops', 'scripts-n-styles' ), $widget_ops, $control_ops );
427
- }
428
-
429
- function widget( $args, $instance ) {
430
- global $shortcode_tags;
431
-
432
- extract( $args );
433
- $title = apply_filters( 'widget_title', empty( $instance[ 'title' ] ) ? '' : $instance[ 'title' ], $instance, $this->id_base );
434
- $text = apply_filters( 'widget_text', empty( $instance[ 'text' ] ) ? '' : $instance[ 'text' ], $instance );
435
-
436
- echo $before_widget;
437
- if ( ! empty( $title ) )
438
- echo $before_title . $title . $after_title;
439
- echo '<div class="hoopstextwidget">';
440
- $content = ! empty( $instance[ 'filter' ] ) ? wpautop( $text ) : $text;
441
-
442
- $backup = $shortcode_tags;
443
- remove_all_shortcodes();
444
-
445
- add_shortcode( 'sns_shortcode', array( 'Scripts_n_Styles', 'hoops_widget' ) );
446
- add_shortcode( 'hoops', array( 'Scripts_n_Styles', 'hoops_widget' ) );
447
-
448
- $content = do_shortcode( $content );
449
-
450
- $shortcode_tags = $backup;
451
-
452
- echo $content;
453
- echo '</div>';
454
- echo $after_widget;
455
- }
456
-
457
- function update( $new_instance, $old_instance ) {
458
- $instance = $old_instance;
459
- $instance[ 'title' ] = strip_tags( $new_instance[ 'title' ] );
460
- if ( current_user_can( 'unfiltered_html' ) )
461
- $instance[ 'text' ] = $new_instance[ 'text' ];
462
- else
463
- $instance[ 'text' ] = stripslashes( wp_filter_post_kses( addslashes( $new_instance[ 'text' ] ) ) ); // wp_filter_post_kses() expects slashed
464
- $instance[ 'filter' ] = isset( $new_instance[ 'filter' ] );
465
- return $instance;
466
- }
467
-
468
- function form( $instance ) {
469
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
470
- $title = strip_tags( $instance[ 'title' ] );
471
- $text = esc_textarea( $instance[ 'text' ] );
472
- ?>
473
- <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
474
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
475
-
476
- <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo $text; ?></textarea>
477
-
478
- <p><input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox" <?php checked( isset( $instance[ 'filter' ] ) ? $instance[ 'filter' ] : 0 ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs' ); ?></label></p>
479
- <?php
480
- }
481
- }
482
- ?>
5
  Description: Allows WordPress admin users the ability to add custom CSS and JavaScript directly to individual Post, Pages or custom post types.
6
  Author: unFocus Projects
7
  Author URI: http://www.unfocus.com/
8
+ Version: 2.0.1.1
9
+ License: GPL2
10
+ Network: true
11
  */
12
+ /* Copyright 2010-2011 Kenneth Newman www.unfocus.com
13
 
14
+ This program is free software; you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License, version 2, as
16
+ published by the Free Software Foundation.
17
+
18
+ This program is distributed in the hope that it will be useful,
 
 
 
 
 
 
19
  but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
  GNU General Public License for more details.
22
+
23
  You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
26
  */
27
 
 
 
 
 
 
 
 
 
 
 
28
  /**
29
  * Scripts n Styles
30
+ *
31
  * Allows WordPress admin users the ability to add custom CSS
32
  * and JavaScript directly to individual Post, Pages or custom
33
  * post types.
34
+ *
35
  * NOTE: No user except the "Super Admin" can use this plugin in MultiSite. I'll add features for MultiSite later, perhaps the ones below...
36
+ * The "Super Admin" user has exclusive 'unfiltered_html' capabilities in MultiSite. Also, options.php checks for is_super_admin()
37
+ * so the 'manage_options' capability for blog admins is insufficient to pass the check to manage options directly.
38
+ *
39
+ * The Tentative plan is for Super Admins to create Snippets or Shortcodes approved for use by users with certain capabilities
40
  * ('unfiltered_html' and/or 'manage_options'). The 'unfiltered_html' capability can be granted via another plugin. This plugin will
41
  * not deal with granting any capabilities.
42
+ *
43
  * @package Scripts_n_Styles
44
  * @link http://www.unfocus.com/projects/scripts-n-styles/ Plugin URI
45
  * @author unFocus Projects
46
  * @link http://www.unfocus.com/ Author URI
47
+ * @version 2
48
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
49
+ * @copyright Copyright (c) 2010, Kenneth Newman
50
+ * @todo Add Post Type Selection on Options Page? Not sure that's usefull.
51
+ * @todo Add Conditional Tags support as alternative to Globally applying Scripts n Styles.
 
52
  * @todo Create ability to add and register scripts and styles for enqueueing (via Options page).
53
  * @todo Create selection on Option page of which to pick registered scripts to make available on edit screens.
54
+ * @todo Create shortcode to embed html/javascript snippets. See http://scribu.net/wordpress/optimal-script-loading.html in which this is already figured out :-)
55
  * @todo Create shortcode registration on Options page to make those snippets available on edit screens.
56
+ * @todo Create shortcode registration of html snippets on edit screens for single use.
57
+ * @todo Figure out and add Error messaging.
58
+ * @todo Add ability to push class names into the TinyMCE editor Style Dropdown.
59
+ * @todo Replace Multi-Select element with something better.
60
+ * @todo Clean up Usage Table, paginate, don't display when empty.
61
+ * @todo "Include Scripts" will be reintroduced when registing is finished.
62
  */
63
 
64
  class Scripts_n_Styles
65
  {
66
+ /**#@+
67
+ * @static
68
+ */
 
69
  static $file = __FILE__;
70
+ static $hook_suffix; // 'tools_page_Scripts-n-Styles';
71
+ static $plugin_file; // 'scripts-n-styles/scripts-n-styles.php'; kept here for reference
72
+ /**#@-*/
73
+
74
+ /**
 
 
 
 
 
75
  * Initializing method. Checks if is_admin() and registers action hooks for admin if true. Sets filters and actions for Theme side functions.
76
+ * @static
77
+ */
78
  static function init() {
79
+
80
  if ( is_admin() && ! ( defined('DISALLOW_UNFILTERED_HTML') && DISALLOW_UNFILTERED_HTML ) ) {
81
  /* NOTE: Setting the DISALLOW_UNFILTERED_HTML constant to
82
  true in the wp-config.php would effectively disable this
83
  plugin's admin because no user would have the capability.
84
  */
85
+ include_once( 'includes/class.SnS_Admin.php' );
86
  SnS_Admin::init();
87
+
88
  }
89
+
 
 
90
  add_filter( 'body_class', array( __CLASS__, 'body_classes' ) );
91
  add_filter( 'post_class', array( __CLASS__, 'post_classes' ) );
92
+
93
  add_action( 'wp_head', array( __CLASS__, 'styles' ), 11 );
94
+ //add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ), 11 );
95
  add_action( 'wp_head', array( __CLASS__, 'scripts_in_head' ), 11 );
96
  add_action( 'wp_footer', array( __CLASS__, 'scripts' ), 11 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
+
99
+ /**
100
+ * Utility Method: Returns the value of $scripts if it is set, and if not, sets it via a call to the database.
101
+ * @return array 'ufp_script' meta data entry.
102
+ */
103
+ static function get_scripts() {
 
 
 
 
104
  global $post;
105
+ return get_post_meta( $post->ID, 'uFp_scripts', true );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
+
108
+ /**
109
+ * Utility Method: Returns the value of $styles if it is set, and if not, sets it via a call to the database.
110
+ * @return array 'ufp_styles' meta data entry.
111
+ */
112
+ static function get_styles() {
113
+ global $post;
114
+ return get_post_meta( $post->ID, 'uFp_styles', true );
 
 
 
 
 
 
 
 
 
115
  }
116
+
117
+ /**
118
  * Utility Method
119
+ */
120
  static function get_wp_registered() {
 
121
  return array(
122
+ // Starting with the list of Scripts registered by default on the Theme side (index page of twentyten).
123
+ // This list should be trimmed down, as some probably aren't apporpriate for Theme enqueueing.
124
+ 'l10n',
125
+ 'utils',
126
+ 'common',
127
+ 'sack',
128
+ 'quicktags',
129
+ 'colorpicker',
130
+ 'editor',
131
+ 'prototype',
132
+ 'wp-ajax-response',
133
+ 'autosave',
134
+ 'wp-lists',
135
+ 'scriptaculous-root',
136
+ 'scriptaculous-builder',
137
+ 'scriptaculous-dragdrop',
138
+ 'scriptaculous-effects',
139
+ 'scriptaculous-slider',
140
+ 'scriptaculous-sound',
141
+ 'scriptaculous-controls',
142
+ 'scriptaculous',
143
+ 'cropper',
144
+ 'jquery',
145
+ 'jquery-ui-core',
146
+ 'jquery-ui-position',
147
+ 'jquery-ui-widget',
148
+ 'jquery-ui-mouse',
149
+ 'jquery-ui-button',
150
+ 'jquery-ui-tabs',
151
+ 'jquery-ui-sortable',
152
+ 'jquery-ui-draggable',
153
+ 'jquery-ui-droppable',
154
+ 'jquery-ui-selectable',
155
+ 'jquery-ui-resizable',
156
+ 'jquery-ui-dialog',
157
+ 'jquery-form',
158
+ 'jquery-color',
159
+ 'suggest',
160
+ 'schedule',
161
+ 'jquery-query',
162
+ 'jquery-serialize-object',
163
+ 'jquery-hotkeys',
164
+ 'jquery-table-hotkeys',
165
+ 'thickbox',
166
+ 'jcrop',
167
+ 'swfobject',
168
+ 'swfupload',
169
+ 'swfupload-swfobject',
170
+ 'swfupload-queue',
171
+ 'swfupload-speed',
172
+ 'swfupload-all',
173
+ 'swfupload-handlers',
174
+ 'comment-reply',
175
+ 'json2',
176
+ 'imgareaselect',
177
+ 'password-strength-meter',
178
+ 'user-profile',
179
+ 'admin-bar',
180
+ 'wplink',
181
+ 'wpdialogs-popup'
182
+ );
183
  }
184
+
185
+ /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  * Theme Action: 'wp_head()'
187
  * Outputs the globally and individually set Styles in the Theme's head element.
188
+ */
189
  static function styles() {
190
  // Global
191
  $options = get_option( 'SnS_options' );
192
  if ( ! empty( $options ) && ! empty( $options[ 'styles' ] ) ) {
193
+ ?><style type="text/css"><?php
194
  echo $options[ 'styles' ];
195
  ?></style><?php
196
  }
197
+
 
 
 
 
 
198
  if ( ! is_singular() ) return;
199
  // Individual
200
+ $styles = self::get_styles();
 
 
201
  if ( ! empty( $styles ) && ! empty( $styles[ 'styles' ] ) ) {
202
+ ?><style type="text/css"><?php
203
  echo $styles[ 'styles' ];
204
  ?></style><?php
205
  }
206
  }
207
+
208
+ /**
209
  * Theme Action: 'wp_footer()'
210
  * Outputs the globally and individually set Scripts at the end of the Theme's body element.
211
+ */
212
  static function scripts() {
213
  // Global
214
  $options = get_option( 'SnS_options' );
215
  if ( ! empty( $options ) && ! empty( $options[ 'scripts' ] ) ) {
216
+ ?><script type="text/javascript"><?php
217
  echo $options[ 'scripts' ];
218
  ?></script><?php
219
  }
220
+
 
 
 
 
 
221
  if ( ! is_singular() ) return;
222
  // Individual
223
+ $scripts = self::get_scripts();
 
 
224
  if ( ! empty( $scripts ) && ! empty( $scripts[ 'scripts' ] ) ) {
225
+ ?><script type="text/javascript"><?php
226
  echo $scripts[ 'scripts' ];
227
  ?></script><?php
228
  }
229
  }
230
+
231
+ /**
232
  * Theme Action: 'wp_head()'
233
  * Outputs the globally and individually set Scripts in the Theme's head element.
234
+ */
235
  static function scripts_in_head() {
236
  // Global
237
  $options = get_option( 'SnS_options' );
238
+ if ( ! empty( $options ) && ! empty($options[ 'scripts_in_head' ]) ) {
239
+ ?><script type="text/javascript"><?php
240
  echo $options[ 'scripts_in_head' ];
241
  ?></script><?php
242
  }
243
+
244
  if ( ! is_singular() ) return;
245
  // Individual
246
+ $scripts = self::get_scripts();
 
 
247
  if ( ! empty( $scripts ) && ! empty( $scripts[ 'scripts_in_head' ] ) ) {
248
+ ?><script type="text/javascript"><?php
249
  echo $scripts[ 'scripts_in_head' ];
250
  ?></script><?php
251
  }
252
  }
253
+
254
+ /**
255
  * Theme Filter: 'body_class()'
256
  * Adds classes to the Theme's body tag.
257
  * @uses self::get_styles()
258
+ * @param array $classes
259
+ * @return array $classes
260
+ */
261
  static function body_classes( $classes ) {
262
+ if ( ! is_singular() ) return $classes;
263
+
264
+ $styles = self::get_styles();
 
 
265
  if ( ! empty( $styles ) && ! empty( $styles[ 'classes_body' ] ) )
266
  $classes = array_merge( $classes, explode( " ", $styles[ 'classes_body' ] ) );
267
+
268
  return $classes;
269
  }
270
+
271
+ /**
272
  * Theme Filter: 'post_class()'
273
  * Adds classes to the Theme's post container.
274
+ * @uses self::get_styles()
275
+ * @param array $classes
276
+ * @return array $classes
277
+ */
278
  static function post_classes( $classes ) {
279
+ if ( ! is_singular() ) return $classes;
280
+
281
+ $styles = self::get_styles();
 
 
 
282
  if ( ! empty( $styles ) && ! empty( $styles[ 'classes_post' ] ) )
283
  $classes = array_merge( $classes, explode( " ", $styles[ 'classes_post' ] ) );
284
+
285
  return $classes;
286
  }
287
+
288
+ /**
289
  * Theme Action: 'wp_enqueue_scripts'
290
  * Enqueues chosen Scripts.
291
+ * @uses self::get_enqueue()
292
+ * @uses self::get_scripts()
293
+ */
294
  static function enqueue_scripts() {
295
  // Global
296
+ $enqueue_scripts = get_option( 'SnS_enqueue_scripts' );
 
 
 
 
 
 
 
297
 
298
+ if ( is_array( $enqueue_scripts ) ) {
299
+ foreach ( $enqueue_scripts as $handle )
300
+ wp_enqueue_script( $handle );
301
+ }
302
+
303
  if ( ! is_singular() ) return;
304
  // Individual
305
+ $scripts = self::get_scripts();
 
 
 
306
  if ( ! empty( $scripts[ 'enqueue_scripts' ] ) && is_array( $scripts[ 'enqueue_scripts' ] ) ) {
307
  foreach ( $scripts[ 'enqueue_scripts' ] as $handle )
308
  wp_enqueue_script( $handle );
309
  }
310
  }
311
+
 
 
 
 
 
 
 
 
 
 
312
  }
313
 
314
  Scripts_n_Styles::init();
315
 
316
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
uninstall.php CHANGED
@@ -1,26 +1,14 @@
1
  <?php
2
- if( ! defined( 'ABSPATH' ) || ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit();
3
-
4
- $options = get_option( 'SnS_options' );
5
- if ( empty($options['delete_data_uninstall']) || 'yes' !== $options['delete_data_uninstall'] ) {
6
- return;
 
 
 
 
7
  }
8
-
9
- $posts = get_posts( array(
10
- 'numberposts' => -1,
11
- 'post_type' => 'any',
12
- 'post_status' => 'any',
13
- 'orderby' => 'ID',
14
- 'meta_key' => '_SnS'
15
- ) );
16
-
17
- foreach( $posts as $post)
18
- delete_post_meta( $post->ID, '_SnS' );
19
- delete_option( 'SnS_options' );
20
-
21
- $users = get_users( 'meta_key=current_sns_tab' );
22
- foreach( $users as $user ) delete_user_option( $user->ID, 'current_sns_tab', true );
23
-
24
- $users = get_users( 'meta_key=scripts_n_styles_page_sns_usage_per_page' );
25
- foreach( $users as $user ) delete_user_option( $user->ID, 'scripts_n_styles_page_sns_usage_per_page', true );
26
  ?>
1
  <?php
2
+ if( !defined( 'ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') )
3
+ exit();
4
+ $get_posts_args = array('numberposts' => -1,
5
+ 'post_type' => 'any',
6
+ 'post_status' => 'any' );
7
+ $all_posts = get_posts( $get_posts_args );
8
+ foreach( $all_posts as $postinfo) {
9
+ delete_post_meta($postinfo->ID, 'uFp_scripts');
10
+ delete_post_meta($postinfo->ID, 'uFp_styles');
11
  }
12
+ delete_option('sns_options');
13
+ delete_option('sns_enqueue_scripts');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  ?>
vendor/chosen/chosen-sprite.png DELETED
Binary file
vendor/chosen/chosen-sprite@2x.png DELETED
Binary file
vendor/chosen/chosen.jquery.min.js DELETED
@@ -1,2 +0,0 @@
1
- /* Chosen v1.0.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
- !function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=""!==a.style.cssText?' style="'+a.style+'"':"",'<li class="'+b.join(" ")+'"'+c+' data-option-array-index="'+a.array_index+'">'+a.search_text+"</li>"):"":""},AbstractChosen.prototype.result_add_group=function(a){return a.search_match||a.group_match?a.active_options>0?'<li class="group-result">'+a.search_text+"</li>":"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.result_single_selected=null,this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.search_contains?"":"^",c=new RegExp(d+a,"i"),j=new RegExp(a,"i"),m=this.results_data,k=0,l=m.length;l>k;k++)b=m[k],b.search_match=!1,f=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(f=this.results_data[b.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(e+=1),b.search_match?(g.length&&(h=b.search_text.search(j),i=b.search_text.substr(0,h+g.length)+"</em>"+b.search_text.substr(h+g.length),b.search_text=i.substr(0,h)+"<em>"+i.substr(h)),null!=f&&(f.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(){var c,d;c=a(this),d=c.data("chosen"),"destroy"===b&&d?d.destroy():d||c.data("chosen",new Chosen(this,b))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(document).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b,c,d;return b=-(null!=(c=a.originalEvent)?c.wheelDelta:void 0)||(null!=(d=a.originialEvent)?d.detail:void 0),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(document).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){return this.container.is(a(b.target).closest(".chosen-container"))?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results())},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+b.html+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.form_field.options[0].selected=!0,this.selected_option_count=null,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c,d;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):(this.result_single_selected&&(this.result_single_selected.removeClass("result-selected"),d=this.result_single_selected[0].getAttribute("data-option-array-index"),this.results_data[d].selected=!1),this.result_single_selected=b),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c)},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}.call(this);
 
 
vendor/chosen/chosen.min.css DELETED
@@ -1,3 +0,0 @@
1
- /* Chosen v1.0.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
-
3
- .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:23px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(chosen-sprite.png) no-repeat 100% -20px;background:url(chosen-sprite.png) no-repeat 100% -20px,-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background:url(chosen-sprite.png) no-repeat 100% -20px,-webkit-linear-gradient(#eee 1%,#fff 15%);background:url(chosen-sprite.png) no-repeat 100% -20px,-moz-linear-gradient(#eee 1%,#fff 15%);background:url(chosen-sprite.png) no-repeat 100% -20px,-o-linear-gradient(#eee 1%,#fff 15%);background:url(chosen-sprite.png) no-repeat 100% -20px,linear-gradient(#eee 1%,#fff 15%);font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:5px;height:15px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#666;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-field .default{color:#999}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 0 3px 5px;padding:3px 20px 3px 5px;border:1px solid #aaa;border-radius:3px;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#111!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(chosen-sprite.png) no-repeat -30px -20px;background:url(chosen-sprite.png) no-repeat -30px -20px,-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background:url(chosen-sprite.png) no-repeat -30px -20px,-webkit-linear-gradient(#eee 1%,#fff 15%);background:url(chosen-sprite.png) no-repeat -30px -20px,-moz-linear-gradient(#eee 1%,#fff 15%);background:url(chosen-sprite.png) no-repeat -30px -20px,-o-linear-gradient(#eee 1%,#fff 15%);background:url(chosen-sprite.png) no-repeat -30px -20px,linear-gradient(#eee 1%,#fff 15%);direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:144dpi){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
 
 
 
vendor/codemirror/codemirror-compressed.css DELETED
@@ -1,659 +0,0 @@
1
- .CodeMirror{font-family:monospace;height:300px}
2
- .CodeMirror-scroll{overflow:auto}
3
- .CodeMirror-lines{padding:4px 0;}
4
- .CodeMirror pre{padding:0 4px;}
5
- .CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff;}
6
- .CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}
7
- .CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999}
8
- .CodeMirror div.CodeMirror-cursor{border-left:1px solid #000;z-index:3}
9
- .CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid #c0c0c0}
10
- .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}
11
- .cm-tab{display:inline-block}
12
- .cm-s-default .cm-keyword{color:#708}
13
- .cm-s-default .cm-atom{color:#219}
14
- .cm-s-default .cm-number{color:#164}
15
- .cm-s-default .cm-def{color:#00f}
16
- .cm-s-default .cm-variable{color:#000}
17
- .cm-s-default .cm-variable-2{color:#05a}
18
- .cm-s-default .cm-variable-3{color:#085}
19
- .cm-s-default .cm-property{color:#000}
20
- .cm-s-default .cm-operator{color:#000}
21
- .cm-s-default .cm-comment{color:#a50}
22
- .cm-s-default .cm-string{color:#a11}
23
- .cm-s-default .cm-string-2{color:#f50}
24
- .cm-s-default .cm-meta{color:#555}
25
- .cm-s-default .cm-error{color:#f00}
26
- .cm-s-default .cm-qualifier{color:#555}
27
- .cm-s-default .cm-builtin{color:#30a}
28
- .cm-s-default .cm-bracket{color:#997}
29
- .cm-s-default .cm-tag{color:#170}
30
- .cm-s-default .cm-attribute{color:#00c}
31
- .cm-s-default .cm-header{color:#00f}
32
- .cm-s-default .cm-quote{color:#090}
33
- .cm-s-default .cm-hr{color:#999}
34
- .cm-s-default .cm-link{color:#00c}
35
- .cm-negative{color:#d44}
36
- .cm-positive{color:#292}
37
- .cm-header,.cm-strong{font-weight:bold}
38
- .cm-em{font-style:italic}
39
- .cm-link{text-decoration:underline}
40
- .cm-invalidchar{color:#f00}
41
- div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}
42
- div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}
43
- .CodeMirror-activeline-background{background:#e8f2ff}
44
- .CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}
45
- .CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:none;position:relative}
46
- .CodeMirror-sizer{position:relative}
47
- .CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}
48
- .CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}
49
- .CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}
50
- .CodeMirror-scrollbar-filler{right:0;bottom:0}
51
- .CodeMirror-gutter-filler{left:0;bottom:0}
52
- .CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}
53
- .CodeMirror-gutter{white-space:normal;height:100%;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}
54
- .CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}
55
- .CodeMirror-lines{cursor:text}
56
- .CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}
57
- .CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}
58
- .CodeMirror-code pre{border-right:30px solid transparent;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}
59
- .CodeMirror-wrap .CodeMirror-code pre{border-right:none;width:auto}
60
- .CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}
61
- .CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}
62
- .CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}
63
- .CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}
64
- .CodeMirror-measure pre{position:static}
65
- .CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:none;width:0}
66
- .CodeMirror-focused div.CodeMirror-cursor{visibility:visible}
67
- .CodeMirror-selected{background:#d9d9d9}
68
- .CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}
69
- .cm-searching{background:#ffa;background:rgba(255,255,0,0.4)}
70
- .CodeMirror span{*vertical-align:text-bottom}
71
- @media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}}.cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}
72
- .cm-s-3024-day div.CodeMirror-selected{background:#d6d5d4 !important}
73
- .cm-s-3024-day .CodeMirror-gutters{background:#f7f7f7;border-right:0}
74
- .cm-s-3024-day .CodeMirror-linenumber{color:#807d7c}
75
- .cm-s-3024-day .CodeMirror-cursor{border-left:1px solid #5c5855 !important}
76
- .cm-s-3024-day span.cm-comment{color:#cdab53}
77
- .cm-s-3024-day span.cm-atom{color:#a16a94}
78
- .cm-s-3024-day span.cm-number{color:#a16a94}
79
- .cm-s-3024-day span.cm-property,.cm-s-3024-day span.cm-attribute{color:#01a252}
80
- .cm-s-3024-day span.cm-keyword{color:#db2d20}
81
- .cm-s-3024-day span.cm-string{color:#fded02}
82
- .cm-s-3024-day span.cm-variable{color:#01a252}
83
- .cm-s-3024-day span.cm-variable-2{color:#01a0e4}
84
- .cm-s-3024-day span.cm-def{color:#e8bbd0}
85
- .cm-s-3024-day span.cm-error{background:#db2d20;color:#5c5855}
86
- .cm-s-3024-day span.cm-bracket{color:#3a3432}
87
- .cm-s-3024-day span.cm-tag{color:#db2d20}
88
- .cm-s-3024-day span.cm-link{color:#a16a94}
89
- .cm-s-3024-day .CodeMirror-activeline-background{background:#e8f2ff !important}
90
- .cm-s-3024-day .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
91
- .cm-s-3024-night.CodeMirror{background:#090300;color:#d6d5d4}
92
- .cm-s-3024-night div.CodeMirror-selected{background:#3a3432 !important}
93
- .cm-s-3024-night .CodeMirror-gutters{background:#090300;border-right:0}
94
- .cm-s-3024-night .CodeMirror-linenumber{color:#5c5855}
95
- .cm-s-3024-night .CodeMirror-cursor{border-left:1px solid #807d7c !important}
96
- .cm-s-3024-night span.cm-comment{color:#cdab53}
97
- .cm-s-3024-night span.cm-atom{color:#a16a94}
98
- .cm-s-3024-night span.cm-number{color:#a16a94}
99
- .cm-s-3024-night span.cm-property,.cm-s-3024-night span.cm-attribute{color:#01a252}
100
- .cm-s-3024-night span.cm-keyword{color:#db2d20}
101
- .cm-s-3024-night span.cm-string{color:#fded02}
102
- .cm-s-3024-night span.cm-variable{color:#01a252}
103
- .cm-s-3024-night span.cm-variable-2{color:#01a0e4}
104
- .cm-s-3024-night span.cm-def{color:#e8bbd0}
105
- .cm-s-3024-night span.cm-error{background:#db2d20;color:#807d7c}
106
- .cm-s-3024-night span.cm-bracket{color:#d6d5d4}
107
- .cm-s-3024-night span.cm-tag{color:#db2d20}
108
- .cm-s-3024-night span.cm-link{color:#a16a94}
109
- .cm-s-3024-night .CodeMirror-activeline-background{background:#2f2f2f !important}
110
- .cm-s-3024-night .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
111
- .cm-s-ambiance .cm-keyword{color:#cda869}
112
- .cm-s-ambiance .cm-atom{color:#cf7ea9}
113
- .cm-s-ambiance .cm-number{color:#78cf8a}
114
- .cm-s-ambiance .cm-def{color:#aac6e3}
115
- .cm-s-ambiance .cm-variable{color:#ffb795}
116
- .cm-s-ambiance .cm-variable-2{color:#eed1b3}
117
- .cm-s-ambiance .cm-variable-3{color:#faded3}
118
- .cm-s-ambiance .cm-property{color:#eed1b3}
119
- .cm-s-ambiance .cm-operator{color:#fa8d6a}
120
- .cm-s-ambiance .cm-comment{color:#555;font-style:italic}
121
- .cm-s-ambiance .cm-string{color:#8f9d6a}
122
- .cm-s-ambiance .cm-string-2{color:#9d937c}
123
- .cm-s-ambiance .cm-meta{color:#d2a8a1}
124
- .cm-s-ambiance .cm-error{color:#af2018}
125
- .cm-s-ambiance .cm-qualifier{color:#ff0}
126
- .cm-s-ambiance .cm-builtin{color:#99c}
127
- .cm-s-ambiance .cm-bracket{color:#24c2c7}
128
- .cm-s-ambiance .cm-tag{color:#fee4ff}
129
- .cm-s-ambiance .cm-attribute{color:#9b859d}
130
- .cm-s-ambiance .cm-header{color:#00f}
131
- .cm-s-ambiance .cm-quote{color:#24c2c7}
132
- .cm-s-ambiance .cm-hr{color:#ffc0cb}
133
- .cm-s-ambiance .cm-link{color:#f4c20b}
134
- .cm-s-ambiance .cm-special{color:#ff9d00}
135
- .cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0}
136
- .cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22}
137
- .cm-s-ambiance .CodeMirror-selected{background:rgba(255,255,255,0.15)}
138
- .cm-s-ambiance .CodeMirror-focused .CodeMirror-selected{background:rgba(255,255,255,0.1)}
139
- .cm-s-ambiance.CodeMirror{line-height:1.4em;font-family:Monaco,Menlo,"Andale Mono","lucida console","Courier New",monospace !important;color:#e6e1dc;background-color:#202020;-webkit-box-shadow:inset 0 0 10px #000;-moz-box-shadow:inset 0 0 10px #000;box-shadow:inset 0 0 10px #000}
140
- .cm-s-ambiance .CodeMirror-gutters{background:#3d3d3d;border-right:1px solid #4d4d4d;box-shadow:0 10px 20px #000}
141
- .cm-s-ambiance .CodeMirror-linenumber{text-shadow:0 1px 1px #4d4d4d;color:#222;padding:0 5px}
142
- .cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor{border-left:1px solid #7991e8}
143
- .cm-s-ambiance .CodeMirror-activeline-background{background:none repeat scroll 0 0 rgba(255,255,255,0.031)}
144
- .cm-s-ambiance.CodeMirror,.cm-s-ambiance .CodeMirror-gutters{background-image:url("data:image/png;base64,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")}
145
- .cm-s-base16-dark.CodeMirror{background:#151515;color:#e0e0e0}
146
- .cm-s-base16-dark div.CodeMirror-selected{background:#202020 !important}
147
- .cm-s-base16-dark .CodeMirror-gutters{background:#151515;border-right:0}
148
- .cm-s-base16-dark .CodeMirror-linenumber{color:#505050}
149
- .cm-s-base16-dark .CodeMirror-cursor{border-left:1px solid #b0b0b0 !important}
150
- .cm-s-base16-dark span.cm-comment{color:#8f5536}
151
- .cm-s-base16-dark span.cm-atom{color:#aa759f}
152
- .cm-s-base16-dark span.cm-number{color:#aa759f}
153
- .cm-s-base16-dark span.cm-property,.cm-s-base16-dark span.cm-attribute{color:#90a959}
154
- .cm-s-base16-dark span.cm-keyword{color:#ac4142}
155
- .cm-s-base16-dark span.cm-string{color:#f4bf75}
156
- .cm-s-base16-dark span.cm-variable{color:#90a959}
157
- .cm-s-base16-dark span.cm-variable-2{color:#6a9fb5}
158
- .cm-s-base16-dark span.cm-def{color:#d28445}
159
- .cm-s-base16-dark span.cm-error{background:#ac4142;color:#b0b0b0}
160
- .cm-s-base16-dark span.cm-bracket{color:#e0e0e0}
161
- .cm-s-base16-dark span.cm-tag{color:#ac4142}
162
- .cm-s-base16-dark span.cm-link{color:#aa759f}
163
- .cm-s-base16-dark .CodeMirror-activeline-background{background:#2f2f2f !important}
164
- .cm-s-base16-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
165
- .cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}
166
- .cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0 !important}
167
- .cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}
168
- .cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}
169
- .cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050 !important}
170
- .cm-s-base16-light span.cm-comment{color:#8f5536}
171
- .cm-s-base16-light span.cm-atom{color:#aa759f}
172
- .cm-s-base16-light span.cm-number{color:#aa759f}
173
- .cm-s-base16-light span.cm-property,.cm-s-base16-light span.cm-attribute{color:#90a959}
174
- .cm-s-base16-light span.cm-keyword{color:#ac4142}
175
- .cm-s-base16-light span.cm-string{color:#f4bf75}
176
- .cm-s-base16-light span.cm-variable{color:#90a959}
177
- .cm-s-base16-light span.cm-variable-2{color:#6a9fb5}
178
- .cm-s-base16-light span.cm-def{color:#d28445}
179
- .cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}
180
- .cm-s-base16-light span.cm-bracket{color:#202020}
181
- .cm-s-base16-light span.cm-tag{color:#ac4142}
182
- .cm-s-base16-light span.cm-link{color:#aa759f}
183
- .cm-s-base16-light .CodeMirror-activeline-background{background:#dddcdc !important}
184
- .cm-s-base16-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
185
- .cm-s-blackboard.CodeMirror{background:#0c1021;color:#f8f8f8}
186
- .cm-s-blackboard .CodeMirror-selected{background:#253b76 !important}
187
- .cm-s-blackboard .CodeMirror-gutters{background:#0c1021;border-right:0}
188
- .cm-s-blackboard .CodeMirror-linenumber{color:#888}
189
- .cm-s-blackboard .CodeMirror-cursor{border-left:1px solid #a7a7a7 !important}
190
- .cm-s-blackboard .cm-keyword{color:#fbde2d}
191
- .cm-s-blackboard .cm-atom{color:#d8fa3c}
192
- .cm-s-blackboard .cm-number{color:#d8fa3c}
193
- .cm-s-blackboard .cm-def{color:#8da6ce}
194
- .cm-s-blackboard .cm-variable{color:#ff6400}
195
- .cm-s-blackboard .cm-operator{color:#fbde2d}
196
- .cm-s-blackboard .cm-comment{color:#aeaeae}
197
- .cm-s-blackboard .cm-string{color:#61ce3c}
198
- .cm-s-blackboard .cm-string-2{color:#61ce3c}
199
- .cm-s-blackboard .cm-meta{color:#d8fa3c}
200
- .cm-s-blackboard .cm-error{background:#9d1e15;color:#f8f8f8}
201
- .cm-s-blackboard .cm-builtin{color:#8da6ce}
202
- .cm-s-blackboard .cm-tag{color:#8da6ce}
203
- .cm-s-blackboard .cm-attribute{color:#8da6ce}
204
- .cm-s-blackboard .cm-header{color:#ff6400}
205
- .cm-s-blackboard .cm-hr{color:#aeaeae}
206
- .cm-s-blackboard .cm-link{color:#8da6ce}
207
- .cm-s-blackboard .CodeMirror-activeline-background{background:#3c3636 !important}
208
- .cm-s-blackboard .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
209
- .cm-s-cobalt.CodeMirror{background:#002240;color:#fff}
210
- .cm-s-cobalt div.CodeMirror-selected{background:#b36539 !important}
211
- .cm-s-cobalt .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}
212
- .cm-s-cobalt .CodeMirror-linenumber{color:#d0d0d0}
213
- .cm-s-cobalt .CodeMirror-cursor{border-left:1px solid #fff !important}
214
- .cm-s-cobalt span.cm-comment{color:#08f}
215
- .cm-s-cobalt span.cm-atom{color:#845dc4}
216
- .cm-s-cobalt span.cm-number,.cm-s-cobalt span.cm-attribute{color:#ff80e1}
217
- .cm-s-cobalt span.cm-keyword{color:#ffee80}
218
- .cm-s-cobalt span.cm-string{color:#3ad900}
219
- .cm-s-cobalt span.cm-meta{color:#ff9d00}
220
- .cm-s-cobalt span.cm-variable-2,.cm-s-cobalt span.cm-tag{color:#9effff}
221
- .cm-s-cobalt span.cm-variable-3,.cm-s-cobalt span.cm-def{color:#fff}
222
- .cm-s-cobalt span.cm-error{color:#9d1e15}
223
- .cm-s-cobalt span.cm-bracket{color:#d8d8d8}
224
- .cm-s-cobalt span.cm-builtin,.cm-s-cobalt span.cm-special{color:#ff9e59}
225
- .cm-s-cobalt span.cm-link{color:#845dc4}
226
- .cm-s-cobalt .CodeMirror-activeline-background{background:#002d57 !important}
227
- .cm-s-cobalt .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
228
- .cm-s-eclipse span.cm-meta{color:#ff1717}
229
- .cm-s-eclipse span.cm-keyword{line-height:1em;font-weight:bold;color:#7f0055}
230
- .cm-s-eclipse span.cm-atom{color:#219}
231
- .cm-s-eclipse span.cm-number{color:#164}
232
- .cm-s-eclipse span.cm-def{color:#00f}
233
- .cm-s-eclipse span.cm-variable{color:#000}
234
- .cm-s-eclipse span.cm-variable-2{color:#0000c0}
235
- .cm-s-eclipse span.cm-variable-3{color:#0000c0}
236
- .cm-s-eclipse span.cm-property{color:#000}
237
- .cm-s-eclipse span.cm-operator{color:#000}
238
- .cm-s-eclipse span.cm-comment{color:#3f7f5f}
239
- .cm-s-eclipse span.cm-string{color:#2a00ff}
240
- .cm-s-eclipse span.cm-string-2{color:#f50}
241
- .cm-s-eclipse span.cm-error{color:#f00}
242
- .cm-s-eclipse span.cm-qualifier{color:#555}
243
- .cm-s-eclipse span.cm-builtin{color:#30a}
244
- .cm-s-eclipse span.cm-bracket{color:#cc7}
245
- .cm-s-eclipse span.cm-tag{color:#170}
246
- .cm-s-eclipse span.cm-attribute{color:#00c}
247
- .cm-s-eclipse span.cm-link{color:#219}
248
- .cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff !important}
249
- .cm-s-eclipse .CodeMirror-matchingbracket{outline:1px solid #808080;color:#000 !important}
250
- .cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string,.cm-s-elegant span.cm-atom{color:#762}
251
- .cm-s-elegant span.cm-comment{color:#262;font-style:italic;line-height:1em}
252
- .cm-s-elegant span.cm-meta{color:#555;font-style:italic;line-height:1em}
253
- .cm-s-elegant span.cm-variable{color:#000}
254
- .cm-s-elegant span.cm-variable-2{color:#b11}
255
- .cm-s-elegant span.cm-qualifier{color:#555}
256
- .cm-s-elegant span.cm-keyword{color:#730}
257
- .cm-s-elegant span.cm-builtin{color:#30a}
258
- .cm-s-elegant span.cm-error{background-color:#fdd}
259
- .cm-s-elegant span.cm-link{color:#762}
260
- .cm-s-elegant .CodeMirror-activeline-background{background:#e8f2ff !important}
261
- .cm-s-elegant .CodeMirror-matchingbracket{outline:1px solid #808080;color:#000 !important}
262
- .cm-s-erlang-dark.CodeMirror{background:#002240;color:#fff}
263
- .cm-s-erlang-dark div.CodeMirror-selected{background:#b36539 !important}
264
- .cm-s-erlang-dark .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}
265
- .cm-s-erlang-dark .CodeMirror-linenumber{color:#d0d0d0}
266
- .cm-s-erlang-dark .CodeMirror-cursor{border-left:1px solid #fff !important}
267
- .cm-s-erlang-dark span.cm-atom{color:#f133f1}
268
- .cm-s-erlang-dark span.cm-attribute{color:#ff80e1}
269
- .cm-s-erlang-dark span.cm-bracket{color:#ff9d00}
270
- .cm-s-erlang-dark span.cm-builtin{color:#eaa}
271
- .cm-s-erlang-dark span.cm-comment{color:#77f}
272
- .cm-s-erlang-dark span.cm-def{color:#e7a}
273
- .cm-s-erlang-dark span.cm-error{color:#9d1e15}
274
- .cm-s-erlang-dark span.cm-keyword{color:#ffee80}
275
- .cm-s-erlang-dark span.cm-meta{color:#50fefe}
276
- .cm-s-erlang-dark span.cm-number{color:#ffd0d0}
277
- .cm-s-erlang-dark span.cm-operator{color:#d55}
278
- .cm-s-erlang-dark span.cm-property{color:#ccc}
279
- .cm-s-erlang-dark span.cm-qualifier{color:#ccc}
280
- .cm-s-erlang-dark span.cm-quote{color:#ccc}
281
- .cm-s-erlang-dark span.cm-special{color:#fbb}
282
- .cm-s-erlang-dark span.cm-string{color:#3ad900}
283
- .cm-s-erlang-dark span.cm-string-2{color:#ccc}
284
- .cm-s-erlang-dark span.cm-tag{color:#9effff}
285
- .cm-s-erlang-dark span.cm-variable{color:#50fe50}
286
- .cm-s-erlang-dark span.cm-variable-2{color:#e0e}
287
- .cm-s-erlang-dark span.cm-variable-3{color:#ccc}
288
- .cm-s-erlang-dark .CodeMirror-activeline-background{background:#013461 !important}
289
- .cm-s-erlang-dark .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
290
- .cm-s-lesser-dark{line-height:1.3em}
291
- .cm-s-lesser-dark{font-family:'Bitstream Vera Sans Mono','DejaVu Sans Mono','Monaco',Courier,monospace !important}
292
- .cm-s-lesser-dark.CodeMirror{background:#262626;color:#ebefe7;text-shadow:0 -1px 1px #262626}
293
- .cm-s-lesser-dark div.CodeMirror-selected{background:#45443b !important}
294
- .cm-s-lesser-dark .CodeMirror-cursor{border-left:1px solid #fff !important}
295
- .cm-s-lesser-dark pre{padding:0 8px}
296
- .cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket{color:#7efc7e}
297
- .cm-s-lesser-dark .CodeMirror-gutters{background:#262626;border-right:1px solid #aaa}
298
- .cm-s-lesser-dark .CodeMirror-linenumber{color:#777}
299
- .cm-s-lesser-dark span.cm-keyword{color:#599eff}
300
- .cm-s-lesser-dark span.cm-atom{color:#c2b470}
301
- .cm-s-lesser-dark span.cm-number{color:#b35e4d}
302
- .cm-s-lesser-dark span.cm-def{color:#fff}
303
- .cm-s-lesser-dark span.cm-variable{color:#d9bf8c}
304
- .cm-s-lesser-dark span.cm-variable-2{color:#669199}
305
- .cm-s-lesser-dark span.cm-variable-3{color:#fff}
306
- .cm-s-lesser-dark span.cm-property{color:#92a75c}
307
- .cm-s-lesser-dark span.cm-operator{color:#92a75c}
308
- .cm-s-lesser-dark span.cm-comment{color:#666}
309
- .cm-s-lesser-dark span.cm-string{color:#bcd279}
310
- .cm-s-lesser-dark span.cm-string-2{color:#f50}
311
- .cm-s-lesser-dark span.cm-meta{color:#738c73}
312
- .cm-s-lesser-dark span.cm-error{color:#9d1e15}
313
- .cm-s-lesser-dark span.cm-qualifier{color:#555}
314
- .cm-s-lesser-dark span.cm-builtin{color:#ff9e59}
315
- .cm-s-lesser-dark span.cm-bracket{color:#ebefe7}
316
- .cm-s-lesser-dark span.cm-tag{color:#669199}
317
- .cm-s-lesser-dark span.cm-attribute{color:#00c}
318
- .cm-s-lesser-dark span.cm-header{color:#a0a}
319
- .cm-s-lesser-dark span.cm-quote{color:#090}
320
- .cm-s-lesser-dark span.cm-hr{color:#999}
321
- .cm-s-lesser-dark span.cm-link{color:#00c}
322
- .cm-s-lesser-dark .CodeMirror-activeline-background{background:#3c3a3a !important}
323
- .cm-s-lesser-dark .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
324
- .cm-s-midnight span.CodeMirror-matchhighlight{background:#494949}
325
- .cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight{background:#314d67 !important}
326
- .cm-s-midnight .CodeMirror-activeline-background{background:#253540 !important}
327
- .cm-s-midnight.CodeMirror{background:#0f192a;color:#d1edff}
328
- .cm-s-midnight.CodeMirror{border-top:1px solid #000;border-bottom:1px solid #000}
329
- .cm-s-midnight div.CodeMirror-selected{background:#314d67 !important}
330
- .cm-s-midnight .CodeMirror-gutters{background:#0f192a;border-right:1px solid}
331
- .cm-s-midnight .CodeMirror-linenumber{color:#d0d0d0}
332
- .cm-s-midnight .CodeMirror-cursor{border-left:1px solid #f8f8f0 !important}
333
- .cm-s-midnight span.cm-comment{color:#428bdd}
334
- .cm-s-midnight span.cm-atom{color:#ae81ff}
335
- .cm-s-midnight span.cm-number{color:#d1edff}
336
- .cm-s-midnight span.cm-property,.cm-s-midnight span.cm-attribute{color:#a6e22e}
337
- .cm-s-midnight span.cm-keyword{color:#e83737}
338
- .cm-s-midnight span.cm-string{color:#1dc116}
339
- .cm-s-midnight span.cm-variable{color:#ffaa3e}
340
- .cm-s-midnight span.cm-variable-2{color:#ffaa3e}
341
- .cm-s-midnight span.cm-def{color:#4dd}
342
- .cm-s-midnight span.cm-error{background:#f92672;color:#f8f8f0}
343
- .cm-s-midnight span.cm-bracket{color:#d1edff}
344
- .cm-s-midnight span.cm-tag{color:#449}
345
- .cm-s-midnight span.cm-link{color:#ae81ff}
346
- .cm-s-midnight .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
347
- .cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}
348
- .cm-s-monokai div.CodeMirror-selected{background:#49483e !important}
349
- .cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0}
350
- .cm-s-monokai .CodeMirror-linenumber{color:#d0d0d0}
351
- .cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0 !important}
352
- .cm-s-monokai span.cm-comment{color:#75715e}
353
- .cm-s-monokai span.cm-atom{color:#ae81ff}
354
- .cm-s-monokai span.cm-number{color:#ae81ff}
355
- .cm-s-monokai span.cm-property,.cm-s-monokai span.cm-attribute{color:#a6e22e}
356
- .cm-s-monokai span.cm-keyword{color:#f92672}
357
- .cm-s-monokai span.cm-string{color:#e6db74}
358
- .cm-s-monokai span.cm-variable{color:#a6e22e}
359
- .cm-s-monokai span.cm-variable-2{color:#9effff}
360
- .cm-s-monokai span.cm-def{color:#fd971f}
361
- .cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0}
362
- .cm-s-monokai span.cm-bracket{color:#f8f8f2}
363
- .cm-s-monokai span.cm-tag{color:#f92672}
364
- .cm-s-monokai span.cm-link{color:#ae81ff}
365
- .cm-s-monokai .CodeMirror-activeline-background{background:#373831 !important}
366
- .cm-s-monokai .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
367
- .cm-s-neat span.cm-comment{color:#a86}
368
- .cm-s-neat span.cm-keyword{line-height:1em;font-weight:bold;color:#00f}
369
- .cm-s-neat span.cm-string{color:#a22}
370
- .cm-s-neat span.cm-builtin{line-height:1em;font-weight:bold;color:#077}
371
- .cm-s-neat span.cm-special{line-height:1em;font-weight:bold;color:#0aa}
372
- .cm-s-neat span.cm-variable{color:#000}
373
- .cm-s-neat span.cm-number,.cm-s-neat span.cm-atom{color:#3a3}
374
- .cm-s-neat span.cm-meta{color:#555}
375
- .cm-s-neat span.cm-link{color:#3a3}
376
- .cm-s-neat .CodeMirror-activeline-background{background:#e8f2ff !important}
377
- .cm-s-neat .CodeMirror-matchingbracket{outline:1px solid #808080;color:#000 !important}
378
- .cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}
379
- .cm-s-night div.CodeMirror-selected{background:#447 !important}
380
- .cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}
381
- .cm-s-night .CodeMirror-linenumber{color:#f8f8f8}
382
- .cm-s-night .CodeMirror-cursor{border-left:1px solid #fff !important}
383
- .cm-s-night span.cm-comment{color:#6900a1}
384
- .cm-s-night span.cm-atom{color:#845dc4}
385
- .cm-s-night span.cm-number,.cm-s-night span.cm-attribute{color:#ffd500}
386
- .cm-s-night span.cm-keyword{color:#599eff}
387
- .cm-s-night span.cm-string{color:#37f14a}
388
- .cm-s-night span.cm-meta{color:#7678e2}
389
- .cm-s-night span.cm-variable-2,.cm-s-night span.cm-tag{color:#99b2ff}
390
- .cm-s-night span.cm-variable-3,.cm-s-night span.cm-def{color:#fff}
391
- .cm-s-night span.cm-error{color:#9d1e15}
392
- .cm-s-night span.cm-bracket{color:#8da6ce}
393
- .cm-s-night span.cm-comment{color:#6900a1}
394
- .cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}
395
- .cm-s-night span.cm-link{color:#845dc4}
396
- .cm-s-night .CodeMirror-activeline-background{background:#1c005a !important}
397
- .cm-s-night .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
398
- .cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}
399
- .cm-s-paraiso-dark div.CodeMirror-selected{background:#41323f !important}
400
- .cm-s-paraiso-dark .CodeMirror-gutters{background:#2f1e2e;border-right:0}
401
- .cm-s-paraiso-dark .CodeMirror-linenumber{color:#776e71}
402
- .cm-s-paraiso-dark .CodeMirror-cursor{border-left:1px solid #8d8687 !important}
403
- .cm-s-paraiso-dark span.cm-comment{color:#e96ba8}
404
- .cm-s-paraiso-dark span.cm-atom{color:#815ba4}
405
- .cm-s-paraiso-dark span.cm-number{color:#815ba4}
406
- .cm-s-paraiso-dark span.cm-property,.cm-s-paraiso-dark span.cm-attribute{color:#48b685}
407
- .cm-s-paraiso-dark span.cm-keyword{color:#ef6155}
408
- .cm-s-paraiso-dark span.cm-string{color:#fec418}
409
- .cm-s-paraiso-dark span.cm-variable{color:#48b685}
410
- .cm-s-paraiso-dark span.cm-variable-2{color:#06b6ef}
411
- .cm-s-paraiso-dark span.cm-def{color:#f99b15}
412
- .cm-s-paraiso-dark span.cm-error{background:#ef6155;color:#8d8687}
413
- .cm-s-paraiso-dark span.cm-bracket{color:#b9b6b0}
414
- .cm-s-paraiso-dark span.cm-tag{color:#ef6155}
415
- .cm-s-paraiso-dark span.cm-link{color:#815ba4}
416
- .cm-s-paraiso-dark .CodeMirror-activeline-background{background:#4d344a !important}
417
- .cm-s-paraiso-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
418
- .cm-s-paraiso-light.CodeMirror{background:#e7e9db;color:#41323f}
419
- .cm-s-paraiso-light div.CodeMirror-selected{background:#b9b6b0 !important}
420
- .cm-s-paraiso-light .CodeMirror-gutters{background:#e7e9db;border-right:0}
421
- .cm-s-paraiso-light .CodeMirror-linenumber{color:#8d8687}
422
- .cm-s-paraiso-light .CodeMirror-cursor{border-left:1px solid #776e71 !important}
423
- .cm-s-paraiso-light span.cm-comment{color:#e96ba8}
424
- .cm-s-paraiso-light span.cm-atom{color:#815ba4}
425
- .cm-s-paraiso-light span.cm-number{color:#815ba4}
426
- .cm-s-paraiso-light span.cm-property,.cm-s-paraiso-light span.cm-attribute{color:#48b685}
427
- .cm-s-paraiso-light span.cm-keyword{color:#ef6155}
428
- .cm-s-paraiso-light span.cm-string{color:#fec418}
429
- .cm-s-paraiso-light span.cm-variable{color:#48b685}
430
- .cm-s-paraiso-light span.cm-variable-2{color:#06b6ef}
431
- .cm-s-paraiso-light span.cm-def{color:#f99b15}
432
- .cm-s-paraiso-light span.cm-error{background:#ef6155;color:#776e71}
433
- .cm-s-paraiso-light span.cm-bracket{color:#41323f}
434
- .cm-s-paraiso-light span.cm-tag{color:#ef6155}
435
- .cm-s-paraiso-light span.cm-link{color:#815ba4}
436
- .cm-s-paraiso-light .CodeMirror-activeline-background{background:#cfd1c4 !important}
437
- .cm-s-paraiso-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
438
- .cm-s-rubyblue{font-family:Trebuchet,Verdana,sans-serif}
439
- .cm-s-rubyblue.CodeMirror{background:#112435;color:#fff}
440
- .cm-s-rubyblue div.CodeMirror-selected{background:#38566f !important}
441
- .cm-s-rubyblue .CodeMirror-gutters{background:#1f4661;border-right:7px solid #3e7087}
442
- .cm-s-rubyblue .CodeMirror-linenumber{color:#fff}
443
- .cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff !important}
444
- .cm-s-rubyblue span.cm-comment{color:#999;font-style:italic;line-height:1em}
445
- .cm-s-rubyblue span.cm-atom{color:#f4c20b}
446
- .cm-s-rubyblue span.cm-number,.cm-s-rubyblue span.cm-attribute{color:#82c6e0}
447
- .cm-s-rubyblue span.cm-keyword{color:#f0f}
448
- .cm-s-rubyblue span.cm-string{color:#f08047}
449
- .cm-s-rubyblue span.cm-meta{color:#f0f}
450
- .cm-s-rubyblue span.cm-variable-2,.cm-s-rubyblue span.cm-tag{color:#7bd827}
451
- .cm-s-rubyblue span.cm-variable-3,.cm-s-rubyblue span.cm-def{color:#fff}
452
- .cm-s-rubyblue span.cm-error{color:#af2018}
453
- .cm-s-rubyblue span.cm-bracket{color:#f0f}
454
- .cm-s-rubyblue span.cm-link{color:#f4c20b}
455
- .cm-s-rubyblue span.CodeMirror-matchingbracket{color:#f0f !important}
456
- .cm-s-rubyblue span.cm-builtin,.cm-s-rubyblue span.cm-special{color:#ff9d00}
457
- .cm-s-rubyblue .CodeMirror-activeline-background{background:#173047 !important}
458
- .solarized.base03{color:#002b36}
459
- .solarized.base02{color:#073642}
460
- .solarized.base01{color:#586e75}
461
- .solarized.base00{color:#657b83}
462
- .solarized.base0{color:#839496}
463
- .solarized.base1{color:#93a1a1}
464
- .solarized.base2{color:#eee8d5}
465
- .solarized.base3{color:#fdf6e3}
466
- .solarized.solar-yellow{color:#b58900}
467
- .solarized.solar-orange{color:#cb4b16}
468
- .solarized.solar-red{color:#dc322f}
469
- .solarized.solar-magenta{color:#d33682}
470
- .solarized.solar-violet{color:#6c71c4}
471
- .solarized.solar-blue{color:#268bd2}
472
- .solarized.solar-cyan{color:#2aa198}
473
- .solarized.solar-green{color:#859900}
474
- .cm-s-solarized{line-height:1.45em;font-family:Menlo,Monaco,"Andale Mono","lucida console","Courier New",monospace !important;color-profile:sRGB;rendering-intent:auto}
475
- .cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}
476
- .cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}
477
- .cm-s-solarized .CodeMirror-widget{text-shadow:none}
478
- .cm-s-solarized .cm-keyword{color:#cb4b16}
479
- .cm-s-solarized .cm-atom{color:#d33682}
480
- .cm-s-solarized .cm-number{color:#d33682}
481
- .cm-s-solarized .cm-def{color:#2aa198}
482
- .cm-s-solarized .cm-variable{color:#268bd2}
483
- .cm-s-solarized .cm-variable-2{color:#b58900}
484
- .cm-s-solarized .cm-variable-3{color:#6c71c4}
485
- .cm-s-solarized .cm-property{color:#2aa198}
486
- .cm-s-solarized .cm-operator{color:#6c71c4}
487
- .cm-s-solarized .cm-comment{color:#586e75;font-style:italic}
488
- .cm-s-solarized .cm-string{color:#859900}
489
- .cm-s-solarized .cm-string-2{color:#b58900}
490
- .cm-s-solarized .cm-meta{color:#859900}
491
- .cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}
492
- .cm-s-solarized .cm-qualifier{color:#b58900}
493
- .cm-s-solarized .cm-builtin{color:#d33682}
494
- .cm-s-solarized .cm-bracket{color:#cb4b16}
495
- .cm-s-solarized .CodeMirror-matchingbracket{color:#859900}
496
- .cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}
497
- .cm-s-solarized .cm-tag{color:#93a1a1}
498
- .cm-s-solarized .cm-attribute{color:#2aa198}
499
- .cm-s-solarized .cm-header{color:#586e75}
500
- .cm-s-solarized .cm-quote{color:#93a1a1}
501
- .cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}
502
- .cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}
503
- .cm-s-solarized .cm-special{color:#6c71c4}
504
- .cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}
505
- .cm-s-solarized .cm-strong{color:#eee}
506
- .cm-s-solarized .cm-tab:before{content:"➤";color:#586e75}
507
- .cm-s-solarized.cm-s-dark .CodeMirror-focused .CodeMirror-selected{background:#386774;color:inherit}
508
- .cm-s-solarized.cm-s-dark ::selection{background:#386774;color:inherit}
509
- .cm-s-solarized.cm-s-dark .CodeMirror-selected{background:#586e75}
510
- .cm-s-solarized.cm-s-light .CodeMirror-focused .CodeMirror-selected{background:#eee8d5;color:inherit}
511
- .cm-s-solarized.cm-s-light ::selection{background:#eee8d5;color:inherit}
512
- .cm-s-solarized.cm-s-light .CodeMirror-selected{background:#93a1a1}
513
- .cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}
514
- .cm-s-solarized .CodeMirror-gutters{padding:0 15px 0 10px;box-shadow:0 10px 20px #000;border-right:1px solid}
515
- .cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642;border-color:#00232c}
516
- .cm-s-solarized.cm-s-dark .CodeMirror-linenumber{text-shadow:#021014 0 -1px}
517
- .cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5;border-color:#eee8d5}
518
- .cm-s-solarized .CodeMirror-linenumber{color:#586e75}
519
- .cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}
520
- .cm-s-solarized .CodeMirror-lines{padding-left:5px}
521
- .cm-s-solarized .CodeMirror-lines .CodeMirror-cursor{border-left:1px solid #819090}
522
- .cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:rgba(255,255,255,0.05)}
523
- .cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,0.05)}
524
- .cm-s-solarized.CodeMirror,.cm-s-solarized .CodeMirror-gutters{background-image:url("data:image/png;base64,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")}
525
- .cm-s-the-matrix.CodeMirror{background:#000;color:#0f0}
526
- .cm-s-the-matrix span.CodeMirror-selected{background:#a8f !important}
527
- .cm-s-the-matrix .CodeMirror-gutters{background:#060;border-right:2px solid #0f0}
528
- .cm-s-the-matrix .CodeMirror-linenumber{color:#fff}
529
- .cm-s-the-matrix .CodeMirror-cursor{border-left:1px solid #0f0 !important}
530
- .cm-s-the-matrix span.cm-keyword{color:#008803;font-weight:bold}
531
- .cm-s-the-matrix span.cm-atom{color:#3ff}
532
- .cm-s-the-matrix span.cm-number{color:#ffb94f}
533
- .cm-s-the-matrix span.cm-def{color:#99c}
534
- .cm-s-the-matrix span.cm-variable{color:#f6c}
535
- .cm-s-the-matrix span.cm-variable-2{color:#c6f}
536
- .cm-s-the-matrix span.cm-variable-3{color:#96f}
537
- .cm-s-the-matrix span.cm-property{color:#62ffa0}
538
- .cm-s-the-matrix span.cm-operator{color:#999}
539
- .cm-s-the-matrix span.cm-comment{color:#ccc}
540
- .cm-s-the-matrix span.cm-string{color:#39c}
541
- .cm-s-the-matrix span.cm-meta{color:#c9f}
542
- .cm-s-the-matrix span.cm-error{color:#f00}
543
- .cm-s-the-matrix span.cm-qualifier{color:#fff700}
544
- .cm-s-the-matrix span.cm-builtin{color:#30a}
545
- .cm-s-the-matrix span.cm-bracket{color:#cc7}
546
- .cm-s-the-matrix span.cm-tag{color:#ffbd40}
547
- .cm-s-the-matrix span.cm-attribute{color:#fff700}
548
- .cm-s-the-matrix .CodeMirror-activeline-background{background:#040}
549
- .cm-s-tomorrow-night-eighties.CodeMirror{background:#000;color:#ccc}
550
- .cm-s-tomorrow-night-eighties div.CodeMirror-selected{background:#2d2d2d !important}
551
- .cm-s-tomorrow-night-eighties .CodeMirror-gutters{background:#000;border-right:0}
552
- .cm-s-tomorrow-night-eighties .CodeMirror-linenumber{color:#515151}
553
- .cm-s-tomorrow-night-eighties .CodeMirror-cursor{border-left:1px solid #6a6a6a !important}
554
- .cm-s-tomorrow-night-eighties span.cm-comment{color:#d27b53}
555
- .cm-s-tomorrow-night-eighties span.cm-atom{color:#a16a94}
556
- .cm-s-tomorrow-night-eighties span.cm-number{color:#a16a94}
557
- .cm-s-tomorrow-night-eighties span.cm-property,.cm-s-tomorrow-night-eighties span.cm-attribute{color:#9c9}
558
- .cm-s-tomorrow-night-eighties span.cm-keyword{color:#f2777a}
559
- .cm-s-tomorrow-night-eighties span.cm-string{color:#fc6}
560
- .cm-s-tomorrow-night-eighties span.cm-variable{color:#9c9}
561
- .cm-s-tomorrow-night-eighties span.cm-variable-2{color:#69c}
562
- .cm-s-tomorrow-night-eighties span.cm-def{color:#f99157}
563
- .cm-s-tomorrow-night-eighties span.cm-error{background:#f2777a;color:#6a6a6a}
564
- .cm-s-tomorrow-night-eighties span.cm-bracket{color:#ccc}
565
- .cm-s-tomorrow-night-eighties span.cm-tag{color:#f2777a}
566
- .cm-s-tomorrow-night-eighties span.cm-link{color:#a16a94}
567
- .cm-s-tomorrow-night-eighties .CodeMirror-activeline-background{background:#343600 !important}
568
- .cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket{text-decoration:underline;color:#fff !important}
569
- .cm-s-twilight.CodeMirror{background:#141414;color:#f7f7f7}
570
- .cm-s-twilight .CodeMirror-selected{background:#323232 !important}
571
- .cm-s-twilight .CodeMirror-gutters{background:#222;border-right:1px solid #aaa}
572
- .cm-s-twilight .CodeMirror-linenumber{color:#aaa}
573
- .cm-s-twilight .CodeMirror-cursor{border-left:1px solid #fff !important}
574
- .cm-s-twilight .cm-keyword{color:#f9ee98}
575
- .cm-s-twilight .cm-atom{color:#fc0}
576
- .cm-s-twilight .cm-number{color:#ca7841}
577
- .cm-s-twilight .cm-def{color:#8da6ce}
578
- .cm-s-twilight span.cm-variable-2,.cm-s-twilight span.cm-tag{color:#607392}
579
- .cm-s-twilight span.cm-variable-3,.cm-s-twilight span.cm-def{color:#607392}
580
- .cm-s-twilight .cm-operator{color:#cda869}
581
- .cm-s-twilight .cm-comment{color:#777;font-style:italic;font-weight:normal}
582
- .cm-s-twilight .cm-string{color:#8f9d6a;font-style:italic}
583
- .cm-s-twilight .cm-string-2{color:#bd6b18}
584
- .cm-s-twilight .cm-meta{background-color:#141414;color:#f7f7f7}
585
- .cm-s-twilight .cm-error{border-bottom:1px solid #f00}
586
- .cm-s-twilight .cm-builtin{color:#cda869}
587
- .cm-s-twilight .cm-tag{color:#997643}
588
- .cm-s-twilight .cm-attribute{color:#d6bb6d}
589
- .cm-s-twilight .cm-header{color:#ff6400}
590
- .cm-s-twilight .cm-hr{color:#aeaeae}
591
- .cm-s-twilight .cm-link{color:#ad9361;font-style:italic;text-decoration:none}
592
- .cm-s-twilight .CodeMirror-activeline-background{background:#27282e !important}
593
- .cm-s-twilight .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
594
- .cm-s-vibrant-ink.CodeMirror{background:#000;color:#fff}
595
- .cm-s-vibrant-ink .CodeMirror-selected{background:#35493c !important}
596
- .cm-s-vibrant-ink .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}
597
- .cm-s-vibrant-ink .CodeMirror-linenumber{color:#d0d0d0}
598
- .cm-s-vibrant-ink .CodeMirror-cursor{border-left:1px solid #fff !important}
599
- .cm-s-vibrant-ink .cm-keyword{color:#cc7832}
600
- .cm-s-vibrant-ink .cm-atom{color:#fc0}
601
- .cm-s-vibrant-ink .cm-number{color:#ffee98}
602
- .cm-s-vibrant-ink .cm-def{color:#8da6ce}
603
- .cm-s-vibrant-ink span.cm-variable-2,.cm-s-vibrant span.cm-tag{color:#ffc66d}
604
- .cm-s-vibrant-ink span.cm-variable-3,.cm-s-vibrant span.cm-def{color:#ffc66d}
605
- .cm-s-vibrant-ink .cm-operator{color:#888}
606
- .cm-s-vibrant-ink .cm-comment{color:#808080;font-weight:bold}
607
- .cm-s-vibrant-ink .cm-string{color:#a5c25c}
608
- .cm-s-vibrant-ink .cm-string-2{color:#f00}
609
- .cm-s-vibrant-ink .cm-meta{color:#d8fa3c}
610
- .cm-s-vibrant-ink .cm-error{border-bottom:1px solid #f00}
611
- .cm-s-vibrant-ink .cm-builtin{color:#8da6ce}
612
- .cm-s-vibrant-ink .cm-tag{color:#8da6ce}
613
- .cm-s-vibrant-ink .cm-attribute{color:#8da6ce}
614
- .cm-s-vibrant-ink .cm-header{color:#ff6400}
615
- .cm-s-vibrant-ink .cm-hr{color:#aeaeae}
616
- .cm-s-vibrant-ink .cm-link{color:#00f}
617
- .cm-s-vibrant-ink .CodeMirror-activeline-background{background:#27282e !important}
618
- .cm-s-vibrant-ink .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
619
- .cm-s-xq-dark.CodeMirror{background:#0a001f;color:#f8f8f8}
620
- .cm-s-xq-dark .CodeMirror-selected{background:#27007a !important}
621
- .cm-s-xq-dark .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}
622
- .cm-s-xq-dark .CodeMirror-linenumber{color:#f8f8f8}
623
- .cm-s-xq-dark .CodeMirror-cursor{border-left:1px solid #fff !important}
624
- .cm-s-xq-dark span.cm-keyword{color:#ffbd40}
625
- .cm-s-xq-dark span.cm-atom{color:#6c8cd5}
626
- .cm-s-xq-dark span.cm-number{color:#164}
627
- .cm-s-xq-dark span.cm-def{color:#fff;text-decoration:underline}
628
- .cm-s-xq-dark span.cm-variable{color:#fff}
629
- .cm-s-xq-dark span.cm-variable-2{color:#eee}
630
- .cm-s-xq-dark span.cm-variable-3{color:#ddd}
631
- .cm-s-xq-dark span.cm-comment{color:#808080}
632
- .cm-s-xq-dark span.cm-string{color:#9fee00}
633
- .cm-s-xq-dark span.cm-meta{color:#ff0}
634
- .cm-s-xq-dark span.cm-error{color:#f00}
635
- .cm-s-xq-dark span.cm-qualifier{color:#fff700}
636
- .cm-s-xq-dark span.cm-builtin{color:#30a}
637
- .cm-s-xq-dark span.cm-bracket{color:#cc7}
638
- .cm-s-xq-dark span.cm-tag{color:#ffbd40}
639
- .cm-s-xq-dark span.cm-attribute{color:#fff700}
640
- .cm-s-xq-dark .CodeMirror-activeline-background{background:#27282e !important}
641
- .cm-s-xq-dark .CodeMirror-matchingbracket{outline:1px solid #808080;color:#fff !important}
642
- .cm-s-xq-light span.cm-keyword{line-height:1em;font-weight:bold;color:#5a5cad}
643
- .cm-s-xq-light span.cm-atom{color:#6c8cd5}
644
- .cm-s-xq-light span.cm-number{color:#164}
645
- .cm-s-xq-light span.cm-def{text-decoration:underline}
646
- .cm-s-xq-light span.cm-variable{color:#000}
647
- .cm-s-xq-light span.cm-variable-2{color:#000}
648
- .cm-s-xq-light span.cm-variable-3{color:#000}
649
- .cm-s-xq-light span.cm-comment{color:#0080ff;font-style:italic}
650
- .cm-s-xq-light span.cm-string{color:#f00}
651
- .cm-s-xq-light span.cm-meta{color:#ff0}
652
- .cm-s-xq-light span.cm-error{color:#f00}
653
- .cm-s-xq-light span.cm-qualifier{color:#808080}
654
- .cm-s-xq-light span.cm-builtin{color:#7ea656}
655
- .cm-s-xq-light span.cm-bracket{color:#cc7}
656
- .cm-s-xq-light span.cm-tag{color:#3f7f7f}
657
- .cm-s-xq-light span.cm-attribute{color:#7f007f}
658
- .cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff !important}
659
- .cm-s-xq-light .CodeMirror-matchingbracket{outline:1px solid #808080;color:#000 !important;background:#ff0}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/codemirror/codemirror-compressed.js DELETED
@@ -1,9 +0,0 @@
1
- // CodeMirror 3.16
2
- // Complied at http://codemirror.net/doc/compress.html
3
- // using core library, and the modes: css, coffeescript, less, javascript, xml, clike, markdown, gfm, htmlmixed, php
4
- window.CodeMirror=function(){"use strict";function w(a,c){if(!(this instanceof w))return new w(a,c);this.options=c=c||{};for(var d in $c)!c.hasOwnProperty(d)&&$c.hasOwnProperty(d)&&(c[d]=$c[d]);I(c);var e="string"==typeof c.value?0:c.value.first,f=this.display=x(a,e);f.wrapper.CodeMirror=this,F(this),c.autofocus&&!o&&Mb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new We},D(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var g=c.value;"string"==typeof g&&(g=new fe(c.value,c.mode)),Eb(this,je)(this,g),b&&setTimeout(ef(Lb,this,!0),20),Ob(this);var h;try{h=document.activeElement==f.input}catch(i){}h||c.autofocus&&!o?setTimeout(ef(lc,this),20):mc(this),Eb(this,function(){for(var a in Zc)Zc.propertyIsEnumerable(a)&&Zc[a](this,c[a],ad);for(var b=0;b<ed.length;++b)ed[b](this)})()}function x(a,b){var d={},f=d.input=kf("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");return e?f.style.width="1000px":f.setAttribute("wrap","off"),n&&(f.style.border="1px solid black"),f.setAttribute("autocorrect","off"),f.setAttribute("autocapitalize","off"),f.setAttribute("spellcheck","false"),d.inputDiv=kf("div",[f],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),d.scrollbarH=kf("div",[kf("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),d.scrollbarV=kf("div",[kf("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),d.scrollbarFiller=kf("div",null,"CodeMirror-scrollbar-filler"),d.gutterFiller=kf("div",null,"CodeMirror-gutter-filler"),d.lineDiv=kf("div",null,"CodeMirror-code"),d.selectionDiv=kf("div",null,null,"position: relative; z-index: 1"),d.cursor=kf("div","\xa0","CodeMirror-cursor"),d.otherCursor=kf("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"),d.measure=kf("div",null,"CodeMirror-measure"),d.lineSpace=kf("div",[d.measure,d.selectionDiv,d.lineDiv,d.cursor,d.otherCursor],null,"position: relative; outline: none"),d.mover=kf("div",[kf("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=kf("div",[d.mover],"CodeMirror-sizer"),d.heightForcer=kf("div",null,null,"position: absolute; height: "+Ue+"px; width: 1px;"),d.gutters=kf("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=kf("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=kf("div",[d.inputDiv,d.scrollbarH,d.scrollbarV,d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),c&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),a.appendChild?a.appendChild(d.wrapper):a(d.wrapper),n&&(f.style.width="0px"),e||(d.scroller.draggable=!0),j?(d.inputDiv.style.height="1px",d.inputDiv.style.position="absolute"):c&&(d.scrollbarH.style.minWidth=d.scrollbarV.style.minWidth="18px"),d.viewOffset=d.lastSizeC=0,d.showingFrom=d.showingTo=b,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.prevInput="",d.alignWidgets=!1,d.pollingFast=!1,d.poll=new We,d.cachedCharWidth=d.cachedTextHeight=null,d.measureLineCache=[],d.measureLineCachePos=0,d.inaccurateSelection=!1,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d}function y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,ab(a,100),a.state.modeGen++,a.curOp&&Hb(a)}function z(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),H(a)),B(a),Hb(a),ob(a),setTimeout(function(){J(a)},100)}function A(a){var b=zb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Ab(a.display)-3);return function(e){return Fd(a.doc,e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function B(a){var b=a.doc,c=A(a);b.iter(function(a){var b=c(a);b!=a.height&&ne(a,b)})}function C(a){var b=jd[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:""),a.state.disableInput=b.disableInput}function D(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ob(a)}function E(a){F(a),Hb(a),setTimeout(function(){L(a)},20)}function F(a){var b=a.display.gutters,c=a.options.gutters;lf(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(kf("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function G(a,b){if(0==b.height)return 0;for(var d,c=b.text.length,e=b;d=Cd(e);){var f=d.find();e=ke(a,f.from.line),c+=f.from.ch-f.to.ch}for(e=b;d=Dd(e);){var f=d.find();c-=e.text.length-f.from.ch,e=ke(a,f.to.line),c+=e.text.length-f.to.ch}return c}function H(a){var b=a.display,c=a.doc;b.maxLine=ke(c,c.first),b.maxLineLength=G(c,b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var d=G(c,a);d>b.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function I(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function J(a){var b=a.display,c=a.doc.height,d=c+fb(b);b.sizer.style.minHeight=b.heightForcer.style.top=d+"px",b.gutters.style.height=Math.max(d,b.scroller.clientHeight-Ue)+"px";var e=Math.max(d,b.scroller.scrollHeight),f=b.scroller.scrollWidth>b.scroller.clientWidth+1,g=e>b.scroller.clientHeight+1;g?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=f?sf(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=e-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):(b.scrollbarV.style.display="",b.scrollbarV.firstChild.style.height="0"),f?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=g?sf(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0"),f&&g?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=sf(b.measure)+"px"):b.scrollbarFiller.style.display="",f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=sf(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="",k&&0===sf(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=l?"18px":"12px")}function K(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top),d=Math.floor(d-eb(a));var f=Math.ceil(d+e);return{from:pe(b,d),to:pe(b,f)}}function L(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=O(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function M(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=N(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(kf("div",[kf("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g),d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",!0}return!1}function N(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function O(a){return of(a.scroller).left-of(a.sizer).left}function P(a,b,c,d){for(var g,e=a.display.showingFrom,f=a.display.showingTo,h=K(a.display,a.doc,c);Q(a,b,h,d)&&(d=!1,g=!0,Y(a),J(a),c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top)),h=K(a.display,a.doc,c),!(h.from>=a.display.showingFrom&&h.to<=a.display.showingTo));)b=[];return g&&(Pe(a,"update",a),(a.display.showingFrom!=e||a.display.showingTo!=f)&&Pe(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo)),g}function Q(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)return e.showingFrom=e.showingTo=f.first,e.viewOffset=0,void 0;if(!(!d&&0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){M(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";var h=1/0;if(a.options.lineNumbers)for(var i=0;i<b.length;++i)b[i].diff&&b[i].from<h&&(h=b[i].from);var j=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first),l=Math.min(j,c.to+a.options.viewportMargin);if(e.showingFrom<k&&k-e.showingFrom<20&&(k=Math.max(f.first,e.showingFrom)),e.showingTo>l&&e.showingTo-l<20&&(l=Math.min(j,e.showingTo)),v)for(k=oe(Ed(f,ke(f,k)));j>l&&Fd(f,ke(f,l));)++l;var m=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,j)}];if(m=m[0].from>=m[0].to?[]:T(m,b),v)for(var i=0;i<m.length;++i)for(var o,n=m[i];o=Dd(ke(f,n.to-1));){var p=o.find().from.line;if(!(p>n.from)){m.splice(i--,1);break}n.to=p}for(var q=0,i=0;i<m.length;++i){var n=m[i];n.from<k&&(n.from=k),n.to>l&&(n.to=l),n.from>=n.to?m.splice(i--,1):q+=n.to-n.from}if(!d&&q==l-k&&k==e.showingFrom&&l==e.showingTo)return S(a),void 0;m.sort(function(a,b){return a.from-b.from});try{var r=document.activeElement}catch(s){}.7*(l-k)>q&&(e.lineDiv.style.display="none"),V(a,k,l,m,h),e.lineDiv.style.display="",r&&document.activeElement!=r&&r.offsetHeight&&r.focus();var t=k!=e.showingFrom||l!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight;return t&&(e.lastSizeC=e.wrapper.clientHeight,ab(a,400)),e.showingFrom=k,e.showingTo=l,R(a),S(a),!0}}function R(a){for(var f,b=a.display,d=b.lineDiv.offsetTop,e=b.lineDiv.firstChild;e;e=e.nextSibling)if(e.lineObj){if(c){var g=e.offsetTop+e.offsetHeight;f=g-d,d=g}else{var h=of(e);f=h.bottom-h.top}var i=e.lineObj.height-f;if(2>f&&(f=zb(b)),i>.001||-.001>i){ne(e.lineObj,f);var j=e.lineObj.widgets;if(j)for(var k=0;k<j.length;++k)j[k].height=j[k].node.offsetHeight}}}function S(a){var b=a.display.viewOffset=qe(a,ke(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function T(a,b){for(var c=0,d=b.length||0;d>c;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,i=a.length;i>h;++h){var j=a[h];e.to<=j.from&&e.diff?f.push({from:j.from+g,to:j.to+g}):e.to<=j.from||e.from>=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.to<j.to&&f.push({from:e.to+g,to:j.to+g}))}a=f}return a}function U(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:O(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function V(a,b,c,d,f){function l(b){var c=b.nextSibling;return e&&p&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b),c}var g=U(a),h=a.display,i=a.options.lineNumbers;d.length||e&&a.display.currentWheelTarget||lf(h.lineDiv);var j=h.lineDiv,k=j.firstChild,m=d.shift(),n=b;for(a.doc.iter(b,c,function(b){if(m&&m.to==n&&(m=d.shift()),Fd(a.doc,b)){if(0!=b.height&&ne(b,0),b.widgets&&k&&k.previousSibling)for(var c=0;c<b.widgets.length;++c){var e=b.widgets[c];if(e.showIfHidden){var h=k.previousSibling;if(/pre/i.test(h.nodeName)){var o=kf("div",null,null,"position: relative");h.parentNode.replaceChild(o,h),o.appendChild(h),h=o}var p=h.appendChild(kf("div",[e.node],"CodeMirror-linewidget"));e.handleMouseEvents||(p.ignoreEvents=!0),X(e,p,h,g)}}}else if(m&&m.from<=n&&m.to>n){for(;k.lineObj!=b;)k=l(k);i&&n>=f&&k.lineNumber&&nf(k.lineNumber,N(a.options,n)),k=k.nextSibling}else{if(b.widgets)for(var s,q=0,r=k;r&&20>q;++q,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){s=r;break}var t=W(a,b,n,g,s);if(t!=s)j.insertBefore(t,k);else{for(;k!=s;)k=l(k);k=k.nextSibling}t.lineObj=b}++n});k;)k=l(k)}function W(a,b,d,e,f){var j,g=Wd(a,b),h=b.gutterMarkers,i=a.display;if(!(a.options.lineNumbers||h||b.bgClass||b.wrapClass||b.widgets))return g;if(f){f.alignable=null;for(var o,k=!0,l=0,m=null,n=f.firstChild;n;n=o)if(o=n.nextSibling,/\bCodeMirror-linewidget\b/.test(n.className)){for(var p=0;p<b.widgets.length;++p){var q=b.widgets[p];if(q.node==n.firstChild){q.above||m||(m=n),X(q,n,f,e),++l;break}}if(p==b.widgets.length){k=!1;break}}else f.removeChild(n);f.insertBefore(g,m),k&&l==b.widgets.length&&(j=f,f.className=b.wrapClass||"")}if(j||(j=kf("div",null,b.wrapClass,"position: relative"),j.appendChild(g)),b.bgClass&&j.insertBefore(kf("div",null,b.bgClass+" CodeMirror-linebackground"),j.firstChild),a.options.lineNumbers||h){var r=j.insertBefore(kf("div",null,null,"position: absolute; left: "+(a.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px"),j.firstChild);if(a.options.fixedGutter&&(j.alignable||(j.alignable=[])).push(r),!a.options.lineNumbers||h&&h["CodeMirror-linenumbers"]||(j.lineNumber=r.appendChild(kf("div",N(a.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+i.lineNumInnerWidth+"px"))),h)for(var s=0;s<a.options.gutters.length;++s){var t=a.options.gutters[s],u=h.hasOwnProperty(t)&&h[t];u&&r.appendChild(kf("div",[u],"CodeMirror-gutter-elt","left: "+e.gutterLeft[t]+"px; width: "+e.gutterWidth[t]+"px"))}}if(c&&(j.style.zIndex=2),b.widgets&&j!=f)for(var p=0,v=b.widgets;p<v.length;++p){var q=v[p],w=kf("div",[q.node],"CodeMirror-linewidget");q.handleMouseEvents||(w.ignoreEvents=!0),X(q,w,j,e),q.above?j.insertBefore(w,a.options.lineNumbers&&0!=b.height?r:g):j.appendChild(w),Pe(q,"redraw")}return j}function X(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function Y(a){var b=a.display,c=Bc(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting?Z(a):b.cursor.style.display=b.otherCursor.style.display="none",c?b.selectionDiv.style.display="none":$(a),a.options.moveInputWithCursor){var d=ub(a,a.doc.sel.head,"div"),e=of(b.wrapper),f=of(b.lineDiv);b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,d.top+f.top-e.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,d.left+f.left-e.left))+"px"}}function Z(a){var b=a.display,c=ub(a,a.doc.sel.head,"div");b.cursor.style.left=c.left+"px",b.cursor.style.top=c.top+"px",b.cursor.style.height=Math.max(0,c.bottom-c.top)*a.options.cursorHeight+"px",b.cursor.style.display="",c.other?(b.otherCursor.style.display="",b.otherCursor.style.left=c.other.left+"px",b.otherCursor.style.top=c.other.top+"px",b.otherCursor.style.height=.85*(c.other.bottom-c.other.top)+"px"):b.otherCursor.style.display="none"}function $(a){function h(a,b,c,d){0>b&&(b=0),e.appendChild(kf("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?f-a:c)+"px; height: "+(d-b)+"px"))}function i(b,d,e){function m(c,d){return tb(a,Ac(b,c),"div",i,d)}var k,l,i=ke(c,b),j=i.text.length;return zf(re(i),d||0,null==e?j:e,function(a,b,c){var n,o,p,i=m(a,"left");if(a==b)n=i,o=p=i.left;else{if(n=m(b-1,"right"),"rtl"==c){var q=i;i=n,n=q}o=i.left,p=n.right}null==d&&0==a&&(o=g),n.top-i.top>3&&(h(o,i.top,null,i.bottom),o=g,i.bottom<n.top&&h(o,i.bottom,null,n.top)),null==e&&b==j&&(p=f),(!k||i.top<k.top||i.top==k.top&&i.left<k.left)&&(k=i),(!l||n.bottom>l.bottom||n.bottom==l.bottom&&n.right>l.right)&&(l=n),g+1>o&&(o=g),h(o,n.top,p-o,n.bottom)}),{start:k,end:l}}var b=a.display,c=a.doc,d=a.doc.sel,e=document.createDocumentFragment(),f=b.lineSpace.offsetWidth,g=gb(a.display);if(d.from.line==d.to.line)i(d.from.line,d.from.ch,d.to.ch);else{var j=ke(c,d.from.line),k=ke(c,d.to.line),l=Ed(c,j)==Ed(c,k),m=i(d.from.line,d.from.ch,l?j.text.length:null).end,n=i(d.to.line,l?0:null,d.to.ch).start;l&&(m.top<n.top-2?(h(m.right,m.top,null,m.bottom),h(g,n.top,n.left,n.bottom)):h(m.right,m.top,n.left-m.right,m.bottom)),m.bottom<n.top&&h(g,m.bottom,null,n.top)}mf(b.selectionDiv,e),b.selectionDiv.style.display=""}function _(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="",a.options.cursorBlinkRate>0&&(b.blinker=setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function ab(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,ef(bb,a))}function bb(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.showingTo)){var f,c=+new Date+a.options.workTime,d=gd(b.mode,db(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=Rd(a,g,d);for(var i=!h||h.length!=g.styles.length,j=0;!i&&j<h.length;++j)i=h[j]!=g.styles[j];i&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1})),g.stateAfter=gd(b.mode,d)}else Td(a,g,d),g.stateAfter=0==b.frontier%5?gd(b.mode,d):null;return++b.frontier,+new Date>c?(ab(a,a.options.workDelay),!0):void 0}),e.length&&Eb(a,function(){for(var a=0;a<e.length;++a)Hb(this,e[a].start,e[a].end)})()}}function cb(a,b,c){for(var d,e,f=a.doc,g=a.doc.mode.innerMode?1e3:100,h=b,i=b-g;h>i;--h){if(h<=f.first)return f.first;var j=ke(f,h-1);if(j.stateAfter&&(!c||h<=f.frontier))return h;var k=Xe(j.text,null,a.options.tabSize);(null==e||d>k)&&(e=h-1,d=k)}return e}function db(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=cb(a,b,c),g=f>d.first&&ke(d,f-1).stateAfter;return g=g?gd(d.mode,g):hd(d.mode),d.iter(f,b,function(c){Td(a,c,g);var h=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo;c.stateAfter=h?gd(d.mode,g):null,++f}),g}function eb(a){return a.lineSpace.offsetTop}function fb(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function gb(a){var b=mf(a.measure,kf("pre",null,null,"text-align: left")).appendChild(kf("span","x"));return b.offsetLeft}function hb(a,b,c,d,e){var f=-1;if(d=d||kb(a,b),d.crude){var g=d.left+c*d.width;return{left:g,right:g+d.width,top:d.top,bottom:d.bottom}}for(var h=c;;h+=f){var i=d[h];if(i)break;0>f&&0==h&&(f=1)}return e=h>c?"left":c>h?"right":e,"left"==e&&i.leftSide?i=i.leftSide:"right"==e&&i.rightSide&&(i=i.rightSide),{left:c>h?i.right:i.left,right:h>c?i.left:i.right,top:i.top,bottom:i.bottom}}function ib(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return e}}function jb(a,b){var c=ib(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function kb(a,b){var c=ib(a,b);if(c)return c.measure;var d=lb(a,b),e=a.display.measureLineCache,f={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:d,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};return 16==e.length?e[++a.display.measureLineCachePos%16]=f:e.push(f),d}function lb(a,e){function t(a){var b=a.top-p.top,c=a.bottom-p.top;c>s&&(c=s),0>b&&(b=0);for(var d=q.length-2;d>=0;d-=2){var e=q[d],f=q[d+1];if(!(e>c||b>f)&&(b>=e&&f>=c||e>=b&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){q[d]=Math.min(b,e),q[d+1]=Math.max(c,f);break}}return 0>d&&(d=q.length,q.push(b,c)),{left:a.left-p.left,right:a.right-p.left,top:d,bottom:null}}function u(a){a.bottom=q[a.top+1],a.top=q[a.top]}if(!a.options.lineWrapping&&e.text.length>=a.options.crudeMeasuringFrom)return mb(a,e);var f=a.display,g=df(e.text.length),h=Wd(a,e,g,!0);if(b&&!c&&!a.options.lineWrapping&&h.childNodes.length>100){for(var i=document.createDocumentFragment(),j=10,k=h.childNodes.length,l=0,m=Math.ceil(k/j);m>l;++l){for(var n=kf("div",null,null,"display: inline-block"),o=0;j>o&&k;++o)n.appendChild(h.firstChild),--k;i.appendChild(n)}h.appendChild(i)}mf(f.measure,h);var p=of(f.lineDiv),q=[],r=df(e.text.length),s=h.offsetHeight;d&&f.measure.first!=h&&mf(f.measure,h);for(var v,l=0;l<g.length;++l)if(v=g[l]){var w=v,x=null;if(/\bCodeMirror-widget\b/.test(v.className)&&v.getClientRects){1==v.firstChild.nodeType&&(w=v.firstChild);var y=w.getClientRects();y.length>1&&(x=r[l]=t(y[0]),x.rightSide=t(y[y.length-1]))}x||(x=r[l]=t(of(w))),v.measureRight&&(x.right=of(v.measureRight).left),v.leftSide&&(x.leftSide=t(of(v.leftSide)))}lf(a.display.measure);for(var v,l=0;l<r.length;++l)(v=r[l])&&(u(v),v.leftSide&&u(v.leftSide),v.rightSide&&u(v.rightSide));return r}function mb(a,b){var c=new Nd(b.text.slice(0,100),null);b.textClass&&(c.textClass=b.textClass);var d=lb(a,c),e=hb(a,c,0,d,"left"),f=hb(a,c,99,d,"right");return{crude:!0,top:e.top,left:e.left,bottom:e.bottom,width:(f.right-e.left)/100}}function nb(a,b){var c=!1;if(b.markedSpans)for(var d=0;d<b.markedSpans;++d){var e=b.markedSpans[d];!e.collapsed||null!=e.to&&e.to!=b.text.length||(c=!0)}var f=!c&&ib(a,b);if(f||b.text.length>=a.options.crudeMeasuringFrom)return hb(a,b,b.text.length,f&&f.measure,"right").right;var g=Wd(a,b,null,!0),h=g.appendChild(uf(a.display.measure));return mf(a.display.measure,g),of(h).right-of(a.display.lineDiv).left}function ob(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0,a.display.cachedCharWidth=a.display.cachedTextHeight=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function pb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function qb(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function rb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=Ld(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=qe(a,b);if("local"==d?g+=eb(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=of(a.display.lineSpace);g+=h.top+("window"==d?0:qb());var i=h.left+("window"==d?0:pb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function sb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=pb(),e-=qb();else if("local"==c||!c){var f=of(a.display.sizer);d+=f.left,e+=f.top}var g=of(a.display.lineSpace);return{left:d-g.left,top:e-g.top}}function tb(a,b,c,d,e){return d||(d=ke(a.doc,b.line)),rb(a,d,hb(a,d,b.ch,null,e),c)}function ub(a,b,c,d,e){function f(b,f){var g=hb(a,d,b,e,f?"right":"left");return f?g.left=g.right:g.right=g.left,rb(a,d,g,c)}function g(a,b){var c=h[b],d=c.level%2;return a==Af(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=Bf(c)-(c.level%2?0:1),d=!0):a==Bf(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=Af(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||ke(a.doc,b.line),e||(e=kb(a,d));var h=re(d),i=b.ch;if(!h)return f(i);var j=If(h,i),k=g(i,j);return null!=Hf&&(k.other=g(i,Hf)),k}function vb(a,b,c,d){var e=new Ac(a,b);return e.xRel=d,c&&(e.outside=!0),e}function wb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return vb(d.first,0,!0,-1);var e=pe(d,c),f=d.first+d.size-1;if(e>f)return vb(d.first+d.size-1,ke(d,f).text.length,!0,1);for(0>b&&(b=0);;){var g=ke(d,e),h=xb(a,g,e,b,c),i=Dd(g),j=i&&i.find();if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=j.to.line}}function xb(a,b,c,d,e){function j(d){var e=ub(a,Ac(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:f<e.top?e.left+h:(g=!1,e.left)}var f=e-qe(a,b),g=!1,h=2*a.display.wrapper.clientWidth,i=kb(a,b),k=re(b),l=b.text.length,m=Cf(b),n=Df(b),o=j(m),p=g,q=j(n),r=g;if(d>q)return vb(c,n,r,1);for(;;){if(k?n==m||n==Kf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);jf.test(b.text.charAt(s));)++s;var u=vb(c,s,s==m?p:r,0>t?-1:t?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=Kf(b,w,1)}var y=j(w);y>d?(n=w,q=y,(r=g)&&(q+=1e3),l=v):(m=w,o=y,p=g,l-=v)}}function zb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==yb){yb=kf("pre");for(var b=0;49>b;++b)yb.appendChild(document.createTextNode("x")),yb.appendChild(kf("br"));yb.appendChild(document.createTextNode("x"))}mf(a.measure,yb);var c=yb.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),lf(a.measure),c||1}function Ab(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=kf("span","x"),c=kf("pre",[b]);mf(a.measure,c);var d=b.offsetWidth;return d>2&&(a.cachedCharWidth=d),d||10}function Cb(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Bb},Oe++||(Ne=[])}function Db(a){var b=a.curOp,c=a.doc,d=a.display;if(a.curOp=null,b.updateMaxLine&&H(a),d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e=nb(a,d.maxLine);d.sizer.style.minWidth=Math.max(0,e+3+Ue)+"px",d.maxLineChanged=!1;var f=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);f<c.scrollLeft&&!b.updateScrollPos&&_b(a,Math.min(d.scroller.scrollLeft,f),!0)}var g,h;if(b.updateScrollPos)g=b.updateScrollPos;else if(b.selectionChanged&&d.scroller.clientHeight){var i=ub(a,c.sel.head);g=Qc(a,i.left,i.top,i.left,i.bottom)}(b.changes.length||b.forceUpdate||g&&null!=g.scrollTop)&&(h=P(a,b.changes,g&&g.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop=a.display.scroller.scrollTop)),!h&&b.selectionChanged&&Y(a),b.updateScrollPos?(d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=g.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=g.scrollLeft,L(a),b.scrollToPos&&Oc(a,Fc(a.doc,b.scrollToPos),b.scrollToPosMargin)):g&&Nc(a),b.selectionChanged&&_(a),a.state.focused&&b.updateInput&&Lb(a,b.userSelChange);var j=b.maybeHiddenMarkers,k=b.maybeUnhiddenMarkers;if(j)for(var l=0;l<j.length;++l)j[l].lines.length||Me(j[l],"hide");if(k)for(var l=0;l<k.length;++l)k[l].lines.length&&Me(k[l],"unhide");var m;if(--Oe||(m=Ne,Ne=null),b.textChanged&&Me(a,"change",a,b.textChanged),b.cursorActivity&&Me(a,"cursorActivity",a),m)for(var l=0;l<m.length;++l)m[l]()}function Eb(a,b){return function(){var c=a||this,d=!c.curOp;d&&Cb(c);try{var e=b.apply(c,arguments)}finally{d&&Db(c)}return e}}function Fb(a){return function(){var c,b=this.cm&&!this.cm.curOp;b&&Cb(this.cm);try{c=a.apply(this,arguments)}finally{b&&Db(this.cm)}return c}}function Gb(a,b){var d,c=!a.curOp;c&&Cb(a);try{d=b()}finally{c&&Db(a)}return d}function Hb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),a.curOp.changes.push({from:b,to:c,diff:d})}function Ib(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){Kb(a),a.state.focused&&Ib(a)})}function Jb(a){function c(){var d=Kb(a);d||b?(a.display.pollingFast=!1,Ib(a)):(b=!0,a.display.poll.set(60,c))}var b=!1;a.display.pollingFast=!0,a.display.poll.set(20,c)}function Kb(a){var c=a.display.input,e=a.display.prevInput,f=a.doc,g=f.sel;if(!a.state.focused||wf(c)||Nb(a)||a.state.disableInput)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(c.value=c.value.substring(0,c.value.length-1),a.state.fakedLastChar=!1);var h=c.value;if(h==e&&Bc(g.from,g.to))return!1;if(b&&!d&&a.display.inputHasSelection===h)return Lb(a,!0),!1;var i=!a.curOp;i&&Cb(a),g.shift=!1;for(var j=0,k=Math.min(e.length,h.length);k>j&&e.charCodeAt(j)==h.charCodeAt(j);)++j;var l=g.from,m=g.to;j<e.length?l=Ac(l.line,l.ch-(e.length-j)):a.state.overwrite&&Bc(l,m)&&!a.state.pasteIncoming&&(m=Ac(m.line,Math.min(ke(f,m.line).text.length,m.ch+(h.length-j))));var n=a.curOp.updateInput,o={from:l,to:m,text:vf(h.slice(j)),origin:a.state.pasteIncoming?"paste":"+input"};return tc(a.doc,o,"end"),a.curOp.updateInput=n,Pe(a,"inputRead",a,o),h.length>1e3||h.indexOf("\n")>-1?c.value=a.display.prevInput="":a.display.prevInput=h,i&&Db(a),a.state.pasteIncoming=!1,!0}function Lb(a,c){var e,f,g=a.doc;if(Bc(g.sel.from,g.sel.to))c&&(a.display.prevInput=a.display.input.value="",b&&!d&&(a.display.inputHasSelection=null));else{a.display.prevInput="",e=xf&&(g.sel.to.line-g.sel.from.line>100||(f=a.getSelection()).length>1e3);var h=e?"-":f||a.getSelection();a.display.input.value=h,a.state.focused&&_e(a.display.input),b&&!d&&(a.display.inputHasSelection=h)}a.display.inaccurateSelection=e}function Mb(a){"nocursor"==a.options.readOnly||o&&document.activeElement==a.display.input||a.display.input.focus()}function Nb(a){return a.options.readOnly||a.doc.cantEdit}function Ob(a){function d(){a.state.focused&&setTimeout(ef(Mb,a),0)}function g(){null==f&&(f=setTimeout(function(){f=null,c.cachedCharWidth=c.cachedTextHeight=rf=null,ob(a),Gb(a,ef(Hb,a))},100))}function h(){for(var a=c.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(h,5e3):Le(window,"resize",g)}function i(b){Qe(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,De(b))||He(b)}function k(){c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),_e(c.input))}var c=a.display;Ke(c.scroller,"mousedown",Eb(a,Tb)),b?Ke(c.scroller,"dblclick",Eb(a,function(b){if(!Qe(a,b)){var c=Qb(a,b);if(c&&!Wb(a,b)&&!Pb(a.display,b)){Ee(b);var d=Xc(ke(a.doc,c.line).text,c);Ic(a.doc,d.from,d.to)}}})):Ke(c.scroller,"dblclick",function(b){Qe(a,b)||Ee(b)}),Ke(c.lineSpace,"selectstart",function(a){Pb(c,a)||Ee(a)}),t||Ke(c.scroller,"contextmenu",function(b){oc(a,b)}),Ke(c.scroller,"scroll",function(){c.scroller.clientHeight&&($b(a,c.scroller.scrollTop),_b(a,c.scroller.scrollLeft,!0),Me(a,"scroll",a))}),Ke(c.scrollbarV,"scroll",function(){c.scroller.clientHeight&&$b(a,c.scrollbarV.scrollTop)}),Ke(c.scrollbarH,"scroll",function(){c.scroller.clientHeight&&_b(a,c.scrollbarH.scrollLeft)}),Ke(c.scroller,"mousewheel",function(b){cc(a,b)}),Ke(c.scroller,"DOMMouseScroll",function(b){cc(a,b)}),Ke(c.scrollbarH,"mousedown",d),Ke(c.scrollbarV,"mousedown",d),Ke(c.wrapper,"scroll",function(){c.wrapper.scrollTop=c.wrapper.scrollLeft=0});var f;Ke(window,"resize",g),setTimeout(h,5e3),Ke(c.input,"keyup",Eb(a,function(b){Qe(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,De(b))||16==b.keyCode&&(a.doc.sel.shift=!1)})),Ke(c.input,"input",ef(Jb,a)),Ke(c.input,"keydown",Eb(a,jc)),Ke(c.input,"keypress",Eb(a,kc)),Ke(c.input,"focus",ef(lc,a)),Ke(c.input,"blur",ef(mc,a)),a.options.dragDrop&&(Ke(c.scroller,"dragstart",function(b){Zb(a,b)}),Ke(c.scroller,"dragenter",i),Ke(c.scroller,"dragover",i),Ke(c.scroller,"drop",Eb(a,Yb))),Ke(c.scroller,"paste",function(b){Pb(c,b)||(Mb(a),Jb(a))}),Ke(c.input,"paste",function(){if(e&&!a.state.fakedLastChar&&!(new Date-a.state.lastMiddleDown<200)){var b=c.input.selectionStart,d=c.input.selectionEnd;c.input.value+="$",c.input.selectionStart=b,c.input.selectionEnd=d,a.state.fakedLastChar=!0}a.state.pasteIncoming=!0,Jb(a)}),Ke(c.input,"cut",k),Ke(c.input,"copy",k),j&&Ke(c.sizer,"mouseup",function(){document.activeElement==c.input&&c.input.blur(),Mb(a)})}function Pb(a,b){for(var c=Ie(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Qb(a,b,c){var d=a.display;if(!c){var e=Ie(b);if(e==d.scrollbarH||e==d.scrollbarH.firstChild||e==d.scrollbarV||e==d.scrollbarV.firstChild||e==d.scrollbarFiller||e==d.gutterFiller)return null}var f,g,h=of(d.lineSpace);try{f=b.clientX,g=b.clientY}catch(b){return null}return wb(a,f-h.left,g-h.top)}function Tb(a){function q(a){if(!Bc(p,a)){if(p=a,"single"==j)return Ic(c.doc,Fc(f,h),a),void 0;if(n=Fc(f,n),o=Fc(f,o),"double"==j){var b=Xc(ke(f,a.line).text,a);Cc(a,n)?Ic(c.doc,b.from,o):Ic(c.doc,n,b.to)}else"triple"==j&&(Cc(a,n)?Ic(c.doc,o,Fc(f,Ac(a.line,0))):Ic(c.doc,n,Fc(f,Ac(a.line+1,0))))}}function u(a){var b=++s,e=Qb(c,a,!0);if(e)if(Bc(e,l)){var h=a.clientY<r.top?-20:a.clientY>r.bottom?20:0;h&&setTimeout(Eb(c,function(){s==b&&(d.scroller.scrollTop+=h,u(a))}),50)}else{c.state.focused||lc(c),l=e,q(e);var g=K(d,f);(e.line>=g.to||e.line<g.from)&&setTimeout(Eb(c,function(){s==b&&u(a)
5
- }),150)}}function v(a){s=1/0,Ee(a),Mb(c),Le(document,"mousemove",w),Le(document,"mouseup",x)}if(!Qe(this,a)){var c=this,d=c.display,f=c.doc,g=f.sel;if(g.shift=a.shiftKey,Pb(d,a))return e||(d.scroller.draggable=!1,setTimeout(function(){d.scroller.draggable=!0},100)),void 0;if(!Wb(c,a)){var h=Qb(c,a);switch(Je(a)){case 3:return t&&oc.call(c,c,a),void 0;case 2:return e&&(c.state.lastMiddleDown=+new Date),h&&Ic(c.doc,h),setTimeout(ef(Mb,c),20),Ee(a),void 0}if(!h)return Ie(a)==d.scroller&&Ee(a),void 0;c.state.focused||lc(c);var i=+new Date,j="single";if(Sb&&Sb.time>i-400&&Bc(Sb.pos,h))j="triple",Ee(a),setTimeout(ef(Mb,c),20),Yc(c,h.line);else if(Rb&&Rb.time>i-400&&Bc(Rb.pos,h)){j="double",Sb={time:i,pos:h},Ee(a);var k=Xc(ke(f,h.line).text,h);Ic(c.doc,k.from,k.to)}else Rb={time:i,pos:h};var l=h;if(c.options.dragDrop&&pf&&!Nb(c)&&!Bc(g.from,g.to)&&!Cc(h,g.from)&&!Cc(g.to,h)&&"single"==j){var m=Eb(c,function(b){e&&(d.scroller.draggable=!1),c.state.draggingText=!1,Le(document,"mouseup",m),Le(d.scroller,"drop",m),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(Ee(b),Ic(c.doc,h),Mb(c))});return e&&(d.scroller.draggable=!0),c.state.draggingText=m,d.scroller.dragDrop&&d.scroller.dragDrop(),Ke(document,"mouseup",m),Ke(d.scroller,"drop",m),void 0}Ee(a),"single"==j&&Ic(c.doc,Fc(f,h));var n=g.from,o=g.to,p=h,r=of(d.wrapper),s=0,w=Eb(c,function(a){b||Je(a)?u(a):v(a)}),x=Eb(c,v);Ke(document,"mousemove",w),Ke(document,"mouseup",x)}}}function Ub(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(of(a.display.gutters).right))return!1;d&&Ee(b);var h=a.display,i=of(h.lineDiv);if(g>i.bottom||!Se(a,c))return Ge(b);g-=i.top-h.viewOffset;for(var j=0;j<a.options.gutters.length;++j){var k=h.gutters.childNodes[j];if(k&&of(k).right>=f){var l=pe(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),Ge(b)}}}function Vb(a,b){return Se(a,"gutterContextMenu")?Ub(a,b,"gutterContextMenu",!1,Me):!1}function Wb(a,b){return Ub(a,b,"gutterClick",!0,Pe)}function Yb(a){var c=this;if(!(Qe(c,a)||Pb(c.display,a)||c.options.onDragEvent&&c.options.onDragEvent(c,De(a)))){Ee(a),b&&(Xb=+new Date);var d=Qb(c,a,!0),e=a.dataTransfer.files;if(d&&!Nb(c))if(e&&e.length&&window.FileReader&&window.File)for(var f=e.length,g=Array(f),h=0,i=function(a,b){var e=new FileReader;e.onload=function(){g[b]=e.result,++h==f&&(d=Fc(c.doc,d),tc(c.doc,{from:d,to:d,text:vf(g.join("\n")),origin:"paste"},"around"))},e.readAsText(a)},j=0;f>j;++j)i(e[j],j);else{if(c.state.draggingText&&!Cc(d,c.doc.sel.from)&&!Cc(c.doc.sel.to,d))return c.state.draggingText(a),setTimeout(ef(Mb,c),20),void 0;try{var g=a.dataTransfer.getData("Text");if(g){var k=c.doc.sel.from,l=c.doc.sel.to;Kc(c.doc,d,d),c.state.draggingText&&zc(c.doc,"",k,l,"paste"),c.replaceSelection(g,null,"paste"),Mb(c),lc(c)}}catch(a){}}}}function Zb(a,c){if(b&&(!a.state.draggingText||+new Date-Xb<100))return He(c),void 0;if(!Qe(a,c)&&!Pb(a.display,c)){var d=a.getSelection();if(c.dataTransfer.setData("Text",d),c.dataTransfer.setDragImage&&!i){var e=kf("img",null,null,"position: fixed; left: 0; top: 0;");h&&(e.width=e.height=1,a.display.wrapper.appendChild(e),e._top=e.offsetTop),c.dataTransfer.setDragImage(e,0,0),h&&e.parentNode.removeChild(e)}}}function $b(b,c){Math.abs(b.doc.scrollTop-c)<2||(b.doc.scrollTop=c,a||P(b,[],c),b.display.scroller.scrollTop!=c&&(b.display.scroller.scrollTop=c),b.display.scrollbarV.scrollTop!=c&&(b.display.scrollbarV.scrollTop=c),a&&P(b,[]),ab(b,100))}function _b(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,L(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function cc(b,c){var d=c.wheelDeltaX,f=c.wheelDeltaY;null==d&&c.detail&&c.axis==c.HORIZONTAL_AXIS&&(d=c.detail),null==f&&c.detail&&c.axis==c.VERTICAL_AXIS?f=c.detail:null==f&&(f=c.wheelDelta);var g=b.display,i=g.scroller;if(d&&i.scrollWidth>i.clientWidth||f&&i.scrollHeight>i.clientHeight){if(f&&p&&e)for(var j=c.target;j!=i;j=j.parentNode)if(j.lineObj){b.display.currentWheelTarget=j;break}if(d&&!a&&!h&&null!=bc)return f&&$b(b,Math.max(0,Math.min(i.scrollTop+f*bc,i.scrollHeight-i.clientHeight))),_b(b,Math.max(0,Math.min(i.scrollLeft+d*bc,i.scrollWidth-i.clientWidth))),Ee(c),g.wheelStartX=null,void 0;if(f&&null!=bc){var k=f*bc,l=b.doc.scrollTop,m=l+g.wrapper.clientHeight;0>k?l=Math.max(0,l+k-50):m=Math.min(b.doc.height,m+k+50),P(b,[],{top:l,bottom:m})}20>ac&&(null==g.wheelStartX?(g.wheelStartX=i.scrollLeft,g.wheelStartY=i.scrollTop,g.wheelDX=d,g.wheelDY=f,setTimeout(function(){if(null!=g.wheelStartX){var a=i.scrollLeft-g.wheelStartX,b=i.scrollTop-g.wheelStartY,c=b&&g.wheelDY&&b/g.wheelDY||a&&g.wheelDX&&a/g.wheelDX;g.wheelStartX=g.wheelStartY=null,c&&(bc=(bc*ac+c)/(ac+1),++ac)}},200)):(g.wheelDX+=d,g.wheelDY+=f))}}function dc(a,b,c){if("string"==typeof b&&(b=id[b],!b))return!1;a.display.pollingFast&&Kb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Nb(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Ve}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function ec(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function gc(a,b){var c=kd(a.options.keyMap),e=c.auto;clearTimeout(fc),e&&!md(b)&&(fc=setTimeout(function(){kd(a.options.keyMap)==c&&(a.options.keyMap=e.call?e.call(null,a):e,C(a))},50));var f=nd(b,!0),g=!1;if(!f)return!1;var h=ec(a);return g=b.shiftKey?ld("Shift-"+f,h,function(b){return dc(a,b,!0)})||ld(f,h,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?dc(a,b):void 0}):ld(f,h,function(b){return dc(a,b)}),g&&(Ee(b),_(a),d&&(b.oldKeyCode=b.keyCode,b.keyCode=0),Pe(a,"keyHandled",a,f,b)),g}function hc(a,b,c){var d=ld("'"+c+"'",ec(a),function(b){return dc(a,b,!0)});return d&&(Ee(b),_(a),Pe(a,"keyHandled",a,"'"+c+"'",b)),d}function jc(a){var c=this;if(c.state.focused||lc(c),!(Qe(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,De(a)))){b&&27==a.keyCode&&(a.returnValue=!1);var d=a.keyCode;c.doc.sel.shift=16==d||a.shiftKey;var e=gc(c,a);h&&(ic=e?d:null,!e&&88==d&&!xf&&(p?a.metaKey:a.ctrlKey)&&c.replaceSelection(""))}}function kc(a){var c=this;if(!(Qe(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,De(a)))){var e=a.keyCode,f=a.charCode;if(h&&e==ic)return ic=null,Ee(a),void 0;if(!(h&&(!a.which||a.which<10)||j)||!gc(c,a)){var g=String.fromCharCode(null==f?e:f);this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Nb(this)&&this.doc.mode.electricChars.indexOf(g)>-1&&setTimeout(Eb(c,function(){Tc(c,c.doc.sel.to.line,"smart")}),75),hc(c,a,g)||(b&&!d&&(c.display.inputHasSelection=null),Jb(c))}}}function lc(a){"nocursor"!=a.options.readOnly&&(a.state.focused||(Me(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Lb(a,!0),e&&setTimeout(ef(Lb,a,!0),0))),Ib(a),_(a))}function mc(a){a.state.focused&&(Me(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)},150)}function oc(a,c){function k(){if(null!=e.input.selectionStart){var a=e.input.value="\u200b"+(Bc(f.from,f.to)?"":e.input.value);e.prevInput="\u200b",e.input.selectionStart=1,e.input.selectionEnd=a.length}}function l(){if(e.inputDiv.style.position="relative",e.input.style.cssText=j,d&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=i),Ib(a),null!=e.input.selectionStart){(!b||d)&&k(),clearTimeout(nc);var c=0,f=function(){" "==e.prevInput&&0==e.input.selectionStart?Eb(a,id.selectAll)(a):c++<10?nc=setTimeout(f,500):Lb(a)};nc=setTimeout(f,200)}}if(!Qe(a,c,"contextmenu")){var e=a.display,f=a.doc.sel;if(!Pb(e,c)&&!Vb(a,c)){var g=Qb(a,c),i=e.scroller.scrollTop;if(g&&!h){(Bc(f.from,f.to)||Cc(g,f.from)||!Cc(g,f.to))&&Eb(a,Kc)(a.doc,g,g);var j=e.input.style.cssText;if(e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(c.clientY-5)+"px; left: "+(c.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",Mb(a),Lb(a,!0),Bc(f.from,f.to)&&(e.input.value=e.prevInput=" "),b&&!d&&k(),t){He(c);var m=function(){Le(window,"mouseup",m),setTimeout(l,20)};Ke(window,"mouseup",m)}else setTimeout(l,50)}}}}function qc(a,b,c){if(!Cc(b.from,c))return Fc(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d){var e=c.line-d,f=a.first+a.size-1;return e>f?Ac(f,ke(a,f).text.length):Gc(c,ke(a,e).text.length)}if(c.line==b.to.line+d)return Gc(c,$e(b.text).length+(1==b.text.length?b.from.ch:0)+ke(a,b.to.line).text.length-b.to.ch);var g=c.line-b.from.line;return Gc(c,b.text[g].length+(g?0:b.from.ch))}function rc(a,b,c){if(c&&"object"==typeof c)return{anchor:qc(a,b,c.anchor),head:qc(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=pc(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};var e=function(a){if(Cc(a,b.from))return a;if(!Cc(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,e=a.ch;return a.line==b.to.line&&(e+=d.ch-b.to.ch),Ac(c,e)};return{anchor:e(a.sel.anchor),head:e(a.sel.head)}}function sc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=Fc(a,b)),c&&(this.to=Fc(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),Me(a,"beforeChange",a,d),a.cm&&Me(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function tc(a,b,c,d){if(a.cm){if(!a.cm.curOp)return Eb(a.cm,tc)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(!(Se(a,"beforeChange")||a.cm&&Se(a.cm,"beforeChange"))||(b=sc(a,b,!0))){var e=u&&!d&&Ad(a,b.from,b.to);if(e){for(var f=e.length-1;f>=1;--f)uc(a,{from:e[f].from,to:e[f].to,text:[""]});e.length&&uc(a,{from:e[0].from,to:e[0].to,text:b.text},c)}else uc(a,b,c)}}function uc(a,b,c){var d=rc(a,b,c);ve(a,b,d,a.cm?a.cm.curOp.id:0/0),xc(a,b,d,yd(a,b));var e=[];ie(a,function(a,c){c||-1!=af(e,a.history)||(Be(a.history,b),e.push(a.history)),xc(a,b,null,yd(a,b))})}function vc(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c=a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e),c.generation=d.generation||++c.maxGeneration;for(var f=Se(a,"beforeChange")||a.cm&&Se(a.cm,"beforeChange"),g=d.changes.length-1;g>=0;--g){var h=d.changes[g];if(h.origin=b,f&&!sc(a,h,!1))return("undo"==b?c.done:c.undone).length=0,void 0;e.changes.push(ue(a,h));var i=g?rc(a,h,null):{anchor:d.anchorBefore,head:d.headBefore};xc(a,h,i,zd(a,h));var j=[];ie(a,function(a,b){b||-1!=af(j,a.history)||(Be(a.history,h),j.push(a.history)),xc(a,h,null,zd(a,h))})}}}}function wc(a,b){function c(a){return Ac(a.line+b,a.ch)}a.first+=b,a.cm&&Hb(a.cm,a.first,a.first,b),a.sel.head=c(a.sel.head),a.sel.anchor=c(a.sel.anchor),a.sel.from=c(a.sel.from),a.sel.to=c(a.sel.to)}function xc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Eb(a.cm,xc)(a,b,c,d);if(b.to.line<a.first)return wc(a,b.text.length-1-(b.to.line-b.from.line)),void 0;if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);wc(a,e),b={from:Ac(a.first,0),to:Ac(b.to.line+e,b.to.ch),text:[$e(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Ac(f,ke(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=le(a,b.from,b.to),c||(c=rc(a,b,null)),a.cm?yc(a.cm,b,d,c):be(a,b,d,c)}}function yc(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=oe(Ed(e,ke(e,g.line))),e.iter(j,h.line+1,function(a){return a==f.maxLine?(i=!0,!0):void 0})),Cc(e.sel.head,b.from)||Cc(b.to,e.sel.head)||(a.curOp.cursorActivity=!0),be(e,b,c,d,A(a)),a.options.lineWrapping||(e.iter(j,g.line+b.text.length,function(a){var b=G(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),e.frontier=Math.min(e.frontier,g.line),ab(a,400);var k=b.text.length-(h.line-g.line)-1;if(Hb(a,g.line,h.line+1,k),Se(a,"change")){var l={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};if(a.curOp.textChanged){for(var m=a.curOp.textChanged;m.next;m=m.next);m.next=l}else a.curOp.textChanged=l}}function zc(a,b,c,d,e){if(d||(d=c),Cc(d,c)){var f=d;d=c,c=f}"string"==typeof b&&(b=vf(b)),tc(a,{from:c,to:d,text:b,origin:e},null)}function Ac(a,b){return this instanceof Ac?(this.line=a,this.ch=b,void 0):new Ac(a,b)}function Bc(a,b){return a.line==b.line&&a.ch==b.ch}function Cc(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function Dc(a){return Ac(a.line,a.ch)}function Ec(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Fc(a,b){if(b.line<a.first)return Ac(a.first,0);var c=a.first+a.size-1;return b.line>c?Ac(c,ke(a,c).text.length):Gc(b,ke(a,b.line).text.length)}function Gc(a,b){var c=a.ch;return null==c||c>b?Ac(a.line,b):0>c?Ac(a.line,0):a}function Hc(a,b){return b>=a.first&&b<a.first+a.size}function Ic(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=Cc(b,e);f!=Cc(c,e)?(e=b,b=c):f!=Cc(b,c)&&(b=c)}Kc(a,e,b,d)}else Kc(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function Jc(a,b,c){var d={anchor:b,head:c};return Me(a,"beforeSelectionChange",a,d),a.cm&&Me(a.cm,"beforeSelectionChange",a.cm,d),d.anchor=Fc(a,d.anchor),d.head=Fc(a,d.head),d}function Kc(a,b,c,d,e){if(!e&&Se(a,"beforeSelectionChange")||a.cm&&Se(a.cm,"beforeSelectionChange")){var f=Jc(a,b,c);c=f.head,b=f.anchor}var g=a.sel;if(g.goalColumn=null,(e||!Bc(b,g.anchor))&&(b=Mc(a,b,d,"push"!=e)),(e||!Bc(c,g.head))&&(c=Mc(a,c,d,"push"!=e)),!Bc(g.anchor,b)||!Bc(g.head,c)){g.anchor=b,g.head=c;var h=Cc(c,b);g.from=h?c:b,g.to=h?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),Pe(a,"cursorActivity",a)}}function Lc(a){Kc(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Mc(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=ke(a,f.line);if(h.markedSpans)for(var i=0;i<h.markedSpans.length;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&(Me(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find()[0>g?"from":"to"];if(Bc(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?Fc(a,Ac(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?Ac(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,Ac(a.first,0)):Mc(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Nc(a){var b=Oc(a,a.doc.sel.head,a.options.cursorScrollMargin);if(a.state.focused){var c=a.display,d=of(c.sizer),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!m){var f="none"==c.cursor.style.display;f&&(c.cursor.style.display="",c.cursor.style.left=b.left+"px",c.cursor.style.top=b.top-c.viewOffset+"px"),c.cursor.scrollIntoView(e),f&&(c.cursor.style.display="none")}}}function Oc(a,b,c){for(null==c&&(c=0);;){var d=!1,e=ub(a,b),f=Qc(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;if(null!=f.scrollTop&&($b(a,f.scrollTop),Math.abs(a.doc.scrollTop-g)>1&&(d=!0)),null!=f.scrollLeft&&(_b(a,f.scrollLeft),Math.abs(a.doc.scrollLeft-h)>1&&(d=!0)),!d)return e}}function Pc(a,b,c,d,e){var f=Qc(a,b,c,d,e);null!=f.scrollTop&&$b(a,f.scrollTop),null!=f.scrollLeft&&_b(a,f.scrollLeft)}function Qc(a,b,c,d,e){var f=a.display,g=zb(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-Ue,i=f.scroller.scrollTop,j={},k=a.doc.height+fb(f),l=g>c,m=e>k-g;if(i>c)j.scrollTop=l?0:c;else if(e>i+h){var n=Math.min(c,(m?k:e)-h);n!=i&&(j.scrollTop=n)}var o=f.scroller.clientWidth-Ue,p=f.scroller.scrollLeft;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=q+10>b;return p+q>b||r?(r&&(b=0),j.scrollLeft=Math.max(0,b-10-q)):d>o+p-3&&(j.scrollLeft=d+10-o),j}function Rc(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Sc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop}),e=a.display.scroller;d.scrollTop=Math.max(0,Math.min(e.scrollHeight-e.clientHeight,d.scrollTop+c)),d.scrollLeft=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,d.scrollLeft+b))}function Tc(a,b,c,d){var e=a.doc;if(null==c&&(c="add"),"smart"==c)if(a.doc.mode.indent)var f=db(a,b);else c="prev";var k,g=a.options.tabSize,h=ke(e,b),i=Xe(h.text,null,g),j=h.text.match(/^\s*/)[0];if("smart"==c&&(k=a.doc.mode.indent(f,h.text.slice(j.length),h.text),k==Ve)){if(!d)return;c="prev"}"prev"==c?k=b>e.first?Xe(ke(e,b-1).text,null,g):0:"add"==c?k=i+a.options.indentUnit:"subtract"==c?k=i-a.options.indentUnit:"number"==typeof c&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";k>m&&(l+=Ze(k-m)),l!=j&&zc(a.doc,l,Ac(b,0),Ac(b,j.length),"+input"),h.stateAfter=null}function Uc(a,b,c){var d=b,e=b,f=a.doc;return"number"==typeof b?e=ke(f,Ec(f,b)):d=oe(b),null==d?null:c(e,d)?(Hb(a,d,d+1),e):null}function Vc(a,b,c,d,e){function k(){var b=f+c;return b<a.first||b>=a.first+a.size?j=!1:(f=b,i=ke(a,b))}function l(a){var b=(e?Kf:Lf)(i,g,c,!0);if(null==b){if(a||!k())return j=!1;g=e?(0>c?Df:Cf)(i):0>c?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=ke(a,f),j=!0;if("char"==d)l();else if("column"==d)l(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=!0;!(0>c)||l(!o);o=!1){var p=i.text.charAt(g)||"\n",q=gf(p)?"w":n?/\s/.test(p)?null:"p":null;if(m&&m!=q){0>c&&(c=1,l());break}if(q&&(m=q),c>0&&!l(!o))break}var r=Mc(a,Ac(f,g),h,!0);return j||(r.hitSide=!0),r}function Wc(a,b,c,d){var g,e=a.doc,f=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(0>c?1.5:.5)*zb(a.display))}else"line"==d&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=wb(a,f,g);if(!i.outside)break;if(0>c?0>=g:g>=e.height){i.hitSide=!0;break}g+=5*c}return i}function Xc(a,b){var c=b.ch,d=b.ch;if(a){(b.xRel<0||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),f=gf(e)?gf:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!gf(a)};c>0&&f(a.charAt(c-1));)--c;for(;d<a.length&&f(a.charAt(d));)++d}return{from:Ac(b.line,c),to:Ac(b.line,d)}}function Yc(a,b){Ic(a.doc,Ac(b,0),Fc(a.doc,Ac(b+1,0)))}function _c(a,b,c,d){w.defaults[a]=b,c&&(Zc[a]=d?function(a,b,d){d!=ad&&c(a,b,d)}:c)}function gd(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c}function hd(a,b,c){return a.startState?a.startState(b,c):!0}function kd(a){return"string"==typeof a?jd[a]:a}function ld(a,b,c){function d(b){b=kd(b);var e=b[a];if(e===!1)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";var f=b.fallthrough;if(null==f)return!1;if("[object Array]"!=Object.prototype.toString.call(f))return d(f);for(var g=0,h=f.length;h>g;++g){var i=d(f[g]);if(i)return i}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function md(a){var b=yf[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b}function nd(a,b){if(h&&34==a.keyCode&&a["char"])return!1;var c=yf[a.keyCode];return null==c||a.altGraphKey?!1:(a.altKey&&(c="Alt-"+c),(s?a.metaKey:a.ctrlKey)&&(c="Ctrl-"+c),(s?a.ctrlKey:a.metaKey)&&(c="Cmd-"+c),!b&&a.shiftKey&&(c="Shift-"+c),c)}function od(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0}function pd(a,b){this.lines=[],this.type=b,this.doc=a}function qd(a,b,c,d,e){if(d&&d.shared)return sd(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Eb(a.cm,qd)(a,b,c,d,e);var f=new pd(a,e);if("range"==e&&!Cc(b,c))return f;d&&cf(d,f),f.replacedWith&&(f.collapsed=!0,f.replacedWith=kf("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents=!0)),f.collapsed&&(v=!0),f.addToHistory&&ve(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},0/0);var i,j,l,g=b.line,h=0,k=a.cm;if(a.iter(g,c.line+1,function(d){k&&f.collapsed&&!k.options.lineWrapping&&Ed(a,d)==k.display.maxLine&&(l=!0);var e={from:null,to:null,marker:f};h+=d.text.length,g==b.line&&(e.from=b.ch,h-=b.ch),g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch),f.collapsed&&(g==c.line&&(j=Bd(d,c.ch)),g==b.line?i=Bd(d,b.ch):ne(d,0)),vd(d,e),++g}),f.collapsed&&a.iter(b.line,c.line+1,function(b){Fd(a,b)&&ne(b,0)}),f.clearOnEnter&&Ke(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(u=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed){if(i!=j)throw new Error("Inserting collapsed marker overlapping an existing one");f.size=h,f.atomic=!0}return k&&(l&&(k.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&Hb(k,b.line,c.line+1),f.atomic&&Lc(k)),f}function rd(a,b){this.markers=a,this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,Ke(a[c],"clear",function(){d.clear()})}function sd(a,b,c,d,e){d=cf(d),d.shared=!1;var f=[qd(a,b,c,d,e)],g=f[0],h=d.replacedWith;return ie(a,function(a){h&&(d.replacedWith=h.cloneNode(!0)),f.push(qd(a,Fc(a,b),Fc(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=$e(f)}),new rd(f,g)}function td(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function ud(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function vd(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function wd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||"bookmark"==g.type&&f.from==b&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(e||(e=[])).push({from:f.from,to:i?null:f.to,marker:g})}}return e}function xd(a,b,c){if(a)for(var e,d=0;d<a.length;++d){var f=a[d],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||"bookmark"==g.type&&f.from==b&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(e||(e=[])).push({from:i?null:f.from-b,to:null==f.to?null:f.to-b,marker:g})}}return e}function yd(a,b){var c=Hc(a,b.from.line)&&ke(a,b.from.line).markedSpans,d=Hc(a,b.to.line)&&ke(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=Bc(b.from,b.to),h=wd(c,e,g),i=xd(d,f,g),j=1==b.text.length,k=$e(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=td(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=td(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}if(j&&h){for(var l=0;l<h.length;++l)null!=h[l].from&&h[l].from==h[l].to&&"bookmark"!=h[l].marker.type&&h.splice(l--,1);h.length||(h=null)}var o=[h];if(!j){var q,p=b.text.length-2;if(p>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(q||(q=[])).push({from:null,to:null,marker:h[l].marker});for(var l=0;p>l;++l)o.push(q);o.push(i)}return o}function zd(a,b){var c=xe(a,b),d=yd(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function Ad(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=af(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(),i=0;i<e.length;++i){var j=e[i];if(!Cc(j.to,h.from)&&!Cc(h.to,j.from)){var k=[i,1];(Cc(j.from,h.from)||!g.inclusiveLeft&&Bc(j.from,h.from))&&k.push({from:j.from,to:h.from}),(Cc(h.to,j.to)||!g.inclusiveRight&&Bc(j.to,h.to))&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function Bd(a,b){var d,c=v&&a.markedSpans;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function Cd(a){return Bd(a,-1)}function Dd(a){return Bd(a,a.text.length+1)}function Ed(a,b){for(var c;c=Cd(b);)b=ke(a,c.find().from.line);return b}function Fd(a,b){var c=v&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Gd(a,b,d))return!0}}function Gd(a,b,c){if(null==c.to){var d=c.marker.find().to,e=ke(a,d.line);return Gd(a,e,td(e.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var f,g=0;g<b.markedSpans.length;++g)if(f=b.markedSpans[g],f.marker.collapsed&&!f.marker.replacedWith&&f.from==c.to&&(f.marker.inclusiveLeft||c.marker.inclusiveRight)&&Gd(a,b,f))return!0}function Hd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Id(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Kd(a){return function(){var b=!this.cm.curOp;b&&Cb(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Db(this.cm)}return c}}function Ld(a){return null!=a.height?a.height:(a.node.parentNode&&1==a.node.parentNode.nodeType||mf(a.cm.display.measure,kf("div",[a.node],null,"position: relative")),a.height=a.node.offsetHeight)}function Md(a,b,c,d){var e=new Jd(a,c,d);return e.noHScroll&&(a.display.alignWidgets=!0),Uc(a,b,function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,!Fd(a.doc,b)||e.showIfHidden){var d=qe(a,b)<a.doc.scrollTop;ne(b,b.height+Ld(e)),d&&Sc(a,0,e.height)}return!0}),e}function Od(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),Hd(a),Id(a,c);var e=d?d(a):1;e!=a.height&&ne(a,e)}function Pd(a){a.parent=null,Hd(a)}function Qd(a,b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var j,g=0,h=null,i=new od(b,a.options.tabSize);for(""==b&&c.blankLine&&c.blankLine(d);!i.eol();)i.pos>a.options.maxHighlightLength?(f=!1,i.pos=b.length,j=null):j=c.token(i,d),f&&h==j||(g<i.start&&e(i.start,h),g=i.start,h=j),i.start=i.pos;for(;g<i.pos;){var k=Math.min(i.pos,g+5e4);e(k,h),g=k}}function Rd(a,b,c){var d=[a.state.modeGen];Qd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(var e=0;e<a.state.overlays.length;++e){var f=a.state.overlays[e],g=1,h=0;Qd(a,b.text,f.mode,!0,function(a,b){for(var c=g;a>h;){var e=d[g];e>a&&d.splice(g,1,a,d[g+1],e),g+=2,h=Math.min(a,e)}if(b)if(f.opaque)d.splice(c,g-c,a,b),g=c+2;else for(;g>c;c+=2){var i=d[c+1];d[c+1]=i?i+" "+b:b}})}return d}function Sd(a,b){return b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Rd(a,b,b.stateAfter=db(a,oe(b)))),b.styles}function Td(a,b,c){var d=a.doc.mode,e=new od(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&e.pos<=a.options.maxHighlightLength;)d.token(e,c),e.start=e.pos}function Vd(a){return a?Ud[a]||(Ud[a]="cm-"+a.replace(/ +/g," cm-")):null}function Wd(a,c,d,f){for(var g,h=c,i=!0;g=Cd(h);)h=ke(a.doc,g.find().from.line);var j={pre:kf("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:f};h.textClass&&(j.pre.className=h.textClass);do{h.text&&(i=!1),j.measure=h==c&&d,j.pos=0,j.addToken=j.measure?Zd:Yd,(b||e)&&a.getOption("lineWrapping")&&(j.addToken=$d(j.addToken));var k=ae(h,j,Sd(a,h));d&&h==c&&!j.measuredSomething&&(d[0]=j.pre.appendChild(uf(a.display.measure)),j.measuredSomething=!0),k&&(h=ke(a.doc,k.to.line))}while(k);!d||j.measuredSomething||d[0]||(d[0]=j.pre.appendChild(i?kf("span","\xa0"):uf(a.display.measure))),j.pre.firstChild||Fd(a.doc,c)||j.pre.appendChild(document.createTextNode("\xa0"));var l;if(d&&b&&(l=re(h))){var m=l.length-1;l[m].from==l[m].to&&--m;var n=l[m],o=l[m-1];if(n.from+1==n.to&&o&&n.level<o.level){var p=d[j.pos-1];p&&p.parentNode.insertBefore(p.measureRight=uf(a.display.measure),p.nextSibling)}}return Me(a,"renderLine",a,c,j.pre),j.pre}function Yd(a,b,c,d,e,f){if(b){if(Xd.test(b))for(var g=document.createDocumentFragment(),h=0;;){Xd.lastIndex=h;var i=Xd.exec(b),j=i?i.index-h:b.length-h;if(j&&(g.appendChild(document.createTextNode(b.slice(h,h+j))),a.col+=j),!i)break;if(h+=j+1," "==i[0]){var k=a.cm.options.tabSize,l=k-a.col%k;g.appendChild(kf("span",Ze(l),"cm-tab")),a.col+=l}else{var m=kf("span","\u2022","cm-invalidchar");m.title="\\u"+i[0].charCodeAt(0).toString(16),g.appendChild(m),a.col+=1}}else{a.col+=b.length;var g=document.createTextNode(b)}if(c||d||e||a.measure){var n=c||"";d&&(n+=d),e&&(n+=e);var m=kf("span",[g],n);return f&&(m.title=f),a.pre.appendChild(m)}a.pre.appendChild(g)}}function Zd(a,c,d,e,f){for(var g=a.cm.options.lineWrapping,h=0;h<c.length;++h){var i=c.charAt(h),j=0==h;i>="\ud800"&&"\udbff">i&&h<c.length-1?(i=c.slice(h,h+2),++h):h&&g&&qf(c,h)&&a.pre.appendChild(kf("wbr"));var k=a.measure[a.pos],l=a.measure[a.pos]=Yd(a,i,d,j&&e,h==c.length-1&&f);k&&(l.leftSide=k.leftSide||k),b&&g&&" "==i&&h&&!/\s/.test(c.charAt(h-1))&&h<c.length-1&&!/\s/.test(c.charAt(h+1))&&(l.style.whiteSpace="normal"),a.pos+=i.length}c.length&&(a.measuredSomething=!0)}function $d(a){function b(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":"\xa0";return b+=" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/,b),e,f,g,h)}}function _d(a,b,c,d){var e=!d&&c.replacedWith;if(e&&(a.copyWidgets&&(e=e.cloneNode(!0)),a.pre.appendChild(e),a.measure)){if(b)a.measure[a.pos]=e;else{var f=uf(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]=a.pre.insertBefore(f,e)}else a.measure[a.pos]=a.pre.appendChild(f)}a.measuredSomething=!0}a.pos+=b}function ae(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var k,m,n,o,p,q,h=e.length,i=0,g=1,j="",l=0;;){if(l==i){m=n=o=p="",q=null,l=1/0;for(var r=[],s=0;s<d.length;++s){var t=d[s],u=t.marker;t.from<=i&&(null==t.to||t.to>i)?(null!=t.to&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||q.marker.size<u.size)&&(q=t)):t.from>i&&l>t.from&&(l=t.from),"bookmark"==u.type&&t.from==i&&u.replacedWith&&r.push(u)}if(q&&(q.from||0)==i&&(_d(b,(null==q.to?h:q.to)-i,q.marker,null==q.from),null==q.to))return q.marker.find();if(!q&&r.length)for(var s=0;s<r.length;++s)_d(b,0,r[s])}if(i>=h)break;for(var v=Math.min(h,l);;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=Vd(c[g++])}}else for(var g=1;g<c.length;g+=2)b.addToken(b,e.slice(f,f=c[g]),Vd(c[g+1]))}function be(a,b,c,d,e){function f(a){return c?c[a]:null}function g(a,c,d){Od(a,c,d,e),Pe(a,"change",a,b)}var h=b.from,i=b.to,j=b.text,k=ke(a,h.line),l=ke(a,i.line),m=$e(j),n=f(j.length-1),o=i.line-h.line;if(0==h.ch&&0==i.ch&&""==m){for(var p=0,q=j.length-1,r=[];q>p;++p)r.push(new Nd(j[p],f(p),e));g(l,l.text,n),o&&a.remove(h.line,o),r.length&&a.insert(h.line,r)}else if(k==l)if(1==j.length)g(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{for(var r=[],p=1,q=j.length-1;q>p;++p)r.push(new Nd(j[p],f(p),e));r.push(new Nd(m+k.text.slice(i.ch),n,e)),g(k,k.text.slice(0,h.ch)+j[0],f(0)),a.insert(h.line+1,r)}else if(1==j.length)g(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),f(0)),a.remove(h.line+1,o);else{g(k,k.text.slice(0,h.ch)+j[0],f(0)),g(l,m+l.text.slice(i.ch),n);for(var p=1,q=j.length-1,r=[];q>p;++p)r.push(new Nd(j[p],f(p),e));
6
- o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,r)}Pe(a,"change",a,b),Kc(a,d.anchor,d.head,null,!0)}function ce(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;c>b;++b)a[b].parent=this,d+=a[b].height;this.height=d}function de(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;e>d;++d){var f=a[d];b+=f.chunkSize(),c+=f.height,f.parent=this}this.size=b,this.height=c,this.parent=null}function ie(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function je(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,B(a),y(a),a.options.lineWrapping||H(a),a.options.mode=b.modeOption,Hb(a)}function ke(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(e>b){a=d;break}b-=e}return a.lines[b]}function le(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function me(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function ne(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function oe(a){if(null==a.parent)return null;for(var b=a.parent,c=af(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function pe(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;e>d;++d){var f=a.children[d],g=f.height;if(g>b){a=f;continue a}b-=g,c+=f.chunkSize()}return c}while(!a.lines);for(var d=0,e=a.lines.length;e>d;++d){var h=a.lines[d],i=h.height;if(i>b)break;b-=i}return c+d}function qe(a,b){b=Ed(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;c+=f.height}for(var g=d.parent;g;d=g,g=d.parent)for(var e=0;e<g.children.length;++e){var h=g.children[e];if(h==d)break;c+=h.height}return c}function re(a){var b=a.order;return null==b&&(b=a.order=Mf(a.text)),b}function se(a){return{done:[],undone:[],undoDepth:1/0,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function te(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ue(a,b){var c={line:b.from.line,ch:b.from.ch},d={from:c,to:pc(b),text:le(a,b.from,b.to)};return te(a,d,b.from.line,b.to.line+1),ie(a,function(a){te(a,d,b.from.line,b.to.line+1)},!0),d}function ve(a,b,c,d){var e=a.history;e.undone.length=0;var f=+new Date,g=$e(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=$e(g.changes);Bc(b.from,b.to)&&Bc(b.from,h.to)?h.to=pc(b):g.changes.push(ue(a,b)),g.anchorAfter=c.anchor,g.headAfter=c.head}else for(g={changes:[ue(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation=++e.maxGeneration;e.done.length>e.undoDepth;)e.done.shift();e.lastTime=f,e.lastOp=d,e.lastOrigin=b.origin}function we(a){if(!a)return null;for(var c,b=0;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function xe(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(we(c[d]));return e}function ye(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(var h=0;h<f.length;++h){var j,i=f[h];if(g.push({from:i.from,to:i.to,text:i.text}),b)for(var k in i)(j=k.match(/^spans_(\d+)$/))&&af(b,Number(j[1]))>-1&&($e(g)[k]=i[k],delete i[k])}}return d}function ze(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Ae(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var i=f.changes[h];if(f.copied||(i.from=Dc(i.from),i.to=Dc(i.to)),c<i.from.line)i.from.line+=d,i.to.line+=d;else if(b<=i.to.line){g=!1;break}}f.copied||(f.anchorBefore=Dc(f.anchorBefore),f.headBefore=Dc(f.headBefore),f.anchorAfter=Dc(f.anchorAfter),f.readAfter=Dc(f.headAfter),f.copied=!0),g?(ze(f.anchorBefore),ze(f.headBefore),ze(f.anchorAfter),ze(f.headAfter)):(a.splice(0,e+1),e=0)}}function Be(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Ae(a.done,c,d,e),Ae(a.undone,c,d,e)}function Ce(){He(this)}function De(a){return a.stop||(a.stop=Ce),a}function Ee(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Fe(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ge(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function He(a){Ee(a),Fe(a)}function Ie(a){return a.target||a.srcElement}function Je(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),p&&a.ctrlKey&&1==b&&(b=3),b}function Ke(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}}function Le(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}}}function Me(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function Pe(a,b){function e(a){return function(){a.apply(null,d)}}var c=a._handlers&&a._handlers[b];if(c){var d=Array.prototype.slice.call(arguments,2);Ne||(++Oe,Ne=[],setTimeout(Re,0));for(var f=0;f<c.length;++f)Ne.push(e(c[f]))}}function Qe(a,b,c){return Me(a,c||b.type,a,b),Ge(b)||b.codemirrorIgnore}function Re(){--Oe;var a=Ne;Ne=null;for(var b=0;b<a.length;++b)a[b]()}function Se(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function Te(a){a.prototype.on=function(a,b){Ke(this,a,b)},a.prototype.off=function(a,b){Le(this,a,b)}}function We(){this.id=null}function Xe(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;b>f;++f)" "==a.charAt(f)?g+=c-g%c:++g;return g}function Ze(a){for(;Ye.length<=a;)Ye.push($e(Ye)+" ");return Ye[a]}function $e(a){return a[a.length-1]}function _e(a){if(n)a.selectionStart=0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function af(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;d>c;++c)if(a[c]==b)return c;return-1}function bf(a,b){function c(){}c.prototype=a;var d=new c;return b&&cf(b,d),d}function cf(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function df(a){for(var b=[],c=0;a>c;++c)b.push(void 0);return b}function ef(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function gf(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||ff.test(a))}function hf(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function kf(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)nf(e,b);else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function lf(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function mf(a,b){return lf(a).appendChild(b)}function nf(a,b){d?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function of(a){return a.getBoundingClientRect()}function qf(){return!1}function sf(a){if(null!=rf)return rf;var b=kf("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return mf(a,b),b.offsetWidth&&(rf=b.offsetHeight-b.clientHeight),rf||0}function uf(a){if(null==tf){var b=kf("span","\u200b");mf(a,kf("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(tf=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return tf?kf("span","\u200b"):kf("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function zf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Af(a){return a.level%2?a.to:a.from}function Bf(a){return a.level%2?a.from:a.to}function Cf(a){var b=re(a);return b?Af(b[0]):0}function Df(a){var b=re(a);return b?Bf($e(b)):a.text.length}function Ef(a,b){var c=ke(a.doc,b),d=Ed(a.doc,c);d!=c&&(b=oe(d));var e=re(d),f=e?e[0].level%2?Df(d):Cf(d):0;return Ac(b,f)}function Ff(a,b){for(var c,d;c=Dd(d=ke(a.doc,b));)b=c.find().to.line;var e=re(d),f=e?e[0].level%2?Cf(d):Df(d):d.text.length;return Ac(b,f)}function Gf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function If(a,b){for(var d,c=0;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return Hf=null,c;if(e.from==b||e.to==b){if(null!=d)return Gf(a,e.level,a[d].level)?(Hf=d,c):(Hf=c,d);d=c}}return Hf=null,d}function Jf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&jf.test(a.text.charAt(b)));return b}function Kf(a,b,c,d){var e=re(a);if(!e)return Lf(a,b,c,d);for(var f=If(e,b),g=e[f],h=Jf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return If(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?Jf(a,g.to,-1,d):Jf(a,g.from,1,d)}}function Lf(a,b,c,d){var e=b+c;if(d)for(;e>0&&jf.test(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(null==document.documentMode||document.documentMode<8),d=b&&(null==document.documentMode||document.documentMode<9),e=/WebKit\//.test(navigator.userAgent),f=e&&/Qt\/\d+\.\d+/.test(navigator.userAgent),g=/Chrome\//.test(navigator.userAgent),h=/Opera\//.test(navigator.userAgent),i=/Apple Computer/.test(navigator.vendor),j=/KHTML\//.test(navigator.userAgent),k=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),m=/PhantomJS/.test(navigator.userAgent),n=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),o=n||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),p=n||/Mac/.test(navigator.platform),q=/win/i.test(navigator.platform),r=h&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);r&&(r=Number(r[1])),r&&r>=15&&(h=!1,e=!0);var yb,Rb,Sb,s=p&&(f||h&&(null==r||12.11>r)),t=a||b&&!d,u=!1,v=!1,Bb=0,Xb=0,ac=0,bc=null;b?bc=-.53:a?bc=15:g?bc=-.7:i&&(bc=-1/3);var fc,nc,ic=null,pc=w.changeEnd=function(a){return a.text?Ac(a.from.line+a.text.length-1,$e(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};w.Pos=Ac,w.prototype={constructor:w,focus:function(){window.focus(),Mb(this),lc(this),Jb(this)},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Zc.hasOwnProperty(a)&&Eb(this,Zc[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:Eb(null,function(a,b){var c=a.token?a:w.getMode(this.options,a);if(c.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque}),this.state.modeGen++,Hb(this)}),removeOverlay:Eb(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,Hb(this),void 0}}),indentLine:Eb(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),Hc(this.doc,a)&&Tc(this,a,b,c)}),indentSelection:Eb(null,function(a){var b=this.doc.sel;if(Bc(b.from,b.to))return Tc(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),d=b.from.line;c>=d;++d)Tc(this,d,a)}),getTokenAt:function(a,b){var c=this.doc;a=Fc(c,a);for(var d=db(this,a.line,b),e=this.doc.mode,f=ke(c,a.line),g=new od(f.text,this.options.tabSize);g.pos<a.ch&&!g.eol();){g.start=g.pos;var h=e.token(g,d)}return{start:g.start,end:g.pos,string:g.current(),className:h||null,type:h||null,state:d}},getTokenTypeAt:function(a){a=Fc(this.doc,a);var b=Sd(this,ke(this.doc,a.line)),c=0,d=(b.length-1)/2,e=a.ch;if(0==e)return b[2];for(;;){var f=c+d>>1;if((f?b[2*f-1]:0)>=e)d=f;else{if(!(b[2*f+1]<e))return b[2*f+2];c=f+1}}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?w.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){if(fd.hasOwnProperty(b)){var c=fd[b],d=this.getModeAt(a);return d[b]&&c[d[b]]||d.helperType&&c[d.helperType]||c[d.name]}},getStateAfter:function(a,b){var c=this.doc;return a=Ec(c,null==a?c.first+c.size-1:a),db(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel;return c=null==a?d.head:"object"==typeof a?Fc(this.doc,a):a?d.from:d.to,ub(this,c,b||"page")},charCoords:function(a,b){return tb(this,Fc(this.doc,a),b||"page")},coordsChar:function(a,b){return a=sb(this,a,b||"page"),wb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=sb(this,{top:a,left:0},b||"page").top,pe(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);var e=ke(this.doc,a);return rb(this,ke(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return zb(this.display)},defaultCharWidth:function(){return Ab(this.display)},setGutterMarker:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&hf(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Eb(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Hb(b,d,d+1),hf(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[d]){if(new RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Eb(null,function(a,b,c){return Uc(this,a,function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Eb(null,function(a,b,c){return Md(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"==typeof a){if(!Hc(this.doc,a))return null;var b=a;if(a=ke(this.doc,a),!a)return null}else{var b=oe(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=ub(this,Fc(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Pc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Eb(null,jc),execCommand:function(a){return id[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=Fc(this.doc,a);b>f&&(g=Vc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Eb(null,function(a,b){var d,c=this.doc.sel;d=c.shift||c.extend||Bc(c.from,c.to)?Vc(this.doc,c.head,a,b,this.options.rtlMoveVisually):0>a?c.from:c.to,Ic(this.doc,d,d,a)}),deleteH:Eb(null,function(a,b){var c=this.doc.sel;Bc(c.from,c.to)?zc(this.doc,"",c.from,Vc(this.doc,c.head,a,b,!1),"+delete"):zc(this.doc,"",c.from,c.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=Fc(this.doc,a);b>g;++g){var i=ub(this,h,"div");if(null==f?f=i.left:i.left=f,h=Wc(this,i,e,c),h.hitSide)break}return h},moveV:Eb(null,function(a,b){var c=this.doc.sel,d=ub(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn);var e=Wc(this,d,a,b);"page"==b&&Sc(this,0,tb(this,e,"div").top-d.top),Ic(this.doc,e,e,a),c.goalColumn=d.left}),toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""))},hasFocus:function(){return this.state.focused},scrollTo:Eb(null,function(a,b){Rc(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller,b=Ue;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:Eb(null,function(a,b){"number"==typeof a&&(a=Ac(a,0)),b||(b=0);var c=a;a&&null==a.line||(this.curOp.scrollToPos=a?Fc(this.doc,a):this.doc.sel.head,this.curOp.scrollToPosMargin=b,c=ub(this,this.curOp.scrollToPos));var d=Qc(this,c.left,c.top-b,c.right,c.bottom+b);Rc(this,d.scrollLeft,d.scrollTop)}),setSize:Eb(null,function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a)),null!=b&&(this.display.wrapper.style.height=c(b)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0}),operation:function(a){return Gb(this,a)},refresh:Eb(null,function(){ob(this),Rc(this,this.doc.scrollLeft,this.doc.scrollTop),Hb(this)}),swapDoc:Eb(null,function(a){var b=this.doc;return b.cm=null,je(this,a),ob(this),Lb(this,!0),Rc(this,a.scrollLeft,a.scrollTop),b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Te(w);var Zc=w.optionHandlers={},$c=w.defaults={},ad=w.Init={toString:function(){return"CodeMirror.Init"}};_c("value","",function(a,b){a.setValue(b)},!0),_c("mode",null,function(a,b){a.doc.modeOption=b,y(a)},!0),_c("indentUnit",2,y,!0),_c("indentWithTabs",!1),_c("smartIndent",!0),_c("tabSize",4,function(a){y(a),ob(a),Hb(a)},!0),_c("electricChars",!0),_c("rtlMoveVisually",!q),_c("theme","default",function(a){D(a),E(a)},!0),_c("keyMap","default",C),_c("extraKeys",null),_c("onKeyEvent",null),_c("onDragEvent",null),_c("lineWrapping",!1,z,!0),_c("gutters",[],function(a){I(a.options),E(a)},!0),_c("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?O(a.display)+"px":"0",a.refresh()},!0),_c("coverGutterNextToScrollbar",!1,J,!0),_c("lineNumbers",!1,function(a){I(a.options),E(a)},!0),_c("firstLineNumber",1,E,!0),_c("lineNumberFormatter",function(a){return a},E,!0),_c("showCursorWhenSelecting",!1,Y,!0),_c("readOnly",!1,function(a,b){"nocursor"==b?(mc(a),a.display.input.blur()):b||Lb(a,!0)}),_c("dragDrop",!0),_c("cursorBlinkRate",530),_c("cursorScrollMargin",0),_c("cursorHeight",1),_c("workTime",100),_c("workDelay",100),_c("flattenSpans",!0),_c("pollInterval",100),_c("undoDepth",40,function(a,b){a.doc.history.undoDepth=b}),_c("historyEventDelay",500),_c("viewportMargin",10,function(a){a.refresh()},!0),_c("maxHighlightLength",1e4,function(a){y(a),a.refresh()},!0),_c("crudeMeasuringFrom",1e4),_c("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)}),_c("tabindex",null,function(a,b){a.display.input.tabIndex=b||""}),_c("autofocus",null);var bd=w.modes={},cd=w.mimeModes={};w.defineMode=function(a,b){if(w.defaults.mode||"null"==a||(w.defaults.mode=a),arguments.length>2){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}bd[a]=b},w.defineMIME=function(a,b){cd[a]=b},w.resolveMode=function(a){if("string"==typeof a&&cd.hasOwnProperty(a))a=cd[a];else if(a&&"string"==typeof a.name&&cd.hasOwnProperty(a.name)){var b=cd[a.name];a=bf(b,a),a.name=b.name}else if("string"==typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return w.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}},w.getMode=function(a,b){var b=w.resolveMode(b),c=bd[b.name];if(!c)return w.getMode(a,"text/plain");var d=c(a,b);if(dd.hasOwnProperty(b.name)){var e=dd[b.name];for(var f in e)e.hasOwnProperty(f)&&(d.hasOwnProperty(f)&&(d["_"+f]=d[f]),d[f]=e[f])}return d.name=b.name,d},w.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),w.defineMIME("text/plain","null");var dd=w.modeExtensions={};w.extendMode=function(a,b){var c=dd.hasOwnProperty(a)?dd[a]:dd[a]={};cf(b,c)},w.defineExtension=function(a,b){w.prototype[a]=b},w.defineDocExtension=function(a,b){fe.prototype[a]=b},w.defineOption=_c;var ed=[];w.defineInitHook=function(a){ed.push(a)};var fd=w.helpers={};w.registerHelper=function(a,b,c){fd.hasOwnProperty(a)||(fd[a]=w[a]={}),fd[a][b]=c},w.isWordChar=gf,w.copyState=gd,w.startState=hd,w.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var id=w.commands={selectAll:function(a){a.setSelection(Ac(a.firstLine(),0),Ac(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!Bc(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:Ac(b.line),"+delete"):a.replaceRange("",b,Ac(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",Ac(b,0),Ac(b),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",Ac(b.line,0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(Ac(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Ac(a.lastLine()))},goLineStart:function(a){a.extendSelection(Ef(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Ef(a,b.line),d=a.getLineHandle(c.line),e=re(d);if(e&&0!=e[0].level)a.extendSelection(c);else{var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;a.extendSelection(Ac(c.line,g?0:f))}},goLineEnd:function(a){a.extendSelection(Ff(a,a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection(" ","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line);b.ch>0&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),Ac(b.line,b.ch-1),Ac(b.line,b.ch+1))},newlineAndIndent:function(a){Eb(a,function(){a.replaceSelection("\n","end","+input"),a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},jd=w.keyMap={};jd.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"},jd.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"},jd.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]},jd["default"]=p?jd.macDefault:jd.pcDefault,jd.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},w.lookupKey=ld,w.isModifierKey=md,w.keyName=nd,w.fromTextArea=function(a,b){function e(){a.value=i.getValue()}if(b||(b={}),b.value=a.value,!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex),!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder),null==b.autofocus){var c=document.body;try{c=document.activeElement}catch(d){}b.autofocus=c==a||null!=a.getAttribute("autofocus")&&c==document.body}if(a.form&&(Ke(a.form,"submit",e),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){e(),f.submit=g,f.submit(),f.submit=h}}catch(d){}}a.style.display="none";var i=w(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);return i.save=e,i.getTextArea=function(){return a},i.toTextArea=function(){e(),a.parentNode.removeChild(i.getWrapperElement()),a.style.display="",a.form&&(Le(a.form,"submit",e),"function"==typeof a.form.submit&&(a.form.submit=g))},i},od.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Xe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue},indentation:function(){return Xe(this.string,null,this.tabSize)},match:function(a,b,c){if("string"!=typeof a){var f=this.string.slice(this.pos).match(a);return f&&f.index>0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);return d(e)==d(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},w.StringStream=od,w.TextMarker=pd,Te(pd),pd.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&Cb(a),Se(this,"clear")){var c=this.find();c&&Pe(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=td(g.markedSpans,this);null!=h.to&&(e=oe(g)),g.markedSpans=ud(g.markedSpans,h),null!=h.from?d=oe(g):this.collapsed&&!Fd(this.doc,g)&&a&&ne(g,zb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=Ed(a.doc,this.lines[f]),j=G(a.doc,i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&Hb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Lc(a)),b&&Db(a)}},pd.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=td(d.markedSpans,this);if(null!=e.from||null!=e.to){var f=oe(d);null!=e.from&&(a=Ac(f,e.from)),null!=e.to&&(b=Ac(f,e.to))}}return"bookmark"==this.type?a:a&&{from:a,to:b}},pd.prototype.changed=function(){var a=this.find(),b=this.doc.cm;if(a&&b){"bookmark"!=this.type&&(a=a.from);var c=ke(this.doc,a.line);if(jb(b,c),a.line>=b.display.showingFrom&&a.line<b.display.showingTo){for(var d=b.display.lineDiv.firstChild;d;d=d.nextSibling)if(d.lineObj==c){d.offsetHeight!=c.height&&ne(c,d.offsetHeight);break}Gb(b,function(){b.curOp.selectionChanged=b.curOp.forceUpdate=b.curOp.updateMaxLine=!0})}}},pd.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=af(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},pd.prototype.detachLine=function(a){if(this.lines.splice(af(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}},w.SharedTextMarker=rd,Te(rd),rd.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();Pe(this,"clear")}},rd.prototype.find=function(){return this.primary.find()};var Jd=w.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a,this.node=b};Te(Jd),Jd.prototype.clear=Kd(function(){var a=this.line.widgets,b=oe(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);var d=qe(this.cm,this.line)<this.cm.doc.scrollTop;ne(this.line,Math.max(0,this.line.height-Ld(this))),d&&Sc(this.cm,0,-this.height),Hb(this.cm,b,b+1)}}),Jd.prototype.changed=Kd(function(){var a=this.height;this.height=null;var b=Ld(this)-a;if(b){ne(this.line,this.line.height+b);var c=oe(this.line);Hb(this.cm,c,c+1)}});var Nd=w.Line=function(a,b,c){this.text=a,Id(this,b),this.height=c?c(this):1};Te(Nd);var Ud={},Xd=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;ce.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,Pd(e),Pe(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0,e=b.length;e>d;++d)b[d].parent=this
7
- },iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},de.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25){var h=[];this.collapse(h),this.children=[new ce(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0,c=this.children.length;c>b;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>=a){if(f.insertInner(a,b,c),f.lines&&f.lines.length>50){for(;f.lines.length>50;){var h=f.lines.splice(f.lines.length-25,25),i=new ce(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new de(b);if(a.parent){a.size-=c.size,a.height-=c.height;var e=af(a.parent.children,a);a.parent.children.splice(e+1,0,c)}else{var d=new de(a.children);d.parent=a,a.children=[d,c],a=d}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;e>d;++d){var f=this.children[d],g=f.chunkSize();if(g>a){var h=Math.min(b,g-a);if(f.iterN(a,h,c))return!0;if(0==(b-=h))break;a=0}else a-=g}}};var ee=0,fe=w.Doc=function(a,b,c){if(!(this instanceof fe))return new fe(a,b,c);null==c&&(c=0),de.call(this,[new ce([new Nd("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=se(),this.cleanGeneration=1,this.frontier=c;var d=Ac(c,0);this.sel={from:d,to:d,head:d,anchor:d,shift:!1,extend:!1,goalColumn:null},this.id=++ee,this.modeOption=b,"string"==typeof a&&(a=vf(a)),be(this,{from:d,to:d,text:a},null,{head:d,anchor:d})};fe.prototype=bf(de.prototype,{constructor:fe,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0,e=b.length;e>d;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=me(this,this.first,this.first+this.size);return a===!1?b:b.join(a||"\n")},setValue:function(a){var b=Ac(this.first,0),c=this.first+this.size-1;tc(this,{from:b,to:Ac(c,ke(this,c).text.length),text:vf(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=Fc(this,b),c=c?Fc(this,c):b,zc(this,a,b,c,d)},getRange:function(a,b,c){var d=le(this,Fc(this,a),Fc(this,b));return c===!1?d:d.join(c||"\n")},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},setLine:function(a,b){Hc(this,a)&&zc(this,b,Ac(a,0),Fc(this,Ac(a)))},removeLine:function(a){a?zc(this,"",Fc(this,Ac(a-1)),Fc(this,Ac(a))):zc(this,"",Ac(0,0),Fc(this,Ac(1,0)))},getLineHandle:function(a){return Hc(this,a)?ke(this,a):void 0},getLineNumber:function(a){return oe(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=ke(this,a)),Ed(this,a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Fc(this,a)},getCursor:function(a){var c,b=this.sel;return c=null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||a===!1?b.to:b.from,Dc(c)},somethingSelected:function(){return!Bc(this.sel.head,this.sel.anchor)},setCursor:Fb(function(a,b,c){var d=Fc(this,"number"==typeof a?Ac(a,b||0):a);c?Ic(this,d):Kc(this,d,d)}),setSelection:Fb(function(a,b,c){Kc(this,Fc(this,a),Fc(this,b||a),c)}),extendSelection:Fb(function(a,b,c){Ic(this,Fc(this,a),b&&Fc(this,b),c)}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to,a)},replaceSelection:function(a,b,c){tc(this,{from:this.sel.from,to:this.sel.to,text:vf(a),origin:c},b||"around")},undo:Fb(function(){vc(this,"undo")}),redo:Fb(function(){vc(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=se(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){return this.history.lastOp=this.history.lastOrigin=null,this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:ye(this.history.done),undone:ye(this.history.undone)}},setHistory:function(a){var b=this.history=se(this.history.maxGeneration);b.done=a.done.slice(0),b.undone=a.undone.slice(0)},markText:function(a,b,c){return qd(this,Fc(this,a),Fc(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft};return a=Fc(this,a),qd(this,a,a,c,"bookmark")},findMarksAt:function(a){a=Fc(this,a);var b=[],c=ke(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,++c,void 0)}),Fc(this,Ac(c,b))},indexFromPos:function(a){a=Fc(this,a);var b=a.ch;return a.line<this.first||a.ch<0?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new fe(me(this,this.first,this.first+this.size),this.modeOption,this.first);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new fe(me(this,b,c),a.mode||this.modeOption,b);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],d},unlinkDoc:function(a){if(a instanceof w&&(a=a.doc),this.linked)for(var b=0;b<this.linked.length;++b){var c=this.linked[b];if(c.doc==a){this.linked.splice(b,1),a.unlinkDoc(this);break}}if(a.history==this.history){var d=[a.id];ie(a,function(a){d.push(a.id)},!0),a.history=se(),a.history.done=ye(this.history.done,d),a.history.undone=ye(this.history.undone,d)}},iterLinkedDocs:function(a){ie(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),fe.prototype.eachLine=fe.prototype.iter;var ge="iter insert remove copy getEditor".split(" ");for(var he in fe.prototype)fe.prototype.hasOwnProperty(he)&&af(ge,he)<0&&(w.prototype[he]=function(a){return function(){return a.apply(this.doc,arguments)}}(fe.prototype[he]));Te(fe),w.e_stop=He,w.e_preventDefault=Ee,w.e_stopPropagation=Fe;var Ne,Oe=0;w.on=Ke,w.off=Le,w.signal=Me;var Ue=30,Ve=w.Pass={toString:function(){return"CodeMirror.Pass"}};We.prototype={set:function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)}},w.countColumn=Xe;var Ye=[""],ff=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,jf=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;w.replaceGetRect=function(a){of=a};var pf=function(){if(d)return!1;var a=kf("div");return"draggable"in a||"dragDrop"in a}();a?qf=function(a,b){return 36==a.charCodeAt(b-1)&&39==a.charCodeAt(b)}:i&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?qf=function(a,b){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(a.slice(b-1,b+1))}:e&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)&&(qf=function(a,b){if(b>1&&45==a.charCodeAt(b-1)){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0;if(b>2&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var rf,tf,vf=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};w.splitLines=vf;var wf=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},xf=function(){var a=kf("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),yf={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};w.keyNames=yf,function(){for(var a=0;10>a;a++)yf[a+48]=String(a);for(var a=65;90>=a;a++)yf[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)yf[a+111]=yf[a+63235]="F"+a}();var Hf,Mf=function(){function c(c){return 255>=c?a.charAt(c):c>=1424&&1524>=c?"R":c>=1536&&1791>=c?b.charAt(c-1536):c>=1792&&2220>=c?"r":"L"}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;for(var l,b=a.length,j=[],k=0;b>k;++k)j.push(l=c(a.charCodeAt(k)));for(var k=0,m=i;b>k;++k){var l=j[k];"m"==l?j[k]=m:m=l}for(var k=0,n=i;b>k;++k){var l=j[k];"1"==l&&"r"==n?j[k]="n":f.test(l)&&(n=l,"r"==l&&(j[k]="R"))}for(var k=1,m=j[0];b-1>k;++k){var l=j[k];"+"==l&&"1"==m&&"1"==j[k+1]?j[k]="1":","!=l||m!=j[k+1]||"1"!=m&&"n"!=m||(j[k]=m),m=l}for(var k=0;b>k;++k){var l=j[k];if(","==l)j[k]="N";else if("%"==l){for(var o=k+1;b>o&&"%"==j[o];++o);for(var p=k&&"!"==j[k-1]||b-1>o&&"1"==j[o]?"1":"N",q=k;o>q;++q)j[q]=p;k=o-1}}for(var k=0,n=i;b>k;++k){var l=j[k];"L"==n&&"1"==l?j[k]="L":f.test(l)&&(n=l)}for(var k=0;b>k;++k)if(e.test(j[k])){for(var o=k+1;b>o&&e.test(j[o]);++o);for(var r="L"==(k?j[k-1]:i),s="L"==(b-1>o?j[o]:i),p=r||s?"L":"R",q=k;o>q;++q)j[q]=p;k=o-1}for(var u,t=[],k=0;b>k;)if(g.test(j[k])){var v=k;for(++k;b>k&&g.test(j[k]);++k);t.push({from:v,to:k,level:0})}else{var w=k,x=t.length;for(++k;b>k&&"L"!=j[k];++k);for(var q=w;k>q;)if(h.test(j[q])){q>w&&t.splice(x,0,{from:w,to:q,level:1});var y=q;for(++q;k>q&&h.test(j[q]);++q);t.splice(x,0,{from:y,to:q,level:2}),w=q}else++q;k>w&&t.splice(x,0,{from:w,to:k,level:1})}return 1==t[0].level&&(u=a.match(/^\s+/))&&(t[0].from=u[0].length,t.unshift({from:0,to:u[0].length,level:0})),1==$e(t).level&&(u=a.match(/\s+$/))&&($e(t).to-=u[0].length,t.push({from:b-u[0].length,to:b,level:0})),t[0].level!=$e(t).level&&t.push({from:b,to:b,level:t[0].level}),t}}();return w.version="3.16.1",w}(),CodeMirror.defineMode("clike",function(a,b){function n(a,b){var c=a.next();if(j[c]){var d=j[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=o(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return m=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=p,p(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(l.test(c))return a.eatWhile(l),"operator";a.eatWhile(/[\w\$_]/);var e=a.current();return f.propertyIsEnumerable(e)?(h.propertyIsEnumerable(e)&&(m="newstatement"),"keyword"):g.propertyIsEnumerable(e)?(h.propertyIsEnumerable(e)&&(m="newstatement"),"builtin"):i.propertyIsEnumerable(e)?"atom":"variable"}function o(a){return function(b,c){for(var e,d=!1,f=!1;null!=(e=b.next());){if(e==a&&!d){f=!0;break}d=!d&&"\\"==e}return(f||!d&&!k)&&(c.tokenize=null),"string"}}function p(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=null;break}c="*"==d}return"comment"}function q(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function r(a,b,c){var d=a.indented;return a.context&&"statement"==a.context.type&&(d=a.context.indented),a.context=new q(d,b,c,null,a.context)}function s(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var m,c=a.indentUnit,d=b.statementIndentUnit||c,e=b.dontAlignCalls,f=b.keywords||{},g=b.builtin||{},h=b.blockKeywords||{},i=b.atoms||{},j=b.hooks||{},k=b.multiLineStrings,l=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new q((a||0)-c,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;m=null;var d=(b.tokenize||n)(a,b);if("comment"==d||"meta"==d)return d;if(null==c.align&&(c.align=!0),";"!=m&&":"!=m&&","!=m||"statement"!=c.type)if("{"==m)r(b,a.column(),"}");else if("["==m)r(b,a.column(),"]");else if("("==m)r(b,a.column(),")");else if("}"==m){for(;"statement"==c.type;)c=s(b);for("}"==c.type&&(c=s(b));"statement"==c.type;)c=s(b)}else m==c.type?s(b):(("}"==c.type||"top"==c.type)&&";"!=m||"statement"==c.type&&"newstatement"==m)&&r(b,a.column(),"statement");else s(b);return b.startOfLine=!1,d},indent:function(a,b){if(a.tokenize!=n&&null!=a.tokenize)return CodeMirror.Pass;var f=a.context,g=b&&b.charAt(0);"statement"==f.type&&"}"==g&&(f=f.prev);var h=g==f.type;return"statement"==f.type?f.indented+("{"==g?0:d):!f.align||e&&")"==f.type?")"!=f.type||h?f.indented+(h?0:c):f.indented+d:f.column+(h?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}}),function(){function a(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){if(!b.startOfLine)return!1;for(;;){if(!a.skipTo("\\")){a.skipToEnd(),b.tokenize=null;break}if(a.next(),a.eol()){b.tokenize=c;break}}return"meta"}function d(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function e(a,b){for(var c=0;c<a.length;++c)CodeMirror.defineMIME(a[c],b)}var b="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";e(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),blockKeywords:a("case do else for if switch while struct"),atoms:a("null"),hooks:{"#":c}}),e(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try bool explicit new "+"static_cast typeid catch operator template typename class friend private "+"this using const_cast inline public throw virtual delete mutable protected "+"wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),atoms:a("true false null"),hooks:{"#":c}}),CodeMirror.defineMIME("text/x-java",{name:"clike",keywords:a("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:a("catch class do else finally for if switch try while"),atoms:a("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}}),CodeMirror.defineMIME("text/x-csharp",{name:"clike",keywords:a("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),builtin:a("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:a("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=d,d(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),CodeMirror.defineMIME("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),blockKeywords:a("catch class do else finally for forSome if match switch try while"),atoms:a("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}}}),e(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadowconst attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smootstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":c}})}(),CodeMirror.defineMode("coffeescript",function(a){function c(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function s(a,c){if(a.sol()){var l=c.scopes[0].offset;if(a.eatSpace()){var m=a.indentation();return m>l?"indent":l>m?"dedent":null}l>0&&w(a,c)}if(a.eatSpace())return null;var q=a.peek();if(a.match("####"))return a.skipToEnd(),"comment";if(a.match("###"))return c.tokenize=u,c.tokenize(a,c);if("#"===q)return a.skipToEnd(),"comment";if(a.match(/^-?[0-9\.]/,!1)){var s=!1;if(a.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(s=!0),a.match(/^-?\d+\.\d*/)&&(s=!0),a.match(/^-?\.\d+/)&&(s=!0),s)return"."==a.peek()&&a.backUp(1),"number";var v=!1;if(a.match(/^-?0x[0-9a-f]+/i)&&(v=!0),a.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(v=!0),a.match(/^-?0(?![\dx])/i)&&(v=!0),v)return"number"}if(a.match(o))return c.tokenize=t(a.current(),"string"),c.tokenize(a,c);if(a.match(p)){if("/"!=a.current()||a.match(/^.*\//,!1))return c.tokenize=t(a.current(),"string-2"),c.tokenize(a,c);a.backUp(1)}return a.match(h)||a.match(g)?"punctuation":a.match(f)||a.match(d)||a.match(k)?"operator":a.match(e)?"punctuation":a.match(r)?"atom":a.match(n)?"keyword":a.match(i)?"variable":a.match(j)?"property":(a.next(),b)}function t(c,d){var e=1==c.length;return function(f,g){for(;!f.eol();)if(f.eatWhile(/[^'"\/\\]/),f.eat("\\")){if(f.next(),e&&f.eol())return d}else{if(f.match(c))return g.tokenize=s,d;f.eat(/['"\/]/)}return e&&(a.mode.singleLineStringErrors?d=b:g.tokenize=s),d}}function u(a,b){for(;!a.eol();){if(a.eatWhile(/[^#]/),a.match("###")){b.tokenize=s;break}a.eatWhile("#")}return"comment"}function v(b,c,d){d=d||"coffee";var e=0;if("coffee"===d){for(var f=0;f<c.scopes.length;f++)if("coffee"===c.scopes[f].type){e=c.scopes[f].offset+a.indentUnit;break}}else e=b.column()+b.current().length;c.scopes.unshift({offset:e,type:d})}function w(a,b){if(1!=b.scopes.length){if("coffee"===b.scopes[0].type){for(var c=a.indentation(),d=-1,e=0;e<b.scopes.length;++e)if(c===b.scopes[e].offset){d=e;break}if(-1===d)return!0;for(;b.scopes[0].offset!==c;)b.scopes.shift();return!1}return b.scopes.shift(),!1}}function x(a,c){var d=c.tokenize(a,c),e=a.current();if("."===e)return d=c.tokenize(a,c),e=a.current(),/^\.[\w$]+$/.test(e)?"variable":b;"return"===e&&(c.dedent+=1),("->"!==e&&"=>"!==e||c.lambda||"coffee"!=c.scopes[0].type||""!==a.peek())&&"indent"!==d||v(a,c);var f="[({".indexOf(e);return-1!==f&&v(a,c,"])}".slice(f,f+1)),l.exec(e)&&v(a,c),"then"==e&&w(a,c),"dedent"===d&&w(a,c)?b:(f="])}".indexOf(e),-1!==f&&w(a,c)?b:(c.dedent>0&&a.eol()&&"coffee"==c.scopes[0].type&&(c.scopes.length>1&&c.scopes.shift(),c.dedent-=1),d))}var b="error",d=new RegExp("^[\\+\\-\\*/%&|\\^~<>!?]"),e=new RegExp("^[\\(\\)\\[\\]\\{\\},:`=;\\.]"),f=new RegExp("^((->)|(=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"),g=new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),h=new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"),i=new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"),j=new RegExp("^(@|this.)[_A-Za-z$][_A-Za-z$0-9]*"),k=c(["and","or","not","is","isnt","in","instanceof","typeof"]),l=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],m=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","throw","when","until"],n=c(l.concat(m));l=c(l);var o=new RegExp("^('{3}|\"{3}|['\"])"),p=new RegExp("^(/{3}|/)"),q=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],r=c(q),y={startState:function(a){return{tokenize:s,scopes:[{offset:a||0,type:"coffee"}],lastToken:null,lambda:!1,dedent:0}},token:function(a,b){var c=x(a,b);return b.lastToken={style:c,content:a.current()},a.eol()&&a.lambda&&(b.lambda=!1),c},indent:function(a){return a.tokenize!=s?0:a.scopes[0].offset},lineComment:"#",fold:"indent"};return y}),CodeMirror.defineMIME("text/x-coffeescript","coffeescript"),CodeMirror.defineMode("css",function(a){return CodeMirror.getMode(a,"text/css")}),CodeMirror.defineMode("css-base",function(a,b){"use strict";function l(a,b){return k=b,a}function m(a,b){var c=a.next();if(d[c]){var e=d[c](a,b);if(e!==!1)return e}if("@"==c)return a.eatWhile(/[\w\\\-]/),l("def",a.current());if("="==c)l(null,"compare");else{if(("~"==c||"|"==c)&&a.eat("="))return l(null,"compare");if('"'==c||"'"==c)return b.tokenize=n(c),b.tokenize(a,b);if("#"==c)return a.eatWhile(/[\w\\\-]/),l("atom","hash");if("!"==c)return a.match(/^\s*\w*/),l("keyword","important");if(/\d/.test(c))return a.eatWhile(/[\w.%]/),l("number","unit");if("-"!==c)return/[,+>*\/]/.test(c)?l(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?l("qualifier","qualifier"):":"==c?l("operator",c):/[;{}\[\]\(\)]/.test(c)?l(null,c):"u"==c&&a.match("rl(")?(a.backUp(1),b.tokenize=o,l("property","variable")):(a.eatWhile(/[\w\\\-]/),l("property","variable"));if(/\d/.test(a.peek()))return a.eatWhile(/[\w.%]/),l("number","unit");if(a.match(/^[^-]+-/))return l("meta","meta")}}function n(a,b){return function(c,d){for(var f,e=!1;null!=(f=c.next())&&(f!=a||e);)e=!e&&"\\"==f;return e||(b&&c.backUp(1),d.tokenize=m),l("string","string")}}function o(a,b){return a.next(),b.tokenize=a.match(/\s*[\"\']/,!1)?m:n(")",!0),l(null,"(")}var c=a.indentUnit,d=b.hooks||{},e=b.atMediaTypes||{},f=b.atMediaFeatures||{},g=b.propertyKeywords||{},h=b.colorKeywords||{},i=b.valueKeywords||{},j=!!b.allowNested,k=null;return{startState:function(a){return{tokenize:m,baseIndent:a||0,stack:[],lastToken:null}},token:function(a,b){if(b.tokenize=b.tokenize||m,b.tokenize==m&&a.eatSpace())return null;var c=b.tokenize(a,b);c&&"string"!=typeof c&&(c=l(c[0],c[1]));var d=b.stack[b.stack.length-1];if("variable"==c)return"variable-definition"==k&&b.stack.push("propertyValue"),b.lastToken="variable-2";if("property"==c){var n=a.current().toLowerCase();"propertyValue"==d?c=i.hasOwnProperty(n)?"string-2":h.hasOwnProperty(n)?"keyword":"variable-2":"rule"==d?g.hasOwnProperty(n)||(c+=" error"):"block"==d?c=g.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?"keyword":i.hasOwnProperty(n)?"string-2":"tag":d&&"@media{"!=d?"@media"==d?c=e[a.current()]?"attribute":/^(only|not)$/.test(n)?"keyword":"and"==n?"error":f.hasOwnProperty(n)?"error":"attribute error":"@mediaType"==d?c=e.hasOwnProperty(n)?"attribute":"and"==n?"operator":/^(only|not)$/.test(n)?"error":"error":"@mediaType("==d?g.hasOwnProperty(n)||(e.hasOwnProperty(n)?c="error":"and"==n?c="operator":/^(only|not)$/.test(n)?c="error":c+=" error"):c="@import"==d?"tag":"error":c="tag"}else"atom"==c?d&&"@media{"!=d&&"block"!=d?"propertyValue"==d?/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(a.current())||(c+=" error"):c="error":c="builtin":"@media"==d&&"{"==k&&(c="error");if("{"==k)if("@media"==d||"@mediaType"==d)b.stack[b.stack.length-1]="@media{";else{var o=j?"block":"rule";b.stack.push(o)}else"}"==k?("interpolation"==d&&(c="operator"),b.stack.pop(),"propertyValue"==d&&b.stack.pop()):"interpolation"==k?b.stack.push("interpolation"):"@media"==k?b.stack.push("@media"):"@import"==k?b.stack.push("@import"):"@media"==d&&/\b(keyword|attribute)\b/.test(c)?b.stack[b.stack.length-1]="@mediaType":"@mediaType"==d&&","==a.current()?b.stack[b.stack.length-1]="@media":"("==k?"@media"==d||"@mediaType"==d?(b.stack[b.stack.length-1]="@mediaType",b.stack.push("@mediaType(")):b.stack.push("("):")"==k?("propertyValue"==d&&b.stack.pop(),b.stack.pop()):":"==k&&"property"==b.lastToken?b.stack.push("propertyValue"):"propertyValue"==d&&";"==k?b.stack.pop():"@import"==d&&";"==k&&b.stack.pop();return b.lastToken=c},indent:function(a,b){var d=a.stack.length;return/^\}/.test(b)&&(d-="propertyValue"==a.stack[d-1]?2:1),a.baseIndent+d*c},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}),function(){function a(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=!0;return b}function g(a,b){for(var d,c=!1;null!=(d=a.next());){if(c&&"/"==d){b.tokenize=null;break}c="*"==d}return["comment","comment"]}var b=a(["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),c=a(["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"]),d=a(["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"]),e=a(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),f=a(["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"]);
8
- CodeMirror.defineMIME("text/css",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,hooks:{"<":function(a,b){function c(a,b){for(var d,c=0;null!=(d=a.next());){if(c>=2&&">"==d){b.tokenize=null;break}c="-"==d?c+1:0}return["comment","comment"]}return a.eat("!")?(b.tokenize=c,c(a,b)):void 0},"/":function(a,b){return a.eat("*")?(b.tokenize=g,g(a,b)):!1}},name:"css-base"}),CodeMirror.defineMIME("text/x-scss",{atMediaTypes:b,atMediaFeatures:c,propertyKeywords:d,colorKeywords:e,valueKeywords:f,allowNested:!0,hooks:{":":function(a){return a.match(/\s*{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),":"==a.peek()?["variable","variable-definition"]:["variable","variable"]},"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=g,g(a,b)):["operator","operator"]},"#":function(a){return a.eat("{")?["operator","interpolation"]:(a.eatWhile(/[\w\\\-]/),["atom","hash"])}},name:"css-base"})}(),CodeMirror.defineMode("gfm",function(a){function c(a){return a.code=!1,null}var b=0,d={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(a){return{code:a.code,codeBlock:a.codeBlock,ateSpace:a.ateSpace}},token:function(a,c){if(c.codeBlock)return a.match(/^```/)?(c.codeBlock=!1,null):(a.skipToEnd(),null);if(a.sol()&&(c.code=!1),a.sol()&&a.match(/^```/))return a.skipToEnd(),c.codeBlock=!0,null;if("`"===a.peek()){a.next();var d=a.pos;a.eatWhile("`");var e=1+a.pos-d;return c.code?e===b&&(c.code=!1):(b=e,c.code=!0),null}if(c.code)return a.next(),null;if(a.eatSpace())return c.ateSpace=!0,null;if(a.sol()||c.ateSpace){if(c.ateSpace=!1,a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return"link";if(a.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return"link"}return a.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))/i)?"link":(a.next(),null)},blankLine:c};return CodeMirror.defineMIME("gfmBase",{name:"markdown",underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0}),CodeMirror.overlayMode(CodeMirror.getMode(a,"gfmBase"),d)},"markdown"),CodeMirror.defineMode("htmlmixed",function(a,b){function i(a,b){var f=b.htmlState.tagName,g=c.token(a,b.htmlState);if("script"==f&&/\btag\b/.test(g)&&">"==a.current()){var h=a.string.slice(Math.max(0,a.pos-100),a.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);h=h?h[1]:"",h&&/[\"\']/.test(h.charAt(0))&&(h=h.slice(1,h.length-1));for(var i=0;i<e.length;++i){var j=e[i];if("string"==typeof j.matches?h==j.matches:j.matches.test(h)){j.mode&&(b.token=k,b.localMode=j.mode,b.localState=j.mode.startState&&j.mode.startState(c.indent(b.htmlState,"")));break}}}else"style"==f&&/\btag\b/.test(g)&&">"==a.current()&&(b.token=l,b.localMode=d,b.localState=d.startState(c.indent(b.htmlState,"")));return g}function j(a,b,c){var f,d=a.current(),e=d.search(b);return e>-1?a.backUp(d.length-e):(f=d.match(/<\/?$/))&&(a.backUp(d.length),a.match(b,!1)||a.match(d[0])),c}function k(a,b){return a.match(/^<\/\s*script\s*>/i,!1)?(b.token=i,b.localState=b.localMode=null,i(a,b)):j(a,/<\/\s*script\s*>/,b.localMode.token(a,b.localState))}function l(a,b){return a.match(/^<\/\s*style\s*>/i,!1)?(b.token=i,b.localState=b.localMode=null,i(a,b)):j(a,/<\/\s*style\s*>/,d.token(a,b.localState))}var c=CodeMirror.getMode(a,{name:"xml",htmlMode:!0}),d=CodeMirror.getMode(a,"css"),e=[],f=b&&b.scriptTypes;if(e.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:CodeMirror.getMode(a,"javascript")}),f)for(var g=0;g<f.length;++g){var h=f[g];e.push({matches:h.matches,mode:h.mode&&CodeMirror.getMode(a,h.mode)})}return e.push({matches:/./,mode:CodeMirror.getMode(a,"text/plain")}),{startState:function(){var a=c.startState();return{token:i,localMode:null,localState:null,htmlState:a}},copyState:function(a){if(a.localState)var b=CodeMirror.copyState(a.localMode,a.localState);return{token:a.token,localMode:a.localMode,localState:b,htmlState:CodeMirror.copyState(c,a.htmlState)}},token:function(a,b){return b.token(a,b)},indent:function(a,b){return!a.localMode||/^\s*<\//.test(b)?c.indent(a.htmlState,b):a.localMode.indent?a.localMode.indent(a.localState,b):CodeMirror.Pass},electricChars:"/{}:",innerMode:function(a){return{state:a.localState||a.htmlState,mode:a.localMode||c}}}},"xml","javascript","css"),CodeMirror.defineMIME("text/html","htmlmixed"),CodeMirror.defineMode("javascript",function(a,b){function i(a,b,c){return b.tokenize=c,c(a,b)}function j(a,b){for(var d,c=!1;null!=(d=a.next());){if(d==b&&!c)return!1;c=!c&&"\\"==d}return c}function m(a,b,c){return k=a,l=c,b}function n(a,b){var c=a.next();if('"'==c||"'"==c)return i(a,b,o(c));if("."==c&&a.match(/^\d+(?:[eE][+\-]?\d+)?/))return m("number","number");if(/[\[\]{}\(\),;\:\.]/.test(c))return m(c);if("0"==c&&a.eat(/x/i))return a.eatWhile(/[\da-f]/i),m("number","number");if(/\d/.test(c))return a.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),m("number","number");if("/"==c)return a.eat("*")?i(a,b,p):a.eat("/")?(a.skipToEnd(),m("comment","comment")):"operator"==b.lastType||"keyword c"==b.lastType||/^[\[{}\(,;:]$/.test(b.lastType)?(j(a,"/"),a.eatWhile(/[gimy]/),m("regexp","string-2")):(a.eatWhile(h),m("operator",null,a.current()));if("#"==c)return a.skipToEnd(),m("error","error");if(h.test(c))return a.eatWhile(h),m("operator",null,a.current());a.eatWhile(/[\w\$_]/);var d=a.current(),e=g.propertyIsEnumerable(d)&&g[d];return e&&"."!=b.lastType?m(e.type,e.style,d):m("variable","variable",d)}function o(a){return function(b,c){return j(b,a)||(c.tokenize=n),m("string","string")}}function p(a,b){for(var d,c=!1;d=a.next();){if("/"==d&&c){b.tokenize=n;break}c="*"==d}return m("comment","comment")}function r(a,b,c,d,e,f){this.indented=a,this.column=b,this.type=c,this.prev=e,this.info=f,null!=d&&(this.align=d)}function s(a,b){for(var c=a.localVars;c;c=c.next)if(c.name==b)return!0}function t(a,b,c,d,f){var g=a.cc;for(u.state=a,u.stream=f,u.marked=null,u.cc=g,a.lexical.hasOwnProperty("align")||(a.lexical.align=!0);;){var h=g.length?g.pop():e?F:E;if(h(c,d)){for(;g.length&&g[g.length-1].lex;)g.pop()();return u.marked?u.marked:"variable"==c&&s(a,d)?"variable-2":b}}}function v(){for(var a=arguments.length-1;a>=0;a--)u.cc.push(arguments[a])}function w(){return v.apply(null,arguments),!0}function x(a){function b(b){for(var c=b;c;c=c.next)if(c.name==a)return!0;return!1}var c=u.state;if(c.context){if(u.marked="def",b(c.localVars))return;c.localVars={name:a,next:c.localVars}}else{if(b(c.globalVars))return;c.globalVars={name:a,next:c.globalVars}}}function z(){u.state.context={prev:u.state.context,vars:u.state.localVars},u.state.localVars=y}function A(){u.state.localVars=u.state.context.vars,u.state.context=u.state.context.prev}function B(a,b){var c=function(){var c=u.state,d=c.indented;"stat"==c.lexical.type&&(d=c.lexical.indented),c.lexical=new r(d,u.stream.column(),a,null,c.lexical,b)};return c.lex=!0,c}function C(){var a=u.state;a.lexical.prev&&(")"==a.lexical.type&&(a.indented=a.lexical.indented),a.lexical=a.lexical.prev)}function D(a){return function(b){return b==a?w():";"==a?v():w(arguments.callee)}}function E(a){return"var"==a?w(B("vardef"),U,D(";"),C):"keyword a"==a?w(B("form"),F,E,C):"keyword b"==a?w(B("form"),E,C):"{"==a?w(B("}"),R,C):";"==a?w():"if"==a?w(B("form"),F,E,C,W):"function"==a?w(_):"for"==a?w(B("form"),D("("),B(")"),X,D(")"),C,E,C):"variable"==a?w(B("stat"),M):"switch"==a?w(B("form"),F,B("}","switch"),D("{"),R,C,C):"case"==a?w(F,D(":")):"default"==a?w(D(":")):"catch"==a?w(B("form"),z,D("("),ab,D(")"),E,C,A):v(B("stat"),F,D(";"),C)}function F(a){return H(a,!1)}function G(a){return H(a,!0)}function H(a,b){var c=b?L:K;return q.hasOwnProperty(a)?w(c):"function"==a?w(_):"keyword c"==a?w(b?J:I):"("==a?w(B(")"),I,D(")"),C,c):"operator"==a?w(b?G:F):"["==a?w(B("]"),Q(G,"]"),C,c):"{"==a?w(B("}"),Q(O,"}"),C,c):w()}function I(a){return a.match(/[;\}\)\],]/)?v():v(F)}function J(a){return a.match(/[;\}\)\],]/)?v():v(G)}function K(a,b){return","==a?w(F):L(a,b,!1)}function L(a,b,c){var d=0==c?K:L,e=0==c?F:G;return"operator"==a?/\+\+|--/.test(b)?w(d):"?"==b?w(F,D(":"),e):w(e):";"!=a?"("==a?w(B(")","call"),Q(G,")"),C,d):"."==a?w(N,d):"["==a?w(B("]"),I,D("]"),C,d):void 0:void 0}function M(a){return":"==a?w(C,E):v(K,D(";"),C)}function N(a){return"variable"==a?(u.marked="property",w()):void 0}function O(a,b){if("variable"==a){if(u.marked="property","get"==b||"set"==b)return w(P)}else("number"==a||"string"==a)&&(u.marked=a+" property");return q.hasOwnProperty(a)?w(D(":"),G):void 0}function P(a){return":"==a?w(F):"variable"!=a?w(D(":"),F):(u.marked="property",w(_))}function Q(a,b){function c(d){if(","==d){var e=u.state.lexical;return"call"==e.info&&(e.pos=(e.pos||0)+1),w(a,c)}return d==b?w():w(D(b))}return function(d){return d==b?w():v(a,c)}}function R(a){return"}"==a?w():v(E,R)}function S(a){return":"==a?w(T):v()}function T(a){return"variable"==a?(u.marked="variable-3",w()):v()}function U(a,b){return"variable"==a?(x(b),f?w(S,V):w(V)):v()}function V(a,b){return"="==b?w(G,V):","==a?w(U):void 0}function W(a,b){return"keyword b"==a&&"else"==b?w(B("form"),E,C):void 0}function X(a){return"var"==a?w(U,D(";"),Z):";"==a?w(Z):"variable"==a?w(Y):v(F,D(";"),Z)}function Y(a,b){return"in"==b?w(F):w(K,Z)}function Z(a,b){return";"==a?w($):"in"==b?w(F):v(F,D(";"),$)}function $(a){")"!=a&&w(F)}function _(a,b){return"variable"==a?(x(b),w(_)):"("==a?w(B(")"),z,Q(ab,")"),C,E,A):void 0}function ab(a,b){return"variable"==a?(x(b),f?w(S):w()):void 0}var k,l,c=a.indentUnit,d=b.statementIndent,e=b.json,f=b.typescript,g=function(){function a(a){return{type:a,style:"keyword"}}var b=a("keyword a"),c=a("keyword b"),d=a("keyword c"),e=a("operator"),g={type:"atom",style:"atom"},h={"if":a("if"),"while":b,"with":b,"else":c,"do":c,"try":c,"finally":c,"return":d,"break":d,"continue":d,"new":d,"delete":d,"throw":d,"var":a("var"),"const":a("var"),let:a("var"),"function":a("function"),"catch":a("catch"),"for":a("for"),"switch":a("switch"),"case":a("case"),"default":a("default"),"in":e,"typeof":e,"instanceof":e,"true":g,"false":g,"null":g,undefined:g,NaN:g,Infinity:g,"this":a("this")};if(f){var i={type:"variable",style:"variable-3"},j={"interface":a("interface"),"class":a("class"),"extends":a("extends"),constructor:a("constructor"),"public":a("public"),"private":a("private"),"protected":a("protected"),"static":a("static"),"super":a("super"),string:i,number:i,bool:i,any:i};for(var k in j)h[k]=j[k]}return h}(),h=/[+\-*&%=<>!?|~^]/,q={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0},u={state:null,column:null,marked:null,cc:null},y={name:"this",next:{name:"arguments"}};return C.lex=!0,{startState:function(a){return{tokenize:n,lastType:null,cc:[],lexical:new r((a||0)-c,0,"block",!1),localVars:b.localVars,globalVars:b.globalVars,context:b.localVars&&{vars:b.localVars},indented:0}},token:function(a,b){if(a.sol()&&(b.lexical.hasOwnProperty("align")||(b.lexical.align=!1),b.indented=a.indentation()),b.tokenize!=p&&a.eatSpace())return null;var c=b.tokenize(a,b);return"comment"==k?c:(b.lastType="operator"!=k||"++"!=l&&"--"!=l?k:"incdec",t(b,c,k,l,a))},indent:function(a,e){if(a.tokenize==p)return CodeMirror.Pass;if(a.tokenize!=n)return 0;for(var f=e&&e.charAt(0),g=a.lexical,h=a.cc.length-1;h>=0;--h){var i=a.cc[h];if(i==C)g=g.prev;else if(i!=W||/^else\b/.test(e))break}"stat"==g.type&&"}"==f&&(g=g.prev),d&&")"==g.type&&"stat"==g.prev.type&&(g=g.prev);var j=g.type,k=f==j;return"vardef"==j?g.indented+("operator"==a.lastType||","==a.lastType?4:0):"form"==j&&"{"==f?g.indented:"form"==j?g.indented+c:"stat"==j?g.indented+("operator"==a.lastType||","==a.lastType?d||c:0):"switch"!=g.info||k||0==b.doubleIndentSwitch?g.align?g.column+(k?0:1):g.indented+(k?0:c):g.indented+(/^(?:case|default)\b/.test(e)?c:2*c)},electricChars:":{}",blockCommentStart:e?null:"/*",blockCommentEnd:e?null:"*/",lineComment:e?null:"//",fold:"brace",helperType:e?"json":"javascript",jsonMode:e}}),CodeMirror.defineMIME("text/javascript","javascript"),CodeMirror.defineMIME("text/ecmascript","javascript"),CodeMirror.defineMIME("application/javascript","javascript"),CodeMirror.defineMIME("application/ecmascript","javascript"),CodeMirror.defineMIME("application/json",{name:"javascript",json:!0}),CodeMirror.defineMIME("application/x-json",{name:"javascript",json:!0}),CodeMirror.defineMIME("text/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMIME("application/typescript",{name:"javascript",typescript:!0}),CodeMirror.defineMode("less",function(a){function d(a,b){return c=b,a}function f(a,b){var f=a.next();if("@"==f)return a.eatWhile(/[\w\-]/),d("meta",a.current());if("/"==f&&a.eat("*"))return b.tokenize=h,h(a,b);if("<"==f&&a.eat("!"))return b.tokenize=i,i(a,b);if("="==f)d(null,"compare");else{if("|"==f&&a.eat("="))return d(null,"compare");if('"'==f||"'"==f)return b.tokenize=j(f),b.tokenize(a,b);if("/"==f){if(a.eat("/"))return b.tokenize=g,g(a,b);if("string"==c||"("==c)return d("string","string");if(void 0!=b.stack[b.stack.length-1])return d(null,f);if(a.eatWhile(/[\a-zA-Z0-9\-_.\s]/),/\/|\)|#/.test(a.peek()||a.eatSpace()&&")"==a.peek())||a.eol())return d("string","string")}else{if("!"==f)return a.match(/^\s*\w*/),d("keyword","important");if(/\d/.test(f))return a.eatWhile(/[\w.%]/),d("number","unit");if(/[,+<>*\/]/.test(f))return"="==a.peek()||"a"==c?d("string","string"):d(null,"select-op");if(!/[;{}:\[\]()~\|]/.test(f)){if("."==f)return"("==c||"string"==c?d("string","string"):(a.eatWhile(/[\a-zA-Z0-9\-_]/)," "==a.peek()&&a.eatSpace(),")"==a.peek()?d("number","unit"):d("tag","tag"));if("#"==f)return a.eatWhile(/[A-Za-z0-9]/),4==a.current().length||7==a.current().length?null!=a.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,!1)?a.current().substring(1)!=a.current().match(/[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/,!1)?d("atom","tag"):(a.eatSpace(),/[\/<>.(){!$%^&*_\-\\?=+\|#'~`]/.test(a.peek())?d("atom","tag"):"}"==a.peek()?d("number","unit"):/[a-zA-Z\\]/.test(a.peek())?d("atom","tag"):a.eol()?d("atom","tag"):d("number","unit")):(a.eatWhile(/[\w\\\-]/),d("atom","tag")):(a.eatWhile(/[\w\\\-]/),d("atom","tag"));if("&"==f)return a.eatWhile(/[\w\-]/),d(null,f);if(a.eatWhile(/[\w\\\-_%.{]/),"string"==c)return d("string","string");if(null!=a.current().match(/(^http$|^https$)/))return a.eatWhile(/[\w\\\-_%.{:\/]/),d("string","string");if("<"==a.peek()||">"==a.peek())return d("tag","tag");if(/\(/.test(a.peek()))return d(null,f);if("/"==a.peek()&&void 0!=b.stack[b.stack.length-1])return d("string","string");if(a.current().match(/\-\d|\-.\d/))return d("number","unit");if(/\/|[\s\)]/.test(a.peek()||a.eol()||a.eatSpace()&&"/"==a.peek())&&-1!==a.current().indexOf("."))return"{"==a.current().substring(a.current().length-1,a.current().length)?(a.backUp(1),d("tag","tag")):(a.eatSpace(),/[{<>.a-zA-Z\/]/.test(a.peek())||a.eol()?d("tag","tag"):d("string","string"));if(a.eol()||"["==a.peek()||"#"==a.peek()||"tag"==c)return"{"==a.current().substring(a.current().length-1,a.current().length)&&a.backUp(1),d("tag","tag");if("compare"==c||"a"==c||"("==c)return d("string","string");if("|"==c||"-"==a.current()||"["==c)return d(null,f);if(":"==a.peek()){a.next();var k=":"==a.peek()?!0:!1;if(k)a.backUp(1);else{var l=a.pos,m=a.current().length;a.eatWhile(/[a-z\\\-]/);var n=a.pos;if(null!=a.current().substring(m-1).match(e))return a.backUp(n-(l-1)),d("tag","tag");a.backUp(n-(l-1))}return k?d("tag","tag"):d("variable","variable")}return d("variable","variable")}if(":"==f)return a.eatWhile(/[a-z\\\-]/),e.test(a.current())?d("tag","tag"):":"==a.peek()?(a.next(),a.eatWhile(/[a-z\\\-]/),a.current().match(/\:\:\-(o|ms|moz|webkit)\-/)?d("string","string"):e.test(a.current().substring(1))?d("tag","tag"):d(null,f)):d(null,f);if("~"!=f)return d(null,f);if("r"==c)return d("string","string")}}}function g(a,b){return a.skipToEnd(),b.tokenize=f,d("comment","comment")}function h(a,b){for(var e,c=!1;null!=(e=a.next());){if(c&&"/"==e){b.tokenize=f;break}c="*"==e}return d("comment","comment")}function i(a,b){for(var e,c=0;null!=(e=a.next());){if(c>=2&&">"==e){b.tokenize=f;break}c="-"==e?c+1:0}return d("comment","comment")}function j(a){return function(b,c){for(var g,e=!1;null!=(g=b.next())&&(g!=a||e);)e=!e&&"\\"==g;return e||(c.tokenize=f),d("string","string")}}var c,b=a.indentUnit,e=/(^\:root$|^\:nth\-child$|^\:nth\-last\-child$|^\:nth\-of\-type$|^\:nth\-last\-of\-type$|^\:first\-child$|^\:last\-child$|^\:first\-of\-type$|^\:last\-of\-type$|^\:only\-child$|^\:only\-of\-type$|^\:empty$|^\:link|^\:visited$|^\:active$|^\:hover$|^\:focus$|^\:target$|^\:lang$|^\:enabled^\:disabled$|^\:checked$|^\:first\-line$|^\:first\-letter$|^\:before$|^\:after$|^\:not$|^\:required$|^\:invalid$)/;return{startState:function(a){return{tokenize:f,baseIndent:a||0,stack:[]}},token:function(a,b){if(a.eatSpace())return null;var d=b.tokenize(a,b),e=b.stack[b.stack.length-1];return"hash"==c&&"rule"==e?d="atom":"variable"==d&&("rule"==e?d=null:e&&"@media{"!=e||(d="when"==a.current()?"variable":/[\s,|\s\)|\s]/.test(a.peek())?"tag":c)),"rule"==e&&/^[\{\};]$/.test(c)&&b.stack.pop(),"{"==c?"@media"==e?b.stack[b.stack.length-1]="@media{":b.stack.push("{"):"}"==c?b.stack.pop():"@media"==c?b.stack.push("@media"):"{"==e&&"comment"!=c&&b.stack.push("rule"),d},indent:function(a,c){var d=a.stack.length;return/^\}/.test(c)&&(d-="rule"==a.stack[a.stack.length-1]?2:1),a.baseIndent+d*b},electricChars:"}"}}),CodeMirror.defineMIME("text/x-less","less"),CodeMirror.mimeModes.hasOwnProperty("text/css")||CodeMirror.defineMIME("text/css","less"),CodeMirror.defineMode("markdown",function(a,b){function C(a,b,c){return b.f=b.inline=c,c(a,b)}function D(a,b,c){return b.f=b.block=c,c(a,b)}function E(a){return a.linkTitle=!1,a.em=!1,a.strong=!1,a.quote=0,c||a.f!=G||(a.f=K,a.block=F),a.trailingSpace=0,a.trailingSpaceNewLine=!1,a.thisLineHasContent=!1,null}function F(a,c){var d=c.list!==!1;if(c.list!==!1&&c.indentationDiff>=0?(c.indentationDiff<4&&(c.indentation-=c.indentationDiff),c.list=null):c.list!==!1&&c.indentation>0?(c.list=null,c.listDepth=Math.floor(c.indentation/4)):c.list!==!1&&(c.list=!1,c.listDepth=0),c.indentationDiff>=4)return c.indentation-=4,a.skipToEnd(),i;if(a.eatSpace())return null;if("#"===a.peek()||c.prevLineHasContent&&a.match(A))c.header=!0;else if(a.eat(">"))for(c.indentation++,c.quote=1,a.eatSpace();a.eat(">");)a.eatSpace(),c.quote++;else{if("["===a.peek())return C(a,c,M);if(a.match(w,!0))return o;if(c.prevLineHasContent&&!d||!a.match(x,!0)&&!a.match(y,!0)){if(b.fencedCodeBlocks&&a.match(/^```([\w+#]*)/,!0))return c.localMode=f(RegExp.$1),c.localMode&&(c.localState=c.localMode.startState()),D(a,c,H),i}else c.indentation+=4,c.list=!0,c.listDepth++,b.taskLists&&a.match(z,!1)&&(c.taskList=!0)}return C(a,c,c.inline)}function G(a,b){var e=d.token(a,b.htmlState);return c&&"tag"===e&&"openTag"!==b.htmlState.type&&!b.htmlState.context&&(b.f=K,b.block=F),b.md_inside&&-1!=a.current().indexOf(">")&&(b.f=K,b.block=F,b.htmlState.context=void 0),e}function H(a,b){return a.sol()&&a.match(/^```/,!0)?(b.localMode=b.localState=null,b.f=K,b.block=F,i):b.localMode?b.localMode.token(a,b.localState):(a.skipToEnd(),i)}function I(a){var b=[];if(a.taskOpen)return"meta";if(a.taskClosed)return"property";if(a.strong&&b.push(v),a.em&&b.push(u),a.linkText&&b.push(s),a.code&&b.push(i),a.header&&b.push(h),a.quote&&b.push(a.quote%2?j:k),a.list!==!1){var c=(a.listDepth-1)%3;c?1===c?b.push(m):b.push(n):b.push(l)}return a.trailingSpaceNewLine?b.push("trailing-space-new-line"):a.trailingSpace&&b.push("trailing-space-"+(a.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function J(a,b){return a.match(B,!0)?I(b):void 0}function K(a,c){var d=c.text(a,c);if("undefined"!=typeof d)return d;if(c.list)return c.list=null,I(c);if(c.taskList){var e="x"!==a.match(z,!0)[1];return e?c.taskOpen=!0:c.taskClosed=!0,c.taskList=!1,I(c)}c.taskOpen=!1,c.taskClosed=!1;var f=a.next();if("\\"===f)return a.next(),I(c);if(c.linkTitle){c.linkTitle=!1;var h=f;"("===f&&(h=")"),h=(h+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var i="^\\s*(?:[^"+h+"\\\\]+|\\\\\\\\|\\\\.)"+h;if(a.match(new RegExp(i),!0))return t}if("`"===f){var j=I(c),k=a.pos;a.eatWhile("`");var l=1+a.pos-k;return c.code?l===g?(c.code=!1,j):I(c):(g=l,c.code=!0,I(c))}if(c.code)return I(c);if("!"===f&&a.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return a.match(/\[[^\]]*\]/),c.inline=c.f=L,p;if("["===f&&a.match(/.*\](\(| ?\[)/,!1))return c.linkText=!0,I(c);if("]"===f&&c.linkText){var m=I(c);return c.linkText=!1,c.inline=c.f=L,m}if("<"===f&&a.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return C(a,c,Q(q,">"));if("<"===f&&a.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return C(a,c,Q(r,">"));if("<"===f&&a.match(/^\w/,!1)){if(-1!=a.string.indexOf(">")){var n=a.string.substring(1,a.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(n)&&(c.md_inside=!0)}return a.backUp(1),D(a,c,G)}if("<"===f&&a.match(/^\/\w*?>/))return c.md_inside=!1,"tag";var o=!1;if(!b.underscoresBreakWords&&"_"===f&&"_"!==a.peek()&&a.match(/(\w)/,!1)){var s=a.pos-2;if(s>=0){var u=a.string.charAt(s);"_"!==u&&u.match(/(\w)/,!1)&&(o=!0)}}var j=I(c);if("*"===f||"_"===f&&!o){if(c.strong===f&&a.eat(f))return c.strong=!1,j;if(!c.strong&&a.eat(f))return c.strong=f,I(c);if(c.em===f)return c.em=!1,j;if(!c.em)return c.em=f,I(c)}else if(" "===f&&(a.eat("*")||a.eat("_"))){if(" "===a.peek())return I(c);a.backUp(1)}return" "===f&&(a.match(/ +$/,!1)?c.trailingSpace++:c.trailingSpace&&(c.trailingSpaceNewLine=!0)),I(c)}function L(a,b){if(a.eatSpace())return null;var c=a.next();return"("===c||"["===c?C(a,b,Q(t,"("===c?")":"]")):"error"}function M(a,b){return a.match(/^[^\]]*\]:/,!0)?(b.f=N,s):C(a,b,K)}function N(a,b){return a.eatSpace()?null:(a.match(/^[^\s]+/,!0),void 0===a.peek()?b.linkTitle=!0:a.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=K,t)}function P(a){return O[a]||(a=(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),O[a]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+a+")")),O[a]}function Q(a,b,c){return c=c||K,function(d,e){return d.match(P(b)),e.inline=e.f=c,a}}var c=CodeMirror.modes.hasOwnProperty("xml"),d=CodeMirror.getMode(a,c?{name:"xml",htmlMode:!0}:"text/plain"),e={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"},f=function(){var b,f,c={},d={},g=[];for(var h in CodeMirror.modes)CodeMirror.modes.propertyIsEnumerable(h)&&g.push(h);for(b=0;b<g.length;b++)c[g[b]]=g[b];var i=[];for(var h in CodeMirror.mimeModes)CodeMirror.mimeModes.propertyIsEnumerable(h)&&i.push({mime:h,mode:CodeMirror.mimeModes[h]});for(b=0;b<i.length;b++)f=i[b].mime,d[f]=i[b].mime;for(var j in e)(e[j]in c||e[j]in d)&&(c[j]=e[j]);return function(b){return c[b]?CodeMirror.getMode(a,c[b]):null}}();void 0===b.underscoresBreakWords&&(b.underscoresBreakWords=!0),void 0===b.fencedCodeBlocks&&(b.fencedCodeBlocks=!1),void 0===b.taskLists&&(b.taskLists=!1);var g=0,h="header",i="comment",j="atom",k="number",l="variable-2",m="variable-3",n="keyword",o="hr",p="tag",q="link",r="link",s="link",t="string",u="em",v="strong",w=/^([*\-=_])(?:\s*\1){2,}\s*$/,x=/^[*\-+]\s+/,y=/^[0-9]+\.\s+/,z=/^\[(x| )\](?=\s)/,A=/^(?:\={1,}|-{1,})$/,B=/^[^!\[\]*_\\<>` "'(]+/,O=[];return{startState:function(){return{f:F,prevLineHasContent:!1,thisLineHasContent:!1,block:F,htmlState:CodeMirror.startState(d),indentation:0,inline:K,text:J,linkText:!1,linkTitle:!1,em:!1,strong:!1,header:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1}},copyState:function(a){return{f:a.f,prevLineHasContent:a.prevLineHasContent,thisLineHasContent:a.thisLineHasContent,block:a.block,htmlState:CodeMirror.copyState(d,a.htmlState),indentation:a.indentation,localMode:a.localMode,localState:a.localMode?CodeMirror.copyState(a.localMode,a.localState):null,inline:a.inline,text:a.text,linkTitle:a.linkTitle,em:a.em,strong:a.strong,header:a.header,taskList:a.taskList,list:a.list,listDepth:a.listDepth,quote:a.quote,trailingSpace:a.trailingSpace,trailingSpaceNewLine:a.trailingSpaceNewLine,md_inside:a.md_inside}},token:function(a,b){if(a.sol()){if(a.match(/^\s*$/,!0))return b.prevLineHasContent=!1,E(b);b.prevLineHasContent=b.thisLineHasContent,b.thisLineHasContent=!0,b.header=!1,b.taskList=!1,b.code=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,b.f=b.block;var c=a.match(/^\s*/,!0)[0].replace(/\t/g," ").length,d=4*Math.floor((c-b.indentation)/4);d>4&&(d=4);var e=b.indentation+d;if(b.indentationDiff=e-b.indentation,b.indentation=e,c>0)return null}return b.f(a,b)},blankLine:E,getType:I}},"xml"),CodeMirror.defineMIME("text/x-markdown","markdown"),function(){function a(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function b(a){return function(b,c){return b.match(a)?c.tokenize=null:b.skipToEnd(),"string"}}var c={name:"clike",keywords:a("abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent"),blockKeywords:a("catch do else elseif for foreach if switch try while"),atoms:a("true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__"),builtin:a("func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport echo print global static exit array empty eval isset unset die include require include_once require_once"),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"
9
- },"<":function(a,c){return a.match(/<</)?(a.eatWhile(/[\w\.]/),c.tokenize=b(a.current().slice(3)),c.tokenize(a,c)):!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1}}};CodeMirror.defineMode("php",function(a,b){function f(a,b){var c=b.curMode==e;if(a.sol()&&'"'!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=d,b.curState=b.html,"meta"):e.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=e,b.curState=b.php,"meta";if('"'==b.pending){for(;!a.eol()&&'"'!=a.next(););var f="string"}else if(b.pending&&a.pos<b.pending.end){a.pos=b.pending.end;var f=b.pending.style}else var f=d.token(a,b.curState);b.pending=null;var g=a.current(),h=g.search(/<\?/);return-1!=h&&(b.pending="string"==f&&/\"$/.test(g)&&!/\?>/.test(g)?'"':{end:a.pos,style:f},a.backUp(g.length-h)),f}var d=CodeMirror.getMode(a,"text/html"),e=CodeMirror.getMode(a,c);return{startState:function(){var a=CodeMirror.startState(d),c=CodeMirror.startState(e);return{html:a,php:c,curMode:b.startOpen?e:d,curState:b.startOpen?c:a,pending:null}},copyState:function(a){var h,b=a.html,c=CodeMirror.copyState(d,b),f=a.php,g=CodeMirror.copyState(e,f);return h=a.curMode==d?c:g,{html:c,php:g,curMode:a.curMode,curState:h,pending:a.pending}},token:f,indent:function(a,b){return a.curMode!=e&&/^\s*<\//.test(b)||a.curMode==e&&/^\?>/.test(b)?d.indent(a.html,b):a.curMode.indent(a.curState,b)},electricChars:"/{}:",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),CodeMirror.defineMIME("application/x-httpd-php","php"),CodeMirror.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),CodeMirror.defineMIME("text/x-php",c)}(),CodeMirror.defineMode("xml",function(a,b){function j(a,b){function c(c){return b.tokenize=c,c(a,b)}var d=a.next();if("<"==d){if(a.eat("!"))return a.eat("[")?a.match("CDATA[")?c(m("atom","]]>")):null:a.match("--")?c(m("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(n(1))):null;if(a.eat("?"))return a.eatWhile(/[\w\._\-]/),b.tokenize=m("meta","?>"),"meta";var e=a.eat("/");h="";for(var f;f=a.eat(/[^\s\u00a0=<>\"\'\/?]/);)h+=f;return h?(i=e?"closeTag":"openTag",b.tokenize=k,"tag"):"error"}if("&"==d){var g;return g=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),g?"atom":"error"}return a.eatWhile(/[^&<]/),null}function k(a,b){var c=a.next();return">"==c||"/"==c&&a.eat(">")?(b.tokenize=j,i=">"==c?"endTag":"selfcloseTag","tag"):"="==c?(i="equals",null):"<"==c?"error":/[\'\"]/.test(c)?(b.tokenize=l(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function l(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function m(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=j;break}c.next()}return a}}function n(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=n(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=j;break}return c.tokenize=n(a-1),c.tokenize(b,c)}}return"meta"}}function r(){for(var a=arguments.length-1;a>=0;a--)o.cc.push(arguments[a])}function s(){return r.apply(null,arguments),!0}function t(a,b){var c=f.doNotIndent.hasOwnProperty(a)||o.context&&o.context.noIndent;o.context={prev:o.context,tagName:a,indent:o.indented,startOfLine:b,noIndent:c}}function u(){o.context&&(o.context=o.context.prev)}function v(a){if("openTag"==a)return o.tagName=h,o.tagStart=p.column(),s(z,w(o.startOfLine));if("closeTag"==a){var b=!1;return o.context?o.context.tagName!=h&&(f.implicitlyClosed.hasOwnProperty(o.context.tagName.toLowerCase())&&u(),b=!o.context||o.context.tagName!=h):b=!0,b&&(q="error"),s(x(b))}return s()}function w(a){return function(b){var c=o.tagName;return o.tagName=o.tagStart=null,"selfcloseTag"==b||"endTag"==b&&f.autoSelfClosers.hasOwnProperty(c.toLowerCase())?(y(c.toLowerCase()),s()):"endTag"==b?(y(c.toLowerCase()),t(c,a),s()):s()}}function x(a){return function(b){return a&&(q="error"),"endTag"==b?(u(),s()):(q="error",s(arguments.callee))}}function y(a){for(var b;;){if(!o.context)return;if(b=o.context.tagName.toLowerCase(),!f.contextGrabbers.hasOwnProperty(b)||!f.contextGrabbers[b].hasOwnProperty(a))return;u()}}function z(a){return"word"==a?(q="attribute",s(A,z)):"endTag"==a||"selfcloseTag"==a?r():(q="error",s(z))}function A(a){if("equals"==a)return s(B,z);if(f.allowMissing){if("word"==a)return q="attribute",s(A,z)}else q="error";return"endTag"==a||"selfcloseTag"==a?r():s()}function B(a){return"string"==a?s(C):"word"==a&&f.allowUnquoted?(q="string",s()):(q="error","endTag"==a||"selfCloseTag"==a?r():s())}function C(a){return"string"==a?s(C):r()}var h,i,o,p,q,c=a.indentUnit,d=b.multilineTagIndentFactor||1,e=b.multilineTagIndentPastTag||!0,f=b.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},g=b.alignCDATA;return{startState:function(){return{tokenize:j,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(a,b){if(!b.tagName&&a.sol()&&(b.startOfLine=!0,b.indented=a.indentation()),a.eatSpace())return null;q=i=h=null;var c=b.tokenize(a,b);if(b.type=i,(c||i)&&"comment"!=c)for(o=b,p=a;;){var d=b.cc.pop()||v;if(d(i||c))break}return b.startOfLine=!1,q||c},indent:function(a,b,f){var h=a.context;if(a.tokenize.isInAttribute)return a.stringStartCol+1;if(a.tokenize!=k&&a.tokenize!=j||h&&h.noIndent)return f?f.match(/^(\s*)/)[0].length:0;if(a.tagName)return e?a.tagStart+a.tagName.length+2:a.tagStart+c*d;if(g&&/<!\[CDATA\[/.test(b))return 0;for(h&&/^<\//.test(b)&&(h=h.prev);h&&!h.startOfLine;)h=h.prev;return h?h.indent+c:0},electricChars:"/",blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:b.htmlMode?"html":"xml",helperType:b.htmlMode?"html":"xml"}}),CodeMirror.defineMIME("text/xml","xml"),CodeMirror.defineMIME("application/xml","xml"),CodeMirror.mimeModes.hasOwnProperty("text/html")||CodeMirror.defineMIME("text/html",{name:"xml",htmlMode:!0});
 
 
 
 
 
 
 
 
 
vendor/coffee-script.js DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * CoffeeScript Compiler v1.6.3
3
- * http://coffeescript.org
4
- *
5
- * Copyright 2011, Jeremy Ashkenas
6
- * Released under the MIT License
7
- */
8
- !function(root){var CoffeeScript=function(){function require(e){return require[e]}return require["./helpers"]=function(){var e={},t={exports:e};return function(){var t,n,i,s,r,o;e.starts=function(e,t,n){return t===e.substr(n,t.length)},e.ends=function(e,t,n){var i;return i=t.length,t===e.substr(e.length-i-(n||0),i)},e.repeat=r=function(e,t){var n;for(n="";t>0;)1&t&&(n+=e),t>>>=1,e+=e;return n},e.compact=function(e){var t,n,i,s;for(s=[],n=0,i=e.length;i>n;n++)t=e[n],t&&s.push(t);return s},e.count=function(e,t){var n,i;if(n=i=0,!t.length)return 1/0;for(;i=1+e.indexOf(t,i);)n++;return n},e.merge=function(e,t){return n(n({},e),t)},n=e.extend=function(e,t){var n,i;for(n in t)i=t[n],e[n]=i;return e},e.flatten=i=function(e){var t,n,s,r;for(n=[],s=0,r=e.length;r>s;s++)t=e[s],t instanceof Array?n=n.concat(i(t)):n.push(t);return n},e.del=function(e,t){var n;return n=e[t],delete e[t],n},e.last=s=function(e,t){return e[e.length-(t||0)-1]},e.some=null!=(o=Array.prototype.some)?o:function(e){var t,n,i;for(n=0,i=this.length;i>n;n++)if(t=this[n],e(t))return!0;return!1},e.invertLiterate=function(e){var t,n,i;return i=!0,n=function(){var n,s,r,o;for(r=e.split("\n"),o=[],n=0,s=r.length;s>n;n++)t=r[n],i&&/^([ ]{4}|[ ]{0,3}\t)/.test(t)?o.push(t):(i=/^\s*$/.test(t))?o.push(t):o.push("# "+t);return o}(),n.join("\n")},t=function(e,t){return t?{first_line:e.first_line,first_column:e.first_column,last_line:t.last_line,last_column:t.last_column}:e},e.addLocationDataFn=function(e,n){return function(i){return"object"==typeof i&&i.updateLocationDataIfMissing&&i.updateLocationDataIfMissing(t(e,n)),i}},e.locationDataToString=function(e){var t;return"2"in e&&"first_line"in e[2]?t=e[2]:"first_line"in e&&(t=e),t?""+(t.first_line+1)+":"+(t.first_column+1)+"-"+(""+(t.last_line+1)+":"+(t.last_column+1)):"No location data"},e.baseFileName=function(e,t,n){var i,s;return null==t&&(t=!1),null==n&&(n=!1),s=n?/\\|\//:/\//,i=e.split(s),e=i[i.length-1],t?(i=e.split("."),i.pop(),"coffee"===i[i.length-1]&&i.length>1&&i.pop(),i.join(".")):e},e.isCoffee=function(e){return/\.((lit)?coffee|coffee\.md)$/.test(e)},e.isLiterate=function(e){return/\.(litcoffee|coffee\.md)$/.test(e)},e.throwSyntaxError=function(e,t){var n;throw null==t.last_line&&(t.last_line=t.first_line),null==t.last_column&&(t.last_column=t.first_column),n=new SyntaxError(e),n.location=t,n},e.prettyErrorMessage=function(e,t,n,i){var s,o,a,c,h,l,u,p,d,f,m;return e.location?(m=e.location,h=m.first_line,c=m.first_column,u=m.last_line,l=m.last_column,s=n.split("\n")[h],f=c,a=h===u?l+1:s.length,p=r(" ",f)+r("^",a-f),i&&(o=function(e){return"[1;31m"+e+"[0m"},s=s.slice(0,f)+o(s.slice(f,a))+s.slice(a),p=o(p)),d=""+t+":"+(h+1)+":"+(c+1)+": error: "+e.message+"\n"+s+"\n"+p):e.stack||""+e}}.call(this),t.exports}(),require["./rewriter"]=function(){var e={},t={exports:e};return function(){var t,n,i,s,r,o,a,c,h,l,u,p,d,f,m,b,k,g,y=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1},v=[].slice;for(d=function(e,t){var n;return n=[e,t],n.generated=!0,n},e.Rewriter=function(){function e(){}return e.prototype.rewrite=function(e){return this.tokens=e,this.removeLeadingNewlines(),this.removeMidExpressionNewlines(),this.closeOpenCalls(),this.closeOpenIndexes(),this.addImplicitIndentation(),this.tagPostfixConditionals(),this.addImplicitBracesAndParens(),this.addLocationDataToGeneratedTokens(),this.tokens},e.prototype.scanTokens=function(e){var t,n,i;for(i=this.tokens,t=0;n=i[t];)t+=e.call(this,n,t,i);return!0},e.prototype.detectEnd=function(e,t,n){var r,o,a,c,h;for(a=this.tokens,r=0;o=a[e];){if(0===r&&t.call(this,o,e))return n.call(this,o,e);if(!o||0>r)return n.call(this,o,e-1);c=o[0],y.call(s,c)>=0?r+=1:(h=o[0],y.call(i,h)>=0&&(r-=1)),e+=1}return e-1},e.prototype.removeLeadingNewlines=function(){var e,t,n,i,s;for(s=this.tokens,e=n=0,i=s.length;i>n&&(t=s[e][0],"TERMINATOR"===t);e=++n);return e?this.tokens.splice(0,e):void 0},e.prototype.removeMidExpressionNewlines=function(){return this.scanTokens(function(e,t,i){var s;return"TERMINATOR"===e[0]&&(s=this.tag(t+1),y.call(n,s)>=0)?(i.splice(t,1),0):1})},e.prototype.closeOpenCalls=function(){var e,t;return t=function(e,t){var n;return")"===(n=e[0])||"CALL_END"===n||"OUTDENT"===e[0]&&")"===this.tag(t-1)},e=function(e,t){return this.tokens["OUTDENT"===e[0]?t-1:t][0]="CALL_END"},this.scanTokens(function(n,i){return"CALL_START"===n[0]&&this.detectEnd(i+1,t,e),1})},e.prototype.closeOpenIndexes=function(){var e,t;return t=function(e){var t;return"]"===(t=e[0])||"INDEX_END"===t},e=function(e){return e[0]="INDEX_END"},this.scanTokens(function(n,i){return"INDEX_START"===n[0]&&this.detectEnd(i+1,t,e),1})},e.prototype.matchTags=function(){var e,t,n,i,s,r,o;for(t=arguments[0],i=2<=arguments.length?v.call(arguments,1):[],e=0,n=s=0,r=i.length;r>=0?r>s:s>r;n=r>=0?++s:--s){for(;"HERECOMMENT"===this.tag(t+n+e);)e+=2;if(null!=i[n]&&("string"==typeof i[n]&&(i[n]=[i[n]]),o=this.tag(t+n+e),y.call(i[n],o)<0))return!1}return!0},e.prototype.looksObjectish=function(e){return this.matchTags(e,"@",null,":")||this.matchTags(e,null,":")},e.prototype.findTagsBackwards=function(e,t){var n,r,o,a,c,h,u;for(n=[];e>=0&&(n.length||(a=this.tag(e),y.call(t,a)<0&&(c=this.tag(e),y.call(s,c)<0||this.tokens[e].generated)&&(h=this.tag(e),y.call(l,h)<0)));)r=this.tag(e),y.call(i,r)>=0&&n.push(this.tag(e)),o=this.tag(e),y.call(s,o)>=0&&n.length&&n.pop(),e-=1;return u=this.tag(e),y.call(t,u)>=0},e.prototype.addImplicitBracesAndParens=function(){var e;return e=[],this.scanTokens(function(t,n,h){var u,p,f,m,b,k,g,v,w,T,C,F,L,N,x,E,D,S,R,A,I,_,$,O,j,M;if(A=t[0],T=(n>0?h[n-1]:[])[0],v=(n<h.length-1?h[n+1]:[])[0],x=function(){return e[e.length-1]},E=n,f=function(e){return n-E+e},m=function(){var e,t;return null!=(e=x())?null!=(t=e[2])?t.ours:void 0:void 0},b=function(){var e;return m()&&"("===(null!=(e=x())?e[0]:void 0)},g=function(){var e;return m()&&"{"===(null!=(e=x())?e[0]:void 0)},k=function(){var e;return m&&"CONTROL"===(null!=(e=x())?e[0]:void 0)},D=function(t){var i;return i=null!=t?t:n,e.push(["(",i,{ours:!0}]),h.splice(i,0,d("CALL_START","(")),null==t?n+=1:void 0},u=function(){return e.pop(),h.splice(n,0,d("CALL_END",")")),n+=1},S=function(t,i){var s;return null==i&&(i=!0),s=null!=t?t:n,e.push(["{",s,{sameLine:!0,startsLine:i,ours:!0}]),h.splice(s,0,d("{",d(new String("{")))),null==t?n+=1:void 0},p=function(t){return t=null!=t?t:n,e.pop(),h.splice(t,0,d("}","}")),n+=1},b()&&("IF"===A||"TRY"===A||"FINALLY"===A||"CATCH"===A||"CLASS"===A||"SWITCH"===A))return e.push(["CONTROL",n,{ours:!0}]),f(1);if("INDENT"===A&&m()){if("=>"!==T&&"->"!==T&&"["!==T&&"("!==T&&","!==T&&"{"!==T&&"TRY"!==T&&"ELSE"!==T&&"="!==T)for(;b();)u();return k()&&e.pop(),e.push([A,n]),f(1)}if(y.call(s,A)>=0)return e.push([A,n]),f(1);if(y.call(i,A)>=0){for(;m();)b()?u():g()?p():e.pop();e.pop()}if((y.call(a,A)>=0&&t.spaced&&!t.stringEnd||"?"===A&&n>0&&!h[n-1].spaced)&&(y.call(r,v)>=0||y.call(c,v)>=0&&!(null!=(I=h[n+1])?I.spaced:void 0)&&!(null!=(_=h[n+1])?_.newLine:void 0)))return"?"===A&&(A=t[0]="FUNC_EXIST"),D(n+1),f(2);if(y.call(a,A)>=0&&this.matchTags(n+1,"INDENT",null,":")&&!this.findTagsBackwards(n,["CLASS","EXTENDS","IF","CATCH","SWITCH","LEADING_WHEN","FOR","WHILE","UNTIL"]))return D(n+1),e.push(["INDENT",n+2]),f(3);if(":"===A){for(C="@"===this.tag(n-2)?n-2:n-1;"HERECOMMENT"===this.tag(C-2);)C-=2;return R=0===C||($=this.tag(C-1),y.call(l,$)>=0)||h[C-1].newLine,x()&&(O=x(),N=O[0],L=O[1],("{"===N||"INDENT"===N&&"{"===this.tag(L-1))&&(R||","===this.tag(C-1)||"{"===this.tag(C-1)))?f(1):(S(C,!!R),f(2))}if("OUTDENT"===T&&b()&&("."===A||"?."===A||"::"===A||"?::"===A))return u(),f(1);if(g()&&y.call(l,A)>=0&&(x()[2].sameLine=!1),y.call(o,A)>=0)for(;m();)if(j=x(),N=j[0],L=j[1],M=j[2],F=M.sameLine,R=M.startsLine,b()&&","!==T)u();else if(g()&&F&&!R)p();else{if(!g()||"TERMINATOR"!==A||","===T||R&&this.looksObjectish(n+1))break;p()}if(","===A&&!this.looksObjectish(n+1)&&g()&&("TERMINATOR"!==v||!this.looksObjectish(n+2)))for(w="OUTDENT"===v?1:0;g();)p(n+w);return f(1)})},e.prototype.addLocationDataToGeneratedTokens=function(){return this.scanTokens(function(e,t,n){var i,s,r,o,a,c;return e[2]?1:e.generated||e.explicit?("{"===e[0]&&(r=null!=(a=n[t+1])?a[2]:void 0)?(s=r.first_line,i=r.first_column):(o=null!=(c=n[t-1])?c[2]:void 0)?(s=o.last_line,i=o.last_column):s=i=0,e[2]={first_line:s,first_column:i,last_line:s,last_column:i},1):1})},e.prototype.addImplicitIndentation=function(){var e,t,n,i,s;return s=n=i=null,t=function(e){var t,n;return";"!==e[1]&&(t=e[0],y.call(u,t)>=0)&&!("ELSE"===e[0]&&"THEN"!==s)&&!!("CATCH"!==(n=e[0])&&"FINALLY"!==n||"->"!==s&&"=>"!==s)},e=function(e,t){return this.tokens.splice(","===this.tag(t-1)?t-1:t,0,i)},this.scanTokens(function(r,o,a){var c,h,l,u,d;if(h=r[0],"TERMINATOR"===h&&"THEN"===this.tag(o+1))return a.splice(o,1),0;if("ELSE"===h&&"OUTDENT"!==this.tag(o-1))return a.splice.apply(a,[o,0].concat(v.call(this.indentation()))),2;if("CATCH"===h)for(c=l=1;2>=l;c=++l)if("OUTDENT"===(u=this.tag(o+c))||"TERMINATOR"===u||"FINALLY"===u)return a.splice.apply(a,[o+c,0].concat(v.call(this.indentation()))),2+c;return y.call(p,h)>=0&&"INDENT"!==this.tag(o+1)&&("ELSE"!==h||"IF"!==this.tag(o+1))?(s=h,d=this.indentation(!0),n=d[0],i=d[1],"THEN"===s&&(n.fromThen=!0),a.splice(o+1,0,n),this.detectEnd(o+2,t,e),"THEN"===h&&a.splice(o,1),1):1})},e.prototype.tagPostfixConditionals=function(){var e,t,n;return n=null,t=function(e,t){var n,i;return i=e[0],n=this.tokens[t-1][0],"TERMINATOR"===i||"INDENT"===i&&y.call(p,n)<0},e=function(e){return"INDENT"!==e[0]||e.generated&&!e.fromThen?n[0]="POST_"+n[0]:void 0},this.scanTokens(function(i,s){return"IF"!==i[0]?1:(n=i,this.detectEnd(s+1,t,e),1)})},e.prototype.indentation=function(e){var t,n;return null==e&&(e=!1),t=["INDENT",2],n=["OUTDENT",2],e&&(t.generated=n.generated=!0),e||(t.explicit=n.explicit=!0),[t,n]},e.prototype.generate=d,e.prototype.tag=function(e){var t;return null!=(t=this.tokens[e])?t[0]:void 0},e}(),t=[["(",")"],["[","]"],["{","}"],["INDENT","OUTDENT"],["CALL_START","CALL_END"],["PARAM_START","PARAM_END"],["INDEX_START","INDEX_END"]],e.INVERSES=h={},s=[],i=[],b=0,k=t.length;k>b;b++)g=t[b],f=g[0],m=g[1],s.push(h[m]=f),i.push(h[f]=m);n=["CATCH","WHEN","ELSE","FINALLY"].concat(i),a=["IDENTIFIER","SUPER",")","CALL_END","]","INDEX_END","@","THIS"],r=["IDENTIFIER","NUMBER","STRING","JS","REGEX","NEW","PARAM_START","CLASS","IF","TRY","SWITCH","THIS","BOOL","NULL","UNDEFINED","UNARY","SUPER","THROW","@","->","=>","[","(","{","--","++"],c=["+","-"],o=["POST_IF","FOR","WHILE","UNTIL","WHEN","BY","LOOP","TERMINATOR"],p=["ELSE","->","=>","TRY","FINALLY","THEN"],u=["TERMINATOR","CATCH","FINALLY","ELSE","OUTDENT","LEADING_WHEN"],l=["TERMINATOR","INDENT","OUTDENT"]}.call(this),t.exports}(),require["./lexer"]=function(){var e={},t={exports:e};return function(){var t,n,i,s,r,o,a,c,h,l,u,p,d,f,m,b,k,g,y,v,w,T,C,F,L,N,x,E,D,S,R,A,I,_,$,O,j,M,B,V,P,U,q,H,G,W,X,Y,K,z,J,Z,Q,et=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};Z=require("./rewriter"),O=Z.Rewriter,g=Z.INVERSES,Q=require("./helpers"),H=Q.count,z=Q.starts,q=Q.compact,X=Q.last,K=Q.repeat,G=Q.invertLiterate,Y=Q.locationDataToString,J=Q.throwSyntaxError,e.Lexer=L=function(){function e(){}return e.prototype.tokenize=function(e,t){var n,i,s,r;for(null==t&&(t={}),this.literate=t.literate,this.indent=0,this.indebt=0,this.outdebt=0,this.indents=[],this.ends=[],this.tokens=[],this.chunkLine=t.line||0,this.chunkColumn=t.column||0,e=this.clean(e),i=0;this.chunk=e.slice(i);)n=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.heredocToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken(),r=this.getLineAndColumnFromChunk(n),this.chunkLine=r[0],this.chunkColumn=r[1],i+=n;return this.closeIndentation(),(s=this.ends.pop())&&this.error("missing "+s),t.rewrite===!1?this.tokens:(new O).rewrite(this.tokens)},e.prototype.clean=function(e){return e.charCodeAt(0)===t&&(e=e.slice(1)),e=e.replace(/\r/g,"").replace(V,""),U.test(e)&&(e="\n"+e,this.chunkLine--),this.literate&&(e=G(e)),e},e.prototype.identifierToken=function(){var e,t,n,i,s,c,h,l,u,p,d,f,m,k;return(h=b.exec(this.chunk))?(c=h[0],i=h[1],e=h[2],s=i.length,l=void 0,"own"===i&&"FOR"===this.tag()?(this.token("OWN",i),i.length):(n=e||(u=X(this.tokens))&&("."===(f=u[0])||"?."===f||"::"===f||"?::"===f||!u.spaced&&"@"===u[0]),p="IDENTIFIER",!n&&(et.call(w,i)>=0||et.call(a,i)>=0)&&(p=i.toUpperCase(),"WHEN"===p&&(m=this.tag(),et.call(T,m)>=0)?p="LEADING_WHEN":"FOR"===p?this.seenFor=!0:"UNLESS"===p?p="IF":et.call(P,p)>=0?p="UNARY":et.call(_,p)>=0&&("INSTANCEOF"!==p&&this.seenFor?(p="FOR"+p,this.seenFor=!1):(p="RELATION","!"===this.value()&&(l=this.tokens.pop(),i="!"+i)))),et.call(v,i)>=0&&(n?(p="IDENTIFIER",i=new String(i),i.reserved=!0):et.call($,i)>=0&&this.error('reserved word "'+i+'"')),n||(et.call(r,i)>=0&&(i=o[i]),p=function(){switch(i){case"!":return"UNARY";case"==":case"!=":return"COMPARE";case"&&":case"||":return"LOGIC";case"true":case"false":return"BOOL";case"break":case"continue":return"STATEMENT";default:return p}}()),d=this.token(p,i,0,s),l&&(k=[l[2].first_line,l[2].first_column],d[2].first_line=k[0],d[2].first_column=k[1]),e&&(t=c.lastIndexOf(":"),this.token(":",":",t,e.length)),c.length)):0},e.prototype.numberToken=function(){var e,t,n,i,s;return(n=R.exec(this.chunk))?(i=n[0],/^0[BOX]/.test(i)?this.error("radix prefix '"+i+"' must be lowercase"):/E/.test(i)&&!/^0x/.test(i)?this.error("exponential notation '"+i+"' must be indicated with a lowercase 'e'"):/^0\d*[89]/.test(i)?this.error("decimal literal '"+i+"' must not be prefixed with '0'"):/^0\d+/.test(i)&&this.error("octal literal '"+i+"' must be prefixed with '0o'"),t=i.length,(s=/^0o([0-7]+)/.exec(i))&&(i="0x"+parseInt(s[1],8).toString(16)),(e=/^0b([01]+)/.exec(i))&&(i="0x"+parseInt(e[1],2).toString(16)),this.token("NUMBER",i,0,t),t):0},e.prototype.stringToken=function(){var e,t,n;switch(this.chunk.charAt(0)){case"'":if(!(e=M.exec(this.chunk)))return 0;n=e[0],this.token("STRING",n.replace(x,"\\\n"),0,n.length);break;case'"':if(!(n=this.balancedString(this.chunk,'"')))return 0;0<n.indexOf("#{",1)?this.interpolateString(n.slice(1,-1),{strOffset:1,lexedLength:n.length}):this.token("STRING",this.escapeLines(n,0,n.length));break;default:return 0}return(t=/^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(n))&&this.error("octal escape sequences "+n+" are not allowed"),n.length},e.prototype.heredocToken=function(){var e,t,n,i;return(n=u.exec(this.chunk))?(t=n[0],i=t.charAt(0),e=this.sanitizeHeredoc(n[2],{quote:i,indent:null}),'"'===i&&0<=e.indexOf("#{")?this.interpolateString(e,{heredoc:!0,strOffset:3,lexedLength:t.length}):this.token("STRING",this.makeString(e,i,!0),0,t.length),t.length):0},e.prototype.commentToken=function(){var e,t,n;return(n=this.chunk.match(c))?(e=n[0],t=n[1],t&&this.token("HERECOMMENT",this.sanitizeHeredoc(t,{herecomment:!0,indent:K(" ",this.indent)}),0,e.length),e.length):0},e.prototype.jsToken=function(){var e,t;return"`"===this.chunk.charAt(0)&&(e=y.exec(this.chunk))?(this.token("JS",(t=e[0]).slice(1,-1),0,t.length),t.length):0},e.prototype.regexToken=function(){var e,t,n,i,s,r,o;return"/"!==this.chunk.charAt(0)?0:(n=f.exec(this.chunk))?t=this.heregexToken(n):(i=X(this.tokens),i&&(r=i[0],et.call(i.spaced?D:S,r)>=0)?0:(n=I.exec(this.chunk))?(o=n,n=o[0],s=o[1],e=o[2],"/*"===s.slice(0,2)&&this.error("regular expressions cannot begin with `*`"),"//"===s&&(s="/(?:)/"),this.token("REGEX",""+s+e,0,n.length),n.length):0)},e.prototype.heregexToken=function(e){var t,n,i,s,r,o,a,c,h,l,u,p,d,f,b,k;if(s=e[0],t=e[1],n=e[2],0>t.indexOf("#{"))return a=t.replace(m,"").replace(/\//g,"\\/"),a.match(/^\*/)&&this.error("regular expressions cannot begin with `*`"),this.token("REGEX","/"+(a||"(?:)")+"/"+n,0,s.length),s.length;for(this.token("IDENTIFIER","RegExp",0,0),this.token("CALL_START","(",0,0),l=[],f=this.interpolateString(t,{regex:!0}),p=0,d=f.length;d>p;p++){if(h=f[p],c=h[0],u=h[1],"TOKENS"===c)l.push.apply(l,u);else if("NEOSTRING"===c){if(!(u=u.replace(m,"")))continue;u=u.replace(/\\/g,"\\\\"),h[0]="STRING",h[1]=this.makeString(u,'"',!0),l.push(h)}else this.error("Unexpected "+c);o=X(this.tokens),r=["+","+"],r[2]=o[2],l.push(r)}return l.pop(),"STRING"!==(null!=(b=l[0])?b[0]:void 0)&&(this.token("STRING",'""',0,0),this.token("+","+",0,0)),(k=this.tokens).push.apply(k,l),n&&(i=s.lastIndexOf(n),this.token(",",",",i,0),this.token("STRING",'"'+n+'"',i,n.length)),this.token(")",")",s.length-1,0),s.length},e.prototype.lineToken=function(){var e,t,n,i,s;if(!(n=E.exec(this.chunk)))return 0;if(t=n[0],this.seenFor=!1,s=t.length-1-t.lastIndexOf("\n"),i=this.unfinished(),s-this.indebt===this.indent)return i?this.suppressNewlines():this.newlineToken(0),t.length;if(s>this.indent){if(i)return this.indebt=s-this.indent,this.suppressNewlines(),t.length;e=s-this.indent+this.outdebt,this.token("INDENT",e,t.length-s,s),this.indents.push(e),this.ends.push("OUTDENT"),this.outdebt=this.indebt=0}else this.indebt=0,this.outdentToken(this.indent-s,i,t.length);return this.indent=s,t.length},e.prototype.outdentToken=function(e,t,n){for(var i,s;e>0;)s=this.indents.length-1,void 0===this.indents[s]?e=0:this.indents[s]===this.outdebt?(e-=this.outdebt,this.outdebt=0):this.indents[s]<this.outdebt?(this.outdebt-=this.indents[s],e-=this.indents[s]):(i=this.indents.pop()+this.outdebt,e-=i,this.outdebt=0,this.pair("OUTDENT"),this.token("OUTDENT",i,0,n));for(i&&(this.outdebt-=e);";"===this.value();)this.tokens.pop();return"TERMINATOR"===this.tag()||t||this.token("TERMINATOR","\n",n,0),this},e.prototype.whitespaceToken=function(){var e,t,n;return(e=U.exec(this.chunk))||(t="\n"===this.chunk.charAt(0))?(n=X(this.tokens),n&&(n[e?"spaced":"newLine"]=!0),e?e[0].length:0):0},e.prototype.newlineToken=function(e){for(;";"===this.value();)this.tokens.pop();return"TERMINATOR"!==this.tag()&&this.token("TERMINATOR","\n",e,0),this},e.prototype.suppressNewlines=function(){return"\\"===this.value()&&this.tokens.pop(),this},e.prototype.literalToken=function(){var e,t,n,r,o,a,c,u;if((e=A.exec(this.chunk))?(r=e[0],s.test(r)&&this.tagParameters()):r=this.chunk.charAt(0),n=r,t=X(this.tokens),"="===r&&t&&(!t[1].reserved&&(o=t[1],et.call(v,o)>=0)&&this.error('reserved word "'+this.value()+"\" can't be assigned"),"||"===(a=t[1])||"&&"===a))return t[0]="COMPOUND_ASSIGN",t[1]+="=",r.length;if(";"===r)this.seenFor=!1,n="TERMINATOR";else if(et.call(N,r)>=0)n="MATH";else if(et.call(h,r)>=0)n="COMPARE";else if(et.call(l,r)>=0)n="COMPOUND_ASSIGN";else if(et.call(P,r)>=0)n="UNARY";else if(et.call(j,r)>=0)n="SHIFT";else if(et.call(F,r)>=0||"?"===r&&(null!=t?t.spaced:void 0))n="LOGIC";else if(t&&!t.spaced)if("("===r&&(c=t[0],et.call(i,c)>=0))"?"===t[0]&&(t[0]="FUNC_EXIST"),n="CALL_START";else if("["===r&&(u=t[0],et.call(k,u)>=0))switch(n="INDEX_START",t[0]){case"?":t[0]="INDEX_SOAK"}switch(r){case"(":case"{":case"[":this.ends.push(g[r]);break;case")":case"}":case"]":this.pair(r)}return this.token(n,r),r.length},e.prototype.sanitizeHeredoc=function(e,t){var n,i,s,r,o;if(s=t.indent,i=t.herecomment){if(p.test(e)&&this.error('block comment cannot contain "*/", starting'),e.indexOf("\n")<0)return e}else for(;r=d.exec(e);)n=r[1],(null===s||0<(o=n.length)&&o<s.length)&&(s=n);return s&&(e=e.replace(RegExp("\\n"+s,"g"),"\n")),i||(e=e.replace(/^\n/,"")),e},e.prototype.tagParameters=function(){var e,t,n,i;if(")"!==this.tag())return this;for(t=[],i=this.tokens,e=i.length,i[--e][0]="PARAM_END";n=i[--e];)switch(n[0]){case")":t.push(n);break;case"(":case"CALL_START":if(!t.length)return"("===n[0]?(n[0]="PARAM_START",this):this;t.pop()}return this},e.prototype.closeIndentation=function(){return this.outdentToken(this.indent)},e.prototype.balancedString=function(e,t){var n,i,s,r,o,a,c,h;for(n=0,a=[t],i=c=1,h=e.length;h>=1?h>c:c>h;i=h>=1?++c:--c)if(n)--n;else{switch(s=e.charAt(i)){case"\\":++n;continue;case t:if(a.pop(),!a.length)return e.slice(0,+i+1||9e9);t=a[a.length-1];continue}"}"!==t||'"'!==s&&"'"!==s?"}"===t&&"/"===s&&(r=f.exec(e.slice(i))||I.exec(e.slice(i)))?n+=r[0].length-1:"}"===t&&"{"===s?a.push(t="}"):'"'===t&&"#"===o&&"{"===s&&a.push(t="}"):a.push(t=s),o=s}return this.error("missing "+a.pop()+", starting")},e.prototype.interpolateString=function(t,n){var i,s,r,o,a,c,h,l,u,p,d,f,m,b,k,g,y,v,w,T,C,F,L,N,x,E,D,S;for(null==n&&(n={}),r=n.heredoc,y=n.regex,m=n.offsetInChunk,w=n.strOffset,u=n.lexedLength,m=m||0,w=w||0,u=u||t.length,r&&t.length>0&&"\n"===t[0]&&(t=t.slice(1),w++),F=[],b=0,o=-1;l=t.charAt(o+=1);)"\\"!==l?"#"===l&&"{"===t.charAt(o+1)&&(s=this.balancedString(t.slice(o+1),"}"))&&(o>b&&F.push(this.makeToken("NEOSTRING",t.slice(b,o),w+b)),a=s.slice(1,-1),a.length&&(E=this.getLineAndColumnFromChunk(w+o+1),p=E[0],i=E[1],f=(new e).tokenize(a,{line:p,column:i,rewrite:!1}),g=f.pop(),"TERMINATOR"===(null!=(D=f[0])?D[0]:void 0)&&(g=f.shift()),(h=f.length)&&(h>1&&(f.unshift(this.makeToken("(","(",w+o+1,0)),f.push(this.makeToken(")",")",w+o+1+a.length,0))),F.push(["TOKENS",f]))),o+=s.length,b=o+1):o+=1;if(o>b&&b<t.length&&F.push(this.makeToken("NEOSTRING",t.slice(b),w+b)),y)return F;if(!F.length)return this.token("STRING",'""',m,u);for("NEOSTRING"!==F[0][0]&&F.unshift(this.makeToken("NEOSTRING","",m)),(c=F.length>1)&&this.token("(","(",m,0),o=N=0,x=F.length;x>N;o=++N)C=F[o],T=C[0],L=C[1],o&&(o&&(k=this.token("+","+")),d="TOKENS"===T?L[0]:C,k[2]={first_line:d[2].first_line,first_column:d[2].first_column,last_line:d[2].first_line,last_column:d[2].first_column}),"TOKENS"===T?(S=this.tokens).push.apply(S,L):"NEOSTRING"===T?(C[0]="STRING",C[1]=this.makeString(L,'"',r),this.tokens.push(C)):this.error("Unexpected "+T);return c&&(v=this.makeToken(")",")",m+u,0),v.stringEnd=!0,this.tokens.push(v)),F},e.prototype.pair=function(e){var t,n;return e!==(n=X(this.ends))?("OUTDENT"!==n&&this.error("unmatched "+e),this.indent-=t=X(this.indents),this.outdentToken(t,!0),this.pair(e)):this.ends.pop()},e.prototype.getLineAndColumnFromChunk=function(e){var t,n,i,s;return 0===e?[this.chunkLine,this.chunkColumn]:(s=e>=this.chunk.length?this.chunk:this.chunk.slice(0,+(e-1)+1||9e9),n=H(s,"\n"),t=this.chunkColumn,n>0?(i=s.split("\n"),t=X(i).length):t+=s.length,[this.chunkLine+n,t])},e.prototype.makeToken=function(e,t,n,i){var s,r,o,a,c;return null==n&&(n=0),null==i&&(i=t.length),r={},a=this.getLineAndColumnFromChunk(n),r.first_line=a[0],r.first_column=a[1],s=Math.max(0,i-1),c=this.getLineAndColumnFromChunk(n+s),r.last_line=c[0],r.last_column=c[1],o=[e,t,r]},e.prototype.token=function(e,t,n,i){var s;return s=this.makeToken(e,t,n,i),this.tokens.push(s),s},e.prototype.tag=function(e,t){var n;return(n=X(this.tokens,e))&&(t?n[0]=t:n[0])},e.prototype.value=function(e,t){var n;return(n=X(this.tokens,e))&&(t?n[1]=t:n[1])},e.prototype.unfinished=function(){var e;return C.test(this.chunk)||"\\"===(e=this.tag())||"."===e||"?."===e||"?::"===e||"UNARY"===e||"MATH"===e||"+"===e||"-"===e||"SHIFT"===e||"RELATION"===e||"COMPARE"===e||"LOGIC"===e||"THROW"===e||"EXTENDS"===e},e.prototype.escapeLines=function(e,t){return e.replace(x,t?"\\n":"")},e.prototype.makeString=function(e,t,n){return e?(e=e.replace(/\\([\s\S])/g,function(e,n){return"\n"===n||n===t?n:e}),e=e.replace(RegExp(""+t,"g"),"\\$&"),t+this.escapeLines(e,n)+t):t+t},e.prototype.error=function(e){return J(e,{first_line:this.chunkLine,first_column:this.chunkColumn})},e}(),w=["true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super"],a=["undefined","then","unless","until","loop","of","by","when"],o={and:"&&",or:"||",is:"==",isnt:"!=",not:"!",yes:"true",no:"false",on:"true",off:"false"},r=function(){var e;e=[];for(W in o)e.push(W);return e}(),a=a.concat(r),$=["case","default","function","var","void","with","const","let","enum","export","import","native","__hasProp","__extends","__slice","__bind","__indexOf","implements","interface","package","private","protected","public","static","yield"],B=["arguments","eval"],v=w.concat($).concat(B),e.RESERVED=$.concat(w).concat(a).concat(B),e.STRICT_PROSCRIBED=B,t=65279,b=/^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/,R=/^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i,u=/^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/,A=/^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/,U=/^[^\n\S]+/,c=/^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)$)|^(?:\s*#(?!##[^#]).*)+/,s=/^[-=]>/,E=/^(?:\n[^\n\S]*)+/,M=/^'[^\\']*(?:\\.[^\\']*)*'/,y=/^`[^\\`]*(?:\\.[^\\`]*)*`/,I=/^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/,f=/^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/,m=/\s+(?:#.*)?/g,x=/\n/g,d=/\n+([^\n\S]*)/g,p=/\*\//,C=/^\s*(?:,|\??\.(?![.\d])|::)/,V=/\s+$/,l=["-=","+=","/=","*=","%=","||=","&&=","?=","<<=",">>=",">>>=","&=","^=","|="],P=["!","~","NEW","TYPEOF","DELETE","DO"],F=["&&","||","&","|","^"],j=["<<",">>",">>>"],h=["==","!=","<",">","<=",">="],N=["*","/","%"],_=["IN","OF","INSTANCEOF"],n=["TRUE","FALSE"],D=["NUMBER","REGEX","BOOL","NULL","UNDEFINED","++","--"],S=D.concat(")","}","THIS","IDENTIFIER","STRING","]"),i=["IDENTIFIER","STRING","REGEX",")","]","}","?","::","@","THIS","SUPER"],k=i.concat("NUMBER","BOOL","NULL","UNDEFINED"),T=["INDENT","OUTDENT","TERMINATOR"]}.call(this),t.exports}(),require["./parser"]=function(){var e={},t={exports:e},n=function(){function e(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,Root:3,Body:4,Block:5,TERMINATOR:6,Line:7,Expression:8,Statement:9,Return:10,Comment:11,STATEMENT:12,Value:13,Invocation:14,Code:15,Operation:16,Assign:17,If:18,Try:19,While:20,For:21,Switch:22,Class:23,Throw:24,INDENT:25,OUTDENT:26,Identifier:27,IDENTIFIER:28,AlphaNumeric:29,NUMBER:30,STRING:31,Literal:32,JS:33,REGEX:34,DEBUGGER:35,UNDEFINED:36,NULL:37,BOOL:38,Assignable:39,"=":40,AssignObj:41,ObjAssignable:42,":":43,ThisProperty:44,RETURN:45,HERECOMMENT:46,PARAM_START:47,ParamList:48,PARAM_END:49,FuncGlyph:50,"->":51,"=>":52,OptComma:53,",":54,Param:55,ParamVar:56,"...":57,Array:58,Object:59,Splat:60,SimpleAssignable:61,Accessor:62,Parenthetical:63,Range:64,This:65,".":66,"?.":67,"::":68,"?::":69,Index:70,INDEX_START:71,IndexValue:72,INDEX_END:73,INDEX_SOAK:74,Slice:75,"{":76,AssignList:77,"}":78,CLASS:79,EXTENDS:80,OptFuncExist:81,Arguments:82,SUPER:83,FUNC_EXIST:84,CALL_START:85,CALL_END:86,ArgList:87,THIS:88,"@":89,"[":90,"]":91,RangeDots:92,"..":93,Arg:94,SimpleArgs:95,TRY:96,Catch:97,FINALLY:98,CATCH:99,THROW:100,"(":101,")":102,WhileSource:103,WHILE:104,WHEN:105,UNTIL:106,Loop:107,LOOP:108,ForBody:109,FOR:110,ForStart:111,ForSource:112,ForVariables:113,OWN:114,ForValue:115,FORIN:116,FOROF:117,BY:118,SWITCH:119,Whens:120,ELSE:121,When:122,LEADING_WHEN:123,IfBlock:124,IF:125,POST_IF:126,UNARY:127,"-":128,"+":129,"--":130,"++":131,"?":132,MATH:133,SHIFT:134,COMPARE:135,LOGIC:136,RELATION:137,COMPOUND_ASSIGN:138,$accept:0,$end:1},terminals_:{2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"-",129:"+",130:"--",131:"++",132:"?",133:"MATH",134:"SHIFT",135:"COMPARE",136:"LOGIC",137:"RELATION",138:"COMPOUND_ASSIGN"},productions_:[0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[95,1],[95,3],[19,2],[19,3],[19,4],[19,5],[97,3],[97,3],[97,2],[24,2],[63,3],[63,5],[103,2],[103,4],[103,2],[103,4],[20,2],[20,2],[20,2],[20,1],[107,2],[107,2],[21,2],[21,2],[21,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[22,5],[22,7],[22,4],[22,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,4],[16,3]],performAction:function(e,t,n,i,s,r,o){var a=r.length-1;switch(s){case 1:return this.$=i.addLocationDataFn(o[a],o[a])(new i.Block);case 2:return this.$=r[a];case 3:return this.$=r[a-1];case 4:this.$=i.addLocationDataFn(o[a],o[a])(i.Block.wrap([r[a]]));break;case 5:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-2].push(r[a]));break;case 6:this.$=r[a-1];break;case 7:this.$=r[a];break;case 8:this.$=r[a];break;case 9:this.$=r[a];break;case 10:this.$=r[a];break;case 11:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 12:this.$=r[a];break;case 13:this.$=r[a];break;case 14:this.$=r[a];break;case 15:this.$=r[a];break;case 16:this.$=r[a];break;case 17:this.$=r[a];break;case 18:this.$=r[a];break;case 19:this.$=r[a];break;case 20:this.$=r[a];break;case 21:this.$=r[a];break;case 22:this.$=r[a];break;case 23:this.$=r[a];break;case 24:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Block);break;case 25:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-1]);break;case 26:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 27:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 28:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 29:this.$=r[a];break;case 30:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 31:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 32:this.$=i.addLocationDataFn(o[a],o[a])(new i.Literal(r[a]));break;case 33:this.$=i.addLocationDataFn(o[a],o[a])(new i.Undefined);break;case 34:this.$=i.addLocationDataFn(o[a],o[a])(new i.Null);break;case 35:this.$=i.addLocationDataFn(o[a],o[a])(new i.Bool(r[a]));break;case 36:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Assign(r[a-2],r[a]));break;case 37:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Assign(r[a-3],r[a]));break;case 38:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Assign(r[a-4],r[a-1]));break;case 39:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 40:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Assign(i.addLocationDataFn(o[a-2])(new i.Value(r[a-2])),r[a],"object"));break;case 41:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Assign(i.addLocationDataFn(o[a-4])(new i.Value(r[a-4])),r[a-1],"object"));break;case 42:this.$=r[a];break;case 43:this.$=r[a];break;case 44:this.$=r[a];break;case 45:this.$=r[a];break;case 46:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Return(r[a]));break;case 47:this.$=i.addLocationDataFn(o[a],o[a])(new i.Return);break;case 48:this.$=i.addLocationDataFn(o[a],o[a])(new i.Comment(r[a]));break;case 49:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Code(r[a-3],r[a],r[a-1]));break;case 50:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Code([],r[a],r[a-1]));
9
- break;case 51:this.$=i.addLocationDataFn(o[a],o[a])("func");break;case 52:this.$=i.addLocationDataFn(o[a],o[a])("boundfunc");break;case 53:this.$=r[a];break;case 54:this.$=r[a];break;case 55:this.$=i.addLocationDataFn(o[a],o[a])([]);break;case 56:this.$=i.addLocationDataFn(o[a],o[a])([r[a]]);break;case 57:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-2].concat(r[a]));break;case 58:this.$=i.addLocationDataFn(o[a-3],o[a])(r[a-3].concat(r[a]));break;case 59:this.$=i.addLocationDataFn(o[a-5],o[a])(r[a-5].concat(r[a-2]));break;case 60:this.$=i.addLocationDataFn(o[a],o[a])(new i.Param(r[a]));break;case 61:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Param(r[a-1],null,!0));break;case 62:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Param(r[a-2],r[a]));break;case 63:this.$=r[a];break;case 64:this.$=r[a];break;case 65:this.$=r[a];break;case 66:this.$=r[a];break;case 67:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Splat(r[a-1]));break;case 68:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 69:this.$=i.addLocationDataFn(o[a-1],o[a])(r[a-1].add(r[a]));break;case 70:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Value(r[a-1],[].concat(r[a])));break;case 71:this.$=r[a];break;case 72:this.$=r[a];break;case 73:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 74:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 75:this.$=r[a];break;case 76:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 77:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 78:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 79:this.$=r[a];break;case 80:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Access(r[a]));break;case 81:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Access(r[a],"soak"));break;case 82:this.$=i.addLocationDataFn(o[a-1],o[a])([i.addLocationDataFn(o[a-1])(new i.Access(new i.Literal("prototype"))),i.addLocationDataFn(o[a])(new i.Access(r[a]))]);break;case 83:this.$=i.addLocationDataFn(o[a-1],o[a])([i.addLocationDataFn(o[a-1])(new i.Access(new i.Literal("prototype"),"soak")),i.addLocationDataFn(o[a])(new i.Access(r[a]))]);break;case 84:this.$=i.addLocationDataFn(o[a],o[a])(new i.Access(new i.Literal("prototype")));break;case 85:this.$=r[a];break;case 86:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-1]);break;case 87:this.$=i.addLocationDataFn(o[a-1],o[a])(i.extend(r[a],{soak:!0}));break;case 88:this.$=i.addLocationDataFn(o[a],o[a])(new i.Index(r[a]));break;case 89:this.$=i.addLocationDataFn(o[a],o[a])(new i.Slice(r[a]));break;case 90:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Obj(r[a-2],r[a-3].generated));break;case 91:this.$=i.addLocationDataFn(o[a],o[a])([]);break;case 92:this.$=i.addLocationDataFn(o[a],o[a])([r[a]]);break;case 93:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-2].concat(r[a]));break;case 94:this.$=i.addLocationDataFn(o[a-3],o[a])(r[a-3].concat(r[a]));break;case 95:this.$=i.addLocationDataFn(o[a-5],o[a])(r[a-5].concat(r[a-2]));break;case 96:this.$=i.addLocationDataFn(o[a],o[a])(new i.Class);break;case 97:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Class(null,null,r[a]));break;case 98:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Class(null,r[a]));break;case 99:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Class(null,r[a-1],r[a]));break;case 100:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Class(r[a]));break;case 101:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Class(r[a-1],null,r[a]));break;case 102:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Class(r[a-2],r[a]));break;case 103:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Class(r[a-3],r[a-1],r[a]));break;case 104:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Call(r[a-2],r[a],r[a-1]));break;case 105:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Call(r[a-2],r[a],r[a-1]));break;case 106:this.$=i.addLocationDataFn(o[a],o[a])(new i.Call("super",[new i.Splat(new i.Literal("arguments"))]));break;case 107:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Call("super",r[a]));break;case 108:this.$=i.addLocationDataFn(o[a],o[a])(!1);break;case 109:this.$=i.addLocationDataFn(o[a],o[a])(!0);break;case 110:this.$=i.addLocationDataFn(o[a-1],o[a])([]);break;case 111:this.$=i.addLocationDataFn(o[a-3],o[a])(r[a-2]);break;case 112:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(new i.Literal("this")));break;case 113:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(new i.Literal("this")));break;case 114:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Value(i.addLocationDataFn(o[a-1])(new i.Literal("this")),[i.addLocationDataFn(o[a])(new i.Access(r[a]))],"this"));break;case 115:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Arr([]));break;case 116:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Arr(r[a-2]));break;case 117:this.$=i.addLocationDataFn(o[a],o[a])("inclusive");break;case 118:this.$=i.addLocationDataFn(o[a],o[a])("exclusive");break;case 119:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Range(r[a-3],r[a-1],r[a-2]));break;case 120:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Range(r[a-2],r[a],r[a-1]));break;case 121:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Range(r[a-1],null,r[a]));break;case 122:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Range(null,r[a],r[a-1]));break;case 123:this.$=i.addLocationDataFn(o[a],o[a])(new i.Range(null,null,r[a]));break;case 124:this.$=i.addLocationDataFn(o[a],o[a])([r[a]]);break;case 125:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-2].concat(r[a]));break;case 126:this.$=i.addLocationDataFn(o[a-3],o[a])(r[a-3].concat(r[a]));break;case 127:this.$=i.addLocationDataFn(o[a-3],o[a])(r[a-2]);break;case 128:this.$=i.addLocationDataFn(o[a-5],o[a])(r[a-5].concat(r[a-2]));break;case 129:this.$=r[a];break;case 130:this.$=r[a];break;case 131:this.$=r[a];break;case 132:this.$=i.addLocationDataFn(o[a-2],o[a])([].concat(r[a-2],r[a]));break;case 133:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Try(r[a]));break;case 134:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Try(r[a-1],r[a][0],r[a][1]));break;case 135:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Try(r[a-2],null,null,r[a]));break;case 136:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Try(r[a-3],r[a-2][0],r[a-2][1],r[a]));break;case 137:this.$=i.addLocationDataFn(o[a-2],o[a])([r[a-1],r[a]]);break;case 138:this.$=i.addLocationDataFn(o[a-2],o[a])([i.addLocationDataFn(o[a-1])(new i.Value(r[a-1])),r[a]]);break;case 139:this.$=i.addLocationDataFn(o[a-1],o[a])([null,r[a]]);break;case 140:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Throw(r[a]));break;case 141:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Parens(r[a-1]));break;case 142:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Parens(r[a-2]));break;case 143:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(r[a]));break;case 144:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.While(r[a-2],{guard:r[a]}));break;case 145:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(r[a],{invert:!0}));break;case 146:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.While(r[a-2],{invert:!0,guard:r[a]}));break;case 147:this.$=i.addLocationDataFn(o[a-1],o[a])(r[a-1].addBody(r[a]));break;case 148:this.$=i.addLocationDataFn(o[a-1],o[a])(r[a].addBody(i.addLocationDataFn(o[a-1])(i.Block.wrap([r[a-1]]))));break;case 149:this.$=i.addLocationDataFn(o[a-1],o[a])(r[a].addBody(i.addLocationDataFn(o[a-1])(i.Block.wrap([r[a-1]]))));break;case 150:this.$=i.addLocationDataFn(o[a],o[a])(r[a]);break;case 151:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(i.addLocationDataFn(o[a-1])(new i.Literal("true"))).addBody(r[a]));break;case 152:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.While(i.addLocationDataFn(o[a-1])(new i.Literal("true"))).addBody(i.addLocationDataFn(o[a])(i.Block.wrap([r[a]]))));break;case 153:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.For(r[a-1],r[a]));break;case 154:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.For(r[a-1],r[a]));break;case 155:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.For(r[a],r[a-1]));break;case 156:this.$=i.addLocationDataFn(o[a-1],o[a])({source:i.addLocationDataFn(o[a])(new i.Value(r[a]))});break;case 157:this.$=i.addLocationDataFn(o[a-1],o[a])(function(){return r[a].own=r[a-1].own,r[a].name=r[a-1][0],r[a].index=r[a-1][1],r[a]}());break;case 158:this.$=i.addLocationDataFn(o[a-1],o[a])(r[a]);break;case 159:this.$=i.addLocationDataFn(o[a-2],o[a])(function(){return r[a].own=!0,r[a]}());break;case 160:this.$=r[a];break;case 161:this.$=r[a];break;case 162:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 163:this.$=i.addLocationDataFn(o[a],o[a])(new i.Value(r[a]));break;case 164:this.$=i.addLocationDataFn(o[a],o[a])([r[a]]);break;case 165:this.$=i.addLocationDataFn(o[a-2],o[a])([r[a-2],r[a]]);break;case 166:this.$=i.addLocationDataFn(o[a-1],o[a])({source:r[a]});break;case 167:this.$=i.addLocationDataFn(o[a-1],o[a])({source:r[a],object:!0});break;case 168:this.$=i.addLocationDataFn(o[a-3],o[a])({source:r[a-2],guard:r[a]});break;case 169:this.$=i.addLocationDataFn(o[a-3],o[a])({source:r[a-2],guard:r[a],object:!0});break;case 170:this.$=i.addLocationDataFn(o[a-3],o[a])({source:r[a-2],step:r[a]});break;case 171:this.$=i.addLocationDataFn(o[a-5],o[a])({source:r[a-4],guard:r[a-2],step:r[a]});break;case 172:this.$=i.addLocationDataFn(o[a-5],o[a])({source:r[a-4],step:r[a-2],guard:r[a]});break;case 173:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Switch(r[a-3],r[a-1]));break;case 174:this.$=i.addLocationDataFn(o[a-6],o[a])(new i.Switch(r[a-5],r[a-3],r[a-1]));break;case 175:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Switch(null,r[a-1]));break;case 176:this.$=i.addLocationDataFn(o[a-5],o[a])(new i.Switch(null,r[a-3],r[a-1]));break;case 177:this.$=r[a];break;case 178:this.$=i.addLocationDataFn(o[a-1],o[a])(r[a-1].concat(r[a]));break;case 179:this.$=i.addLocationDataFn(o[a-2],o[a])([[r[a-1],r[a]]]);break;case 180:this.$=i.addLocationDataFn(o[a-3],o[a])([[r[a-2],r[a-1]]]);break;case 181:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.If(r[a-1],r[a],{type:r[a-2]}));break;case 182:this.$=i.addLocationDataFn(o[a-4],o[a])(r[a-4].addElse(new i.If(r[a-1],r[a],{type:r[a-2]})));break;case 183:this.$=r[a];break;case 184:this.$=i.addLocationDataFn(o[a-2],o[a])(r[a-2].addElse(r[a]));break;case 185:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.If(r[a],i.addLocationDataFn(o[a-2])(i.Block.wrap([r[a-2]])),{type:r[a-1],statement:!0}));break;case 186:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.If(r[a],i.addLocationDataFn(o[a-2])(i.Block.wrap([r[a-2]])),{type:r[a-1],statement:!0}));break;case 187:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op(r[a-1],r[a]));break;case 188:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("-",r[a]));break;case 189:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("+",r[a]));break;case 190:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("--",r[a]));break;case 191:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("++",r[a]));break;case 192:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("--",r[a-1],null,!0));break;case 193:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Op("++",r[a-1],null,!0));break;case 194:this.$=i.addLocationDataFn(o[a-1],o[a])(new i.Existence(r[a-1]));break;case 195:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op("+",r[a-2],r[a]));break;case 196:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op("-",r[a-2],r[a]));break;case 197:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op(r[a-1],r[a-2],r[a]));break;case 198:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op(r[a-1],r[a-2],r[a]));break;case 199:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op(r[a-1],r[a-2],r[a]));break;case 200:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Op(r[a-1],r[a-2],r[a]));break;case 201:this.$=i.addLocationDataFn(o[a-2],o[a])(function(){return"!"===r[a-1].charAt(0)?new i.Op(r[a-1].slice(1),r[a-2],r[a]).invert():new i.Op(r[a-1],r[a-2],r[a])}());break;case 202:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Assign(r[a-2],r[a],r[a-1]));break;case 203:this.$=i.addLocationDataFn(o[a-4],o[a])(new i.Assign(r[a-4],r[a-1],r[a-3]));break;case 204:this.$=i.addLocationDataFn(o[a-3],o[a])(new i.Assign(r[a-3],r[a],r[a-2]));break;case 205:this.$=i.addLocationDataFn(o[a-2],o[a])(new i.Extends(r[a-2],r[a]))}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],102:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,7],6:[2,7],26:[2,7],102:[2,7],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,8],6:[2,8],26:[2,8],102:[2,8],103:90,104:[1,65],106:[1,66],109:91,110:[1,68],111:69,126:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],73:[2,12],74:[1,101],78:[2,12],81:92,84:[1,94],85:[2,108],86:[2,12],91:[2,12],93:[2,12],102:[2,12],104:[2,12],105:[2,12],106:[2,12],110:[2,12],118:[2,12],126:[2,12],128:[2,12],129:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12],137:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],62:103,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],73:[2,13],74:[1,101],78:[2,13],81:102,84:[1,94],85:[2,108],86:[2,13],91:[2,13],93:[2,13],102:[2,13],104:[2,13],105:[2,13],106:[2,13],110:[2,13],118:[2,13],126:[2,13],128:[2,13],129:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13],137:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],73:[2,14],78:[2,14],86:[2,14],91:[2,14],93:[2,14],102:[2,14],104:[2,14],105:[2,14],106:[2,14],110:[2,14],118:[2,14],126:[2,14],128:[2,14],129:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14],137:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],73:[2,15],78:[2,15],86:[2,15],91:[2,15],93:[2,15],102:[2,15],104:[2,15],105:[2,15],106:[2,15],110:[2,15],118:[2,15],126:[2,15],128:[2,15],129:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15],137:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],73:[2,16],78:[2,16],86:[2,16],91:[2,16],93:[2,16],102:[2,16],104:[2,16],105:[2,16],106:[2,16],110:[2,16],118:[2,16],126:[2,16],128:[2,16],129:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16],137:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],73:[2,17],78:[2,17],86:[2,17],91:[2,17],93:[2,17],102:[2,17],104:[2,17],105:[2,17],106:[2,17],110:[2,17],118:[2,17],126:[2,17],128:[2,17],129:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17],137:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],73:[2,18],78:[2,18],86:[2,18],91:[2,18],93:[2,18],102:[2,18],104:[2,18],105:[2,18],106:[2,18],110:[2,18],118:[2,18],126:[2,18],128:[2,18],129:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18],137:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],73:[2,19],78:[2,19],86:[2,19],91:[2,19],93:[2,19],102:[2,19],104:[2,19],105:[2,19],106:[2,19],110:[2,19],118:[2,19],126:[2,19],128:[2,19],129:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19],137:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],73:[2,20],78:[2,20],86:[2,20],91:[2,20],93:[2,20],102:[2,20],104:[2,20],105:[2,20],106:[2,20],110:[2,20],118:[2,20],126:[2,20],128:[2,20],129:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20],137:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],73:[2,21],78:[2,21],86:[2,21],91:[2,21],93:[2,21],102:[2,21],104:[2,21],105:[2,21],106:[2,21],110:[2,21],118:[2,21],126:[2,21],128:[2,21],129:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21],137:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],73:[2,22],78:[2,22],86:[2,22],91:[2,22],93:[2,22],102:[2,22],104:[2,22],105:[2,22],106:[2,22],110:[2,22],118:[2,22],126:[2,22],128:[2,22],129:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22],137:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],73:[2,23],78:[2,23],86:[2,23],91:[2,23],93:[2,23],102:[2,23],104:[2,23],105:[2,23],106:[2,23],110:[2,23],118:[2,23],126:[2,23],128:[2,23],129:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23],137:[2,23]},{1:[2,9],6:[2,9],26:[2,9],102:[2,9],104:[2,9],106:[2,9],110:[2,9],126:[2,9]},{1:[2,10],6:[2,10],26:[2,10],102:[2,10],104:[2,10],106:[2,10],110:[2,10],126:[2,10]},{1:[2,11],6:[2,11],26:[2,11],102:[2,11],104:[2,11],106:[2,11],110:[2,11],126:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,104],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],73:[2,75],74:[2,75],78:[2,75],84:[2,75],85:[2,75],86:[2,75],91:[2,75],93:[2,75],102:[2,75],104:[2,75],105:[2,75],106:[2,75],110:[2,75],118:[2,75],126:[2,75],128:[2,75],129:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75],137:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],69:[2,76],71:[2,76],73:[2,76],74:[2,76],78:[2,76],84:[2,76],85:[2,76],86:[2,76],91:[2,76],93:[2,76],102:[2,76],104:[2,76],105:[2,76],106:[2,76],110:[2,76],118:[2,76],126:[2,76],128:[2,76],129:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76],137:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],69:[2,77],71:[2,77],73:[2,77],74:[2,77],78:[2,77],84:[2,77],85:[2,77],86:[2,77],91:[2,77],93:[2,77],102:[2,77],104:[2,77],105:[2,77],106:[2,77],110:[2,77],118:[2,77],126:[2,77],128:[2,77],129:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77],137:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],69:[2,78],71:[2,78],73:[2,78],74:[2,78],78:[2,78],84:[2,78],85:[2,78],86:[2,78],91:[2,78],93:[2,78],102:[2,78],104:[2,78],105:[2,78],106:[2,78],110:[2,78],118:[2,78],126:[2,78],128:[2,78],129:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78],137:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],69:[2,79],71:[2,79],73:[2,79],74:[2,79],78:[2,79],84:[2,79],85:[2,79],86:[2,79],91:[2,79],93:[2,79],102:[2,79],104:[2,79],105:[2,79],106:[2,79],110:[2,79],118:[2,79],126:[2,79],128:[2,79],129:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79],137:[2,79]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],69:[2,106],71:[2,106],73:[2,106],74:[2,106],78:[2,106],82:105,84:[2,106],85:[1,106],86:[2,106],91:[2,106],93:[2,106],102:[2,106],104:[2,106],105:[2,106],106:[2,106],110:[2,106],118:[2,106],126:[2,106],128:[2,106],129:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106],137:[2,106]},{6:[2,55],25:[2,55],27:110,28:[1,73],44:111,48:107,49:[2,55],54:[2,55],55:108,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{5:116,25:[1,5]},{8:117,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:119,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:120,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{13:122,14:123,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:124,44:63,58:47,59:48,61:121,63:25,64:26,65:27,76:[1,70],83:[1,28],88:[1,58],89:[1,59],90:[1,57],101:[1,56]},{13:122,14:123,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:124,44:63,58:47,59:48,61:125,63:25,64:26,65:27,76:[1,70],83:[1,28],88:[1,58],89:[1,59],90:[1,57],101:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,72],74:[2,72],78:[2,72],80:[1,129],84:[2,72],85:[2,72],86:[2,72],91:[2,72],93:[2,72],102:[2,72],104:[2,72],105:[2,72],106:[2,72],110:[2,72],118:[2,72],126:[2,72],128:[2,72],129:[2,72],130:[1,126],131:[1,127],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[2,72],138:[1,128]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],73:[2,183],78:[2,183],86:[2,183],91:[2,183],93:[2,183],102:[2,183],104:[2,183],105:[2,183],106:[2,183],110:[2,183],118:[2,183],121:[1,130],126:[2,183],128:[2,183],129:[2,183],132:[2,183],133:[2,183],134:[2,183],135:[2,183],136:[2,183],137:[2,183]},{5:131,25:[1,5]},{5:132,25:[1,5]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],73:[2,150],78:[2,150],86:[2,150],91:[2,150],93:[2,150],102:[2,150],104:[2,150],105:[2,150],106:[2,150],110:[2,150],118:[2,150],126:[2,150],128:[2,150],129:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150],137:[2,150]},{5:133,25:[1,5]},{8:134,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,135],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,96],5:136,6:[2,96],13:122,14:123,25:[1,5],26:[2,96],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:124,44:63,49:[2,96],54:[2,96],57:[2,96],58:47,59:48,61:138,63:25,64:26,65:27,73:[2,96],76:[1,70],78:[2,96],80:[1,137],83:[1,28],86:[2,96],88:[1,58],89:[1,59],90:[1,57],91:[2,96],93:[2,96],101:[1,56],102:[2,96],104:[2,96],105:[2,96],106:[2,96],110:[2,96],118:[2,96],126:[2,96],128:[2,96],129:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96],137:[2,96]},{8:139,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,47],6:[2,47],8:140,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],102:[2,47],103:39,104:[2,47],106:[2,47],107:40,108:[1,67],109:41,110:[2,47],111:69,119:[1,42],124:37,125:[1,64],126:[2,47],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],78:[2,48],102:[2,48],104:[2,48],106:[2,48],110:[2,48],126:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],69:[2,73],71:[2,73],73:[2,73],74:[2,73],78:[2,73],84:[2,73],85:[2,73],86:[2,73],91:[2,73],93:[2,73],102:[2,73],104:[2,73],105:[2,73],106:[2,73],110:[2,73],118:[2,73],126:[2,73],128:[2,73],129:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73],137:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],73:[2,74],74:[2,74],78:[2,74],84:[2,74],85:[2,74],86:[2,74],91:[2,74],93:[2,74],102:[2,74],104:[2,74],105:[2,74],106:[2,74],110:[2,74],118:[2,74],126:[2,74],128:[2,74],129:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74],137:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],69:[2,29],71:[2,29],73:[2,29],74:[2,29],78:[2,29],84:[2,29],85:[2,29],86:[2,29],91:[2,29],93:[2,29],102:[2,29],104:[2,29],105:[2,29],106:[2,29],110:[2,29],118:[2,29],126:[2,29],128:[2,29],129:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29],137:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],69:[2,30],71:[2,30],73:[2,30],74:[2,30],78:[2,30],84:[2,30],85:[2,30],86:[2,30],91:[2,30],93:[2,30],102:[2,30],104:[2,30],105:[2,30],106:[2,30],110:[2,30],118:[2,30],126:[2,30],128:[2,30],129:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30],137:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],69:[2,31],71:[2,31],73:[2,31],74:[2,31],78:[2,31],84:[2,31],85:[2,31],86:[2,31],91:[2,31],93:[2,31],102:[2,31],104:[2,31],105:[2,31],106:[2,31],110:[2,31],118:[2,31],126:[2,31],128:[2,31],129:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31],137:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],69:[2,32],71:[2,32],73:[2,32],74:[2,32],78:[2,32],84:[2,32],85:[2,32],86:[2,32],91:[2,32],93:[2,32],102:[2,32],104:[2,32],105:[2,32],106:[2,32],110:[2,32],118:[2,32],126:[2,32],128:[2,32],129:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32],137:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],69:[2,33],71:[2,33],73:[2,33],74:[2,33],78:[2,33],84:[2,33],85:[2,33],86:[2,33],91:[2,33],93:[2,33],102:[2,33],104:[2,33],105:[2,33],106:[2,33],110:[2,33],118:[2,33],126:[2,33],128:[2,33],129:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33],137:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],69:[2,34],71:[2,34],73:[2,34],74:[2,34],78:[2,34],84:[2,34],85:[2,34],86:[2,34],91:[2,34],93:[2,34],102:[2,34],104:[2,34],105:[2,34],106:[2,34],110:[2,34],118:[2,34],126:[2,34],128:[2,34],129:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34],137:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],69:[2,35],71:[2,35],73:[2,35],74:[2,35],78:[2,35],84:[2,35],85:[2,35],86:[2,35],91:[2,35],93:[2,35],102:[2,35],104:[2,35],105:[2,35],106:[2,35],110:[2,35],118:[2,35],126:[2,35],128:[2,35],129:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35],137:[2,35]},{4:141,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,142],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:143,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:145,88:[1,58],89:[1,59],90:[1,57],91:[1,144],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],69:[2,112],71:[2,112],73:[2,112],74:[2,112],78:[2,112],84:[2,112],85:[2,112],86:[2,112],91:[2,112],93:[2,112],102:[2,112],104:[2,112],105:[2,112],106:[2,112],110:[2,112],118:[2,112],126:[2,112],128:[2,112],129:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112],137:[2,112]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],27:149,28:[1,73],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],69:[2,113],71:[2,113],73:[2,113],74:[2,113],78:[2,113],84:[2,113],85:[2,113],86:[2,113],91:[2,113],93:[2,113],102:[2,113],104:[2,113],105:[2,113],106:[2,113],110:[2,113],118:[2,113],126:[2,113],128:[2,113],129:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],69:[2,68],71:[2,68],73:[2,68],74:[2,68],78:[2,68],80:[2,68],84:[2,68],85:[2,68],86:[2,68],91:[2,68],93:[2,68],102:[2,68],104:[2,68],105:[2,68],106:[2,68],110:[2,68],118:[2,68],126:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68],138:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,71],74:[2,71],78:[2,71],80:[2,71],84:[2,71],85:[2,71],86:[2,71],91:[2,71],93:[2,71],102:[2,71],104:[2,71],105:[2,71],106:[2,71],110:[2,71],118:[2,71],126:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71],138:[2,71]},{8:150,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:151,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:152,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{5:153,8:154,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{27:159,28:[1,73],44:160,58:161,59:162,64:155,76:[1,70],89:[1,114],90:[1,57],113:156,114:[1,157],115:158},{112:163,116:[1,164],117:[1,165]},{6:[2,91],11:169,25:[2,91],27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:167,42:168,44:172,46:[1,46],54:[2,91],77:166,78:[2,91],89:[1,114]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],69:[2,27],71:[2,27],73:[2,27],74:[2,27],78:[2,27],84:[2,27],85:[2,27],86:[2,27],91:[2,27],93:[2,27],102:[2,27],104:[2,27],105:[2,27],106:[2,27],110:[2,27],118:[2,27],126:[2,27],128:[2,27],129:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27],137:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],69:[2,28],71:[2,28],73:[2,28],74:[2,28],78:[2,28],84:[2,28],85:[2,28],86:[2,28],91:[2,28],93:[2,28],102:[2,28],104:[2,28],105:[2,28],106:[2,28],110:[2,28],118:[2,28],126:[2,28],128:[2,28],129:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28],137:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],69:[2,26],71:[2,26],73:[2,26],74:[2,26],78:[2,26],80:[2,26],84:[2,26],85:[2,26],86:[2,26],91:[2,26],93:[2,26],102:[2,26],104:[2,26],105:[2,26],106:[2,26],110:[2,26],116:[2,26],117:[2,26],118:[2,26],126:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26],138:[2,26]},{1:[2,6],6:[2,6],7:173,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],102:[2,6],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],73:[2,24],78:[2,24],86:[2,24],91:[2,24],93:[2,24],98:[2,24],99:[2,24],102:[2,24],104:[2,24],105:[2,24],106:[2,24],110:[2,24],118:[2,24],121:[2,24],123:[2,24],126:[2,24],128:[2,24],129:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24],137:[2,24]},{6:[1,74],26:[1,174]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],73:[2,194],78:[2,194],86:[2,194],91:[2,194],93:[2,194],102:[2,194],104:[2,194],105:[2,194],106:[2,194],110:[2,194],118:[2,194],126:[2,194],128:[2,194],129:[2,194],132:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194],137:[2,194]},{8:175,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:176,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:177,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:178,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:179,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:180,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:181,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:182,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],73:[2,149],78:[2,149],86:[2,149],91:[2,149],93:[2,149],102:[2,149],104:[2,149],105:[2,149],106:[2,149],110:[2,149],118:[2,149],126:[2,149],128:[2,149],129:[2,149],132:[2,149],133:[2,149],134:[2,149],135:[2,149],136:[2,149],137:[2,149]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],73:[2,154],78:[2,154],86:[2,154],91:[2,154],93:[2,154],102:[2,154],104:[2,154],105:[2,154],106:[2,154],110:[2,154],118:[2,154],126:[2,154],128:[2,154],129:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154],137:[2,154]},{8:183,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],73:[2,148],78:[2,148],86:[2,148],91:[2,148],93:[2,148],102:[2,148],104:[2,148],105:[2,148],106:[2,148],110:[2,148],118:[2,148],126:[2,148],128:[2,148],129:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148],137:[2,148]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],73:[2,153],78:[2,153],86:[2,153],91:[2,153],93:[2,153],102:[2,153],104:[2,153],105:[2,153],106:[2,153],110:[2,153],118:[2,153],126:[2,153],128:[2,153],129:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153],137:[2,153]},{82:184,85:[1,106]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],69:[2,69],71:[2,69],73:[2,69],74:[2,69],78:[2,69],80:[2,69],84:[2,69],85:[2,69],86:[2,69],91:[2,69],93:[2,69],102:[2,69],104:[2,69],105:[2,69],106:[2,69],110:[2,69],118:[2,69],126:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69],138:[2,69]},{85:[2,109]},{27:185,28:[1,73]},{27:186,28:[1,73]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],27:187,28:[1,73],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],69:[2,84],71:[2,84],73:[2,84],74:[2,84],78:[2,84],80:[2,84],84:[2,84],85:[2,84],86:[2,84],91:[2,84],93:[2,84],102:[2,84],104:[2,84],105:[2,84],106:[2,84],110:[2,84],118:[2,84],126:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84],138:[2,84]},{27:188,28:[1,73]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],69:[2,85],71:[2,85],73:[2,85],74:[2,85],78:[2,85],80:[2,85],84:[2,85],85:[2,85],86:[2,85],91:[2,85],93:[2,85],102:[2,85],104:[2,85],105:[2,85],106:[2,85],110:[2,85],118:[2,85],126:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85],138:[2,85]},{8:190,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,194],58:47,59:48,61:36,63:25,64:26,65:27,72:189,75:191,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],92:192,93:[1,193],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{70:195,71:[1,100],74:[1,101]},{82:196,85:[1,106]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],69:[2,70],71:[2,70],73:[2,70],74:[2,70],78:[2,70],80:[2,70],84:[2,70],85:[2,70],86:[2,70],91:[2,70],93:[2,70],102:[2,70],104:[2,70],105:[2,70],106:[2,70],110:[2,70],118:[2,70],126:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70],138:[2,70]},{6:[1,198],8:197,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,199],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],49:[2,107],54:[2,107],57:[2,107],66:[2,107],67:[2,107],68:[2,107],69:[2,107],71:[2,107],73:[2,107],74:[2,107],78:[2,107],84:[2,107],85:[2,107],86:[2,107],91:[2,107],93:[2,107],102:[2,107],104:[2,107],105:[2,107],106:[2,107],110:[2,107],118:[2,107],126:[2,107],128:[2,107],129:[2,107],132:[2,107],133:[2,107],134:[2,107],135:[2,107],136:[2,107],137:[2,107]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],86:[1,200],87:201,88:[1,58],89:[1,59],90:[1,57],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,53],25:[2,53],49:[1,203],53:205,54:[1,204]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,207],49:[2,60],54:[2,60],57:[1,206]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:149,28:[1,73]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:145,88:[1,58],89:[1,59],90:[1,57],91:[1,144],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],73:[2,50],78:[2,50],86:[2,50],91:[2,50],93:[2,50],102:[2,50],104:[2,50],105:[2,50],106:[2,50],110:[2,50],118:[2,50],126:[2,50],128:[2,50],129:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50],137:[2,50]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],73:[2,187],78:[2,187],86:[2,187],91:[2,187],93:[2,187],102:[2,187],103:87,104:[2,187],105:[2,187],106:[2,187],109:88,110:[2,187],111:69,118:[2,187],126:[2,187],128:[2,187],129:[2,187],132:[1,78],133:[2,187],134:[2,187],135:[2,187],136:[2,187],137:[2,187]},{103:90,104:[1,65],106:[1,66],109:91,110:[1,68],111:69,126:[1,89]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],73:[2,188],78:[2,188],86:[2,188],91:[2,188],93:[2,188],102:[2,188],103:87,104:[2,188],105:[2,188],106:[2,188],109:88,110:[2,188],111:69,118:[2,188],126:[2,188],128:[2,188],129:[2,188],132:[1,78],133:[2,188],134:[2,188],135:[2,188],136:[2,188],137:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],73:[2,189],78:[2,189],86:[2,189],91:[2,189],93:[2,189],102:[2,189],103:87,104:[2,189],105:[2,189],106:[2,189],109:88,110:[2,189],111:69,118:[2,189],126:[2,189],128:[2,189],129:[2,189],132:[1,78],133:[2,189],134:[2,189],135:[2,189],136:[2,189],137:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,190],74:[2,72],78:[2,190],84:[2,72],85:[2,72],86:[2,190],91:[2,190],93:[2,190],102:[2,190],104:[2,190],105:[2,190],106:[2,190],110:[2,190],118:[2,190],126:[2,190],128:[2,190],129:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190],137:[2,190]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],74:[1,101],81:92,84:[1,94],85:[2,108]},{62:103,66:[1,95],67:[1,96],68:[1,97],69:[1,98],70:99,71:[1,100],74:[1,101],81:102,84:[1,94],85:[2,108]},{66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],74:[2,75],84:[2,75],85:[2,75]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,191],74:[2,72],78:[2,191],84:[2,72],85:[2,72],86:[2,191],91:[2,191],93:[2,191],102:[2,191],104:[2,191],105:[2,191],106:[2,191],110:[2,191],118:[2,191],126:[2,191],128:[2,191],129:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191],137:[2,191]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],73:[2,192],78:[2,192],86:[2,192],91:[2,192],93:[2,192],102:[2,192],104:[2,192],105:[2,192],106:[2,192],110:[2,192],118:[2,192],126:[2,192],128:[2,192],129:[2,192],132:[2,192],133:[2,192],134:[2,192],135:[2,192],136:[2,192],137:[2,192]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],73:[2,193],78:[2,193],86:[2,193],91:[2,193],93:[2,193],102:[2,193],104:[2,193],105:[2,193],106:[2,193],110:[2,193],118:[2,193],126:[2,193],128:[2,193],129:[2,193],132:[2,193],133:[2,193],134:[2,193],135:[2,193],136:[2,193],137:[2,193]},{6:[1,210],8:208,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,209],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:211,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{5:212,25:[1,5],125:[1,213]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],73:[2,133],78:[2,133],86:[2,133],91:[2,133],93:[2,133],97:214,98:[1,215],99:[1,216],102:[2,133],104:[2,133],105:[2,133],106:[2,133],110:[2,133],118:[2,133],126:[2,133],128:[2,133],129:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133],137:[2,133]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],73:[2,147],78:[2,147],86:[2,147],91:[2,147],93:[2,147],102:[2,147],104:[2,147],105:[2,147],106:[2,147],110:[2,147],118:[2,147],126:[2,147],128:[2,147],129:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147],137:[2,147]},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],49:[2,155],54:[2,155],57:[2,155],73:[2,155],78:[2,155],86:[2,155],91:[2,155],93:[2,155],102:[2,155],104:[2,155],105:[2,155],106:[2,155],110:[2,155],118:[2,155],126:[2,155],128:[2,155],129:[2,155],132:[2,155],133:[2,155],134:[2,155],135:[2,155],136:[2,155],137:[2,155]},{25:[1,217],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{120:218,122:219,123:[1,220]},{1:[2,97],6:[2,97],25:[2,97],26:[2,97],49:[2,97],54:[2,97],57:[2,97],73:[2,97],78:[2,97],86:[2,97],91:[2,97],93:[2,97],102:[2,97],104:[2,97],105:[2,97],106:[2,97],110:[2,97],118:[2,97],126:[2,97],128:[2,97],129:[2,97],132:[2,97],133:[2,97],134:[2,97],135:[2,97],136:[2,97],137:[2,97]},{8:221,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,100],5:222,6:[2,100],25:[1,5],26:[2,100],49:[2,100],54:[2,100],57:[2,100],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,100],74:[2,72],78:[2,100],80:[1,223],84:[2,72],85:[2,72],86:[2,100],91:[2,100],93:[2,100],102:[2,100],104:[2,100],105:[2,100],106:[2,100],110:[2,100],118:[2,100],126:[2,100],128:[2,100],129:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100],137:[2,100]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],73:[2,140],78:[2,140],86:[2,140],91:[2,140],93:[2,140],102:[2,140],103:87,104:[2,140],105:[2,140],106:[2,140],109:88,110:[2,140],111:69,118:[2,140],126:[2,140],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,46],6:[2,46],26:[2,46],102:[2,46],103:87,104:[2,46],106:[2,46],109:88,110:[2,46],111:69,126:[2,46],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,74],102:[1,224]},{4:225,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,129],25:[2,129],54:[2,129],57:[1,227],91:[2,129],92:226,93:[1,193],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],69:[2,115],71:[2,115],73:[2,115],74:[2,115],78:[2,115],84:[2,115],85:[2,115],86:[2,115],91:[2,115],93:[2,115],102:[2,115],104:[2,115],105:[2,115],106:[2,115],110:[2,115],116:[2,115],117:[2,115],118:[2,115],126:[2,115],128:[2,115],129:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115],137:[2,115]},{6:[2,53],25:[2,53],53:228,54:[1,229],91:[2,53]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],86:[2,124],91:[2,124]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:230,88:[1,58],89:[1,59],90:[1,57],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,130],25:[2,130],26:[2,130],54:[2,130],86:[2,130],91:[2,130]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],43:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],69:[2,114],71:[2,114],73:[2,114],74:[2,114],78:[2,114],80:[2,114],84:[2,114],85:[2,114],86:[2,114],91:[2,114],93:[2,114],102:[2,114],104:[2,114],105:[2,114],106:[2,114],110:[2,114],116:[2,114],117:[2,114],118:[2,114],126:[2,114],128:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114],137:[2,114],138:[2,114]},{5:231,25:[1,5],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],73:[2,143],78:[2,143],86:[2,143],91:[2,143],93:[2,143],102:[2,143],103:87,104:[1,65],105:[1,232],106:[1,66],109:88,110:[1,68],111:69,118:[2,143],126:[2,143],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],73:[2,145],78:[2,145],86:[2,145],91:[2,145],93:[2,145],102:[2,145],103:87,104:[1,65],105:[1,233],106:[1,66],109:88,110:[1,68],111:69,118:[2,145],126:[2,145],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],73:[2,151],78:[2,151],86:[2,151],91:[2,151],93:[2,151],102:[2,151],104:[2,151],105:[2,151],106:[2,151],110:[2,151],118:[2,151],126:[2,151],128:[2,151],129:[2,151],132:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151],137:[2,151]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],73:[2,152],78:[2,152],86:[2,152],91:[2,152],93:[2,152],102:[2,152],103:87,104:[1,65],105:[2,152],106:[1,66],109:88,110:[1,68],111:69,118:[2,152],126:[2,152],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],49:[2,156],54:[2,156],57:[2,156],73:[2,156],78:[2,156],86:[2,156],91:[2,156],93:[2,156],102:[2,156],104:[2,156],105:[2,156],106:[2,156],110:[2,156],118:[2,156],126:[2,156],128:[2,156],129:[2,156],132:[2,156],133:[2,156],134:[2,156],135:[2,156],136:[2,156],137:[2,156]},{116:[2,158],117:[2,158]},{27:159,28:[1,73],44:160,58:161,59:162,76:[1,70],89:[1,114],90:[1,115],113:234,115:158},{54:[1,235],116:[2,164],117:[2,164]},{54:[2,160],116:[2,160],117:[2,160]},{54:[2,161],116:[2,161],117:[2,161]},{54:[2,162],116:[2,162],117:[2,162]},{54:[2,163],116:[2,163],117:[2,163]},{1:[2,157],6:[2,157],25:[2,157],26:[2,157],49:[2,157],54:[2,157],57:[2,157],73:[2,157],78:[2,157],86:[2,157],91:[2,157],93:[2,157],102:[2,157],104:[2,157],105:[2,157],106:[2,157],110:[2,157],118:[2,157],126:[2,157],128:[2,157],129:[2,157],132:[2,157],133:[2,157],134:[2,157],135:[2,157],136:[2,157],137:[2,157]},{8:236,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:237,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,53],25:[2,53],53:238,54:[1,239],78:[2,53]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],78:[2,92]},{6:[2,39],25:[2,39],26:[2,39],43:[1,240],54:[2,39],78:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],78:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],78:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],78:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],78:[2,45]},{1:[2,5],6:[2,5],26:[2,5],102:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],73:[2,25],78:[2,25],86:[2,25],91:[2,25],93:[2,25],98:[2,25],99:[2,25],102:[2,25],104:[2,25],105:[2,25],106:[2,25],110:[2,25],118:[2,25],121:[2,25],123:[2,25],126:[2,25],128:[2,25],129:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25],137:[2,25]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],73:[2,195],78:[2,195],86:[2,195],91:[2,195],93:[2,195],102:[2,195],103:87,104:[2,195],105:[2,195],106:[2,195],109:88,110:[2,195],111:69,118:[2,195],126:[2,195],128:[2,195],129:[2,195],132:[1,78],133:[1,81],134:[2,195],135:[2,195],136:[2,195],137:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],73:[2,196],78:[2,196],86:[2,196],91:[2,196],93:[2,196],102:[2,196],103:87,104:[2,196],105:[2,196],106:[2,196],109:88,110:[2,196],111:69,118:[2,196],126:[2,196],128:[2,196],129:[2,196],132:[1,78],133:[1,81],134:[2,196],135:[2,196],136:[2,196],137:[2,196]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],73:[2,197],78:[2,197],86:[2,197],91:[2,197],93:[2,197],102:[2,197],103:87,104:[2,197],105:[2,197],106:[2,197],109:88,110:[2,197],111:69,118:[2,197],126:[2,197],128:[2,197],129:[2,197],132:[1,78],133:[2,197],134:[2,197],135:[2,197],136:[2,197],137:[2,197]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],73:[2,198],78:[2,198],86:[2,198],91:[2,198],93:[2,198],102:[2,198],103:87,104:[2,198],105:[2,198],106:[2,198],109:88,110:[2,198],111:69,118:[2,198],126:[2,198],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[2,198],135:[2,198],136:[2,198],137:[2,198]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],73:[2,199],78:[2,199],86:[2,199],91:[2,199],93:[2,199],102:[2,199],103:87,104:[2,199],105:[2,199],106:[2,199],109:88,110:[2,199],111:69,118:[2,199],126:[2,199],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[2,199],136:[2,199],137:[1,85]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],73:[2,200],78:[2,200],86:[2,200],91:[2,200],93:[2,200],102:[2,200],103:87,104:[2,200],105:[2,200],106:[2,200],109:88,110:[2,200],111:69,118:[2,200],126:[2,200],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[2,200],137:[1,85]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],73:[2,201],78:[2,201],86:[2,201],91:[2,201],93:[2,201],102:[2,201],103:87,104:[2,201],105:[2,201],106:[2,201],109:88,110:[2,201],111:69,118:[2,201],126:[2,201],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[2,201],136:[2,201],137:[2,201]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],73:[2,186],78:[2,186],86:[2,186],91:[2,186],93:[2,186],102:[2,186],103:87,104:[1,65],105:[2,186],106:[1,66],109:88,110:[1,68],111:69,118:[2,186],126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],73:[2,185],78:[2,185],86:[2,185],91:[2,185],93:[2,185],102:[2,185],103:87,104:[1,65],105:[2,185],106:[1,66],109:88,110:[1,68],111:69,118:[2,185],126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],69:[2,104],71:[2,104],73:[2,104],74:[2,104],78:[2,104],84:[2,104],85:[2,104],86:[2,104],91:[2,104],93:[2,104],102:[2,104],104:[2,104],105:[2,104],106:[2,104],110:[2,104],118:[2,104],126:[2,104],128:[2,104],129:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104],137:[2,104]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],69:[2,80],71:[2,80],73:[2,80],74:[2,80],78:[2,80],80:[2,80],84:[2,80],85:[2,80],86:[2,80],91:[2,80],93:[2,80],102:[2,80],104:[2,80],105:[2,80],106:[2,80],110:[2,80],118:[2,80],126:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80],138:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],69:[2,81],71:[2,81],73:[2,81],74:[2,81],78:[2,81],80:[2,81],84:[2,81],85:[2,81],86:[2,81],91:[2,81],93:[2,81],102:[2,81],104:[2,81],105:[2,81],106:[2,81],110:[2,81],118:[2,81],126:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81],138:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],69:[2,82],71:[2,82],73:[2,82],74:[2,82],78:[2,82],80:[2,82],84:[2,82],85:[2,82],86:[2,82],91:[2,82],93:[2,82],102:[2,82],104:[2,82],105:[2,82],106:[2,82],110:[2,82],118:[2,82],126:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82],138:[2,82]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],69:[2,83],71:[2,83],73:[2,83],74:[2,83],78:[2,83],80:[2,83],84:[2,83],85:[2,83],86:[2,83],91:[2,83],93:[2,83],102:[2,83],104:[2,83],105:[2,83],106:[2,83],110:[2,83],118:[2,83],126:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83],138:[2,83]},{73:[1,241]},{57:[1,194],73:[2,88],92:242,93:[1,193],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{73:[2,89]},{8:243,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,73:[2,123],76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{12:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],73:[2,117],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{12:[2,118],28:[2,118],30:[2,118],31:[2,118],33:[2,118],34:[2,118],35:[2,118],36:[2,118],37:[2,118],38:[2,118],45:[2,118],46:[2,118],47:[2,118],51:[2,118],52:[2,118],73:[2,118],76:[2,118],79:[2,118],83:[2,118],88:[2,118],89:[2,118],90:[2,118],96:[2,118],100:[2,118],101:[2,118],104:[2,118],106:[2,118],108:[2,118],110:[2,118],119:[2,118],125:[2,118],127:[2,118],128:[2,118],129:[2,118],130:[2,118],131:[2,118]},{1:[2,87],6:[2,87],25:[2,87],26:[2,87],40:[2,87],49:[2,87],54:[2,87],57:[2,87],66:[2,87],67:[2,87],68:[2,87],69:[2,87],71:[2,87],73:[2,87],74:[2,87],78:[2,87],80:[2,87],84:[2,87],85:[2,87],86:[2,87],91:[2,87],93:[2,87],102:[2,87],104:[2,87],105:[2,87],106:[2,87],110:[2,87],118:[2,87],126:[2,87],128:[2,87],129:[2,87],130:[2,87],131:[2,87],132:[2,87],133:[2,87],134:[2,87],135:[2,87],136:[2,87],137:[2,87],138:[2,87]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],69:[2,105],71:[2,105],73:[2,105],74:[2,105],78:[2,105],84:[2,105],85:[2,105],86:[2,105],91:[2,105],93:[2,105],102:[2,105],104:[2,105],105:[2,105],106:[2,105],110:[2,105],118:[2,105],126:[2,105],128:[2,105],129:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105],137:[2,105]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],73:[2,36],78:[2,36],86:[2,36],91:[2,36],93:[2,36],102:[2,36],103:87,104:[2,36],105:[2,36],106:[2,36],109:88,110:[2,36],111:69,118:[2,36],126:[2,36],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{8:244,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:245,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],69:[2,110],71:[2,110],73:[2,110],74:[2,110],78:[2,110],84:[2,110],85:[2,110],86:[2,110],91:[2,110],93:[2,110],102:[2,110],104:[2,110],105:[2,110],106:[2,110],110:[2,110],118:[2,110],126:[2,110],128:[2,110],129:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110],137:[2,110]},{6:[2,53],25:[2,53],53:246,54:[1,229],86:[2,53]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],57:[1,247],86:[2,129],91:[2,129],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{50:248,51:[1,60],52:[1,61]},{6:[2,54],25:[2,54],26:[2,54],27:110,28:[1,73],44:111,55:249,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{6:[1,250],25:[1,251]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61]},{8:252,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,202],6:[2,202],25:[2,202],26:[2,202],49:[2,202],54:[2,202],57:[2,202],73:[2,202],78:[2,202],86:[2,202],91:[2,202],93:[2,202],102:[2,202],103:87,104:[2,202],105:[2,202],106:[2,202],109:88,110:[2,202],111:69,118:[2,202],126:[2,202],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{8:253,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:254,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,205],6:[2,205],25:[2,205],26:[2,205],49:[2,205],54:[2,205],57:[2,205],73:[2,205],78:[2,205],86:[2,205],91:[2,205],93:[2,205],102:[2,205],103:87,104:[2,205],105:[2,205],106:[2,205],109:88,110:[2,205],111:69,118:[2,205],126:[2,205],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],73:[2,184],78:[2,184],86:[2,184],91:[2,184],93:[2,184],102:[2,184],104:[2,184],105:[2,184],106:[2,184],110:[2,184],118:[2,184],126:[2,184],128:[2,184],129:[2,184],132:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184],137:[2,184]},{8:255,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],73:[2,134],78:[2,134],86:[2,134],91:[2,134],93:[2,134],98:[1,256],102:[2,134],104:[2,134],105:[2,134],106:[2,134],110:[2,134],118:[2,134],126:[2,134],128:[2,134],129:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134],137:[2,134]},{5:257,25:[1,5]},{5:260,25:[1,5],27:258,28:[1,73],59:259,76:[1,70]},{120:261,122:219,123:[1,220]},{26:[1,262],121:[1,263],122:264,123:[1,220]},{26:[2,177],121:[2,177],123:[2,177]},{8:266,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],95:265,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,98],5:267,6:[2,98],25:[1,5],26:[2,98],49:[2,98],54:[2,98],57:[2,98],73:[2,98],78:[2,98],86:[2,98],91:[2,98],93:[2,98],102:[2,98],103:87,104:[1,65],105:[2,98],106:[1,66],109:88,110:[1,68],111:69,118:[2,98],126:[2,98],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,101],6:[2,101],25:[2,101],26:[2,101],49:[2,101],54:[2,101],57:[2,101],73:[2,101],78:[2,101],86:[2,101],91:[2,101],93:[2,101],102:[2,101],104:[2,101],105:[2,101],106:[2,101],110:[2,101],118:[2,101],126:[2,101],128:[2,101],129:[2,101],132:[2,101],133:[2,101],134:[2,101],135:[2,101],136:[2,101],137:[2,101]},{8:268,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],66:[2,141],67:[2,141],68:[2,141],69:[2,141],71:[2,141],73:[2,141],74:[2,141],78:[2,141],84:[2,141],85:[2,141],86:[2,141],91:[2,141],93:[2,141],102:[2,141],104:[2,141],105:[2,141],106:[2,141],110:[2,141],118:[2,141],126:[2,141],128:[2,141],129:[2,141],132:[2,141],133:[2,141],134:[2,141],135:[2,141],136:[2,141],137:[2,141]},{6:[1,74],26:[1,269]},{8:270,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,67],12:[2,118],25:[2,67],28:[2,118],30:[2,118],31:[2,118],33:[2,118],34:[2,118],35:[2,118],36:[2,118],37:[2,118],38:[2,118],45:[2,118],46:[2,118],47:[2,118],51:[2,118],52:[2,118],54:[2,67],76:[2,118],79:[2,118],83:[2,118],88:[2,118],89:[2,118],90:[2,118],91:[2,67],96:[2,118],100:[2,118],101:[2,118],104:[2,118],106:[2,118],108:[2,118],110:[2,118],119:[2,118],125:[2,118],127:[2,118],128:[2,118],129:[2,118],130:[2,118],131:[2,118]},{6:[1,272],25:[1,273],91:[1,271]},{6:[2,54],8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,54],26:[2,54],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],86:[2,54],88:[1,58],89:[1,59],90:[1,57],91:[2,54],94:274,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,53],25:[2,53],26:[2,53],53:275,54:[1,229]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],73:[2,181],78:[2,181],86:[2,181],91:[2,181],93:[2,181],102:[2,181],104:[2,181],105:[2,181],106:[2,181],110:[2,181],118:[2,181],121:[2,181],126:[2,181],128:[2,181],129:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181],137:[2,181]},{8:276,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:277,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{116:[2,159],117:[2,159]},{27:159,28:[1,73],44:160,58:161,59:162,76:[1,70],89:[1,114],90:[1,115],115:278},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],73:[2,166],78:[2,166],86:[2,166],91:[2,166],93:[2,166],102:[2,166],103:87,104:[2,166],105:[1,279],106:[2,166],109:88,110:[2,166],111:69,118:[1,280],126:[2,166],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],73:[2,167],78:[2,167],86:[2,167],91:[2,167],93:[2,167],102:[2,167],103:87,104:[2,167],105:[1,281],106:[2,167],109:88,110:[2,167],111:69,118:[2,167],126:[2,167],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,283],25:[1,284],78:[1,282]},{6:[2,54],11:169,25:[2,54],26:[2,54],27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:285,42:168,44:172,46:[1,46],78:[2,54],89:[1,114]},{8:286,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,287],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],69:[2,86],71:[2,86],73:[2,86],74:[2,86],78:[2,86],80:[2,86],84:[2,86],85:[2,86],86:[2,86],91:[2,86],93:[2,86],102:[2,86],104:[2,86],105:[2,86],106:[2,86],110:[2,86],118:[2,86],126:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86],138:[2,86]},{8:288,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,73:[2,121],76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{73:[2,122],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],73:[2,37],78:[2,37],86:[2,37],91:[2,37],93:[2,37],102:[2,37],103:87,104:[2,37],105:[2,37],106:[2,37],109:88,110:[2,37],111:69,118:[2,37],126:[2,37],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{26:[1,289],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,272],25:[1,273],86:[1,290]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],86:[2,67],91:[2,67]},{5:291,25:[1,5]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{27:110,28:[1,73],44:111,55:292,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{6:[2,55],25:[2,55],26:[2,55],27:110,28:[1,73],44:111,48:293,54:[2,55],55:108,56:109,58:112,59:113,76:[1,70],89:[1,114],90:[1,115]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{26:[1,294],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,204],6:[2,204],25:[2,204],26:[2,204],49:[2,204],54:[2,204],57:[2,204],73:[2,204],78:[2,204],86:[2,204],91:[2,204],93:[2,204],102:[2,204],103:87,104:[2,204],105:[2,204],106:[2,204],109:88,110:[2,204],111:69,118:[2,204],126:[2,204],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{5:295,25:[1,5],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{5:296,25:[1,5]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],73:[2,135],78:[2,135],86:[2,135],91:[2,135],93:[2,135],102:[2,135],104:[2,135],105:[2,135],106:[2,135],110:[2,135],118:[2,135],126:[2,135],128:[2,135],129:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135],137:[2,135]},{5:297,25:[1,5]},{5:298,25:[1,5]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],73:[2,139],78:[2,139],86:[2,139],91:[2,139],93:[2,139],98:[2,139],102:[2,139],104:[2,139],105:[2,139],106:[2,139],110:[2,139],118:[2,139],126:[2,139],128:[2,139],129:[2,139],132:[2,139],133:[2,139],134:[2,139],135:[2,139],136:[2,139],137:[2,139]},{26:[1,299],121:[1,300],122:264,123:[1,220]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],49:[2,175],54:[2,175],57:[2,175],73:[2,175],78:[2,175],86:[2,175],91:[2,175],93:[2,175],102:[2,175],104:[2,175],105:[2,175],106:[2,175],110:[2,175],118:[2,175],126:[2,175],128:[2,175],129:[2,175],132:[2,175],133:[2,175],134:[2,175],135:[2,175],136:[2,175],137:[2,175]},{5:301,25:[1,5]},{26:[2,178],121:[2,178],123:[2,178]},{5:302,25:[1,5],54:[1,303]},{25:[2,131],54:[2,131],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],49:[2,99],54:[2,99],57:[2,99],73:[2,99],78:[2,99],86:[2,99],91:[2,99],93:[2,99],102:[2,99],104:[2,99],105:[2,99],106:[2,99],110:[2,99],118:[2,99],126:[2,99],128:[2,99],129:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99],137:[2,99]},{1:[2,102],5:304,6:[2,102],25:[1,5],26:[2,102],49:[2,102],54:[2,102],57:[2,102],73:[2,102],78:[2,102],86:[2,102],91:[2,102],93:[2,102],102:[2,102],103:87,104:[1,65],105:[2,102],106:[1,66],109:88,110:[1,68],111:69,118:[2,102],126:[2,102],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{102:[1,305]},{91:[1,306],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,116],6:[2,116],25:[2,116],26:[2,116],40:[2,116],49:[2,116],54:[2,116],57:[2,116],66:[2,116],67:[2,116],68:[2,116],69:[2,116],71:[2,116],73:[2,116],74:[2,116],78:[2,116],84:[2,116],85:[2,116],86:[2,116],91:[2,116],93:[2,116],102:[2,116],104:[2,116],105:[2,116],106:[2,116],110:[2,116],116:[2,116],117:[2,116],118:[2,116],126:[2,116],128:[2,116],129:[2,116],132:[2,116],133:[2,116],134:[2,116],135:[2,116],136:[2,116],137:[2,116]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],94:307,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:202,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,147],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:148,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],87:308,88:[1,58],89:[1,59],90:[1,57],94:146,96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],86:[2,125],91:[2,125]},{6:[1,272],25:[1,273],26:[1,309]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],73:[2,144],78:[2,144],86:[2,144],91:[2,144],93:[2,144],102:[2,144],103:87,104:[1,65],105:[2,144],106:[1,66],109:88,110:[1,68],111:69,118:[2,144],126:[2,144],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],73:[2,146],78:[2,146],86:[2,146],91:[2,146],93:[2,146],102:[2,146],103:87,104:[1,65],105:[2,146],106:[1,66],109:88,110:[1,68],111:69,118:[2,146],126:[2,146],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{116:[2,165],117:[2,165]},{8:310,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:311,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:312,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,90],6:[2,90],25:[2,90],26:[2,90],40:[2,90],49:[2,90],54:[2,90],57:[2,90],66:[2,90],67:[2,90],68:[2,90],69:[2,90],71:[2,90],73:[2,90],74:[2,90],78:[2,90],84:[2,90],85:[2,90],86:[2,90],91:[2,90],93:[2,90],102:[2,90],104:[2,90],105:[2,90],106:[2,90],110:[2,90],116:[2,90],117:[2,90],118:[2,90],126:[2,90],128:[2,90],129:[2,90],132:[2,90],133:[2,90],134:[2,90],135:[2,90],136:[2,90],137:[2,90]},{11:169,27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:313,42:168,44:172,46:[1,46],89:[1,114]},{6:[2,91],11:169,25:[2,91],26:[2,91],27:170,28:[1,73],29:171,30:[1,71],31:[1,72],41:167,42:168,44:172,46:[1,46],54:[2,91],77:314,89:[1,114]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],78:[2,93]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],78:[2,40],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{8:315,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{73:[2,120],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,38],6:[2,38],25:[2,38],26:[2,38],49:[2,38],54:[2,38],57:[2,38],73:[2,38],78:[2,38],86:[2,38],91:[2,38],93:[2,38],102:[2,38],104:[2,38],105:[2,38],106:[2,38],110:[2,38],118:[2,38],126:[2,38],128:[2,38],129:[2,38],132:[2,38],133:[2,38],134:[2,38],135:[2,38],136:[2,38],137:[2,38]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],69:[2,111],71:[2,111],73:[2,111],74:[2,111],78:[2,111],84:[2,111],85:[2,111],86:[2,111],91:[2,111],93:[2,111],102:[2,111],104:[2,111],105:[2,111],106:[2,111],110:[2,111],118:[2,111],126:[2,111],128:[2,111],129:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111],137:[2,111]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],73:[2,49],78:[2,49],86:[2,49],91:[2,49],93:[2,49],102:[2,49],104:[2,49],105:[2,49],106:[2,49],110:[2,49],118:[2,49],126:[2,49],128:[2,49],129:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49],137:[2,49]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{6:[2,53],25:[2,53],26:[2,53],53:316,54:[1,204]},{1:[2,203],6:[2,203],25:[2,203],26:[2,203],49:[2,203],54:[2,203],57:[2,203],73:[2,203],78:[2,203],86:[2,203],91:[2,203],93:[2,203],102:[2,203],104:[2,203],105:[2,203],106:[2,203],110:[2,203],118:[2,203],126:[2,203],128:[2,203],129:[2,203],132:[2,203],133:[2,203],134:[2,203],135:[2,203],136:[2,203],137:[2,203]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],73:[2,182],78:[2,182],86:[2,182],91:[2,182],93:[2,182],102:[2,182],104:[2,182],105:[2,182],106:[2,182],110:[2,182],118:[2,182],121:[2,182],126:[2,182],128:[2,182],129:[2,182],132:[2,182],133:[2,182],134:[2,182],135:[2,182],136:[2,182],137:[2,182]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],73:[2,136],78:[2,136],86:[2,136],91:[2,136],93:[2,136],102:[2,136],104:[2,136],105:[2,136],106:[2,136],110:[2,136],118:[2,136],126:[2,136],128:[2,136],129:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136],137:[2,136]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],73:[2,137],78:[2,137],86:[2,137],91:[2,137],93:[2,137],98:[2,137],102:[2,137],104:[2,137],105:[2,137],106:[2,137],110:[2,137],118:[2,137],126:[2,137],128:[2,137],129:[2,137],132:[2,137],133:[2,137],134:[2,137],135:[2,137],136:[2,137],137:[2,137]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],73:[2,138],78:[2,138],86:[2,138],91:[2,138],93:[2,138],98:[2,138],102:[2,138],104:[2,138],105:[2,138],106:[2,138],110:[2,138],118:[2,138],126:[2,138],128:[2,138],129:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138],137:[2,138]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],73:[2,173],78:[2,173],86:[2,173],91:[2,173],93:[2,173],102:[2,173],104:[2,173],105:[2,173],106:[2,173],110:[2,173],118:[2,173],126:[2,173],128:[2,173],129:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173],137:[2,173]},{5:317,25:[1,5]},{26:[1,318]},{6:[1,319],26:[2,179],121:[2,179],123:[2,179]},{8:320,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],73:[2,103],78:[2,103],86:[2,103],91:[2,103],93:[2,103],102:[2,103],104:[2,103],105:[2,103],106:[2,103],110:[2,103],118:[2,103],126:[2,103],128:[2,103],129:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103],137:[2,103]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],66:[2,142],67:[2,142],68:[2,142],69:[2,142],71:[2,142],73:[2,142],74:[2,142],78:[2,142],84:[2,142],85:[2,142],86:[2,142],91:[2,142],93:[2,142],102:[2,142],104:[2,142],105:[2,142],106:[2,142],110:[2,142],118:[2,142],126:[2,142],128:[2,142],129:[2,142],132:[2,142],133:[2,142],134:[2,142],135:[2,142],136:[2,142],137:[2,142]},{1:[2,119],6:[2,119],25:[2,119],26:[2,119],49:[2,119],54:[2,119],57:[2,119],66:[2,119],67:[2,119],68:[2,119],69:[2,119],71:[2,119],73:[2,119],74:[2,119],78:[2,119],84:[2,119],85:[2,119],86:[2,119],91:[2,119],93:[2,119],102:[2,119],104:[2,119],105:[2,119],106:[2,119],110:[2,119],118:[2,119],126:[2,119],128:[2,119],129:[2,119],132:[2,119],133:[2,119],134:[2,119],135:[2,119],136:[2,119],137:[2,119]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],86:[2,126],91:[2,126]},{6:[2,53],25:[2,53],26:[2,53],53:321,54:[1,229]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],86:[2,127],91:[2,127]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],73:[2,168],78:[2,168],86:[2,168],91:[2,168],93:[2,168],102:[2,168],103:87,104:[2,168],105:[2,168],106:[2,168],109:88,110:[2,168],111:69,118:[1,322],126:[2,168],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],73:[2,170],78:[2,170],86:[2,170],91:[2,170],93:[2,170],102:[2,170],103:87,104:[2,170],105:[1,323],106:[2,170],109:88,110:[2,170],111:69,118:[2,170],126:[2,170],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],73:[2,169],78:[2,169],86:[2,169],91:[2,169],93:[2,169],102:[2,169],103:87,104:[2,169],105:[2,169],106:[2,169],109:88,110:[2,169],111:69,118:[2,169],126:[2,169],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],78:[2,94]},{6:[2,53],25:[2,53],26:[2,53],53:324,54:[1,239]},{26:[1,325],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,250],25:[1,251],26:[1,326]},{26:[1,327]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],49:[2,176],54:[2,176],57:[2,176],73:[2,176],78:[2,176],86:[2,176],91:[2,176],93:[2,176],102:[2,176],104:[2,176],105:[2,176],106:[2,176],110:[2,176],118:[2,176],126:[2,176],128:[2,176],129:[2,176],132:[2,176],133:[2,176],134:[2,176],135:[2,176],136:[2,176],137:[2,176]},{26:[2,180],121:[2,180],123:[2,180]},{25:[2,132],54:[2,132],103:87,104:[1,65],106:[1,66],109:88,110:[1,68],111:69,126:[1,86],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[1,272],25:[1,273],26:[1,328]},{8:329,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{8:330,9:118,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,76:[1,70],79:[1,43],83:[1,28],88:[1,58],89:[1,59],90:[1,57],96:[1,38],100:[1,44],101:[1,56],103:39,104:[1,65],106:[1,66],107:40,108:[1,67],109:41,110:[1,68],111:69,119:[1,42],124:37,125:[1,64],127:[1,31],128:[1,32],129:[1,33],130:[1,34],131:[1,35]},{6:[1,283],25:[1,284],26:[1,331]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],78:[2,41]},{6:[2,59],25:[2,59],26:[2,59],49:[2,59],54:[2,59]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],49:[2,174],54:[2,174],57:[2,174],73:[2,174],78:[2,174],86:[2,174],91:[2,174],93:[2,174],102:[2,174],104:[2,174],105:[2,174],106:[2,174],110:[2,174],118:[2,174],126:[2,174],128:[2,174],129:[2,174],132:[2,174],133:[2,174],134:[2,174],135:[2,174],136:[2,174],137:[2,174]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],86:[2,128],91:[2,128]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],73:[2,171],78:[2,171],86:[2,171],91:[2,171],93:[2,171],102:[2,171],103:87,104:[2,171],105:[2,171],106:[2,171],109:88,110:[2,171],111:69,118:[2,171],126:[2,171],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],73:[2,172],78:[2,172],86:[2,172],91:[2,172],93:[2,172],102:[2,172],103:87,104:[2,172],105:[2,172],106:[2,172],109:88,110:[2,172],111:69,118:[2,172],126:[2,172],128:[1,80],129:[1,79],132:[1,78],133:[1,81],134:[1,82],135:[1,83],136:[1,84],137:[1,85]},{6:[2,95],25:[2,95],26:[2,95],54:[2,95],78:[2,95]}],defaultActions:{60:[2,51],61:[2,52],75:[2,3],94:[2,109],191:[2,89]},parseError:function(e){throw new Error(e)
10
- },parse:function(e){function t(){var e;return e=n.lexer.lex()||1,"number"!=typeof e&&(e=n.symbols_[e]||e),e}var n=this,i=[0],s=[null],r=[],o=this.table,a="",c=0,h=0,l=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;r.push(u);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,f,m,b,k,g,y,v,w,T={};;){if(m=i[i.length-1],this.defaultActions[m]?b=this.defaultActions[m]:((null===d||"undefined"==typeof d)&&(d=t()),b=o[m]&&o[m][d]),"undefined"==typeof b||!b.length||!b[0]){var C="";if(!l){w=[];for(g in o[m])this.terminals_[g]&&g>2&&w.push("'"+this.terminals_[g]+"'");C=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(C,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:u,expected:w})}}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+d);switch(b[0]){case 1:i.push(d),s.push(this.lexer.yytext),r.push(this.lexer.yylloc),i.push(b[1]),d=null,f?(d=f,f=null):(h=this.lexer.yyleng,a=this.lexer.yytext,c=this.lexer.yylineno,u=this.lexer.yylloc,l>0&&l--);break;case 2:if(y=this.productions_[b[1]][1],T.$=s[s.length-y],T._$={first_line:r[r.length-(y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(y||1)].first_column,last_column:r[r.length-1].last_column},p&&(T._$.range=[r[r.length-(y||1)].range[0],r[r.length-1].range[1]]),k=this.performAction.call(T,a,h,c,this.yy,b[1],s,r),"undefined"!=typeof k)return k;y&&(i=i.slice(0,2*-1*y),s=s.slice(0,-1*y),r=r.slice(0,-1*y)),i.push(this.productions_[b[1]][0]),s.push(T.$),r.push(T._$),v=o[i[i.length-2]][i[i.length-1]],i.push(v);break;case 3:return!0}}return!0}};return e.prototype=t,t.Parser=e,new e}();return"undefined"!=typeof require&&"undefined"!=typeof e&&(e.parser=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)},e.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),process.exit(1));var n=require("fs").readFileSync(require("path").normalize(t[1]),"utf8");return e.parser.parse(n)},"undefined"!=typeof t&&require.main===t&&e.main(process.argv.slice(1))),t.exports}(),require["./scope"]=function(){var e={},t={exports:e};return function(){var t,n,i,s;s=require("./helpers"),n=s.extend,i=s.last,e.Scope=t=function(){function e(t,n,i){this.parent=t,this.expressions=n,this.method=i,this.variables=[{name:"arguments",type:"arguments"}],this.positions={},this.parent||(e.root=this)}return e.root=null,e.prototype.add=function(e,t,n){return this.shared&&!n?this.parent.add(e,t,n):Object.prototype.hasOwnProperty.call(this.positions,e)?this.variables[this.positions[e]].type=t:this.positions[e]=this.variables.push({name:e,type:t})-1},e.prototype.namedMethod=function(){var e;return(null!=(e=this.method)?e.name:void 0)||!this.parent?this.method:this.parent.namedMethod()},e.prototype.find=function(e){return this.check(e)?!0:(this.add(e,"var"),!1)},e.prototype.parameter=function(e){return this.shared&&this.parent.check(e,!0)?void 0:this.add(e,"param")},e.prototype.check=function(e){var t;return!!(this.type(e)||(null!=(t=this.parent)?t.check(e):void 0))},e.prototype.temporary=function(e,t){return e.length>1?"_"+e+(t>1?t-1:""):"_"+(t+parseInt(e,36)).toString(36).replace(/\d/g,"a")},e.prototype.type=function(e){var t,n,i,s;for(s=this.variables,n=0,i=s.length;i>n;n++)if(t=s[n],t.name===e)return t.type;return null},e.prototype.freeVariable=function(e,t){var n,i;for(null==t&&(t=!0),n=0;this.check(i=this.temporary(e,n));)n++;return t&&this.add(i,"var",!0),i},e.prototype.assign=function(e,t){return this.add(e,{value:t,assigned:!0},!0),this.hasAssignments=!0},e.prototype.hasDeclarations=function(){return!!this.declaredVariables().length},e.prototype.declaredVariables=function(){var e,t,n,i,s,r;for(e=[],t=[],r=this.variables,i=0,s=r.length;s>i;i++)n=r[i],"var"===n.type&&("_"===n.name.charAt(0)?t:e).push(n.name);return e.sort().concat(t.sort())},e.prototype.assignedVariables=function(){var e,t,n,i,s;for(i=this.variables,s=[],t=0,n=i.length;n>t;t++)e=i[t],e.type.assigned&&s.push(""+e.name+" = "+e.type.value);return s},e}()}.call(this),t.exports}(),require["./nodes"]=function(){var e={},t={exports:e};return function(){var t,n,i,s,r,o,a,c,h,l,u,p,d,f,m,b,k,g,y,v,w,T,C,F,L,N,x,E,D,S,R,A,I,_,$,O,j,M,B,V,P,U,q,H,G,W,X,Y,K,z,J,Z,Q,et,tt,nt,it,st,rt,ot,at,ct,ht,lt,ut,pt,dt,ft,mt,bt,kt,gt={}.hasOwnProperty,yt=function(e,t){function n(){this.constructor=e}for(var i in t)gt.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},vt=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1},wt=[].slice;Error.stackTraceLimit=1/0,V=require("./scope").Scope,ft=require("./lexer"),$=ft.RESERVED,B=ft.STRICT_PROSCRIBED,mt=require("./helpers"),Q=mt.compact,it=mt.flatten,nt=mt.extend,at=mt.merge,et=mt.del,lt=mt.starts,tt=mt.ends,rt=mt.last,ht=mt.some,Z=mt.addLocationDataFn,ot=mt.locationDataToString,ut=mt.throwSyntaxError,e.extend=nt,e.addLocationDataFn=Z,J=function(){return!0},S=function(){return!1},G=function(){return this},D=function(){return this.negated=!this.negated,this},e.CodeFragment=l=function(){function e(e,t){var n;this.code=""+t,this.locationData=null!=e?e.locationData:void 0,this.type=(null!=e?null!=(n=e.constructor)?n.name:void 0:void 0)||"unknown"}return e.prototype.toString=function(){return""+this.code+(this.locationData?": "+ot(this.locationData):"")},e}(),st=function(e){var t;return function(){var n,i,s;for(s=[],n=0,i=e.length;i>n;n++)t=e[n],s.push(t.code);return s}().join("")},e.Base=s=function(){function e(){}return e.prototype.compile=function(e,t){return st(this.compileToFragments(e,t))},e.prototype.compileToFragments=function(e,t){var n;return e=nt({},e),t&&(e.level=t),n=this.unfoldSoak(e)||this,n.tab=e.indent,e.level!==N&&n.isStatement(e)?n.compileClosure(e):n.compileNode(e)},e.prototype.compileClosure=function(e){var t;return(t=this.jumps())&&t.error("cannot use a pure statement in an expression"),e.sharedScope=!0,c.wrap(this).compileNode(e)},e.prototype.cache=function(e,t,n){var s,r;return this.isComplex()?(s=new x(n||e.scope.freeVariable("ref")),r=new i(s,this),t?[r.compileToFragments(e,t),[this.makeCode(s.value)]]:[r,s]):(s=t?this.compileToFragments(e,t):this,[s,s])},e.prototype.cacheToCodeFragments=function(e){return[st(e[0]),st(e[1])]},e.prototype.makeReturn=function(e){var t;return t=this.unwrapAll(),e?new o(new x(""+e+".push"),[t]):new j(t)},e.prototype.contains=function(e){var t;return t=void 0,this.traverseChildren(!1,function(n){return e(n)?(t=n,!1):void 0}),t},e.prototype.lastNonComment=function(e){var t;for(t=e.length;t--;)if(!(e[t]instanceof u))return e[t];return null},e.prototype.toString=function(e,t){var n;return null==e&&(e=""),null==t&&(t=this.constructor.name),n="\n"+e+t,this.soak&&(n+="?"),this.eachChild(function(t){return n+=t.toString(e+H)}),n},e.prototype.eachChild=function(e){var t,n,i,s,r,o,a,c;if(!this.children)return this;for(a=this.children,i=0,r=a.length;r>i;i++)if(t=a[i],this[t])for(c=it([this[t]]),s=0,o=c.length;o>s;s++)if(n=c[s],e(n)===!1)return this;return this},e.prototype.traverseChildren=function(e,t){return this.eachChild(function(n){var i;return i=t(n),i!==!1?n.traverseChildren(e,t):void 0})},e.prototype.invert=function(){return new A("!",this)},e.prototype.unwrapAll=function(){var e;for(e=this;e!==(e=e.unwrap()););return e},e.prototype.children=[],e.prototype.isStatement=S,e.prototype.jumps=S,e.prototype.isComplex=J,e.prototype.isChainable=S,e.prototype.isAssignable=S,e.prototype.unwrap=G,e.prototype.unfoldSoak=S,e.prototype.assigns=S,e.prototype.updateLocationDataIfMissing=function(e){return this.locationData||(this.locationData=e),this.eachChild(function(t){return t.updateLocationDataIfMissing(e)})},e.prototype.error=function(e){return ut(e,this.locationData)},e.prototype.makeCode=function(e){return new l(this,e)},e.prototype.wrapInBraces=function(e){return[].concat(this.makeCode("("),e,this.makeCode(")"))},e.prototype.joinFragmentArrays=function(e,t){var n,i,s,r,o;for(n=[],s=r=0,o=e.length;o>r;s=++r)i=e[s],s&&n.push(this.makeCode(t)),n=n.concat(i);return n},e}(),e.Block=r=function(e){function t(e){this.expressions=Q(it(e||[]))}return yt(t,e),t.prototype.children=["expressions"],t.prototype.push=function(e){return this.expressions.push(e),this},t.prototype.pop=function(){return this.expressions.pop()},t.prototype.unshift=function(e){return this.expressions.unshift(e),this},t.prototype.unwrap=function(){return 1===this.expressions.length?this.expressions[0]:this},t.prototype.isEmpty=function(){return!this.expressions.length},t.prototype.isStatement=function(e){var t,n,i,s;for(s=this.expressions,n=0,i=s.length;i>n;n++)if(t=s[n],t.isStatement(e))return!0;return!1},t.prototype.jumps=function(e){var t,n,i,s;for(s=this.expressions,n=0,i=s.length;i>n;n++)if(t=s[n],t.jumps(e))return t},t.prototype.makeReturn=function(e){var t,n;for(n=this.expressions.length;n--;)if(t=this.expressions[n],!(t instanceof u)){this.expressions[n]=t.makeReturn(e),t instanceof j&&!t.expression&&this.expressions.splice(n,1);break}return this},t.prototype.compileToFragments=function(e,n){return null==e&&(e={}),e.scope?t.__super__.compileToFragments.call(this,e,n):this.compileRoot(e)},t.prototype.compileNode=function(e){var n,i,s,r,o,a,c,h,l;for(this.tab=e.indent,a=e.level===N,i=[],l=this.expressions,r=c=0,h=l.length;h>c;r=++c)o=l[r],o=o.unwrapAll(),o=o.unfoldSoak(e)||o,o instanceof t?i.push(o.compileNode(e)):a?(o.front=!0,s=o.compileToFragments(e),o.isStatement(e)||(s.unshift(this.makeCode(""+this.tab)),s.push(this.makeCode(";"))),i.push(s)):i.push(o.compileToFragments(e,C));return a?this.spaced?[].concat(this.joinFragmentArrays(i,"\n\n"),this.makeCode("\n")):this.joinFragmentArrays(i,"\n"):(n=i.length?this.joinFragmentArrays(i,", "):[this.makeCode("void 0")],i.length>1&&e.level>=C?this.wrapInBraces(n):n)},t.prototype.compileRoot=function(e){var t,n,i,s,r,o,a,c,h,l;for(e.indent=e.bare?"":H,e.level=N,this.spaced=!0,e.scope=new V(null,this,null),l=e.locals||[],c=0,h=l.length;h>c;c++)s=l[c],e.scope.parameter(s);return r=[],e.bare||(o=function(){var e,n,s,r;for(s=this.expressions,r=[],i=e=0,n=s.length;n>e&&(t=s[i],t.unwrap()instanceof u);i=++e)r.push(t);return r}.call(this),a=this.expressions.slice(o.length),this.expressions=o,o.length&&(r=this.compileNode(at(e,{indent:""})),r.push(this.makeCode("\n"))),this.expressions=a),n=this.compileWithDeclarations(e),e.bare?n:[].concat(r,this.makeCode("(function() {\n"),n,this.makeCode("\n}).call(this);\n"))},t.prototype.compileWithDeclarations=function(e){var t,n,i,s,r,o,a,c,h,l,p,d,f,m;for(s=[],o=[],d=this.expressions,r=l=0,p=d.length;p>l&&(i=d[r],i=i.unwrap(),i instanceof u||i instanceof x);r=++l);return e=at(e,{level:N}),r&&(a=this.expressions.splice(r,9e9),f=[this.spaced,!1],h=f[0],this.spaced=f[1],m=[this.compileNode(e),h],s=m[0],this.spaced=m[1],this.expressions=a),o=this.compileNode(e),c=e.scope,c.expressions===this&&(n=e.scope.hasDeclarations(),t=c.hasAssignments,n||t?(r&&s.push(this.makeCode("\n")),s.push(this.makeCode(""+this.tab+"var ")),n&&s.push(this.makeCode(c.declaredVariables().join(", "))),t&&(n&&s.push(this.makeCode(",\n"+(this.tab+H))),s.push(this.makeCode(c.assignedVariables().join(",\n"+(this.tab+H))))),s.push(this.makeCode(";\n"+(this.spaced?"\n":"")))):s.length&&o.length&&s.push(this.makeCode("\n"))),s.concat(o)},t.wrap=function(e){return 1===e.length&&e[0]instanceof t?e[0]:new t(e)},t}(s),e.Literal=x=function(e){function t(e){this.value=e}return yt(t,e),t.prototype.makeReturn=function(){return this.isStatement()?this:t.__super__.makeReturn.apply(this,arguments)},t.prototype.isAssignable=function(){return m.test(this.value)},t.prototype.isStatement=function(){var e;return"break"===(e=this.value)||"continue"===e||"debugger"===e},t.prototype.isComplex=S,t.prototype.assigns=function(e){return e===this.value},t.prototype.jumps=function(e){return"break"!==this.value||(null!=e?e.loop:void 0)||(null!=e?e.block:void 0)?"continue"!==this.value||(null!=e?e.loop:void 0)?void 0:this:this},t.prototype.compileNode=function(e){var t,n,i;return n="this"===this.value?(null!=(i=e.scope.method)?i.bound:void 0)?e.scope.method.context:this.value:this.value.reserved?'"'+this.value+'"':this.value,t=this.isStatement()?""+this.tab+n+";":n,[this.makeCode(t)]},t.prototype.toString=function(){return' "'+this.value+'"'},t}(s),e.Undefined=function(e){function t(){return bt=t.__super__.constructor.apply(this,arguments)}return yt(t,e),t.prototype.isAssignable=S,t.prototype.isComplex=S,t.prototype.compileNode=function(e){return[this.makeCode(e.level>=w?"(void 0)":"void 0")]},t}(s),e.Null=function(e){function t(){return kt=t.__super__.constructor.apply(this,arguments)}return yt(t,e),t.prototype.isAssignable=S,t.prototype.isComplex=S,t.prototype.compileNode=function(){return[this.makeCode("null")]},t}(s),e.Bool=function(e){function t(e){this.val=e}return yt(t,e),t.prototype.isAssignable=S,t.prototype.isComplex=S,t.prototype.compileNode=function(){return[this.makeCode(this.val)]},t}(s),e.Return=j=function(e){function t(e){e&&!e.unwrap().isUndefined&&(this.expression=e)}return yt(t,e),t.prototype.children=["expression"],t.prototype.isStatement=J,t.prototype.makeReturn=G,t.prototype.jumps=G,t.prototype.compileToFragments=function(e,n){var i,s;return i=null!=(s=this.expression)?s.makeReturn():void 0,!i||i instanceof t?t.__super__.compileToFragments.call(this,e,n):i.compileToFragments(e,n)},t.prototype.compileNode=function(e){var t;return t=[],t.push(this.makeCode(this.tab+("return"+(this.expression?" ":"")))),this.expression&&(t=t.concat(this.expression.compileToFragments(e,L))),t.push(this.makeCode(";")),t},t}(s),e.Value=K=function(e){function t(e,n,i){return!n&&e instanceof t?e:(this.base=e,this.properties=n||[],i&&(this[i]=!0),this)}return yt(t,e),t.prototype.children=["base","properties"],t.prototype.add=function(e){return this.properties=this.properties.concat(e),this},t.prototype.hasProperties=function(){return!!this.properties.length},t.prototype.isArray=function(){return!this.properties.length&&this.base instanceof n},t.prototype.isComplex=function(){return this.hasProperties()||this.base.isComplex()},t.prototype.isAssignable=function(){return this.hasProperties()||this.base.isAssignable()},t.prototype.isSimpleNumber=function(){return this.base instanceof x&&M.test(this.base.value)},t.prototype.isString=function(){return this.base instanceof x&&k.test(this.base.value)},t.prototype.isAtomic=function(){var e,t,n,i;for(i=this.properties.concat(this.base),t=0,n=i.length;n>t;t++)if(e=i[t],e.soak||e instanceof o)return!1;return!0},t.prototype.isStatement=function(e){return!this.properties.length&&this.base.isStatement(e)},t.prototype.assigns=function(e){return!this.properties.length&&this.base.assigns(e)},t.prototype.jumps=function(e){return!this.properties.length&&this.base.jumps(e)},t.prototype.isObject=function(e){return this.properties.length?!1:this.base instanceof R&&(!e||this.base.generated)},t.prototype.isSplice=function(){return rt(this.properties)instanceof P},t.prototype.unwrap=function(){return this.properties.length?this:this.base},t.prototype.cacheReference=function(e){var n,s,r,o;return r=rt(this.properties),this.properties.length<2&&!this.base.isComplex()&&!(null!=r?r.isComplex():void 0)?[this,this]:(n=new t(this.base,this.properties.slice(0,-1)),n.isComplex()&&(s=new x(e.scope.freeVariable("base")),n=new t(new _(new i(s,n)))),r?(r.isComplex()&&(o=new x(e.scope.freeVariable("name")),r=new v(new i(o,r.index)),o=new v(o)),[n.add(r),new t(s||n.base,[o||r])]):[n,s])},t.prototype.compileNode=function(e){var t,n,i,s,r;for(this.base.front=this.front,i=this.properties,t=this.base.compileToFragments(e,i.length?w:null),(this.base instanceof _||i.length)&&M.test(st(t))&&t.push(this.makeCode(".")),s=0,r=i.length;r>s;s++)n=i[s],t.push.apply(t,n.compileToFragments(e));return t},t.prototype.unfoldSoak=function(e){var n=this;return null!=this.unfoldedSoak?this.unfoldedSoak:this.unfoldedSoak=function(){var s,r,o,a,c,h,l,u,d,f;if(o=n.base.unfoldSoak(e))return(d=o.body.properties).push.apply(d,n.properties),o;for(f=n.properties,r=l=0,u=f.length;u>l;r=++l)if(a=f[r],a.soak)return a.soak=!1,s=new t(n.base,n.properties.slice(0,r)),h=new t(n.base,n.properties.slice(r)),s.isComplex()&&(c=new x(e.scope.freeVariable("ref")),s=new _(new i(c,s)),h.base=c),new g(new p(s),h,{soak:!0});return!1}()},t}(s),e.Comment=u=function(e){function t(e){this.comment=e}return yt(t,e),t.prototype.isStatement=J,t.prototype.makeReturn=G,t.prototype.compileNode=function(e,t){var n;return n="/*"+ct(this.comment,this.tab)+(vt.call(this.comment,"\n")>=0?"\n"+this.tab:"")+"*/\n",(t||e.level)===N&&(n=e.indent+n),[this.makeCode(n)]},t}(s),e.Call=o=function(e){function n(e,t,n){this.args=null!=t?t:[],this.soak=n,this.isNew=!1,this.isSuper="super"===e,this.variable=this.isSuper?null:e}return yt(n,e),n.prototype.children=["variable","args"],n.prototype.newInstance=function(){var e,t;return e=(null!=(t=this.variable)?t.base:void 0)||this.variable,e instanceof n&&!e.isNew?e.newInstance():this.isNew=!0,this},n.prototype.superReference=function(e){var n,i;return i=e.scope.namedMethod(),(null!=i?i.klass:void 0)?(n=[new t(new x("__super__"))],i["static"]&&n.push(new t(new x("constructor"))),n.push(new t(new x(i.name))),new K(new x(i.klass),n).compile(e)):(null!=i?i.ctor:void 0)?""+i.name+".__super__.constructor":this.error("cannot call super outside of an instance method.")},n.prototype.superThis=function(e){var t;return t=e.scope.method,t&&!t.klass&&t.context||"this"},n.prototype.unfoldSoak=function(e){var t,i,s,r,o,a,c,h,l;if(this.soak){if(this.variable){if(i=pt(e,this,"variable"))return i;h=new K(this.variable).cacheReference(e),s=h[0],o=h[1]}else s=new x(this.superReference(e)),o=new K(s);return o=new n(o,this.args),o.isNew=this.isNew,s=new x("typeof "+s.compile(e)+' === "function"'),new g(s,new K(o),{soak:!0})}for(t=this,r=[];;)if(t.variable instanceof n)r.push(t),t=t.variable;else{if(!(t.variable instanceof K))break;if(r.push(t),!((t=t.variable.base)instanceof n))break}for(l=r.reverse(),a=0,c=l.length;c>a;a++)t=l[a],i&&(t.variable instanceof n?t.variable=i:t.variable.base=i),i=pt(e,t,"variable");return i},n.prototype.compileNode=function(e){var t,n,i,s,r,o,a,c,h,l;if(null!=(h=this.variable)&&(h.front=this.front),s=U.compileSplattedArray(e,this.args,!0),s.length)return this.compileSplat(e,s);for(i=[],l=this.args,n=a=0,c=l.length;c>a;n=++a)t=l[n],n&&i.push(this.makeCode(", ")),i.push.apply(i,t.compileToFragments(e,C));return r=[],this.isSuper?(o=this.superReference(e)+(".call("+this.superThis(e)),i.length&&(o+=", "),r.push(this.makeCode(o))):(this.isNew&&r.push(this.makeCode("new ")),r.push.apply(r,this.variable.compileToFragments(e,w)),r.push(this.makeCode("("))),r.push.apply(r,i),r.push(this.makeCode(")")),r},n.prototype.compileSplat=function(e,t){var n,i,s,r,o,a;return this.isSuper?[].concat(this.makeCode(""+this.superReference(e)+".apply("+this.superThis(e)+", "),t,this.makeCode(")")):this.isNew?(r=this.tab+H,[].concat(this.makeCode("(function(func, args, ctor) {\n"+r+"ctor.prototype = func.prototype;\n"+r+"var child = new ctor, result = func.apply(child, args);\n"+r+"return Object(result) === result ? result : child;\n"+this.tab+"})("),this.variable.compileToFragments(e,C),this.makeCode(", "),t,this.makeCode(", function(){})"))):(n=[],i=new K(this.variable),(o=i.properties.pop())&&i.isComplex()?(a=e.scope.freeVariable("ref"),n=n.concat(this.makeCode("("+a+" = "),i.compileToFragments(e,C),this.makeCode(")"),o.compileToFragments(e))):(s=i.compileToFragments(e,w),M.test(st(s))&&(s=this.wrapInBraces(s)),o?(a=st(s),s.push.apply(s,o.compileToFragments(e))):a="null",n=n.concat(s)),n=n.concat(this.makeCode(".apply("+a+", "),t,this.makeCode(")")))},n}(s),e.Extends=d=function(e){function t(e,t){this.child=e,this.parent=t}return yt(t,e),t.prototype.children=["child","parent"],t.prototype.compileToFragments=function(e){return new o(new K(new x(dt("extends"))),[this.child,this.parent]).compileToFragments(e)},t}(s),e.Access=t=function(e){function t(e,t){this.name=e,this.name.asKey=!0,this.soak="soak"===t}return yt(t,e),t.prototype.children=["name"],t.prototype.compileToFragments=function(e){var t;return t=this.name.compileToFragments(e),m.test(st(t))?t.unshift(this.makeCode(".")):(t.unshift(this.makeCode("[")),t.push(this.makeCode("]"))),t},t.prototype.isComplex=S,t}(s),e.Index=v=function(e){function t(e){this.index=e}return yt(t,e),t.prototype.children=["index"],t.prototype.compileToFragments=function(e){return[].concat(this.makeCode("["),this.index.compileToFragments(e,L),this.makeCode("]"))},t.prototype.isComplex=function(){return this.index.isComplex()},t}(s),e.Range=O=function(e){function t(e,t,n){this.from=e,this.to=t,this.exclusive="exclusive"===n,this.equals=this.exclusive?"":"="}return yt(t,e),t.prototype.children=["from","to"],t.prototype.compileVariables=function(e){var t,n,i,s,r;return e=at(e,{top:!0}),n=this.cacheToCodeFragments(this.from.cache(e,C)),this.fromC=n[0],this.fromVar=n[1],i=this.cacheToCodeFragments(this.to.cache(e,C)),this.toC=i[0],this.toVar=i[1],(t=et(e,"step"))&&(s=this.cacheToCodeFragments(t.cache(e,C)),this.step=s[0],this.stepVar=s[1]),r=[this.fromVar.match(M),this.toVar.match(M)],this.fromNum=r[0],this.toNum=r[1],this.stepVar?this.stepNum=this.stepVar.match(M):void 0},t.prototype.compileNode=function(e){var t,n,i,s,r,o,a,c,h,l,u,p,d,f;return this.fromVar||this.compileVariables(e),e.index?(a=this.fromNum&&this.toNum,r=et(e,"index"),o=et(e,"name"),h=o&&o!==r,p=""+r+" = "+this.fromC,this.toC!==this.toVar&&(p+=", "+this.toC),this.step!==this.stepVar&&(p+=", "+this.step),d=[""+r+" <"+this.equals,""+r+" >"+this.equals],c=d[0],s=d[1],n=this.stepNum?+this.stepNum>0?""+c+" "+this.toVar:""+s+" "+this.toVar:a?(f=[+this.fromNum,+this.toNum],i=f[0],u=f[1],f,u>=i?""+c+" "+u:""+s+" "+u):(t=this.stepVar?""+this.stepVar+" > 0":""+this.fromVar+" <= "+this.toVar,""+t+" ? "+c+" "+this.toVar+" : "+s+" "+this.toVar),l=this.stepVar?""+r+" += "+this.stepVar:a?h?u>=i?"++"+r:"--"+r:u>=i?""+r+"++":""+r+"--":h?""+t+" ? ++"+r+" : --"+r:""+t+" ? "+r+"++ : "+r+"--",h&&(p=""+o+" = "+p),h&&(l=""+o+" = "+l),[this.makeCode(""+p+"; "+n+"; "+l)]):this.compileArray(e)},t.prototype.compileArray=function(e){var t,n,i,s,r,o,a,c,h,l,u,p,d;return this.fromNum&&this.toNum&&Math.abs(this.fromNum-this.toNum)<=20?(h=function(){d=[];for(var e=p=+this.fromNum,t=+this.toNum;t>=p?t>=e:e>=t;t>=p?e++:e--)d.push(e);return d}.apply(this),this.exclusive&&h.pop(),[this.makeCode("["+h.join(", ")+"]")]):(o=this.tab+H,r=e.scope.freeVariable("i"),l=e.scope.freeVariable("results"),c="\n"+o+l+" = [];",this.fromNum&&this.toNum?(e.index=r,n=st(this.compileNode(e))):(u=""+r+" = "+this.fromC+(this.toC!==this.toVar?", "+this.toC:""),i=""+this.fromVar+" <= "+this.toVar,n="var "+u+"; "+i+" ? "+r+" <"+this.equals+" "+this.toVar+" : "+r+" >"+this.equals+" "+this.toVar+"; "+i+" ? "+r+"++ : "+r+"--"),a="{ "+l+".push("+r+"); }\n"+o+"return "+l+";\n"+e.indent,s=function(e){return null!=e?e.contains(function(e){return e instanceof x&&"arguments"===e.value&&!e.asKey}):void 0},(s(this.from)||s(this.to))&&(t=", arguments"),[this.makeCode("(function() {"+c+"\n"+o+"for ("+n+")"+a+"}).apply(this"+(null!=t?t:"")+")")])},t}(s),e.Slice=P=function(e){function t(e){this.range=e,t.__super__.constructor.call(this)}return yt(t,e),t.prototype.children=["range"],t.prototype.compileNode=function(e){var t,n,i,s,r,o,a;return a=this.range,r=a.to,i=a.from,s=i&&i.compileToFragments(e,L)||[this.makeCode("0")],r&&(t=r.compileToFragments(e,L),n=st(t),(this.range.exclusive||-1!==+n)&&(o=", "+(this.range.exclusive?n:M.test(n)?""+(+n+1):(t=r.compileToFragments(e,w),"+"+st(t)+" + 1 || 9e9")))),[this.makeCode(".slice("+st(s)+(o||"")+")")]},t}(s),e.Obj=R=function(e){function t(e,t){this.generated=null!=t?t:!1,this.objects=this.properties=e||[]}return yt(t,e),t.prototype.children=["properties"],t.prototype.compileNode=function(e){var t,n,s,r,o,a,c,h,l,p,d,f,m;if(l=this.properties,!l.length)return[this.makeCode(this.front?"({})":"{}")];if(this.generated)for(p=0,f=l.length;f>p;p++)c=l[p],c instanceof K&&c.error("cannot have an implicit value in an implicit object");for(s=e.indent+=H,a=this.lastNonComment(this.properties),t=[],n=d=0,m=l.length;m>d;n=++d)h=l[n],o=n===l.length-1?"":h===a||h instanceof u?"\n":",\n",r=h instanceof u?"":s,h instanceof i&&h.variable instanceof K&&h.variable.hasProperties()&&h.variable.error("Invalid object key"),h instanceof K&&h["this"]&&(h=new i(h.properties[0].name,h,"object")),h instanceof u||(h instanceof i||(h=new i(h,h,"object")),(h.variable.base||h.variable).asKey=!0),r&&t.push(this.makeCode(r)),t.push.apply(t,h.compileToFragments(e,N)),o&&t.push(this.makeCode(o));return t.unshift(this.makeCode("{"+(l.length&&"\n"))),t.push(this.makeCode(""+(l.length&&"\n"+this.tab)+"}")),this.front?this.wrapInBraces(t):t},t.prototype.assigns=function(e){var t,n,i,s;for(s=this.properties,n=0,i=s.length;i>n;n++)if(t=s[n],t.assigns(e))return!0;return!1},t}(s),e.Arr=n=function(e){function t(e){this.objects=e||[]}return yt(t,e),t.prototype.children=["objects"],t.prototype.compileNode=function(e){var t,n,i,s,r,o,a;if(!this.objects.length)return[this.makeCode("[]")];if(e.indent+=H,t=U.compileSplattedArray(e,this.objects),t.length)return t;for(t=[],n=function(){var t,n,i,s;for(i=this.objects,s=[],t=0,n=i.length;n>t;t++)r=i[t],s.push(r.compileToFragments(e,C));return s}.call(this),s=o=0,a=n.length;a>o;s=++o)i=n[s],s&&t.push(this.makeCode(", ")),t.push.apply(t,i);return st(t).indexOf("\n")>=0?(t.unshift(this.makeCode("[\n"+e.indent)),t.push(this.makeCode("\n"+this.tab+"]"))):(t.unshift(this.makeCode("[")),t.push(this.makeCode("]"))),t},t.prototype.assigns=function(e){var t,n,i,s;for(s=this.objects,n=0,i=s.length;i>n;n++)if(t=s[n],t.assigns(e))return!0;return!1},t}(s),e.Class=a=function(e){function n(e,t,n){this.variable=e,this.parent=t,this.body=null!=n?n:new r,this.boundFuncs=[],this.body.classBody=!0}return yt(n,e),n.prototype.children=["variable","parent","body"],n.prototype.determineName=function(){var e,n;return this.variable?(e=(n=rt(this.variable.properties))?n instanceof t&&n.name.value:this.variable.base.value,vt.call(B,e)>=0&&this.variable.error("class variable name may not be "+e),e&&(e=m.test(e)&&e)):null},n.prototype.setContext=function(e){return this.body.traverseChildren(!1,function(t){return t.classBody?!1:t instanceof x&&"this"===t.value?t.value=e:t instanceof h&&(t.klass=e,t.bound)?t.context=e:void 0})},n.prototype.addBoundFunctions=function(e){var n,i,s,r,o;for(o=this.boundFuncs,s=0,r=o.length;r>s;s++)n=o[s],i=new K(new x("this"),[new t(n)]).compile(e),this.ctor.body.unshift(new x(""+i+" = "+dt("bind")+"("+i+", this)"))},n.prototype.addProperties=function(e,n,s){var r,o,a,c,l;return l=e.base.properties.slice(0),a=function(){var e;for(e=[];r=l.shift();)r instanceof i&&(o=r.variable.base,delete r.context,c=r.value,"constructor"===o.value?(this.ctor&&r.error("cannot define more than one constructor in a class"),c.bound&&r.error("cannot define a constructor as a bound function"),c instanceof h?r=this.ctor=c:(this.externalCtor=s.scope.freeVariable("class"),r=new i(new x(this.externalCtor),c))):r.variable["this"]?(c["static"]=!0,c.bound&&(c.context=n)):(r.variable=new K(new x(n),[new t(new x("prototype")),new t(o)]),c instanceof h&&c.bound&&(this.boundFuncs.push(o),c.bound=!1))),e.push(r);return e}.call(this),Q(a)},n.prototype.walkBody=function(e,t){var i=this;return this.traverseChildren(!1,function(s){var o,a,c,h,l,u,p;if(o=!0,s instanceof n)return!1;if(s instanceof r){for(p=a=s.expressions,c=l=0,u=p.length;u>l;c=++l)h=p[c],h instanceof K&&h.isObject(!0)&&(o=!1,a[c]=i.addProperties(h,e,t));s.expressions=a=it(a)}return o&&!(s instanceof n)})},n.prototype.hoistDirectivePrologue=function(){var e,t,n;for(t=0,e=this.body.expressions;(n=e[t])&&n instanceof u||n instanceof K&&n.isString();)++t;return this.directives=e.splice(0,t)},n.prototype.ensureConstructor=function(e,t){var n,s,r;return n=!this.ctor,this.ctor||(this.ctor=new h),this.ctor.ctor=this.ctor.name=e,this.ctor.klass=null,this.ctor.noReturn=!0,n?(this.parent&&(r=new x(""+e+".__super__.constructor.apply(this, arguments)")),this.externalCtor&&(r=new x(""+this.externalCtor+".apply(this, arguments)")),r&&(s=new x(t.scope.freeVariable("ref")),this.ctor.body.unshift(new i(s,r))),this.addBoundFunctions(t),r&&(this.ctor.body.push(s),this.ctor.body.makeReturn()),this.body.expressions.unshift(this.ctor)):this.addBoundFunctions(t)},n.prototype.compileNode=function(e){var t,n,s,r,o,a,l;return n=this.determineName(),o=n||"_Class",o.reserved&&(o="_"+o),r=new x(o),this.hoistDirectivePrologue(),this.setContext(o),this.walkBody(o,e),this.ensureConstructor(o,e),this.body.spaced=!0,this.ctor instanceof h||this.body.expressions.unshift(this.ctor),this.body.expressions.push(r),(l=this.body.expressions).unshift.apply(l,this.directives),t=c.wrap(this.body),this.parent&&(this.superClass=new x(e.scope.freeVariable("super",!1)),this.body.expressions.unshift(new d(r,this.superClass)),t.args.push(this.parent),a=t.variable.params||t.variable.base.params,a.push(new I(this.superClass))),s=new _(t,!0),this.variable&&(s=new i(this.variable,s)),s.compileToFragments(e)},n}(s),e.Assign=i=function(e){function n(e,t,n,i){var s,r,o;this.variable=e,this.value=t,this.context=n,this.param=i&&i.param,this.subpattern=i&&i.subpattern,o=r=this.variable.unwrapAll().value,s=vt.call(B,o)>=0,s&&"object"!==this.context&&this.variable.error('variable name may not be "'+r+'"')}return yt(n,e),n.prototype.children=["variable","value"],n.prototype.isStatement=function(e){return(null!=e?e.level:void 0)===N&&null!=this.context&&vt.call(this.context,"?")>=0},n.prototype.assigns=function(e){return this["object"===this.context?"value":"variable"].assigns(e)},n.prototype.unfoldSoak=function(e){return pt(e,this,"variable")},n.prototype.compileNode=function(e){var t,n,i,s,r,o,a,c,l,u,p;if(i=this.variable instanceof K){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(e);if(this.variable.isSplice())return this.compileSplice(e);if("||="===(c=this.context)||"&&="===c||"?="===c)return this.compileConditional(e)}return n=this.variable.compileToFragments(e,C),r=st(n),this.context||(a=this.variable.unwrapAll(),a.isAssignable()||this.variable.error('"'+this.variable.compile(e)+'" cannot be assigned'),("function"==typeof a.hasProperties?a.hasProperties():void 0)||(this.param?e.scope.add(r,"var"):e.scope.find(r))),this.value instanceof h&&(s=E.exec(r))&&(s[1]&&(this.value.klass=s[1]),this.value.name=null!=(l=null!=(u=null!=(p=s[2])?p:s[3])?u:s[4])?l:s[5]),o=this.value.compileToFragments(e,C),"object"===this.context?n.concat(this.makeCode(": "),o):(t=n.concat(this.makeCode(" "+(this.context||"=")+" "),o),e.level<=C?t:this.wrapInBraces(t))},n.prototype.compilePatternMatch=function(e){var i,s,r,o,a,c,h,l,u,p,d,f,b,k,g,y,w,T,L,E,D,S,R,A,I,O,j,M;if(y=e.level===N,T=this.value,d=this.variable.base.objects,!(f=d.length))return r=T.compileToFragments(e),e.level>=F?this.wrapInBraces(r):r;if(h=this.variable.isObject(),y&&1===f&&!((p=d[0])instanceof U))return p instanceof n?(R=p,A=R.variable,c=A.base,p=R.value):c=h?p["this"]?p.properties[0].name:p:new x(0),i=m.test(c.unwrap().value||0),T=new K(T),T.properties.push(new(i?t:v)(c)),I=p.unwrap().value,vt.call($,I)>=0&&p.error("assignment to a reserved word: "+p.compile(e)),new n(p,T,null,{param:this.param}).compileToFragments(e,N);for(L=T.compileToFragments(e,C),E=st(L),s=[],g=!1,(!m.test(E)||this.variable.assigns(E))&&(s.push([this.makeCode(""+(b=e.scope.freeVariable("ref"))+" = ")].concat(wt.call(L))),L=[this.makeCode(b)],E=b),a=D=0,S=d.length;S>D;a=++D)p=d[a],c=a,h&&(p instanceof n?(O=p,j=O.variable,c=j.base,p=O.value):p.base instanceof _?(M=new K(p.unwrapAll()).cacheReference(e),p=M[0],c=M[1]):c=p["this"]?p.properties[0].name:p),!g&&p instanceof U?(u=p.name.unwrap().value,p=p.unwrap(),w=""+f+" <= "+E+".length ? "+dt("slice")+".call("+E+", "+a,(k=f-a-1)?(l=e.scope.freeVariable("i"),w+=", "+l+" = "+E+".length - "+k+") : ("+l+" = "+a+", [])"):w+=") : []",w=new x(w),g=""+l+"++"):(u=p.unwrap().value,p instanceof U&&p.error("multiple splats are disallowed in an assignment"),"number"==typeof c?(c=new x(g||c),i=!1):i=h&&m.test(c.unwrap().value||0),w=new K(new x(E),[new(i?t:v)(c)])),null!=u&&vt.call($,u)>=0&&p.error("assignment to a reserved word: "+p.compile(e)),s.push(new n(p,w,null,{param:this.param,subpattern:!0}).compileToFragments(e,C));
11
- return y||this.subpattern||s.push(L),o=this.joinFragmentArrays(s,", "),e.level<C?o:this.wrapInBraces(o)},n.prototype.compileConditional=function(e){var t,i,s;return s=this.variable.cacheReference(e),t=s[0],i=s[1],!t.properties.length&&t.base instanceof x&&"this"!==t.base.value&&!e.scope.check(t.base.value)&&this.variable.error('the variable "'+t.base.value+"\" can't be assigned with "+this.context+" because it has not been declared before"),vt.call(this.context,"?")>=0&&(e.isExistentialEquals=!0),new A(this.context.slice(0,-1),t,new n(i,this.value,"=")).compileToFragments(e)},n.prototype.compileSplice=function(e){var t,n,i,s,r,o,a,c,h,l,u,p;return l=this.variable.properties.pop().range,i=l.from,a=l.to,n=l.exclusive,o=this.variable.compile(e),i?(u=this.cacheToCodeFragments(i.cache(e,F)),s=u[0],r=u[1]):s=r="0",a?(null!=i?i.isSimpleNumber():void 0)&&a.isSimpleNumber()?(a=+a.compile(e)-+r,n||(a+=1)):(a=a.compile(e,w)+" - "+r,n||(a+=" + 1")):a="9e9",p=this.value.cache(e,C),c=p[0],h=p[1],t=[].concat(this.makeCode("[].splice.apply("+o+", ["+s+", "+a+"].concat("),c,this.makeCode(")), "),h),e.level>N?this.wrapInBraces(t):t},n}(s),e.Code=h=function(e){function t(e,t,n){this.params=e||[],this.body=t||new r,this.bound="boundfunc"===n,this.bound&&(this.context="_this")}return yt(t,e),t.prototype.children=["params","body"],t.prototype.isStatement=function(){return!!this.ctor},t.prototype.jumps=S,t.prototype.compileNode=function(e){var t,s,r,o,a,c,h,l,u,p,d,f,m,b,k,y,v,T,C,F,L,N,E,D,S,R,I,_,$;for(e.scope=new V(e.scope,this.body,this),e.scope.shared=et(e,"sharedScope"),e.indent+=H,delete e.bare,delete e.isExistentialEquals,u=[],r=[],this.eachParamName(function(t){return e.scope.check(t)?void 0:e.scope.parameter(t)}),S=this.params,k=0,C=S.length;C>k;k++)if(l=S[k],l.splat){for(R=this.params,y=0,F=R.length;F>y;y++)h=R[y].name,h["this"]&&(h=h.properties[0].name),h.value&&e.scope.add(h.value,"var",!0);d=new i(new K(new n(function(){var t,n,i,s;for(i=this.params,s=[],t=0,n=i.length;n>t;t++)h=i[t],s.push(h.asReference(e));return s}.call(this))),new K(new x("arguments")));break}for(I=this.params,v=0,L=I.length;L>v;v++)l=I[v],l.isComplex()?(m=p=l.asReference(e),l.value&&(m=new A("?",p,l.value)),r.push(new i(new K(l.name),m,"=",{param:!0}))):(p=l,l.value&&(c=new x(p.name.value+" == null"),m=new i(new K(l.name),l.value,"="),r.push(new g(c,m)))),d||u.push(p);for(b=this.body.isEmpty(),d&&r.unshift(d),r.length&&(_=this.body.expressions).unshift.apply(_,r),o=T=0,N=u.length;N>T;o=++T)h=u[o],u[o]=h.compileToFragments(e),e.scope.parameter(st(u[o]));for(f=[],this.eachParamName(function(e,t){return vt.call(f,e)>=0&&t.error("multiple parameters named '"+e+"'"),f.push(e)}),b||this.noReturn||this.body.makeReturn(),this.bound&&((null!=($=e.scope.parent.method)?$.bound:void 0)?this.bound=this.context=e.scope.parent.method.context:this["static"]||e.scope.parent.assign("_this","this")),a=e.indent,s="function",this.ctor&&(s+=" "+this.name),s+="(",t=[this.makeCode(s)],o=D=0,E=u.length;E>D;o=++D)h=u[o],o&&t.push(this.makeCode(", ")),t.push.apply(t,h);return t.push(this.makeCode(") {")),this.body.isEmpty()||(t=t.concat(this.makeCode("\n"),this.body.compileWithDeclarations(e),this.makeCode("\n"+this.tab))),t.push(this.makeCode("}")),this.ctor?[this.makeCode(this.tab)].concat(wt.call(t)):this.front||e.level>=w?this.wrapInBraces(t):t},t.prototype.eachParamName=function(e){var t,n,i,s,r;for(s=this.params,r=[],n=0,i=s.length;i>n;n++)t=s[n],r.push(t.eachName(e));return r},t.prototype.traverseChildren=function(e,n){return e?t.__super__.traverseChildren.call(this,e,n):void 0},t}(s),e.Param=I=function(e){function t(e,t,n){var i;this.name=e,this.value=t,this.splat=n,i=e=this.name.unwrapAll().value,vt.call(B,i)>=0&&this.name.error('parameter name "'+e+'" is not allowed')}return yt(t,e),t.prototype.children=["name","value"],t.prototype.compileToFragments=function(e){return this.name.compileToFragments(e,C)},t.prototype.asReference=function(e){var t;return this.reference?this.reference:(t=this.name,t["this"]?(t=t.properties[0].name,t.value.reserved&&(t=new x(e.scope.freeVariable(t.value)))):t.isComplex()&&(t=new x(e.scope.freeVariable("arg"))),t=new K(t),this.splat&&(t=new U(t)),this.reference=t)},t.prototype.isComplex=function(){return this.name.isComplex()},t.prototype.eachName=function(e,t){var n,s,r,o,a,c;if(null==t&&(t=this.name),n=function(t){var n;return n=t.properties[0].name,n.value.reserved?void 0:e(n.value,n)},t instanceof x)return e(t.value,t);if(t instanceof K)return n(t);for(c=t.objects,o=0,a=c.length;a>o;o++)r=c[o],r instanceof i?this.eachName(e,r.value.unwrap()):r instanceof U?(s=r.name.unwrap(),e(s.value,s)):r instanceof K?r.isArray()||r.isObject()?this.eachName(e,r.base):r["this"]?n(r):e(r.base.value,r.base):r.error("illegal parameter "+r.compile())},t}(s),e.Splat=U=function(e){function t(e){this.name=e.compile?e:new x(e)}return yt(t,e),t.prototype.children=["name"],t.prototype.isAssignable=J,t.prototype.assigns=function(e){return this.name.assigns(e)},t.prototype.compileToFragments=function(e){return this.name.compileToFragments(e)},t.prototype.unwrap=function(){return this.name},t.compileSplattedArray=function(e,n,i){var s,r,o,a,c,h,l,u,p,d;for(l=-1;(u=n[++l])&&!(u instanceof t););if(l>=n.length)return[];if(1===n.length)return u=n[0],c=u.compileToFragments(e,C),i?c:[].concat(u.makeCode(""+dt("slice")+".call("),c,u.makeCode(")"));for(s=n.slice(l),h=p=0,d=s.length;d>p;h=++p)u=s[h],o=u.compileToFragments(e,C),s[h]=u instanceof t?[].concat(u.makeCode(""+dt("slice")+".call("),o,u.makeCode(")")):[].concat(u.makeCode("["),o,u.makeCode("]"));return 0===l?(u=n[0],a=u.joinFragmentArrays(s.slice(1),", "),s[0].concat(u.makeCode(".concat("),a,u.makeCode(")"))):(r=function(){var t,i,s,r;for(s=n.slice(0,l),r=[],t=0,i=s.length;i>t;t++)u=s[t],r.push(u.compileToFragments(e,C));return r}(),r=n[0].joinFragmentArrays(r,", "),a=n[l].joinFragmentArrays(s,", "),[].concat(n[0].makeCode("["),r,n[l].makeCode("].concat("),a,rt(n).makeCode(")")))},t}(s),e.While=z=function(e){function t(e,t){this.condition=(null!=t?t.invert:void 0)?e.invert():e,this.guard=null!=t?t.guard:void 0}return yt(t,e),t.prototype.children=["condition","guard","body"],t.prototype.isStatement=J,t.prototype.makeReturn=function(e){return e?t.__super__.makeReturn.apply(this,arguments):(this.returns=!this.jumps({loop:!0}),this)},t.prototype.addBody=function(e){return this.body=e,this},t.prototype.jumps=function(){var e,t,n,i;if(e=this.body.expressions,!e.length)return!1;for(n=0,i=e.length;i>n;n++)if(t=e[n],t.jumps({loop:!0}))return t;return!1},t.prototype.compileNode=function(e){var t,n,i,s;return e.indent+=H,s="",n=this.body,n.isEmpty()?n=this.makeCode(""):(this.returns&&(n.makeReturn(i=e.scope.freeVariable("results")),s=""+this.tab+i+" = [];\n"),this.guard&&(n.expressions.length>1?n.expressions.unshift(new g(new _(this.guard).invert(),new x("continue"))):this.guard&&(n=r.wrap([new g(this.guard,n)]))),n=[].concat(this.makeCode("\n"),n.compileToFragments(e,N),this.makeCode("\n"+this.tab))),t=[].concat(this.makeCode(s+this.tab+"while ("),this.condition.compileToFragments(e,L),this.makeCode(") {"),n,this.makeCode("}")),this.returns&&t.push(this.makeCode("\n"+this.tab+"return "+i+";")),t},t}(s),e.Op=A=function(e){function t(e,t,i,s){if("in"===e)return new y(t,i);if("do"===e)return this.generateDo(t);if("new"===e){if(t instanceof o&&!t["do"]&&!t.isNew)return t.newInstance();(t instanceof h&&t.bound||t["do"])&&(t=new _(t))}return this.operator=n[e]||e,this.first=t,this.second=i,this.flip=!!s,this}var n,s;return yt(t,e),n={"==":"===","!=":"!==",of:"in"},s={"!==":"===","===":"!=="},t.prototype.children=["first","second"],t.prototype.isSimpleNumber=S,t.prototype.isUnary=function(){return!this.second},t.prototype.isComplex=function(){var e;return!(this.isUnary()&&("+"===(e=this.operator)||"-"===e))||this.first.isComplex()},t.prototype.isChainable=function(){var e;return"<"===(e=this.operator)||">"===e||">="===e||"<="===e||"==="===e||"!=="===e},t.prototype.invert=function(){var e,n,i,r,o;if(this.isChainable()&&this.first.isChainable()){for(e=!0,n=this;n&&n.operator;)e&&(e=n.operator in s),n=n.first;if(!e)return new _(this).invert();for(n=this;n&&n.operator;)n.invert=!n.invert,n.operator=s[n.operator],n=n.first;return this}return(r=s[this.operator])?(this.operator=r,this.first.unwrap()instanceof t&&this.first.invert(),this):this.second?new _(this).invert():"!"===this.operator&&(i=this.first.unwrap())instanceof t&&("!"===(o=i.operator)||"in"===o||"instanceof"===o)?i:new t("!",this)},t.prototype.unfoldSoak=function(e){var t;return("++"===(t=this.operator)||"--"===t||"delete"===t)&&pt(e,this,"first")},t.prototype.generateDo=function(e){var t,n,s,r,a,c,l,u;for(r=[],n=e instanceof i&&(a=e.value.unwrap())instanceof h?a:e,u=n.params||[],c=0,l=u.length;l>c;c++)s=u[c],s.value?(r.push(s.value),delete s.value):r.push(s);return t=new o(e,r),t["do"]=!0,t},t.prototype.compileNode=function(e){var t,n,i,s;return n=this.isChainable()&&this.first.isChainable(),n||(this.first.front=this.front),"delete"===this.operator&&e.scope.check(this.first.unwrapAll().value)&&this.error("delete operand may not be argument or var"),("--"===(i=this.operator)||"++"===i)&&(s=this.first.unwrapAll().value,vt.call(B,s)>=0)&&this.error('cannot increment/decrement "'+this.first.unwrapAll().value+'"'),this.isUnary()?this.compileUnary(e):n?this.compileChain(e):"?"===this.operator?this.compileExistence(e):(t=[].concat(this.first.compileToFragments(e,F),this.makeCode(" "+this.operator+" "),this.second.compileToFragments(e,F)),e.level<=F?t:this.wrapInBraces(t))},t.prototype.compileChain=function(e){var t,n,i,s;return s=this.first.second.cache(e),this.first.second=s[0],i=s[1],n=this.first.compileToFragments(e,F),t=n.concat(this.makeCode(" "+(this.invert?"&&":"||")+" "),i.compileToFragments(e),this.makeCode(" "+this.operator+" "),this.second.compileToFragments(e,F)),this.wrapInBraces(t)},t.prototype.compileExistence=function(e){var t,n;return!e.isExistentialEquals&&this.first.isComplex()?(n=new x(e.scope.freeVariable("ref")),t=new _(new i(n,this.first))):(t=this.first,n=t),new g(new p(t),n,{type:"if"}).addElse(this.second).compileToFragments(e)},t.prototype.compileUnary=function(e){var n,i,s;return i=[],n=this.operator,i.push([this.makeCode(n)]),"!"===n&&this.first instanceof p?(this.first.negated=!this.first.negated,this.first.compileToFragments(e)):e.level>=w?new _(this).compileToFragments(e):(s="+"===n||"-"===n,("new"===n||"typeof"===n||"delete"===n||s&&this.first instanceof t&&this.first.operator===n)&&i.push([this.makeCode(" ")]),(s&&this.first instanceof t||"new"===n&&this.first.isStatement(e))&&(this.first=new _(this.first)),i.push(this.first.compileToFragments(e,F)),this.flip&&i.reverse(),this.joinFragmentArrays(i,""))},t.prototype.toString=function(e){return t.__super__.toString.call(this,e,this.constructor.name+" "+this.operator)},t}(s),e.In=y=function(e){function t(e,t){this.object=e,this.array=t}return yt(t,e),t.prototype.children=["object","array"],t.prototype.invert=D,t.prototype.compileNode=function(e){var t,n,i,s,r;if(this.array instanceof K&&this.array.isArray()){for(r=this.array.base.objects,i=0,s=r.length;s>i;i++)if(n=r[i],n instanceof U){t=!0;break}if(!t)return this.compileOrTest(e)}return this.compileLoopTest(e)},t.prototype.compileOrTest=function(e){var t,n,i,s,r,o,a,c,h,l,u,p;if(0===this.array.base.objects.length)return[this.makeCode(""+!!this.negated)];for(l=this.object.cache(e,F),o=l[0],r=l[1],u=this.negated?[" !== "," && "]:[" === "," || "],t=u[0],n=u[1],a=[],p=this.array.base.objects,i=c=0,h=p.length;h>c;i=++c)s=p[i],i&&a.push(this.makeCode(n)),a=a.concat(i?r:o,this.makeCode(t),s.compileToFragments(e,w));return e.level<F?a:this.wrapInBraces(a)},t.prototype.compileLoopTest=function(e){var t,n,i,s;return s=this.object.cache(e,C),i=s[0],n=s[1],t=[].concat(this.makeCode(dt("indexOf")+".call("),this.array.compileToFragments(e,C),this.makeCode(", "),n,this.makeCode(") "+(this.negated?"< 0":">= 0"))),st(i)===st(n)?t:(t=i.concat(this.makeCode(", "),t),e.level<C?t:this.wrapInBraces(t))},t.prototype.toString=function(e){return t.__super__.toString.call(this,e,this.constructor.name+(this.negated?"!":""))},t}(s),e.Try=X=function(e){function t(e,t,n,i){this.attempt=e,this.errorVariable=t,this.recovery=n,this.ensure=i}return yt(t,e),t.prototype.children=["attempt","recovery","ensure"],t.prototype.isStatement=J,t.prototype.jumps=function(e){var t;return this.attempt.jumps(e)||(null!=(t=this.recovery)?t.jumps(e):void 0)},t.prototype.makeReturn=function(e){return this.attempt&&(this.attempt=this.attempt.makeReturn(e)),this.recovery&&(this.recovery=this.recovery.makeReturn(e)),this},t.prototype.compileNode=function(e){var t,n,s,r;return e.indent+=H,r=this.attempt.compileToFragments(e,N),t=this.recovery?(s=new x("_error"),this.errorVariable?this.recovery.unshift(new i(this.errorVariable,s)):void 0,[].concat(this.makeCode(" catch ("),s.compileToFragments(e),this.makeCode(") {\n"),this.recovery.compileToFragments(e,N),this.makeCode("\n"+this.tab+"}"))):this.ensure||this.recovery?[]:[this.makeCode(" catch (_error) {}")],n=this.ensure?[].concat(this.makeCode(" finally {\n"),this.ensure.compileToFragments(e,N),this.makeCode("\n"+this.tab+"}")):[],[].concat(this.makeCode(""+this.tab+"try {\n"),r,this.makeCode("\n"+this.tab+"}"),t,n)},t}(s),e.Throw=W=function(e){function t(e){this.expression=e}return yt(t,e),t.prototype.children=["expression"],t.prototype.isStatement=J,t.prototype.jumps=S,t.prototype.makeReturn=G,t.prototype.compileNode=function(e){return[].concat(this.makeCode(this.tab+"throw "),this.expression.compileToFragments(e),this.makeCode(";"))},t}(s),e.Existence=p=function(e){function t(e){this.expression=e}return yt(t,e),t.prototype.children=["expression"],t.prototype.invert=D,t.prototype.compileNode=function(e){var t,n,i,s;return this.expression.front=this.front,i=this.expression.compile(e,F),m.test(i)&&!e.scope.check(i)?(s=this.negated?["===","||"]:["!==","&&"],t=s[0],n=s[1],i="typeof "+i+" "+t+' "undefined" '+n+" "+i+" "+t+" null"):i=""+i+" "+(this.negated?"==":"!=")+" null",[this.makeCode(e.level<=T?i:"("+i+")")]},t}(s),e.Parens=_=function(e){function t(e){this.body=e}return yt(t,e),t.prototype.children=["body"],t.prototype.unwrap=function(){return this.body},t.prototype.isComplex=function(){return this.body.isComplex()},t.prototype.compileNode=function(e){var t,n,i;return n=this.body.unwrap(),n instanceof K&&n.isAtomic()?(n.front=this.front,n.compileToFragments(e)):(i=n.compileToFragments(e,L),t=e.level<F&&(n instanceof A||n instanceof o||n instanceof f&&n.returns),t?i:this.wrapInBraces(i))},t}(s),e.For=f=function(e){function t(e,t){var n;this.source=t.source,this.guard=t.guard,this.step=t.step,this.name=t.name,this.index=t.index,this.body=r.wrap([e]),this.own=!!t.own,this.object=!!t.object,this.object&&(n=[this.index,this.name],this.name=n[0],this.index=n[1]),this.index instanceof K&&this.index.error("index cannot be a pattern matching expression"),this.range=this.source instanceof K&&this.source.base instanceof O&&!this.source.properties.length,this.pattern=this.name instanceof K,this.range&&this.index&&this.index.error("indexes do not apply to range loops"),this.range&&this.pattern&&this.name.error("cannot pattern match over range loops"),this.own&&!this.object&&this.index.error("cannot use own with for-in"),this.returns=!1}return yt(t,e),t.prototype.children=["body","source","guard","step"],t.prototype.compileNode=function(e){var t,n,s,o,a,c,h,l,u,p,d,f,b,k,y,v,w,T,F,L,E,D,S,R,A,I,$,O,B,V,P,U,q,G;return t=r.wrap([this.body]),T=null!=(q=rt(t.expressions))?q.jumps():void 0,T&&T instanceof j&&(this.returns=!1),$=this.range?this.source.base:this.source,I=e.scope,L=this.name&&this.name.compile(e,C),k=this.index&&this.index.compile(e,C),L&&!this.pattern&&I.find(L),k&&I.find(k),this.returns&&(A=I.freeVariable("results")),y=this.object&&k||I.freeVariable("i"),v=this.range&&L||k||y,w=v!==y?""+v+" = ":"",this.step&&!this.range&&(G=this.cacheToCodeFragments(this.step.cache(e,C)),O=G[0],V=G[1],B=V.match(M)),this.pattern&&(L=y),U="",d="",h="",f=this.tab+H,this.range?p=$.compileToFragments(at(e,{index:y,name:L,step:this.step})):(P=this.source.compile(e,C),!L&&!this.own||m.test(P)||(h+=""+this.tab+(D=I.freeVariable("ref"))+" = "+P+";\n",P=D),L&&!this.pattern&&(E=""+L+" = "+P+"["+v+"]"),this.object||(O!==V&&(h+=""+this.tab+O+";\n"),this.step&&B&&(u=0>+B)||(F=I.freeVariable("len")),a=""+w+y+" = 0, "+F+" = "+P+".length",c=""+w+y+" = "+P+".length - 1",s=""+y+" < "+F,o=""+y+" >= 0",this.step?(B?u&&(s=o,a=c):(s=""+V+" > 0 ? "+s+" : "+o,a="("+V+" > 0 ? ("+a+") : "+c+")"),b=""+y+" += "+V):b=""+(v!==y?"++"+y:""+y+"++"),p=[this.makeCode(""+a+"; "+s+"; "+w+b)])),this.returns&&(S=""+this.tab+A+" = [];\n",R="\n"+this.tab+"return "+A+";",t.makeReturn(A)),this.guard&&(t.expressions.length>1?t.expressions.unshift(new g(new _(this.guard).invert(),new x("continue"))):this.guard&&(t=r.wrap([new g(this.guard,t)]))),this.pattern&&t.expressions.unshift(new i(this.name,new x(""+P+"["+v+"]"))),l=[].concat(this.makeCode(h),this.pluckDirectCall(e,t)),E&&(U="\n"+f+E+";"),this.object&&(p=[this.makeCode(""+v+" in "+P)],this.own&&(d="\n"+f+"if (!"+dt("hasProp")+".call("+P+", "+v+")) continue;")),n=t.compileToFragments(at(e,{indent:f}),N),n&&n.length>0&&(n=[].concat(this.makeCode("\n"),n,this.makeCode("\n"))),[].concat(l,this.makeCode(""+(S||"")+this.tab+"for ("),p,this.makeCode(") {"+d+U),n,this.makeCode(""+this.tab+"}"+(R||"")))},t.prototype.pluckDirectCall=function(e,t){var n,s,r,a,c,l,u,p,d,f,m,b,k,g,y;for(s=[],f=t.expressions,c=p=0,d=f.length;d>p;c=++p)r=f[c],r=r.unwrapAll(),r instanceof o&&(u=r.variable.unwrapAll(),(u instanceof h||u instanceof K&&(null!=(m=u.base)?m.unwrapAll():void 0)instanceof h&&1===u.properties.length&&("call"===(b=null!=(k=u.properties[0].name)?k.value:void 0)||"apply"===b))&&(a=(null!=(g=u.base)?g.unwrapAll():void 0)||u,l=new x(e.scope.freeVariable("fn")),n=new K(l),u.base&&(y=[n,u],u.base=y[0],n=y[1]),t.expressions[c]=new o(n,r.args),s=s.concat(this.makeCode(this.tab),new i(l,a).compileToFragments(e,N),this.makeCode(";\n"))));return s},t}(z),e.Switch=q=function(e){function t(e,t,n){this.subject=e,this.cases=t,this.otherwise=n}return yt(t,e),t.prototype.children=["subject","cases","otherwise"],t.prototype.isStatement=J,t.prototype.jumps=function(e){var t,n,i,s,r,o,a;for(null==e&&(e={block:!0}),r=this.cases,i=0,s=r.length;s>i;i++)if(o=r[i],n=o[0],t=o[1],t.jumps(e))return t;return null!=(a=this.otherwise)?a.jumps(e):void 0},t.prototype.makeReturn=function(e){var t,n,i,s,o;for(s=this.cases,n=0,i=s.length;i>n;n++)t=s[n],t[1].makeReturn(e);return e&&(this.otherwise||(this.otherwise=new r([new x("void 0")]))),null!=(o=this.otherwise)&&o.makeReturn(e),this},t.prototype.compileNode=function(e){var t,n,i,s,r,o,a,c,h,l,u,p,d,f,m,b;for(c=e.indent+H,h=e.indent=c+H,o=[].concat(this.makeCode(this.tab+"switch ("),this.subject?this.subject.compileToFragments(e,L):this.makeCode("false"),this.makeCode(") {\n")),f=this.cases,a=l=0,p=f.length;p>l;a=++l){for(m=f[a],s=m[0],t=m[1],b=it([s]),u=0,d=b.length;d>u;u++)i=b[u],this.subject||(i=i.invert()),o=o.concat(this.makeCode(c+"case "),i.compileToFragments(e,L),this.makeCode(":\n"));if((n=t.compileToFragments(e,N)).length>0&&(o=o.concat(n,this.makeCode("\n"))),a===this.cases.length-1&&!this.otherwise)break;r=this.lastNonComment(t.expressions),r instanceof j||r instanceof x&&r.jumps()&&"debugger"!==r.value||o.push(i.makeCode(h+"break;\n"))}return this.otherwise&&this.otherwise.expressions.length&&o.push.apply(o,[this.makeCode(c+"default:\n")].concat(wt.call(this.otherwise.compileToFragments(e,N)),[this.makeCode("\n")])),o.push(this.makeCode(this.tab+"}")),o},t}(s),e.If=g=function(e){function t(e,t,n){this.body=t,null==n&&(n={}),this.condition="unless"===n.type?e.invert():e,this.elseBody=null,this.isChain=!1,this.soak=n.soak}return yt(t,e),t.prototype.children=["condition","body","elseBody"],t.prototype.bodyNode=function(){var e;return null!=(e=this.body)?e.unwrap():void 0},t.prototype.elseBodyNode=function(){var e;return null!=(e=this.elseBody)?e.unwrap():void 0},t.prototype.addElse=function(e){return this.isChain?this.elseBodyNode().addElse(e):(this.isChain=e instanceof t,this.elseBody=this.ensureBlock(e)),this},t.prototype.isStatement=function(e){var t;return(null!=e?e.level:void 0)===N||this.bodyNode().isStatement(e)||(null!=(t=this.elseBodyNode())?t.isStatement(e):void 0)},t.prototype.jumps=function(e){var t;return this.body.jumps(e)||(null!=(t=this.elseBody)?t.jumps(e):void 0)},t.prototype.compileNode=function(e){return this.isStatement(e)?this.compileStatement(e):this.compileExpression(e)},t.prototype.makeReturn=function(e){return e&&(this.elseBody||(this.elseBody=new r([new x("void 0")]))),this.body&&(this.body=new r([this.body.makeReturn(e)])),this.elseBody&&(this.elseBody=new r([this.elseBody.makeReturn(e)])),this},t.prototype.ensureBlock=function(e){return e instanceof r?e:new r([e])},t.prototype.compileStatement=function(e){var n,i,s,r,o,a,c;return s=et(e,"chainChild"),(o=et(e,"isExistentialEquals"))?new t(this.condition.invert(),this.elseBodyNode(),{type:"if"}).compileToFragments(e):(c=e.indent+H,r=this.condition.compileToFragments(e,L),i=this.ensureBlock(this.body).compileToFragments(at(e,{indent:c})),a=[].concat(this.makeCode("if ("),r,this.makeCode(") {\n"),i,this.makeCode("\n"+this.tab+"}")),s||a.unshift(this.makeCode(this.tab)),this.elseBody?(n=a.concat(this.makeCode(" else ")),this.isChain?(e.chainChild=!0,n=n.concat(this.elseBody.unwrap().compileToFragments(e,N))):n=n.concat(this.makeCode("{\n"),this.elseBody.compileToFragments(at(e,{indent:c}),N),this.makeCode("\n"+this.tab+"}")),n):a)},t.prototype.compileExpression=function(e){var t,n,i,s;return i=this.condition.compileToFragments(e,T),n=this.bodyNode().compileToFragments(e,C),t=this.elseBodyNode()?this.elseBodyNode().compileToFragments(e,C):[this.makeCode("void 0")],s=i.concat(this.makeCode(" ? "),n,this.makeCode(" : "),t),e.level>=T?this.wrapInBraces(s):s},t.prototype.unfoldSoak=function(){return this.soak&&this},t}(s),c={wrap:function(e,n,i){var s,a,c,l,u;return e.jumps()?e:(l=new h([],r.wrap([e])),s=[],a=e.contains(this.isLiteralArguments),a&&e.classBody&&a.error("Class bodies shouldn't reference arguments"),(a||e.contains(this.isLiteralThis))&&(u=new x(a?"apply":"call"),s=[new x("this")],a&&s.push(new x("arguments")),l=new K(l,[new t(u)])),l.noReturn=i,c=new o(l,s),n?r.wrap([c]):c)},isLiteralArguments:function(e){return e instanceof x&&"arguments"===e.value&&!e.asKey},isLiteralThis:function(e){return e instanceof x&&"this"===e.value&&!e.asKey||e instanceof h&&e.bound||e instanceof o&&e.isSuper}},pt=function(e,t,n){var i;if(i=t[n].unfoldSoak(e))return t[n]=i.body,i.body=new K(t),i},Y={"extends":function(){return"function(child, parent) { for (var key in parent) { if ("+dt("hasProp")+".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"},bind:function(){return"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }"},indexOf:function(){return"[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"},hasProp:function(){return"{}.hasOwnProperty"},slice:function(){return"[].slice"}},N=1,L=2,C=3,T=4,F=5,w=6,H=" ",b="[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*",m=RegExp("^"+b+"$"),M=/^[+-]?\d+$/,E=RegExp("^(?:("+b+")\\.prototype(?:\\.("+b+")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|("+b+")$"),k=/^['"]/,dt=function(e){var t;return t="__"+e,V.root.assign(t,Y[e]()),t},ct=function(e,t){return e=e.replace(/\n/g,"$&"+t),e.replace(/\s+$/,"")}}.call(this),t.exports}(),require["./sourcemap"]=function(){var e={},t={exports:e};return function(){var e,n;e=function(){function e(e){this.line=e,this.columns=[]}return e.prototype.add=function(e,t,n){var i,s;return s=t[0],i=t[1],null==n&&(n={}),this.columns[e]&&n.noReplace?void 0:this.columns[e]={line:this.line,column:e,sourceLine:s,sourceColumn:i}},e.prototype.sourceLocation=function(e){for(var t;!((t=this.columns[e])||0>=e);)e--;return t&&[t.sourceLine,t.sourceColumn]},e}(),n=function(){function t(){this.lines=[]}var n,i,s,r;return t.prototype.add=function(t,n,i){var s,r,o,a;return null==i&&(i={}),r=n[0],s=n[1],o=(a=this.lines)[r]||(a[r]=new e(r)),o.add(s,t,i)},t.prototype.sourceLocation=function(e){var t,n,i;for(n=e[0],t=e[1];!((i=this.lines[n])||0>=n);)n--;return i&&i.sourceLocation(t)},t.prototype.generate=function(e,t){var n,i,s,r,o,a,c,h,l,u,p,d,f,m,b,k;for(null==e&&(e={}),null==t&&(t=null),u=0,i=0,r=0,s=0,h=!1,n="",b=this.lines,a=p=0,f=b.length;f>p;a=++p)if(o=b[a])for(k=o.columns,d=0,m=k.length;m>d;d++)if(c=k[d]){for(;u<c.line;)i=0,h=!1,n+=";",u++;h&&(n+=",",h=!1),n+=this.encodeVlq(c.column-i),i=c.column,n+=this.encodeVlq(0),n+=this.encodeVlq(c.sourceLine-r),r=c.sourceLine,n+=this.encodeVlq(c.sourceColumn-s),s=c.sourceColumn,h=!0}return l={version:3,file:e.generatedFile||"",sourceRoot:e.sourceRoot||"",sources:e.sourceFiles||[""],names:[],mappings:n},e.inline&&(l.sourcesContent=[t]),JSON.stringify(l,null,2)},s=5,i=1<<s,r=i-1,t.prototype.encodeVlq=function(e){var t,n,o,a;for(t="",o=0>e?1:0,a=(Math.abs(e)<<1)+o;a||!t;)n=a&r,a>>=s,a&&(n|=i),t+=this.encodeBase64(n);return t},n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t.prototype.encodeBase64=function(e){return n[e]||function(){throw new Error("Cannot Base64 encode value: "+e)}()},t}(),t.exports=n}.call(this),t.exports}(),require["./coffee-script"]=function(){var e={},t={exports:e};return function(){var t,n,i,s,r,o,a,c,h,l,u,p,d,f,m,b,k,g,y,v,w,T,C={}.hasOwnProperty;if(l=require("fs"),y=require("vm"),k=require("path"),s=require("child_process"),t=require("./lexer").Lexer,f=require("./parser").parser,u=require("./helpers"),i=require("./sourcemap"),e.VERSION="1.6.3",e.helpers=u,e.compile=r=function(e,t){var n,s,r,o,a,c,h,l,d,m,b,k;for(null==t&&(t={}),d=u.merge,t.sourceMap&&(l=new i),a=f.parse(p.tokenize(e,t)).compileToFragments(t),r=0,t.header&&(r+=1),t.shiftLine&&(r+=1),s=0,h="",b=0,k=a.length;k>b;b++)o=a[b],t.sourceMap&&(o.locationData&&l.add([o.locationData.first_line,o.locationData.first_column],[r,s],{noReplace:!0}),m=u.count(o.code,"\n"),r+=m,s=o.code.length-(m?o.code.lastIndexOf("\n"):0)),h+=o.code;return t.header&&(c="Generated by CoffeeScript "+this.VERSION,h="// "+c+"\n"+h),t.sourceMap?(n={js:h},n.sourceMap=l,n.v3SourceMap=l.generate(t,e),n):h},e.tokens=function(e,t){return p.tokenize(e,t)},e.nodes=function(e,t){return"string"==typeof e?f.parse(p.tokenize(e,t)):f.parse(e)},e.run=function(e,t){var n,i;return null==t&&(t={}),i=require.main,null==t.sourceMap&&(t.sourceMap=!0),i.filename=process.argv[1]=t.filename?l.realpathSync(t.filename):".",i.moduleCache&&(i.moduleCache={}),i.paths=require("module")._nodeModulePaths(k.dirname(l.realpathSync(t.filename||"."))),!u.isCoffee(i.filename)||require.extensions?(n=r(e,t),m(),g[i.filename]=n.sourceMap,i._compile(n.js,i.filename)):i._compile(e,i.filename)},e.eval=function(e,t){var n,i,s,o,a,c,h,l,u,p,d,f,m,b;if(null==t&&(t={}),e=e.trim()){if(i=y.Script){if(null!=t.sandbox){if(t.sandbox instanceof i.createContext().constructor)h=t.sandbox;else{h=i.createContext(),f=t.sandbox;for(o in f)C.call(f,o)&&(l=f[o],h[o]=l)}h.global=h.root=h.GLOBAL=h}else h=global;if(h.__filename=t.filename||"eval",h.__dirname=k.dirname(h.__filename),h===global&&!h.module&&!h.require){for(n=require("module"),h.module=d=new n(t.modulename||"eval"),h.require=b=function(e){return n._load(e,d,!0)},d.filename=h.__filename,m=Object.getOwnPropertyNames(require),u=0,p=m.length;p>u;u++)c=m[u],"paths"!==c&&(b[c]=require[c]);b.paths=d.paths=n._nodeModulePaths(process.cwd()),b.resolve=function(e){return n._resolveFilename(e,d)}}}a={};for(o in t)C.call(t,o)&&(l=t[o],a[o]=l);return a.bare=!0,s=r(e,a),h===global?y.runInThisContext(s):y.runInContext(s,h)}},d=function(e,t){var n,i,s;return i=l.readFileSync(t,"utf8"),s=65279===i.charCodeAt(0)?i.substring(1):i,n=r(s,{filename:t,sourceMap:!0,literate:u.isLiterate(t)}),g[t]=n.sourceMap,e._compile(n.js,t)},require.extensions){for(T=[".coffee",".litcoffee",".coffee.md"],v=0,w=T.length;w>v;v++)o=T[v],require.extensions[o]=d;n=require("module"),a=function(e){var t,i;for(i=k.basename(e).split("."),""===i[0]&&i.shift();i.shift();)if(t="."+i.join("."),n._extensions[t])return t;return".js"},n.prototype.load=function(e){var t;return this.filename=e,this.paths=n._nodeModulePaths(k.dirname(e)),t=a(e),n._extensions[t](this,e),this.loaded=!0}}s&&(c=s.fork,s.fork=function(e,t,n){var i;return null==t&&(t=[]),null==n&&(n={}),i=u.isCoffee(e)?"coffee":null,Array.isArray(t)||(t=[],n=t||{}),n.execPath||(n.execPath=i),c(e,t,n)}),p=new t,f.lexer={lex:function(){var e,t;return t=this.tokens[this.pos++],t?(e=t[0],this.yytext=t[1],this.yylloc=t[2],this.yylineno=this.yylloc.first_line):e="",e},setInput:function(e){return this.tokens=e,this.pos=0},upcomingInput:function(){return""}},f.yy=require("./nodes"),f.yy.parseError=function(e,t){var n;return n=t.token,e="unexpected "+(1===n?"end of input":n),u.throwSyntaxError(e,f.lexer.yylloc)},b=!1,g={},m=function(){var t;if(!b)return b=!0,t=require.main,Error.prepareStackTrace=function(t,n){var i,s,r,o,a;return o={},r=function(e,t,n){var i,s;return s=g[e],s&&(i=s.sourceLocation([t-1,n-1])),i?[i[0]+1,i[1]+1]:null},s=function(){var t,s,o;for(o=[],t=0,s=n.length;s>t&&(i=n[t],i.getFunction()!==e.run);t++)o.push(" at "+h(i,r));return o}(),""+t.name+": "+(null!=(a=t.message)?a:"")+"\n"+s.join("\n")+"\n"}},h=function(e,t){var n,i,s,r,o,a,c,h,l,u,p,d;return r=void 0,s="",e.isNative()?s="native":(e.isEval()?(r=e.getScriptNameOrSourceURL(),r||(s=""+e.getEvalOrigin()+", ")):r=e.getFileName(),r||(r="<anonymous>"),h=e.getLineNumber(),i=e.getColumnNumber(),u=t(r,h,i),s=u?""+r+":"+u[0]+":"+u[1]+", <js>:"+h+":"+i:""+r+":"+h+":"+i),o=e.getFunctionName(),a=e.isConstructor(),c=!(e.isToplevel()||a),c?(l=e.getMethodName(),d=e.getTypeName(),o?(p=n="",d&&o.indexOf(d)&&(p=""+d+"."),l&&o.indexOf("."+l)!==o.length-l.length-1&&(n=" [as "+l+"]"),""+p+o+n+" ("+s+")"):""+d+"."+(l||"<anonymous>")+" ("+s+")"):a?"new "+(o||"<anonymous>")+" ("+s+")":o?""+o+" ("+s+")":s}}.call(this),t.exports}(),require["./browser"]=function(){var exports={},module={exports:exports};return function(){var CoffeeScript,compile,runScripts,__indexOf=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};CoffeeScript=require("./coffee-script"),CoffeeScript.require=require,compile=CoffeeScript.compile,CoffeeScript.eval=function(code,options){return null==options&&(options={}),null==options.bare&&(options.bare=!0),eval(compile(code,options))},CoffeeScript.run=function(e,t){return null==t&&(t={}),t.bare=!0,t.shiftLine=!0,Function(compile(e,t))()},"undefined"!=typeof window&&null!==window&&("undefined"!=typeof btoa&&null!==btoa&&"undefined"!=typeof JSON&&null!==JSON&&"undefined"!=typeof unescape&&null!==unescape&&"undefined"!=typeof encodeURIComponent&&null!==encodeURIComponent&&(compile=function(e,t){var n,i,s;return null==t&&(t={}),t.sourceMap=!0,t.inline=!0,s=CoffeeScript.compile(e,t),n=s.js,i=s.v3SourceMap,""+n+"\n//@ sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(i)))+"\n//@ sourceURL=coffeescript"}),CoffeeScript.load=function(e,t,n){var i;return null==n&&(n={}),n.sourceFiles=[e],i=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest,i.open("GET",e,!0),"overrideMimeType"in i&&i.overrideMimeType("text/plain"),i.onreadystatechange=function(){var s;if(4===i.readyState){if(0!==(s=i.status)&&200!==s)throw new Error("Could not load "+e);if(CoffeeScript.run(i.responseText,n),t)return t()}},i.send(null)},runScripts=function(){var e,t,n,i,s,r,o;return o=window.document.getElementsByTagName("script"),t=["text/coffeescript","text/literate-coffeescript"],e=function(){var e,n,i,s;
12
- for(s=[],e=0,n=o.length;n>e;e++)r=o[e],i=r.type,__indexOf.call(t,i)>=0&&s.push(r);return s}(),i=0,s=e.length,(n=function(){var s,r,o;return o=e[i++],s=null!=o?o.type:void 0,__indexOf.call(t,s)>=0?(r={literate:"text/literate-coffeescript"===s},o.src?CoffeeScript.load(o.src,n,r):(r.sourceFiles=["embedded"],CoffeeScript.run(o.innerHTML,r),n())):void 0})(),null},window.addEventListener?window.addEventListener("DOMContentLoaded",runScripts,!1):window.attachEvent("onload",runScripts))}.call(this),module.exports}(),require["./coffee-script"]}();"function"==typeof define&&define.amd?define(function(){return CoffeeScript}):root.CoffeeScript=CoffeeScript}(this);
 
 
 
 
 
 
 
 
 
 
 
 
vendor/less.js DELETED
@@ -1,5837 +0,0 @@
1
- /*
2
- * LESS - Leaner CSS v1.4.2
3
- * http://lesscss.org
4
- *
5
- * Copyright (c) 2009-2013, Alexis Sellier
6
- * Licensed under the Apache 2.0 License.
7
- *
8
- * @licence
9
- */
10
- (function (window, undefined) {
11
- //
12
- // Stub out `require` in the browser
13
- //
14
- function require(arg) {
15
- return window.less[arg.split('/')[1]];
16
- };
17
-
18
- var less, tree, charset;
19
-
20
- if (typeof environment === "object" && ({}).toString.call(environment) === "[object Environment]") {
21
- // Rhino
22
- // Details on how to detect Rhino: https://github.com/ringo/ringojs/issues/88
23
- if (typeof(window) === 'undefined') { less = {} }
24
- else { less = window.less = {} }
25
- tree = less.tree = {};
26
- less.mode = 'rhino';
27
- } else if (typeof(window) === 'undefined') {
28
- // Node.js
29
- less = exports,
30
- tree = require('./tree');
31
- less.mode = 'node';
32
- } else {
33
- // Browser
34
- if (typeof(window.less) === 'undefined') { window.less = {} }
35
- less = window.less,
36
- tree = window.less.tree = {};
37
- less.mode = 'browser';
38
- }
39
- //
40
- // less.js - parser
41
- //
42
- // A relatively straight-forward predictive parser.
43
- // There is no tokenization/lexing stage, the input is parsed
44
- // in one sweep.
45
- //
46
- // To make the parser fast enough to run in the browser, several
47
- // optimization had to be made:
48
- //
49
- // - Matching and slicing on a huge input is often cause of slowdowns.
50
- // The solution is to chunkify the input into smaller strings.
51
- // The chunks are stored in the `chunks` var,
52
- // `j` holds the current chunk index, and `current` holds
53
- // the index of the current chunk in relation to `input`.
54
- // This gives us an almost 4x speed-up.
55
- //
56
- // - In many cases, we don't need to match individual tokens;
57
- // for example, if a value doesn't hold any variables, operations
58
- // or dynamic references, the parser can effectively 'skip' it,
59
- // treating it as a literal.
60
- // An example would be '1px solid #000' - which evaluates to itself,
61
- // we don't need to know what the individual components are.
62
- // The drawback, of course is that you don't get the benefits of
63
- // syntax-checking on the CSS. This gives us a 50% speed-up in the parser,
64
- // and a smaller speed-up in the code-gen.
65
- //
66
- //
67
- // Token matching is done with the `$` function, which either takes
68
- // a terminal string or regexp, or a non-terminal function to call.
69
- // It also takes care of moving all the indices forwards.
70
- //
71
- //
72
- less.Parser = function Parser(env) {
73
- var input, // LeSS input string
74
- i, // current index in `input`
75
- j, // current chunk
76
- temp, // temporarily holds a chunk's state, for backtracking
77
- memo, // temporarily holds `i`, when backtracking
78
- furthest, // furthest index the parser has gone to
79
- chunks, // chunkified input
80
- current, // index of current chunk, in `input`
81
- parser;
82
-
83
- var that = this;
84
-
85
- // Top parser on an import tree must be sure there is one "env"
86
- // which will then be passed around by reference.
87
- if (!(env instanceof tree.parseEnv)) {
88
- env = new tree.parseEnv(env);
89
- }
90
-
91
- var imports = this.imports = {
92
- paths: env.paths || [], // Search paths, when importing
93
- queue: [], // Files which haven't been imported yet
94
- files: env.files, // Holds the imported parse trees
95
- contents: env.contents, // Holds the imported file contents
96
- mime: env.mime, // MIME type of .less files
97
- error: null, // Error in parsing/evaluating an import
98
- push: function (path, currentFileInfo, callback) {
99
- var parserImporter = this;
100
- this.queue.push(path);
101
-
102
- //
103
- // Import a file asynchronously
104
- //
105
- less.Parser.importer(path, currentFileInfo, function (e, root, fullPath) {
106
- parserImporter.queue.splice(parserImporter.queue.indexOf(path), 1); // Remove the path from the queue
107
-
108
- var imported = fullPath in parserImporter.files;
109
-
110
- parserImporter.files[fullPath] = root; // Store the root
111
-
112
- if (e && !parserImporter.error) { parserImporter.error = e; }
113
-
114
- callback(e, root, imported);
115
- }, env);
116
- }
117
- };
118
-
119
- function save() { temp = chunks[j], memo = i, current = i; }
120
- function restore() { chunks[j] = temp, i = memo, current = i; }
121
-
122
- function sync() {
123
- if (i > current) {
124
- chunks[j] = chunks[j].slice(i - current);
125
- current = i;
126
- }
127
- }
128
- function isWhitespace(c) {
129
- // Could change to \s?
130
- var code = c.charCodeAt(0);
131
- return code === 32 || code === 10 || code === 9;
132
- }
133
- //
134
- // Parse from a token, regexp or string, and move forward if match
135
- //
136
- function $(tok) {
137
- var match, args, length, index, k;
138
-
139
- //
140
- // Non-terminal
141
- //
142
- if (tok instanceof Function) {
143
- return tok.call(parser.parsers);
144
- //
145
- // Terminal
146
- //
147
- // Either match a single character in the input,
148
- // or match a regexp in the current chunk (chunk[j]).
149
- //
150
- } else if (typeof(tok) === 'string') {
151
- match = input.charAt(i) === tok ? tok : null;
152
- length = 1;
153
- sync ();
154
- } else {
155
- sync ();
156
-
157
- if (match = tok.exec(chunks[j])) {
158
- length = match[0].length;
159
- } else {
160
- return null;
161
- }
162
- }
163
-
164
- // The match is confirmed, add the match length to `i`,
165
- // and consume any extra white-space characters (' ' || '\n')
166
- // which come after that. The reason for this is that LeSS's
167
- // grammar is mostly white-space insensitive.
168
- //
169
- if (match) {
170
- skipWhitespace(length);
171
-
172
- if(typeof(match) === 'string') {
173
- return match;
174
- } else {
175
- return match.length === 1 ? match[0] : match;
176
- }
177
- }
178
- }
179
-
180
- function skipWhitespace(length) {
181
- var oldi = i, oldj = j,
182
- endIndex = i + chunks[j].length,
183
- mem = i += length;
184
-
185
- while (i < endIndex) {
186
- if (! isWhitespace(input.charAt(i))) { break }
187
- i++;
188
- }
189
- chunks[j] = chunks[j].slice(length + (i - mem));
190
- current = i;
191
-
192
- if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
193
-
194
- return oldi !== i || oldj !== j;
195
- }
196
-
197
- function expect(arg, msg) {
198
- var result = $(arg);
199
- if (! result) {
200
- error(msg || (typeof(arg) === 'string' ? "expected '" + arg + "' got '" + input.charAt(i) + "'"
201
- : "unexpected token"));
202
- } else {
203
- return result;
204
- }
205
- }
206
-
207
- function error(msg, type) {
208
- var e = new Error(msg);
209
- e.index = i;
210
- e.type = type || 'Syntax';
211
- throw e;
212
- }
213
-
214
- // Same as $(), but don't change the state of the parser,
215
- // just return the match.
216
- function peek(tok) {
217
- if (typeof(tok) === 'string') {
218
- return input.charAt(i) === tok;
219
- } else {
220
- if (tok.test(chunks[j])) {
221
- return true;
222
- } else {
223
- return false;
224
- }
225
- }
226
- }
227
-
228
- function getInput(e, env) {
229
- if (e.filename && env.currentFileInfo.filename && (e.filename !== env.currentFileInfo.filename)) {
230
- return parser.imports.contents[e.filename];
231
- } else {
232
- return input;
233
- }
234
- }
235
-
236
- function getLocation(index, input) {
237
- for (var n = index, column = -1;
238
- n >= 0 && input.charAt(n) !== '\n';
239
- n--) { column++ }
240
-
241
- return { line: typeof(index) === 'number' ? (input.slice(0, index).match(/\n/g) || "").length : null,
242
- column: column };
243
- }
244
-
245
- function getDebugInfo(index, inputStream, env) {
246
- var filename = env.currentFileInfo.filename;
247
- if(less.mode !== 'browser' && less.mode !== 'rhino') {
248
- filename = require('path').resolve(filename);
249
- }
250
-
251
- return {
252
- lineNumber: getLocation(index, inputStream).line + 1,
253
- fileName: filename
254
- };
255
- }
256
-
257
- function LessError(e, env) {
258
- var input = getInput(e, env),
259
- loc = getLocation(e.index, input),
260
- line = loc.line,
261
- col = loc.column,
262
- lines = input.split('\n');
263
-
264
- this.type = e.type || 'Syntax';
265
- this.message = e.message;
266
- this.filename = e.filename || env.currentFileInfo.filename;
267
- this.index = e.index;
268
- this.line = typeof(line) === 'number' ? line + 1 : null;
269
- this.callLine = e.call && (getLocation(e.call, input).line + 1);
270
- this.callExtract = lines[getLocation(e.call, input).line];
271
- this.stack = e.stack;
272
- this.column = col;
273
- this.extract = [
274
- lines[line - 1],
275
- lines[line],
276
- lines[line + 1]
277
- ];
278
- }
279
-
280
- LessError.prototype = new Error();
281
- LessError.prototype.constructor = LessError;
282
-
283
- this.env = env = env || {};
284
-
285
- // The optimization level dictates the thoroughness of the parser,
286
- // the lower the number, the less nodes it will create in the tree.
287
- // This could matter for debugging, or if you want to access
288
- // the individual nodes in the tree.
289
- this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
290
-
291
- //
292
- // The Parser
293
- //
294
- return parser = {
295
-
296
- imports: imports,
297
- //
298
- // Parse an input string into an abstract syntax tree,
299
- // call `callback` when done.
300
- //
301
- parse: function (str, callback) {
302
- var root, start, end, zone, line, lines, buff = [], c, error = null;
303
-
304
- i = j = current = furthest = 0;
305
- input = str.replace(/\r\n/g, '\n');
306
-
307
- // Remove potential UTF Byte Order Mark
308
- input = input.replace(/^\uFEFF/, '');
309
-
310
- // Split the input into chunks.
311
- chunks = (function (chunks) {
312
- var j = 0,
313
- skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
314
- comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
315
- string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
316
- level = 0,
317
- match,
318
- chunk = chunks[0],
319
- inParam;
320
-
321
- for (var i = 0, c, cc; i < input.length;) {
322
- skip.lastIndex = i;
323
- if (match = skip.exec(input)) {
324
- if (match.index === i) {
325
- i += match[0].length;
326
- chunk.push(match[0]);
327
- }
328
- }
329
- c = input.charAt(i);
330
- comment.lastIndex = string.lastIndex = i;
331
-
332
- if (match = string.exec(input)) {
333
- if (match.index === i) {
334
- i += match[0].length;
335
- chunk.push(match[0]);
336
- continue;
337
- }
338
- }
339
-
340
- if (!inParam && c === '/') {
341
- cc = input.charAt(i + 1);
342
- if (cc === '/' || cc === '*') {
343
- if (match = comment.exec(input)) {
344
- if (match.index === i) {
345
- i += match[0].length;
346
- chunk.push(match[0]);
347
- continue;
348
- }
349
- }
350
- }
351
- }
352
-
353
- switch (c) {
354
- case '{': if (! inParam) { level ++; chunk.push(c); break }
355
- case '}': if (! inParam) { level --; chunk.push(c); chunks[++j] = chunk = []; break }
356
- case '(': if (! inParam) { inParam = true; chunk.push(c); break }
357
- case ')': if ( inParam) { inParam = false; chunk.push(c); break }
358
- default: chunk.push(c);
359
- }
360
-
361
- i++;
362
- }
363
- if (level != 0) {
364
- error = new(LessError)({
365
- index: i-1,
366
- type: 'Parse',
367
- message: (level > 0) ? "missing closing `}`" : "missing opening `{`",
368
- filename: env.currentFileInfo.filename
369
- }, env);
370
- }
371
-
372
- return chunks.map(function (c) { return c.join('') });;
373
- })([[]]);
374
-
375
- if (error) {
376
- return callback(new(LessError)(error, env));
377
- }
378
-
379
- // Start with the primary rule.
380
- // The whole syntax tree is held under a Ruleset node,
381
- // with the `root` property set to true, so no `{}` are
382
- // output. The callback is called when the input is parsed.
383
- try {
384
- root = new(tree.Ruleset)([], $(this.parsers.primary));
385
- root.root = true;
386
- root.firstRoot = true;
387
- } catch (e) {
388
- return callback(new(LessError)(e, env));
389
- }
390
-
391
- root.toCSS = (function (evaluate) {
392
- var line, lines, column;
393
-
394
- return function (options, variables) {
395
- options = options || {};
396
- var importError,
397
- evalEnv = new tree.evalEnv(options);
398
-
399
- //
400
- // Allows setting variables with a hash, so:
401
- //
402
- // `{ color: new(tree.Color)('#f01') }` will become:
403
- //
404
- // new(tree.Rule)('@color',
405
- // new(tree.Value)([
406
- // new(tree.Expression)([
407
- // new(tree.Color)('#f01')
408
- // ])
409
- // ])
410
- // )
411
- //
412
- if (typeof(variables) === 'object' && !Array.isArray(variables)) {
413
- variables = Object.keys(variables).map(function (k) {
414
- var value = variables[k];
415
-
416
- if (! (value instanceof tree.Value)) {
417
- if (! (value instanceof tree.Expression)) {
418
- value = new(tree.Expression)([value]);
419
- }
420
- value = new(tree.Value)([value]);
421
- }
422
- return new(tree.Rule)('@' + k, value, false, 0);
423
- });
424
- evalEnv.frames = [new(tree.Ruleset)(null, variables)];
425
- }
426
-
427
- try {
428
- var evaldRoot = evaluate.call(this, evalEnv);
429
-
430
- new(tree.joinSelectorVisitor)()
431
- .run(evaldRoot);
432
-
433
- new(tree.processExtendsVisitor)()
434
- .run(evaldRoot);
435
-
436
- var css = evaldRoot.toCSS({
437
- compress: Boolean(options.compress),
438
- dumpLineNumbers: env.dumpLineNumbers,
439
- strictUnits: Boolean(options.strictUnits)});
440
- } catch (e) {
441
- throw new(LessError)(e, env);
442
- }
443
-
444
- if (options.yuicompress && less.mode === 'node') {
445
- return require('ycssmin').cssmin(css, options.maxLineLen);
446
- } else if (options.compress) {
447
- return css.replace(/(\s)+/g, "$1");
448
- } else {
449
- return css;
450
- }
451
- };
452
- })(root.eval);
453
-
454
- // If `i` is smaller than the `input.length - 1`,
455
- // it means the parser wasn't able to parse the whole
456
- // string, so we've got a parsing error.
457
- //
458
- // We try to extract a \n delimited string,
459
- // showing the line where the parse error occured.
460
- // We split it up into two parts (the part which parsed,
461
- // and the part which didn't), so we can color them differently.
462
- if (i < input.length - 1) {
463
- i = furthest;
464
- lines = input.split('\n');
465
- line = (input.slice(0, i).match(/\n/g) || "").length + 1;
466
-
467
- for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }
468
-
469
- error = {
470
- type: "Parse",
471
- message: "Unrecognised input",
472
- index: i,
473
- filename: env.currentFileInfo.filename,
474
- line: line,
475
- column: column,
476
- extract: [
477
- lines[line - 2],
478
- lines[line - 1],
479
- lines[line]
480
- ]
481
- };
482
- }
483
-
484
- var finish = function (e) {
485
- e = error || e || parser.imports.error;
486
-
487
- if (e) {
488
- if (!(e instanceof LessError)) {
489
- e = new(LessError)(e, env);
490
- }
491
-
492
- callback(e);
493
- }
494
- else {
495
- callback(null, root);
496
- }
497
- };
498
-
499
- if (env.processImports !== false) {
500
- new tree.importVisitor(this.imports, finish)
501
- .run(root);
502
- } else {
503
- finish();
504
- }
505
- },
506
-
507
- //
508
- // Here in, the parsing rules/functions
509
- //
510
- // The basic structure of the syntax tree generated is as follows:
511
- //
512
- // Ruleset -> Rule -> Value -> Expression -> Entity
513
- //
514
- // Here's some LESS code:
515
- //
516
- // .class {
517
- // color: #fff;
518
- // border: 1px solid #000;
519
- // width: @w + 4px;
520
- // > .child {...}
521
- // }
522
- //
523
- // And here's what the parse tree might look like:
524
- //
525
- // Ruleset (Selector '.class', [
526
- // Rule ("color", Value ([Expression [Color #fff]]))
527
- // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
528
- // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
529
- // Ruleset (Selector [Element '>', '.child'], [...])
530
- // ])
531
- //
532
- // In general, most rules will try to parse a token with the `$()` function, and if the return
533
- // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
534
- // first, before parsing, that's when we use `peek()`.
535
- //
536
- parsers: {
537
- //
538
- // The `primary` rule is the *entry* and *exit* point of the parser.
539
- // The rules here can appear at any level of the parse tree.
540
- //
541
- // The recursive nature of the grammar is an interplay between the `block`
542
- // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
543
- // as represented by this simplified grammar:
544
- //
545
- // primary → (ruleset | rule)+
546
- // ruleset → selector+ block
547
- // block → '{' primary '}'
548
- //
549
- // Only at one point is the primary rule not called from the
550
- // block rule: at the root level.
551
- //
552
- primary: function () {
553
- var node, root = [];
554
-
555
- while ((node = $(this.extendRule) || $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
556
- $(this.mixin.call) || $(this.comment) || $(this.directive))
557
- || $(/^[\s\n]+/) || $(/^;+/)) {
558
- node && root.push(node);
559
- }
560
- return root;
561
- },
562
-
563
- // We create a Comment node for CSS comments `/* */`,
564
- // but keep the LeSS comments `//` silent, by just skipping
565
- // over them.
566
- comment: function () {
567
- var comment;
568
-
569
- if (input.charAt(i) !== '/') return;
570
-
571
- if (input.charAt(i + 1) === '/') {
572
- return new(tree.Comment)($(/^\/\/.*/), true);
573
- } else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
574
- return new(tree.Comment)(comment);
575
- }
576
- },
577
-
578
- //
579
- // Entities are tokens which can be found inside an Expression
580
- //
581
- entities: {
582
- //
583
- // A string, which supports escaping " and '
584
- //
585
- // "milky way" 'he\'s the one!'
586
- //
587
- quoted: function () {
588
- var str, j = i, e, index = i;
589
-
590
- if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
591
- if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return;
592
-
593
- e && $('~');
594
-
595
- if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) {
596
- return new(tree.Quoted)(str[0], str[1] || str[2], e, index, env.currentFileInfo);
597
- }
598
- },
599
-
600
- //
601
- // A catch-all word, such as:
602
- //
603
- // black border-collapse
604
- //
605
- keyword: function () {
606
- var k;
607
-
608
- if (k = $(/^[_A-Za-z-][_A-Za-z0-9-]*/)) {
609
- if (tree.colors.hasOwnProperty(k)) {
610
- // detect named color
611
- return new(tree.Color)(tree.colors[k].slice(1));
612
- } else {
613
- return new(tree.Keyword)(k);
614
- }
615
- }
616
- },
617
-
618
- //
619
- // A function call
620
- //
621
- // rgb(255, 0, 255)
622
- //
623
- // We also try to catch IE's `alpha()`, but let the `alpha` parser
624
- // deal with the details.
625
- //
626
- // The arguments are parsed with the `entities.arguments` parser.
627
- //
628
- call: function () {
629
- var name, nameLC, args, alpha_ret, index = i;
630
-
631
- if (! (name = /^([\w-]+|%|progid:[\w\.]+)\(/.exec(chunks[j]))) return;
632
-
633
- name = name[1];
634
- nameLC = name.toLowerCase();
635
-
636
- if (nameLC === 'url') { return null }
637
- else { i += name.length }
638
-
639
- if (nameLC === 'alpha') {
640
- alpha_ret = $(this.alpha);
641
- if(typeof alpha_ret !== 'undefined') {
642
- return alpha_ret;
643
- }
644
- }
645
-
646
- $('('); // Parse the '(' and consume whitespace.
647
-
648
- args = $(this.entities.arguments);
649
-
650
- if (! $(')')) {
651
- return;
652
- }
653
-
654
- if (name) { return new(tree.Call)(name, args, index, env.currentFileInfo); }
655
- },
656
- arguments: function () {
657
- var args = [], arg;
658
-
659
- while (arg = $(this.entities.assignment) || $(this.expression)) {
660
- args.push(arg);
661
- if (! $(',')) { break }
662
- }
663
- return args;
664
- },
665
- literal: function () {
666
- return $(this.entities.dimension) ||
667
- $(this.entities.color) ||
668
- $(this.entities.quoted) ||
669
- $(this.entities.unicodeDescriptor);
670
- },
671
-
672
- // Assignments are argument entities for calls.
673
- // They are present in ie filter properties as shown below.
674
- //
675
- // filter: progid:DXImageTransform.Microsoft.Alpha( *opacity=50* )
676
- //
677
-
678
- assignment: function () {
679
- var key, value;
680
- if ((key = $(/^\w+(?=\s?=)/i)) && $('=') && (value = $(this.entity))) {
681
- return new(tree.Assignment)(key, value);
682
- }
683
- },
684
-
685
- //
686
- // Parse url() tokens
687
- //
688
- // We use a specific rule for urls, because they don't really behave like
689
- // standard function calls. The difference is that the argument doesn't have
690
- // to be enclosed within a string, so it can't be parsed as an Expression.
691
- //
692
- url: function () {
693
- var value;
694
-
695
- if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
696
- value = $(this.entities.quoted) || $(this.entities.variable) ||
697
- $(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || "";
698
-
699
- expect(')');
700
-
701
- return new(tree.URL)((value.value != null || value instanceof tree.Variable)
702
- ? value : new(tree.Anonymous)(value), env.currentFileInfo);
703
- },
704
-
705
- //
706
- // A Variable entity, such as `@fink`, in
707
- //
708
- // width: @fink + 2px
709
- //
710
- // We use a different parser for variable definitions,
711
- // see `parsers.variable`.
712
- //
713
- variable: function () {
714
- var name, index = i;
715
-
716
- if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
717
- return new(tree.Variable)(name, index, env.currentFileInfo);
718
- }
719
- },
720
-
721
- // A variable entity useing the protective {} e.g. @{var}
722
- variableCurly: function () {
723
- var name, curly, index = i;
724
-
725
- if (input.charAt(i) === '@' && (curly = $(/^@\{([\w-]+)\}/))) {
726
- return new(tree.Variable)("@" + curly[1], index, env.currentFileInfo);
727
- }
728
- },
729
-
730
- //
731
- // A Hexadecimal color
732
- //
733
- // #4F3C2F
734
- //
735
- // `rgb` and `hsl` colors are parsed through the `entities.call` parser.
736
- //
737
- color: function () {
738
- var rgb;
739
-
740
- if (input.charAt(i) === '#' && (rgb = $(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))) {
741
- return new(tree.Color)(rgb[1]);
742
- }
743
- },
744
-
745
- //
746
- // A Dimension, that is, a number and a unit
747
- //
748
- // 0.5em 95%
749
- //
750
- dimension: function () {
751
- var value, c = input.charCodeAt(i);
752
- //Is the first char of the dimension 0-9, '.', '+' or '-'
753
- if ((c > 57 || c < 43) || c === 47 || c == 44) return;
754
-
755
- if (value = $(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/)) {
756
- return new(tree.Dimension)(value[1], value[2]);
757
- }
758
- },
759
-
760
- //
761
- // A unicode descriptor, as is used in unicode-range
762
- //
763
- // U+0?? or U+00A1-00A9
764
- //
765
- unicodeDescriptor: function () {
766
- var ud;
767
-
768
- if (ud = $(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/)) {
769
- return new(tree.UnicodeDescriptor)(ud[0]);
770
- }
771
- },
772
-
773
- //
774
- // JavaScript code to be evaluated
775
- //
776
- // `window.location.href`
777
- //
778
- javascript: function () {
779
- var str, j = i, e;
780
-
781
- if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
782
- if (input.charAt(j) !== '`') { return }
783
-
784
- e && $('~');
785
-
786
- if (str = $(/^`([^`]*)`/)) {
787
- return new(tree.JavaScript)(str[1], i, e);
788
- }
789
- }
790
- },
791
-
792
- //
793
- // The variable part of a variable definition. Used in the `rule` parser
794
- //
795
- // @fink:
796
- //
797
- variable: function () {
798
- var name;
799
-
800
- if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { return name[1] }
801
- },
802
-
803
- //
804
- // extend syntax - used to extend selectors
805
- //
806
- extend: function(isRule) {
807
- var elements, e, index = i, option, extendList = [];
808
-
809
- if (!$(isRule ? /^&:extend\(/ : /^:extend\(/)) { return; }
810
-
811
- do {
812
- option = null;
813
- elements = [];
814
- while (true) {
815
- option = $(/^(all)(?=\s*(\)|,))/);
816
- if (option) { break; }
817
- e = $(this.element);
818
- if (!e) { break; }
819
- elements.push(e);
820
- }
821
-
822
- option = option && option[1];
823
-
824
- extendList.push(new(tree.Extend)(new(tree.Selector)(elements), option, index));
825
-
826
- } while($(","))
827
-
828
- expect(/^\)/);
829
-
830
- if (isRule) {
831
- expect(/^;/);
832
- }
833
-
834
- return extendList;
835
- },
836
-
837
- //
838
- // extendRule - used in a rule to extend all the parent selectors
839
- //
840
- extendRule: function() {
841
- return this.extend(true);
842
- },
843
-
844
- //
845
- // Mixins
846
- //
847
- mixin: {
848
- //
849
- // A Mixin call, with an optional argument list
850
- //
851
- // #mixins > .square(#fff);
852
- // .rounded(4px, black);
853
- // .button;
854
- //
855
- // The `while` loop is there because mixins can be
856
- // namespaced, but we only support the child and descendant
857
- // selector for now.
858
- //
859
- call: function () {
860
- var elements = [], e, c, args, delim, arg, index = i, s = input.charAt(i), important = false;
861
-
862
- if (s !== '.' && s !== '#') { return }
863
-
864
- save(); // stop us absorbing part of an invalid selector
865
-
866
- while (e = $(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)) {
867
- elements.push(new(tree.Element)(c, e, i));
868
- c = $('>');
869
- }
870
- if ($('(')) {
871
- args = this.mixin.args.call(this, true).args;
872
- expect(')');
873
- }
874
-
875
- args = args || [];
876
-
877
- if ($(this.important)) {
878
- important = true;
879
- }
880
-
881
- if (elements.length > 0 && ($(';') || peek('}'))) {
882
- return new(tree.mixin.Call)(elements, args, index, env.currentFileInfo, important);
883
- }
884
-
885
- restore();
886
- },
887
- args: function (isCall) {
888
- var expressions = [], argsSemiColon = [], isSemiColonSeperated, argsComma = [], expressionContainsNamed, name, nameLoop, value, arg,
889
- returner = {args:null, variadic: false};
890
- while (true) {
891
- if (isCall) {
892
- arg = $(this.expression);
893
- } else {
894
- $(this.comment);
895
- if (input.charAt(i) === '.' && $(/^\.{3}/)) {
896
- returner.variadic = true;
897
- if ($(";") && !isSemiColonSeperated) {
898
- isSemiColonSeperated = true;
899
- }
900
- (isSemiColonSeperated ? argsSemiColon : argsComma)
901
- .push({ variadic: true });
902
- break;
903
- }
904
- arg = $(this.entities.variable) || $(this.entities.literal)
905
- || $(this.entities.keyword);
906
- }
907
-
908
- if (!arg) {
909
- break;
910
- }
911
-
912
- nameLoop = null;
913
- if (arg.throwAwayComments) {
914
- arg.throwAwayComments();
915
- }
916
- value = arg;
917
- var val = null;
918
-
919
- if (isCall) {
920
- // Variable
921
- if (arg.value.length == 1) {
922
- var val = arg.value[0];
923
- }
924
- } else {
925
- val = arg;
926
- }
927
-
928
- if (val && val instanceof tree.Variable) {
929
- if ($(':')) {
930
- if (expressions.length > 0) {
931
- if (isSemiColonSeperated) {
932
- error("Cannot mix ; and , as delimiter types");
933
- }
934
- expressionContainsNamed = true;
935
- }
936
- value = expect(this.expression);
937
- nameLoop = (name = val.name);
938
- } else if (!isCall && $(/^\.{3}/)) {
939
- returner.variadic = true;
940
- if ($(";") && !isSemiColonSeperated) {
941
- isSemiColonSeperated = true;
942
- }
943
- (isSemiColonSeperated ? argsSemiColon : argsComma)
944
- .push({ name: arg.name, variadic: true });
945
- break;
946
- } else if (!isCall) {
947
- name = nameLoop = val.name;
948
- value = null;
949
- }
950
- }
951
-
952
- if (value) {
953
- expressions.push(value);
954
- }
955
-
956
- argsComma.push({ name:nameLoop, value:value });
957
-
958
- if ($(',')) {
959
- continue;
960
- }
961
-
962
- if ($(';') || isSemiColonSeperated) {
963
-
964
- if (expressionContainsNamed) {
965
- error("Cannot mix ; and , as delimiter types");
966
- }
967
-
968
- isSemiColonSeperated = true;
969
-
970
- if (expressions.length > 1) {
971
- value = new (tree.Value)(expressions);
972
- }
973
- argsSemiColon.push({ name:name, value:value });
974
-
975
- name = null;
976
- expressions = [];
977
- expressionContainsNamed = false;
978
- }
979
- }
980
-
981
- returner.args = isSemiColonSeperated ? argsSemiColon : argsComma;
982
- return returner;
983
- },
984
- //
985
- // A Mixin definition, with a list of parameters
986
- //
987
- // .rounded (@radius: 2px, @color) {
988
- // ...
989
- // }
990
- //
991
- // Until we have a finer grained state-machine, we have to
992
- // do a look-ahead, to make sure we don't have a mixin call.
993
- // See the `rule` function for more information.
994
- //
995
- // We start by matching `.rounded (`, and then proceed on to
996
- // the argument list, which has optional default values.
997
- // We store the parameters in `params`, with a `value` key,
998
- // if there is a value, such as in the case of `@radius`.
999
- //
1000
- // Once we've got our params list, and a closing `)`, we parse
1001
- // the `{...}` block.
1002
- //
1003
- definition: function () {
1004
- var name, params = [], match, ruleset, param, value, cond, variadic = false;
1005
- if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
1006
- peek(/^[^{]*\}/)) return;
1007
-
1008
- save();
1009
-
1010
- if (match = $(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)) {
1011
- name = match[1];
1012
-
1013
- var argInfo = this.mixin.args.call(this, false);
1014
- params = argInfo.args;
1015
- variadic = argInfo.variadic;
1016
-
1017
- // .mixincall("@{a}");
1018
- // looks a bit like a mixin definition.. so we have to be nice and restore
1019
- if (!$(')')) {
1020
- furthest = i;
1021
- restore();
1022
- }
1023
-
1024
- $(this.comment);
1025
-
1026
- if ($(/^when/)) { // Guard
1027
- cond = expect(this.conditions, 'expected condition');
1028
- }
1029
-
1030
- ruleset = $(this.block);
1031
-
1032
- if (ruleset) {
1033
- return new(tree.mixin.Definition)(name, params, ruleset, cond, variadic);
1034
- } else {
1035
- restore();
1036
- }
1037
- }
1038
- }
1039
- },
1040
-
1041
- //
1042
- // Entities are the smallest recognized token,
1043
- // and can be found inside a rule's value.
1044
- //
1045
- entity: function () {
1046
- return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) ||
1047
- $(this.entities.call) || $(this.entities.keyword) ||$(this.entities.javascript) ||
1048
- $(this.comment);
1049
- },
1050
-
1051
- //
1052
- // A Rule terminator. Note that we use `peek()` to check for '}',
1053
- // because the `block` rule will be expecting it, but we still need to make sure
1054
- // it's there, if ';' was ommitted.
1055
- //
1056
- end: function () {
1057
- return $(';') || peek('}');
1058
- },
1059
-
1060
- //
1061
- // IE's alpha function
1062
- //
1063
- // alpha(opacity=88)
1064
- //
1065
- alpha: function () {
1066
- var value;
1067
-
1068
- if (! $(/^\(opacity=/i)) return;
1069
- if (value = $(/^\d+/) || $(this.entities.variable)) {
1070
- expect(')');
1071
- return new(tree.Alpha)(value);
1072
- }
1073
- },
1074
-
1075
- //
1076
- // A Selector Element
1077
- //
1078
- // div
1079
- // + h1
1080
- // #socks
1081
- // input[type="text"]
1082
- //
1083
- // Elements are the building blocks for Selectors,
1084
- // they are made out of a `Combinator` (see combinator rule),
1085
- // and an element name, such as a tag a class, or `*`.
1086
- //
1087
- element: function () {
1088
- var e, t, c, v;
1089
-
1090
- c = $(this.combinator);
1091
-
1092
- e = $(/^(?:\d+\.\d+|\d+)%/) || $(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/) ||
1093
- $('*') || $('&') || $(this.attribute) || $(/^\([^()@]+\)/) || $(/^[\.#](?=@)/) || $(this.entities.variableCurly);
1094
-
1095
- if (! e) {
1096
- if ($('(')) {
1097
- if ((v = ($(this.selector))) &&
1098
- $(')')) {
1099
- e = new(tree.Paren)(v);
1100
- }
1101
- }
1102
- }
1103
-
1104
- if (e) { return new(tree.Element)(c, e, i) }
1105
- },
1106
-
1107
- //
1108
- // Combinators combine elements together, in a Selector.
1109
- //
1110
- // Because our parser isn't white-space sensitive, special care
1111
- // has to be taken, when parsing the descendant combinator, ` `,
1112
- // as it's an empty space. We have to check the previous character
1113
- // in the input, to see if it's a ` ` character. More info on how
1114
- // we deal with this in *combinator.js*.
1115
- //
1116
- combinator: function () {
1117
- var c = input.charAt(i);
1118
-
1119
- if (c === '>' || c === '+' || c === '~' || c === '|') {
1120
- i++;
1121
- while (input.charAt(i).match(/\s/)) { i++ }
1122
- return new(tree.Combinator)(c);
1123
- } else if (input.charAt(i - 1).match(/\s/)) {
1124
- return new(tree.Combinator)(" ");
1125
- } else {
1126
- return new(tree.Combinator)(null);
1127
- }
1128
- },
1129
-
1130
- //
1131
- // A CSS Selector
1132
- //
1133
- // .class > div + h1
1134
- // li a:hover
1135
- //
1136
- // Selectors are made out of one or more Elements, see above.
1137
- //
1138
- selector: function () {
1139
- var sel, e, elements = [], c, extend, extendList = [];
1140
-
1141
- while ((extend = $(this.extend)) || (e = $(this.element))) {
1142
- if (extend) {
1143
- extendList.push.apply(extendList, extend);
1144
- } else {
1145
- if (extendList.length) {
1146
- error("Extend can only be used at the end of selector");
1147
- }
1148
- c = input.charAt(i);
1149
- elements.push(e)
1150
- e = null;
1151
- }
1152
- if (c === '{' || c === '}' || c === ';' || c === ',' || c === ')') { break }
1153
- }
1154
-
1155
- if (elements.length > 0) { return new(tree.Selector)(elements, extendList); }
1156
- if (extendList.length) { error("Extend must be used to extend a selector, it cannot be used on its own"); }
1157
- },
1158
- attribute: function () {
1159
- var attr = '', key, val, op;
1160
-
1161
- if (! $('[')) return;
1162
-
1163
- if (!(key = $(this.entities.variableCurly))) {
1164
- key = expect(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/);
1165
- }
1166
-
1167
- if ((op = $(/^[|~*$^]?=/))) {
1168
- val = $(this.entities.quoted) || $(/^[\w-]+/) || $(this.entities.variableCurly);
1169
- }
1170
-
1171
- expect(']');
1172
-
1173
- return new(tree.Attribute)(key, op, val);
1174
- },
1175
-
1176
- //
1177
- // The `block` rule is used by `ruleset` and `mixin.definition`.
1178
- // It's a wrapper around the `primary` rule, with added `{}`.
1179
- //
1180
- block: function () {
1181
- var content;
1182
- if ($('{') && (content = $(this.primary)) && $('}')) {
1183
- return content;
1184
- }
1185
- },
1186
-
1187
- //
1188
- // div, .class, body > p {...}
1189
- //
1190
- ruleset: function () {
1191
- var selectors = [], s, rules, debugInfo;
1192
-
1193
- save();
1194
-
1195
- if (env.dumpLineNumbers)
1196
- debugInfo = getDebugInfo(i, input, env);
1197
-
1198
- while (s = $(this.selector)) {
1199
- selectors.push(s);
1200
- $(this.comment);
1201
- if (! $(',')) { break }
1202
- $(this.comment);
1203
- }
1204
-
1205
- if (selectors.length > 0 && (rules = $(this.block))) {
1206
- var ruleset = new(tree.Ruleset)(selectors, rules, env.strictImports);
1207
- if (env.dumpLineNumbers)
1208
- ruleset.debugInfo = debugInfo;
1209
- return ruleset;
1210
- } else {
1211
- // Backtrack
1212
- furthest = i;
1213
- restore();
1214
- }
1215
- },
1216
- rule: function (tryAnonymous) {
1217
- var name, value, c = input.charAt(i), important;
1218
- save();
1219
-
1220
- if (c === '.' || c === '#' || c === '&') { return }
1221
-
1222
- if (name = $(this.variable) || $(this.property)) {
1223
- // prefer to try to parse first if its a variable or we are compressing
1224
- // but always fallback on the other one
1225
- value = !tryAnonymous && (env.compress || (name.charAt(0) === '@')) ?
1226
- ($(this.value) || $(this.anonymousValue)) :
1227
- ($(this.anonymousValue) || $(this.value));
1228
-
1229
- important = $(this.important);
1230
-
1231
- if (value && $(this.end)) {
1232
- return new(tree.Rule)(name, value, important, memo, env.currentFileInfo);
1233
- } else {
1234
- furthest = i;
1235
- restore();
1236
- if (value && !tryAnonymous) {
1237
- return this.rule(true);
1238
- }
1239
- }
1240
- }
1241
- },
1242
- anonymousValue: function () {
1243
- var match;
1244
- if (match = /^([^@+\/'"*`(;{}-]*);/.exec(chunks[j])) {
1245
- i += match[0].length - 1;
1246
- return new(tree.Anonymous)(match[1]);
1247
- }
1248
- },
1249
-
1250
- //
1251
- // An @import directive
1252
- //
1253
- // @import "lib";
1254
- //
1255
- // Depending on our environemnt, importing is done differently:
1256
- // In the browser, it's an XHR request, in Node, it would be a
1257
- // file-system operation. The function used for importing is
1258
- // stored in `import`, which we pass to the Import constructor.
1259
- //
1260
- "import": function () {
1261
- var path, features, index = i;
1262
-
1263
- save();
1264
-
1265
- var dir = $(/^@import?\s+/);
1266
-
1267
- var options = (dir ? $(this.importOptions) : null) || {};
1268
-
1269
- if (dir && (path = $(this.entities.quoted) || $(this.entities.url))) {
1270
- features = $(this.mediaFeatures);
1271
- if ($(';')) {
1272
- features = features && new(tree.Value)(features);
1273
- return new(tree.Import)(path, features, options, index, env.currentFileInfo);
1274
- }
1275
- }
1276
-
1277
- restore();
1278
- },
1279
-
1280
- importOptions: function() {
1281
- var o, options = {}, optionName, value;
1282
-
1283
- // list of options, surrounded by parens
1284
- if (! $('(')) { return null; }
1285
- do {
1286
- if (o = $(this.importOption)) {
1287
- optionName = o;
1288
- value = true;
1289
- switch(optionName) {
1290
- case "css":
1291
- optionName = "less";
1292
- value = false;
1293
- break;
1294
- case "once":
1295
- optionName = "multiple";
1296
- value = false;
1297
- break;
1298
- }
1299
- options[optionName] = value;
1300
- if (! $(',')) { break }
1301
- }
1302
- } while (o);
1303
- expect(')');
1304
- return options;
1305
- },
1306
-
1307
- importOption: function() {
1308
- var opt = $(/^(less|css|multiple|once)/);
1309
- if (opt) {
1310
- return opt[1];
1311
- }
1312
- },
1313
-
1314
- mediaFeature: function () {
1315
- var e, p, nodes = [];
1316
-
1317
- do {
1318
- if (e = $(this.entities.keyword)) {
1319
- nodes.push(e);
1320
- } else if ($('(')) {
1321
- p = $(this.property);
1322
- e = $(this.value);
1323
- if ($(')')) {
1324
- if (p && e) {
1325
- nodes.push(new(tree.Paren)(new(tree.Rule)(p, e, null, i, env.currentFileInfo, true)));
1326
- } else if (e) {
1327
- nodes.push(new(tree.Paren)(e));
1328
- } else {
1329
- return null;
1330
- }
1331
- } else { return null }
1332
- }
1333
- } while (e);
1334
-
1335
- if (nodes.length > 0) {
1336
- return new(tree.Expression)(nodes);
1337
- }
1338
- },
1339
-
1340
- mediaFeatures: function () {
1341
- var e, features = [];
1342
-
1343
- do {
1344
- if (e = $(this.mediaFeature)) {
1345
- features.push(e);
1346
- if (! $(',')) { break }
1347
- } else if (e = $(this.entities.variable)) {
1348
- features.push(e);
1349
- if (! $(',')) { break }
1350
- }
1351
- } while (e);
1352
-
1353
- return features.length > 0 ? features : null;
1354
- },
1355
-
1356
- media: function () {
1357
- var features, rules, media, debugInfo;
1358
-
1359
- if (env.dumpLineNumbers)
1360
- debugInfo = getDebugInfo(i, input, env);
1361
-
1362
- if ($(/^@media/)) {
1363
- features = $(this.mediaFeatures);
1364
-
1365
- if (rules = $(this.block)) {
1366
- media = new(tree.Media)(rules, features);
1367
- if(env.dumpLineNumbers)
1368
- media.debugInfo = debugInfo;
1369
- return media;
1370
- }
1371
- }
1372
- },
1373
-
1374
- //
1375
- // A CSS Directive
1376
- //
1377
- // @charset "utf-8";
1378
- //
1379
- directive: function () {
1380
- var name, value, rules, identifier, e, nodes, nonVendorSpecificName,
1381
- hasBlock, hasIdentifier, hasExpression;
1382
-
1383
- if (input.charAt(i) !== '@') return;
1384
-
1385
- if (value = $(this['import']) || $(this.media)) {
1386
- return value;
1387
- }
1388
-
1389
- save();
1390
-
1391
- name = $(/^@[a-z-]+/);
1392
-
1393
- if (!name) return;
1394
-
1395
- nonVendorSpecificName = name;
1396
- if (name.charAt(1) == '-' && name.indexOf('-', 2) > 0) {
1397
- nonVendorSpecificName = "@" + name.slice(name.indexOf('-', 2) + 1);
1398
- }
1399
-
1400
- switch(nonVendorSpecificName) {
1401
- case "@font-face":
1402
- hasBlock = true;
1403
- break;
1404
- case "@viewport":
1405
- case "@top-left":
1406
- case "@top-left-corner":
1407
- case "@top-center":
1408
- case "@top-right":
1409
- case "@top-right-corner":
1410
- case "@bottom-left":
1411
- case "@bottom-left-corner":
1412
- case "@bottom-center":
1413
- case "@bottom-right":
1414
- case "@bottom-right-corner":
1415
- case "@left-top":
1416
- case "@left-middle":
1417
- case "@left-bottom":
1418
- case "@right-top":
1419
- case "@right-middle":
1420
- case "@right-bottom":
1421
- hasBlock = true;
1422
- break;
1423
- case "@page":
1424
- case "@document":
1425
- case "@supports":
1426
- case "@keyframes":
1427
- hasBlock = true;
1428
- hasIdentifier = true;
1429
- break;
1430
- case "@namespace":
1431
- hasExpression = true;
1432
- break;
1433
- }
1434
-
1435
- if (hasIdentifier) {
1436
- name += " " + ($(/^[^{]+/) || '').trim();
1437
- }
1438
-
1439
- if (hasBlock)
1440
- {
1441
- if (rules = $(this.block)) {
1442
- return new(tree.Directive)(name, rules);
1443
- }
1444
- } else {
1445
- if ((value = hasExpression ? $(this.expression) : $(this.entity)) && $(';')) {
1446
- var directive = new(tree.Directive)(name, value);
1447
- if (env.dumpLineNumbers) {
1448
- directive.debugInfo = getDebugInfo(i, input, env);
1449
- }
1450
- return directive;
1451
- }
1452
- }
1453
-
1454
- restore();
1455
- },
1456
-
1457
- //
1458
- // A Value is a comma-delimited list of Expressions
1459
- //
1460
- // font-family: Baskerville, Georgia, serif;
1461
- //
1462
- // In a Rule, a Value represents everything after the `:`,
1463
- // and before the `;`.
1464
- //
1465
- value: function () {
1466
- var e, expressions = [], important;
1467
-
1468
- while (e = $(this.expression)) {
1469
- expressions.push(e);
1470
- if (! $(',')) { break }
1471
- }
1472
-
1473
- if (expressions.length > 0) {
1474
- return new(tree.Value)(expressions);
1475
- }
1476
- },
1477
- important: function () {
1478
- if (input.charAt(i) === '!') {
1479
- return $(/^! *important/);
1480
- }
1481
- },
1482
- sub: function () {
1483
- var a, e;
1484
-
1485
- if ($('(')) {
1486
- if (a = $(this.addition)) {
1487
- e = new(tree.Expression)([a]);
1488
- expect(')');
1489
- e.parens = true;
1490
- return e;
1491
- }
1492
- }
1493
- },
1494
- multiplication: function () {
1495
- var m, a, op, operation, isSpaced, expression = [];
1496
- if (m = $(this.operand)) {
1497
- isSpaced = isWhitespace(input.charAt(i - 1));
1498
- while (!peek(/^\/[*\/]/) && (op = ($('/') || $('*')))) {
1499
- if (a = $(this.operand)) {
1500
- m.parensInOp = true;
1501
- a.parensInOp = true;
1502
- operation = new(tree.Operation)(op, [operation || m, a], isSpaced);
1503
- isSpaced = isWhitespace(input.charAt(i - 1));
1504
- } else {
1505
- break;
1506
- }
1507
- }
1508
- return operation || m;
1509
- }
1510
- },
1511
- addition: function () {
1512
- var m, a, op, operation, isSpaced;
1513
- if (m = $(this.multiplication)) {
1514
- isSpaced = isWhitespace(input.charAt(i - 1));
1515
- while ((op = $(/^[-+]\s+/) || (!isSpaced && ($('+') || $('-')))) &&
1516
- (a = $(this.multiplication))) {
1517
- m.parensInOp = true;
1518
- a.parensInOp = true;
1519
- operation = new(tree.Operation)(op, [operation || m, a], isSpaced);
1520
- isSpaced = isWhitespace(input.charAt(i - 1));
1521
- }
1522
- return operation || m;
1523
- }
1524
- },
1525
- conditions: function () {
1526
- var a, b, index = i, condition;
1527
-
1528
- if (a = $(this.condition)) {
1529
- while ($(',') && (b = $(this.condition))) {
1530
- condition = new(tree.Condition)('or', condition || a, b, index);
1531
- }
1532
- return condition || a;
1533
- }
1534
- },
1535
- condition: function () {
1536
- var a, b, c, op, index = i, negate = false;
1537
-
1538
- if ($(/^not/)) { negate = true }
1539
- expect('(');
1540
- if (a = $(this.addition) || $(this.entities.keyword) || $(this.entities.quoted)) {
1541
- if (op = $(/^(?:>=|=<|[<=>])/)) {
1542
- if (b = $(this.addition) || $(this.entities.keyword) || $(this.entities.quoted)) {
1543
- c = new(tree.Condition)(op, a, b, index, negate);
1544
- } else {
1545
- error('expected expression');
1546
- }
1547
- } else {
1548
- c = new(tree.Condition)('=', a, new(tree.Keyword)('true'), index, negate);
1549
- }
1550
- expect(')');
1551
- return $(/^and/) ? new(tree.Condition)('and', c, $(this.condition)) : c;
1552
- }
1553
- },
1554
-
1555
- //
1556
- // An operand is anything that can be part of an operation,
1557
- // such as a Color, or a Variable
1558
- //
1559
- operand: function () {
1560
- var negate, p = input.charAt(i + 1);
1561
-
1562
- if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
1563
- var o = $(this.sub) || $(this.entities.dimension) ||
1564
- $(this.entities.color) || $(this.entities.variable) ||
1565
- $(this.entities.call);
1566
-
1567
- if (negate) {
1568
- o.parensInOp = true;
1569
- o = new(tree.Negative)(o);
1570
- }
1571
-
1572
- return o;
1573
- },
1574
-
1575
- //
1576
- // Expressions either represent mathematical operations,
1577
- // or white-space delimited Entities.
1578
- //
1579
- // 1px solid black
1580
- // @var * 2
1581
- //
1582
- expression: function () {
1583
- var e, delim, entities = [], d;
1584
-
1585
- while (e = $(this.addition) || $(this.entity)) {
1586
- entities.push(e);
1587
- // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here
1588
- if (!peek(/^\/[\/*]/) && (delim = $('/'))) {
1589
- entities.push(new(tree.Anonymous)(delim));
1590
- }
1591
- }
1592
- if (entities.length > 0) {
1593
- return new(tree.Expression)(entities);
1594
- }
1595
- },
1596
- property: function () {
1597
- var name;
1598
-
1599
- if (name = $(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/)) {
1600
- return name[1];
1601
- }
1602
- }
1603
- }
1604
- };
1605
- };
1606
-
1607
- if (less.mode === 'browser' || less.mode === 'rhino') {
1608
- //
1609
- // Used by `@import` directives
1610
- //
1611
- less.Parser.importer = function (path, currentFileInfo, callback, env) {
1612
- if (!/^([a-z-]+:)?\//.test(path) && currentFileInfo.currentDirectory) {
1613
- path = currentFileInfo.currentDirectory + path;
1614
- }
1615
- var sheetEnv = env.toSheet(path);
1616
- sheetEnv.processImports = false;
1617
- sheetEnv.currentFileInfo = currentFileInfo;
1618
-
1619
- // We pass `true` as 3rd argument, to force the reload of the import.
1620
- // This is so we can get the syntax tree as opposed to just the CSS output,
1621
- // as we need this to evaluate the current stylesheet.
1622
- loadStyleSheet(sheetEnv,
1623
- function (e, root, data, sheet, _, path) {
1624
- callback.call(null, e, root, path);
1625
- }, true);
1626
- };
1627
- }
1628
-
1629
- (function (tree) {
1630
-
1631
- tree.functions = {
1632
- rgb: function (r, g, b) {
1633
- return this.rgba(r, g, b, 1.0);
1634
- },
1635
- rgba: function (r, g, b, a) {
1636
- var rgb = [r, g, b].map(function (c) { return scaled(c, 256); });
1637
- a = number(a);
1638
- return new(tree.Color)(rgb, a);
1639
- },
1640
- hsl: function (h, s, l) {
1641
- return this.hsla(h, s, l, 1.0);
1642
- },
1643
- hsla: function (h, s, l, a) {
1644
- h = (number(h) % 360) / 360;
1645
- s = clamp(number(s)); l = clamp(number(l)); a = clamp(number(a));
1646
-
1647
- var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
1648
- var m1 = l * 2 - m2;
1649
-
1650
- return this.rgba(hue(h + 1/3) * 255,
1651
- hue(h) * 255,
1652
- hue(h - 1/3) * 255,
1653
- a);
1654
-
1655
- function hue(h) {
1656
- h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
1657
- if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
1658
- else if (h * 2 < 1) return m2;
1659
- else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;
1660
- else return m1;
1661
- }
1662
- },
1663
-
1664
- hsv: function(h, s, v) {
1665
- return this.hsva(h, s, v, 1.0);
1666
- },
1667
-
1668
- hsva: function(h, s, v, a) {
1669
- h = ((number(h) % 360) / 360) * 360;
1670
- s = number(s); v = number(v); a = number(a);
1671
-
1672
- var i, f;
1673
- i = Math.floor((h / 60) % 6);
1674
- f = (h / 60) - i;
1675
-
1676
- var vs = [v,
1677
- v * (1 - s),
1678
- v * (1 - f * s),
1679
- v * (1 - (1 - f) * s)];
1680
- var perm = [[0, 3, 1],
1681
- [2, 0, 1],
1682
- [1, 0, 3],
1683
- [1, 2, 0],
1684
- [3, 1, 0],
1685
- [0, 1, 2]];
1686
-
1687
- return this.rgba(vs[perm[i][0]] * 255,
1688
- vs[perm[i][1]] * 255,
1689
- vs[perm[i][2]] * 255,
1690
- a);
1691
- },
1692
-
1693
- hue: function (color) {
1694
- return new(tree.Dimension)(Math.round(color.toHSL().h));
1695
- },
1696
- saturation: function (color) {
1697
- return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
1698
- },
1699
- lightness: function (color) {
1700
- return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
1701
- },
1702
- hsvhue: function(color) {
1703
- return new(tree.Dimension)(Math.round(color.toHSV().h));
1704
- },
1705
- hsvsaturation: function (color) {
1706
- return new(tree.Dimension)(Math.round(color.toHSV().s * 100), '%');
1707
- },
1708
- hsvvalue: function (color) {
1709
- return new(tree.Dimension)(Math.round(color.toHSV().v * 100), '%');
1710
- },
1711
- red: function (color) {
1712
- return new(tree.Dimension)(color.rgb[0]);
1713
- },
1714
- green: function (color) {
1715
- return new(tree.Dimension)(color.rgb[1]);
1716
- },
1717
- blue: function (color) {
1718
- return new(tree.Dimension)(color.rgb[2]);
1719
- },
1720
- alpha: function (color) {
1721
- return new(tree.Dimension)(color.toHSL().a);
1722
- },
1723
- luma: function (color) {
1724
- return new(tree.Dimension)(Math.round(color.luma() * color.alpha * 100), '%');
1725
- },
1726
- saturate: function (color, amount) {
1727
- var hsl = color.toHSL();
1728
-
1729
- hsl.s += amount.value / 100;
1730
- hsl.s = clamp(hsl.s);
1731
- return hsla(hsl);
1732
- },
1733
- desaturate: function (color, amount) {
1734
- var hsl = color.toHSL();
1735
-
1736
- hsl.s -= amount.value / 100;
1737
- hsl.s = clamp(hsl.s);
1738
- return hsla(hsl);
1739
- },
1740
- lighten: function (color, amount) {
1741
- var hsl = color.toHSL();
1742
-
1743
- hsl.l += amount.value / 100;
1744
- hsl.l = clamp(hsl.l);
1745
- return hsla(hsl);
1746
- },
1747
- darken: function (color, amount) {
1748
- var hsl = color.toHSL();
1749
-
1750
- hsl.l -= amount.value / 100;
1751
- hsl.l = clamp(hsl.l);
1752
- return hsla(hsl);
1753
- },
1754
- fadein: function (color, amount) {
1755
- var hsl = color.toHSL();
1756
-
1757
- hsl.a += amount.value / 100;
1758
- hsl.a = clamp(hsl.a);
1759
- return hsla(hsl);
1760
- },
1761
- fadeout: function (color, amount) {
1762
- var hsl = color.toHSL();
1763
-
1764
- hsl.a -= amount.value / 100;
1765
- hsl.a = clamp(hsl.a);
1766
- return hsla(hsl);
1767
- },
1768
- fade: function (color, amount) {
1769
- var hsl = color.toHSL();
1770
-
1771
- hsl.a = amount.value / 100;
1772
- hsl.a = clamp(hsl.a);
1773
- return hsla(hsl);
1774
- },
1775
- spin: function (color, amount) {
1776
- var hsl = color.toHSL();
1777
- var hue = (hsl.h + amount.value) % 360;
1778
-
1779
- hsl.h = hue < 0 ? 360 + hue : hue;
1780
-
1781
- return hsla(hsl);
1782
- },
1783
- //
1784
- // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
1785
- // http://sass-lang.com
1786
- //
1787
- mix: function (color1, color2, weight) {
1788
- if (!weight) {
1789
- weight = new(tree.Dimension)(50);
1790
- }
1791
- var p = weight.value / 100.0;
1792
- var w = p * 2 - 1;
1793
- var a = color1.toHSL().a - color2.toHSL().a;
1794
-
1795
- var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
1796
- var w2 = 1 - w1;
1797
-
1798
- var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
1799
- color1.rgb[1] * w1 + color2.rgb[1] * w2,
1800
- color1.rgb[2] * w1 + color2.rgb[2] * w2];
1801
-
1802
- var alpha = color1.alpha * p + color2.alpha * (1 - p);
1803
-
1804
- return new(tree.Color)(rgb, alpha);
1805
- },
1806
- greyscale: function (color) {
1807
- return this.desaturate(color, new(tree.Dimension)(100));
1808
- },
1809
- contrast: function (color, dark, light, threshold) {
1810
- // filter: contrast(3.2);
1811
- // should be kept as is, so check for color
1812
- if (!color.rgb) {
1813
- return null;
1814
- }
1815
- if (typeof light === 'undefined') {
1816
- light = this.rgba(255, 255, 255, 1.0);
1817
- }
1818
- if (typeof dark === 'undefined') {
1819
- dark = this.rgba(0, 0, 0, 1.0);
1820
- }
1821
- //Figure out which is actually light and dark!
1822
- if (dark.luma() > light.luma()) {
1823
- var t = light;
1824
- light = dark;
1825
- dark = t;
1826
- }
1827
- if (typeof threshold === 'undefined') {
1828
- threshold = 0.43;
1829
- } else {
1830
- threshold = number(threshold);
1831
- }
1832
- if ((color.luma() * color.alpha) < threshold) {
1833
- return light;
1834
- } else {
1835
- return dark;
1836
- }
1837
- },
1838
- e: function (str) {
1839
- return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
1840
- },
1841
- escape: function (str) {
1842
- return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
1843
- },
1844
- '%': function (quoted /* arg, arg, ...*/) {
1845
- var args = Array.prototype.slice.call(arguments, 1),
1846
- str = quoted.value;
1847
-
1848
- for (var i = 0; i < args.length; i++) {
1849
- str = str.replace(/%[sda]/i, function(token) {
1850
- var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
1851
- return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
1852
- });
1853
- }
1854
- str = str.replace(/%%/g, '%');
1855
- return new(tree.Quoted)('"' + str + '"', str);
1856
- },
1857
- unit: function (val, unit) {
1858
- return new(tree.Dimension)(val.value, unit ? unit.toCSS() : "");
1859
- },
1860
- convert: function (val, unit) {
1861
- return val.convertTo(unit.value);
1862
- },
1863
- round: function (n, f) {
1864
- var fraction = typeof(f) === "undefined" ? 0 : f.value;
1865
- return this._math(function(num) { return num.toFixed(fraction); }, null, n);
1866
- },
1867
- pi: function () {
1868
- return new(tree.Dimension)(Math.PI);
1869
- },
1870
- mod: function(a, b) {
1871
- return new(tree.Dimension)(a.value % b.value, a.unit);
1872
- },
1873
- pow: function(x, y) {
1874
- if (typeof x === "number" && typeof y === "number") {
1875
- x = new(tree.Dimension)(x);
1876
- y = new(tree.Dimension)(y);
1877
- } else if (!(x instanceof tree.Dimension) || !(y instanceof tree.Dimension)) {
1878
- throw { type: "Argument", message: "arguments must be numbers" };
1879
- }
1880
-
1881
- return new(tree.Dimension)(Math.pow(x.value, y.value), x.unit);
1882
- },
1883
- _math: function (fn, unit, n) {
1884
- if (n instanceof tree.Dimension) {
1885
- return new(tree.Dimension)(fn(parseFloat(n.value)), unit == null ? n.unit : unit);
1886
- } else if (typeof(n) === 'number') {
1887
- return fn(n);
1888
- } else {
1889
- throw { type: "Argument", message: "argument must be a number" };
1890
- }
1891
- },
1892
- argb: function (color) {
1893
- return new(tree.Anonymous)(color.toARGB());
1894
-
1895
- },
1896
- percentage: function (n) {
1897
- return new(tree.Dimension)(n.value * 100, '%');
1898
- },
1899
- color: function (n) {
1900
- if (n instanceof tree.Quoted) {
1901
- return new(tree.Color)(n.value.slice(1));
1902
- } else {
1903
- throw { type: "Argument", message: "argument must be a string" };
1904
- }
1905
- },
1906
- iscolor: function (n) {
1907
- return this._isa(n, tree.Color);
1908
- },
1909
- isnumber: function (n) {
1910
- return this._isa(n, tree.Dimension);
1911
- },
1912
- isstring: function (n) {
1913
- return this._isa(n, tree.Quoted);
1914
- },
1915
- iskeyword: function (n) {
1916
- return this._isa(n, tree.Keyword);
1917
- },
1918
- isurl: function (n) {
1919
- return this._isa(n, tree.URL);
1920
- },
1921
- ispixel: function (n) {
1922
- return this.isunit(n, 'px');
1923
- },
1924
- ispercentage: function (n) {
1925
- return this.isunit(n, '%');
1926
- },
1927
- isem: function (n) {
1928
- return this.isunit(n, 'em');
1929
- },
1930
- isunit: function (n, unit) {
1931
- return (n instanceof tree.Dimension) && n.unit.is(unit.value || unit) ? tree.True : tree.False;
1932
- },
1933
- _isa: function (n, Type) {
1934
- return (n instanceof Type) ? tree.True : tree.False;
1935
- },
1936
-
1937
- /* Blending modes */
1938
-
1939
- multiply: function(color1, color2) {
1940
- var r = color1.rgb[0] * color2.rgb[0] / 255;
1941
- var g = color1.rgb[1] * color2.rgb[1] / 255;
1942
- var b = color1.rgb[2] * color2.rgb[2] / 255;
1943
- return this.rgb(r, g, b);
1944
- },
1945
- screen: function(color1, color2) {
1946
- var r = 255 - (255 - color1.rgb[0]) * (255 - color2.rgb[0]) / 255;
1947
- var g = 255 - (255 - color1.rgb[1]) * (255 - color2.rgb[1]) / 255;
1948
- var b = 255 - (255 - color1.rgb[2]) * (255 - color2.rgb[2]) / 255;
1949
- return this.rgb(r, g, b);
1950
- },
1951
- overlay: function(color1, color2) {
1952
- var r = color1.rgb[0] < 128 ? 2 * color1.rgb[0] * color2.rgb[0] / 255 : 255 - 2 * (255 - color1.rgb[0]) * (255 - color2.rgb[0]) / 255;
1953
- var g = color1.rgb[1] < 128 ? 2 * color1.rgb[1] * color2.rgb[1] / 255 : 255 - 2 * (255 - color1.rgb[1]) * (255 - color2.rgb[1]) / 255;
1954
- var b = color1.rgb[2] < 128 ? 2 * color1.rgb[2] * color2.rgb[2] / 255 : 255 - 2 * (255 - color1.rgb[2]) * (255 - color2.rgb[2]) / 255;
1955
- return this.rgb(r, g, b);
1956
- },
1957
- softlight: function(color1, color2) {
1958
- var t = color2.rgb[0] * color1.rgb[0] / 255;
1959
- var r = t + color1.rgb[0] * (255 - (255 - color1.rgb[0]) * (255 - color2.rgb[0]) / 255 - t) / 255;
1960
- t = color2.rgb[1] * color1.rgb[1] / 255;
1961
- var g = t + color1.rgb[1] * (255 - (255 - color1.rgb[1]) * (255 - color2.rgb[1]) / 255 - t) / 255;
1962
- t = color2.rgb[2] * color1.rgb[2] / 255;
1963
- var b = t + color1.rgb[2] * (255 - (255 - color1.rgb[2]) * (255 - color2.rgb[2]) / 255 - t) / 255;
1964
- return this.rgb(r, g, b);
1965
- },
1966
- hardlight: function(color1, color2) {
1967
- var r = color2.rgb[0] < 128 ? 2 * color2.rgb[0] * color1.rgb[0] / 255 : 255 - 2 * (255 - color2.rgb[0]) * (255 - color1.rgb[0]) / 255;
1968
- var g = color2.rgb[1] < 128 ? 2 * color2.rgb[1] * color1.rgb[1] / 255 : 255 - 2 * (255 - color2.rgb[1]) * (255 - color1.rgb[1]) / 255;
1969
- var b = color2.rgb[2] < 128 ? 2 * color2.rgb[2] * color1.rgb[2] / 255 : 255 - 2 * (255 - color2.rgb[2]) * (255 - color1.rgb[2]) / 255;
1970
- return this.rgb(r, g, b);
1971
- },
1972
- difference: function(color1, color2) {
1973
- var r = Math.abs(color1.rgb[0] - color2.rgb[0]);
1974
- var g = Math.abs(color1.rgb[1] - color2.rgb[1]);
1975
- var b = Math.abs(color1.rgb[2] - color2.rgb[2]);
1976
- return this.rgb(r, g, b);
1977
- },
1978
- exclusion: function(color1, color2) {
1979
- var r = color1.rgb[0] + color2.rgb[0] * (255 - color1.rgb[0] - color1.rgb[0]) / 255;
1980
- var g = color1.rgb[1] + color2.rgb[1] * (255 - color1.rgb[1] - color1.rgb[1]) / 255;
1981
- var b = color1.rgb[2] + color2.rgb[2] * (255 - color1.rgb[2] - color1.rgb[2]) / 255;
1982
- return this.rgb(r, g, b);
1983
- },
1984
- average: function(color1, color2) {
1985
- var r = (color1.rgb[0] + color2.rgb[0]) / 2;
1986
- var g = (color1.rgb[1] + color2.rgb[1]) / 2;
1987
- var b = (color1.rgb[2] + color2.rgb[2]) / 2;
1988
- return this.rgb(r, g, b);
1989
- },
1990
- negation: function(color1, color2) {
1991
- var r = 255 - Math.abs(255 - color2.rgb[0] - color1.rgb[0]);
1992
- var g = 255 - Math.abs(255 - color2.rgb[1] - color1.rgb[1]);
1993
- var b = 255 - Math.abs(255 - color2.rgb[2] - color1.rgb[2]);
1994
- return this.rgb(r, g, b);
1995
- },
1996
- tint: function(color, amount) {
1997
- return this.mix(this.rgb(255,255,255), color, amount);
1998
- },
1999
- shade: function(color, amount) {
2000
- return this.mix(this.rgb(0, 0, 0), color, amount);
2001
- },
2002
- extract: function(values, index) {
2003
- index = index.value - 1; // (1-based index)
2004
- return values.value[index];
2005
- },
2006
-
2007
- "data-uri": function(mimetypeNode, filePathNode) {
2008
-
2009
- if (typeof window !== 'undefined') {
2010
- return new tree.URL(filePathNode || mimetypeNode, this.currentFileInfo).eval(this.env);
2011
- }
2012
-
2013
- var mimetype = mimetypeNode.value;
2014
- var filePath = (filePathNode && filePathNode.value);
2015
-
2016
- var fs = require("fs"),
2017
- path = require("path"),
2018
- useBase64 = false;
2019
-
2020
- if (arguments.length < 2) {
2021
- filePath = mimetype;
2022
- }
2023
-
2024
- if (this.env.isPathRelative(filePath)) {
2025
- if (this.currentFileInfo.relativeUrls) {
2026
- filePath = path.join(this.currentFileInfo.currentDirectory, filePath);
2027
- } else {
2028
- filePath = path.join(this.currentFileInfo.entryPath, filePath);
2029
- }
2030
- }
2031
-
2032
- // detect the mimetype if not given
2033
- if (arguments.length < 2) {
2034
- var mime;
2035
- try {
2036
- mime = require('mime');
2037
- } catch (ex) {
2038
- mime = tree._mime;
2039
- }
2040
-
2041
- mimetype = mime.lookup(filePath);
2042
-
2043
- // use base 64 unless it's an ASCII or UTF-8 format
2044
- var charset = mime.charsets.lookup(mimetype);
2045
- useBase64 = ['US-ASCII', 'UTF-8'].indexOf(charset) < 0;
2046
- if (useBase64) mimetype += ';base64';
2047
- }
2048
- else {
2049
- useBase64 = /;base64$/.test(mimetype)
2050
- }
2051
-
2052
- var buf = fs.readFileSync(filePath);
2053
-
2054
- // IE8 cannot handle a data-uri larger than 32KB. If this is exceeded
2055
- // and the --ieCompat flag is enabled, return a normal url() instead.
2056
- var DATA_URI_MAX_KB = 32,
2057
- fileSizeInKB = parseInt((buf.length / 1024), 10);
2058
- if (fileSizeInKB >= DATA_URI_MAX_KB) {
2059
-
2060
- if (this.env.ieCompat !== false) {
2061
- if (!this.env.silent) {
2062
- console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!", filePath, fileSizeInKB, DATA_URI_MAX_KB);
2063
- }
2064
-
2065
- return new tree.URL(filePathNode || mimetypeNode, this.currentFileInfo).eval(this.env);
2066
- } else if (!this.env.silent) {
2067
- // if explicitly disabled (via --no-ie-compat on CLI, or env.ieCompat === false), merely warn
2068
- console.warn("WARNING: Embedding %s (%dKB) exceeds IE8's data-uri size limit of %dKB!", filePath, fileSizeInKB, DATA_URI_MAX_KB);
2069
- }
2070
- }
2071
-
2072
- buf = useBase64 ? buf.toString('base64')
2073
- : encodeURIComponent(buf);
2074
-
2075
- var uri = "'data:" + mimetype + ',' + buf + "'";
2076
- return new(tree.URL)(new(tree.Anonymous)(uri));
2077
- }
2078
- };
2079
-
2080
- // these static methods are used as a fallback when the optional 'mime' dependency is missing
2081
- tree._mime = {
2082
- // this map is intentionally incomplete
2083
- // if you want more, install 'mime' dep
2084
- _types: {
2085
- '.htm' : 'text/html',
2086
- '.html': 'text/html',
2087
- '.gif' : 'image/gif',
2088
- '.jpg' : 'image/jpeg',
2089
- '.jpeg': 'image/jpeg',
2090
- '.png' : 'image/png'
2091
- },
2092
- lookup: function (filepath) {
2093
- var ext = require('path').extname(filepath),
2094
- type = tree._mime._types[ext];
2095
- if (type === undefined) {
2096
- throw new Error('Optional dependency "mime" is required for ' + ext);
2097
- }
2098
- return type;
2099
- },
2100
- charsets: {
2101
- lookup: function (type) {
2102
- // assumes all text types are UTF-8
2103
- return type && (/^text\//).test(type) ? 'UTF-8' : '';
2104
- }
2105
- }
2106
- };
2107
-
2108
- var mathFunctions = [{name:"ceil"}, {name:"floor"}, {name: "sqrt"}, {name:"abs"},
2109
- {name:"tan", unit: ""}, {name:"sin", unit: ""}, {name:"cos", unit: ""},
2110
- {name:"atan", unit: "rad"}, {name:"asin", unit: "rad"}, {name:"acos", unit: "rad"}],
2111
- createMathFunction = function(name, unit) {
2112
- return function(n) {
2113
- if (unit != null) {
2114
- n = n.unify();
2115
- }
2116
- return this._math(Math[name], unit, n);
2117
- };
2118
- };
2119
-
2120
- for(var i = 0; i < mathFunctions.length; i++) {
2121
- tree.functions[mathFunctions[i].name] = createMathFunction(mathFunctions[i].name, mathFunctions[i].unit);
2122
- }
2123
-
2124
- function hsla(color) {
2125
- return tree.functions.hsla(color.h, color.s, color.l, color.a);
2126
- }
2127
-
2128
- function scaled(n, size) {
2129
- if (n instanceof tree.Dimension && n.unit.is('%')) {
2130
- return parseFloat(n.value * size / 100);
2131
- } else {
2132
- return number(n);
2133
- }
2134
- }
2135
-
2136
- function number(n) {
2137
- if (n instanceof tree.Dimension) {
2138
- return parseFloat(n.unit.is('%') ? n.value / 100 : n.value);
2139
- } else if (typeof(n) === 'number') {
2140
- return n;
2141
- } else {
2142
- throw {
2143
- error: "RuntimeError",
2144
- message: "color functions take numbers as parameters"
2145
- };
2146
- }
2147
- }
2148
-
2149
- function clamp(val) {
2150
- return Math.min(1, Math.max(0, val));
2151
- }
2152
-
2153
- tree.functionCall = function(env, currentFileInfo) {
2154
- this.env = env;
2155
- this.currentFileInfo = currentFileInfo;
2156
- };
2157
-
2158
- tree.functionCall.prototype = tree.functions;
2159
-
2160
- })(require('./tree'));
2161
- (function (tree) {
2162
- tree.colors = {
2163
- 'aliceblue':'#f0f8ff',
2164
- 'antiquewhite':'#faebd7',
2165
- 'aqua':'#00ffff',
2166
- 'aquamarine':'#7fffd4',
2167
- 'azure':'#f0ffff',
2168
- 'beige':'#f5f5dc',
2169
- 'bisque':'#ffe4c4',
2170
- 'black':'#000000',
2171
- 'blanchedalmond':'#ffebcd',
2172
- 'blue':'#0000ff',
2173
- 'blueviolet':'#8a2be2',
2174
- 'brown':'#a52a2a',
2175
- 'burlywood':'#deb887',
2176
- 'cadetblue':'#5f9ea0',
2177
- 'chartreuse':'#7fff00',
2178
- 'chocolate':'#d2691e',
2179
- 'coral':'#ff7f50',
2180
- 'cornflowerblue':'#6495ed',
2181
- 'cornsilk':'#fff8dc',
2182
- 'crimson':'#dc143c',
2183
- 'cyan':'#00ffff',
2184
- 'darkblue':'#00008b',
2185
- 'darkcyan':'#008b8b',
2186
- 'darkgoldenrod':'#b8860b',
2187
- 'darkgray':'#a9a9a9',
2188
- 'darkgrey':'#a9a9a9',
2189
- 'darkgreen':'#006400',
2190
- 'darkkhaki':'#bdb76b',
2191
- 'darkmagenta':'#8b008b',
2192
- 'darkolivegreen':'#556b2f',
2193
- 'darkorange':'#ff8c00',
2194
- 'darkorchid':'#9932cc',
2195
- 'darkred':'#8b0000',
2196
- 'darksalmon':'#e9967a',
2197
- 'darkseagreen':'#8fbc8f',
2198
- 'darkslateblue':'#483d8b',
2199
- 'darkslategray':'#2f4f4f',
2200
- 'darkslategrey':'#2f4f4f',
2201
- 'darkturquoise':'#00ced1',
2202
- 'darkviolet':'#9400d3',
2203
- 'deeppink':'#ff1493',
2204
- 'deepskyblue':'#00bfff',
2205
- 'dimgray':'#696969',
2206
- 'dimgrey':'#696969',
2207
- 'dodgerblue':'#1e90ff',
2208
- 'firebrick':'#b22222',
2209
- 'floralwhite':'#fffaf0',
2210
- 'forestgreen':'#228b22',
2211
- 'fuchsia':'#ff00ff',
2212
- 'gainsboro':'#dcdcdc',
2213
- 'ghostwhite':'#f8f8ff',
2214
- 'gold':'#ffd700',
2215
- 'goldenrod':'#daa520',
2216
- 'gray':'#808080',
2217
- 'grey':'#808080',
2218
- 'green':'#008000',
2219
- 'greenyellow':'#adff2f',
2220
- 'honeydew':'#f0fff0',
2221
- 'hotpink':'#ff69b4',
2222
- 'indianred':'#cd5c5c',
2223
- 'indigo':'#4b0082',
2224
- 'ivory':'#fffff0',
2225
- 'khaki':'#f0e68c',
2226
- 'lavender':'#e6e6fa',
2227
- 'lavenderblush':'#fff0f5',
2228
- 'lawngreen':'#7cfc00',
2229
- 'lemonchiffon':'#fffacd',
2230
- 'lightblue':'#add8e6',
2231
- 'lightcoral':'#f08080',
2232
- 'lightcyan':'#e0ffff',
2233
- 'lightgoldenrodyellow':'#fafad2',
2234
- 'lightgray':'#d3d3d3',
2235
- 'lightgrey':'#d3d3d3',
2236
- 'lightgreen':'#90ee90',
2237
- 'lightpink':'#ffb6c1',
2238
- 'lightsalmon':'#ffa07a',
2239
- 'lightseagreen':'#20b2aa',
2240
- 'lightskyblue':'#87cefa',
2241
- 'lightslategray':'#778899',
2242
- 'lightslategrey':'#778899',
2243
- 'lightsteelblue':'#b0c4de',
2244
- 'lightyellow':'#ffffe0',
2245
- 'lime':'#00ff00',
2246
- 'limegreen':'#32cd32',
2247
- 'linen':'#faf0e6',
2248
- 'magenta':'#ff00ff',
2249
- 'maroon':'#800000',
2250
- 'mediumaquamarine':'#66cdaa',
2251
- 'mediumblue':'#0000cd',
2252
- 'mediumorchid':'#ba55d3',
2253
- 'mediumpurple':'#9370d8',
2254
- 'mediumseagreen':'#3cb371',
2255
- 'mediumslateblue':'#7b68ee',
2256
- 'mediumspringgreen':'#00fa9a',
2257
- 'mediumturquoise':'#48d1cc',
2258
- 'mediumvioletred':'#c71585',
2259
- 'midnightblue':'#191970',
2260
- 'mintcream':'#f5fffa',
2261
- 'mistyrose':'#ffe4e1',
2262
- 'moccasin':'#ffe4b5',
2263
- 'navajowhite':'#ffdead',
2264
- 'navy':'#000080',
2265
- 'oldlace':'#fdf5e6',
2266
- 'olive':'#808000',
2267
- 'olivedrab':'#6b8e23',
2268
- 'orange':'#ffa500',
2269
- 'orangered':'#ff4500',
2270
- 'orchid':'#da70d6',
2271
- 'palegoldenrod':'#eee8aa',
2272
- 'palegreen':'#98fb98',
2273
- 'paleturquoise':'#afeeee',
2274
- 'palevioletred':'#d87093',
2275
- 'papayawhip':'#ffefd5',
2276
- 'peachpuff':'#ffdab9',
2277
- 'peru':'#cd853f',
2278
- 'pink':'#ffc0cb',
2279
- 'plum':'#dda0dd',
2280
- 'powderblue':'#b0e0e6',
2281
- 'purple':'#800080',
2282
- 'red':'#ff0000',
2283
- 'rosybrown':'#bc8f8f',
2284
- 'royalblue':'#4169e1',
2285
- 'saddlebrown':'#8b4513',
2286
- 'salmon':'#fa8072',
2287
- 'sandybrown':'#f4a460',
2288
- 'seagreen':'#2e8b57',
2289
- 'seashell':'#fff5ee',
2290
- 'sienna':'#a0522d',
2291
- 'silver':'#c0c0c0',
2292
- 'skyblue':'#87ceeb',
2293
- 'slateblue':'#6a5acd',
2294
- 'slategray':'#708090',
2295
- 'slategrey':'#708090',
2296
- 'snow':'#fffafa',
2297
- 'springgreen':'#00ff7f',
2298
- 'steelblue':'#4682b4',
2299
- 'tan':'#d2b48c',
2300
- 'teal':'#008080',
2301
- 'thistle':'#d8bfd8',
2302
- 'tomato':'#ff6347',
2303
- // 'transparent':'rgba(0,0,0,0)',
2304
- 'turquoise':'#40e0d0',
2305
- 'violet':'#ee82ee',
2306
- 'wheat':'#f5deb3',
2307
- 'white':'#ffffff',
2308
- 'whitesmoke':'#f5f5f5',
2309
- 'yellow':'#ffff00',
2310
- 'yellowgreen':'#9acd32'
2311
- };
2312
- })(require('./tree'));
2313
- (function (tree) {
2314
-
2315
- tree.Alpha = function (val) {
2316
- this.value = val;
2317
- };
2318
- tree.Alpha.prototype = {
2319
- type: "Alpha",
2320
- accept: function (visitor) {
2321
- this.value = visitor.visit(this.value);
2322
- },
2323
- eval: function (env) {
2324
- if (this.value.eval) { this.value = this.value.eval(env) }
2325
- return this;
2326
- },
2327
- toCSS: function () {
2328
- return "alpha(opacity=" +
2329
- (this.value.toCSS ? this.value.toCSS() : this.value) + ")";
2330
- }
2331
- };
2332
-
2333
- })(require('../tree'));
2334
- (function (tree) {
2335
-
2336
- tree.Anonymous = function (string) {
2337
- this.value = string.value || string;
2338
- };
2339
- tree.Anonymous.prototype = {
2340
- type: "Anonymous",
2341
- toCSS: function () {
2342
- return this.value;
2343
- },
2344
- eval: function () { return this },
2345
- compare: function (x) {
2346
- if (!x.toCSS) {
2347
- return -1;
2348
- }
2349
-
2350
- var left = this.toCSS(),
2351
- right = x.toCSS();
2352
-
2353
- if (left === right) {
2354
- return 0;
2355
- }
2356
-
2357
- return left < right ? -1 : 1;
2358
- }
2359
- };
2360
-
2361
- })(require('../tree'));
2362
- (function (tree) {
2363
-
2364
- tree.Assignment = function (key, val) {
2365
- this.key = key;
2366
- this.value = val;
2367
- };
2368
- tree.Assignment.prototype = {
2369
- type: "Assignment",
2370
- accept: function (visitor) {
2371
- this.value = visitor.visit(this.value);
2372
- },
2373
- toCSS: function () {
2374
- return this.key + '=' + (this.value.toCSS ? this.value.toCSS() : this.value);
2375
- },
2376
- eval: function (env) {
2377
- if (this.value.eval) {
2378
- return new(tree.Assignment)(this.key, this.value.eval(env));
2379
- }
2380
- return this;
2381
- }
2382
- };
2383
-
2384
- })(require('../tree'));(function (tree) {
2385
-
2386
- //
2387
- // A function call node.
2388
- //
2389
- tree.Call = function (name, args, index, currentFileInfo) {
2390
- this.name = name;
2391
- this.args = args;
2392
- this.index = index;
2393
- this.currentFileInfo = currentFileInfo;
2394
- };
2395
- tree.Call.prototype = {
2396
- type: "Call",
2397
- accept: function (visitor) {
2398
- this.args = visitor.visit(this.args);
2399
- },
2400
- //
2401
- // When evaluating a function call,
2402
- // we either find the function in `tree.functions` [1],
2403
- // in which case we call it, passing the evaluated arguments,
2404
- // if this returns null or we cannot find the function, we
2405
- // simply print it out as it appeared originally [2].
2406
- //
2407
- // The *functions.js* file contains the built-in functions.
2408
- //
2409
- // The reason why we evaluate the arguments, is in the case where
2410
- // we try to pass a variable to a function, like: `saturate(@color)`.
2411
- // The function should receive the value, not the variable.
2412
- //
2413
- eval: function (env) {
2414
- var args = this.args.map(function (a) { return a.eval(env); }),
2415
- nameLC = this.name.toLowerCase(),
2416
- result, func;
2417
-
2418
- if (nameLC in tree.functions) { // 1.
2419
- try {
2420
- func = new tree.functionCall(env, this.currentFileInfo);
2421
- result = func[nameLC].apply(func, args);
2422
- if (result != null) {
2423
- return result;
2424
- }
2425
- } catch (e) {
2426
- throw { type: e.type || "Runtime",
2427
- message: "error evaluating function `" + this.name + "`" +
2428
- (e.message ? ': ' + e.message : ''),
2429
- index: this.index, filename: this.currentFileInfo.filename };
2430
- }
2431
- }
2432
-
2433
- // 2.
2434
- return new(tree.Anonymous)(this.name +
2435
- "(" + args.map(function (a) { return a.toCSS(env); }).join(', ') + ")");
2436
- },
2437
-
2438
- toCSS: function (env) {
2439
- return this.eval(env).toCSS();
2440
- }
2441
- };
2442
-
2443
- })(require('../tree'));
2444
- (function (tree) {
2445
- //
2446
- // RGB Colors - #ff0014, #eee
2447
- //
2448
- tree.Color = function (rgb, a) {
2449
- //
2450
- // The end goal here, is to parse the arguments
2451
- // into an integer triplet, such as `128, 255, 0`
2452
- //
2453
- // This facilitates operations and conversions.
2454
- //
2455
- if (Array.isArray(rgb)) {
2456
- this.rgb = rgb;
2457
- } else if (rgb.length == 6) {
2458
- this.rgb = rgb.match(/.{2}/g).map(function (c) {
2459
- return parseInt(c, 16);
2460
- });
2461
- } else {
2462
- this.rgb = rgb.split('').map(function (c) {
2463
- return parseInt(c + c, 16);
2464
- });
2465
- }
2466
- this.alpha = typeof(a) === 'number' ? a : 1;
2467
- };
2468
- tree.Color.prototype = {
2469
- type: "Color",
2470
- eval: function () { return this },
2471
- luma: function () { return (0.2126 * this.rgb[0] / 255) + (0.7152 * this.rgb[1] / 255) + (0.0722 * this.rgb[2] / 255); },
2472
-
2473
- //
2474
- // If we have some transparency, the only way to represent it
2475
- // is via `rgba`. Otherwise, we use the hex representation,
2476
- // which has better compatibility with older browsers.
2477
- // Values are capped between `0` and `255`, rounded and zero-padded.
2478
- //
2479
- toCSS: function (env, doNotCompress) {
2480
- var compress = env && env.compress && !doNotCompress;
2481
- if (this.alpha < 1.0) {
2482
- return "rgba(" + this.rgb.map(function (c) {
2483
- return Math.round(c);
2484
- }).concat(this.alpha).join(',' + (compress ? '' : ' ')) + ")";
2485
- } else {
2486
- var color = this.rgb.map(function (i) {
2487
- i = Math.round(i);
2488
- i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
2489
- return i.length === 1 ? '0' + i : i;
2490
- }).join('');
2491
-
2492
- if (compress) {
2493
- color = color.split('');
2494
-
2495
- // Convert color to short format
2496
- if (color[0] == color[1] && color[2] == color[3] && color[4] == color[5]) {
2497
- color = color[0] + color[2] + color[4];
2498
- } else {
2499
- color = color.join('');
2500
- }
2501
- }
2502
-
2503
- return '#' + color;
2504
- }
2505
- },
2506
-
2507
- //
2508
- // Operations have to be done per-channel, if not,
2509
- // channels will spill onto each other. Once we have
2510
- // our result, in the form of an integer triplet,
2511
- // we create a new Color node to hold the result.
2512
- //
2513
- operate: function (env, op, other) {
2514
- var result = [];
2515
-
2516
- if (! (other instanceof tree.Color)) {
2517
- other = other.toColor();
2518
- }
2519
-
2520
- for (var c = 0; c < 3; c++) {
2521
- result[c] = tree.operate(env, op, this.rgb[c], other.rgb[c]);
2522
- }
2523
- return new(tree.Color)(result, this.alpha + other.alpha);
2524
- },
2525
-
2526
- toHSL: function () {
2527
- var r = this.rgb[0] / 255,
2528
- g = this.rgb[1] / 255,
2529
- b = this.rgb[2] / 255,
2530
- a = this.alpha;
2531
-
2532
- var max = Math.max(r, g, b), min = Math.min(r, g, b);
2533
- var h, s, l = (max + min) / 2, d = max - min;
2534
-
2535
- if (max === min) {
2536
- h = s = 0;
2537
- } else {
2538
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
2539
-
2540
- switch (max) {
2541
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
2542
- case g: h = (b - r) / d + 2; break;
2543
- case b: h = (r - g) / d + 4; break;
2544
- }
2545
- h /= 6;
2546
- }
2547
- return { h: h * 360, s: s, l: l, a: a };
2548
- },
2549
- //Adapted from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
2550
- toHSV: function () {
2551
- var r = this.rgb[0] / 255,
2552
- g = this.rgb[1] / 255,
2553
- b = this.rgb[2] / 255,
2554
- a = this.alpha;
2555
-
2556
- var max = Math.max(r, g, b), min = Math.min(r, g, b);
2557
- var h, s, v = max;
2558
-
2559
- var d = max - min;
2560
- if (max === 0) {
2561
- s = 0;
2562
- } else {
2563
- s = d / max;
2564
- }
2565
-
2566
- if (max === min) {
2567
- h = 0;
2568
- } else {
2569
- switch(max){
2570
- case r: h = (g - b) / d + (g < b ? 6 : 0); break;
2571
- case g: h = (b - r) / d + 2; break;
2572
- case b: h = (r - g) / d + 4; break;
2573
- }
2574
- h /= 6;
2575
- }
2576
- return { h: h * 360, s: s, v: v, a: a };
2577
- },
2578
- toARGB: function () {
2579
- var argb = [Math.round(this.alpha * 255)].concat(this.rgb);
2580
- return '#' + argb.map(function (i) {
2581
- i = Math.round(i);
2582
- i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
2583
- return i.length === 1 ? '0' + i : i;
2584
- }).join('');
2585
- },
2586
- compare: function (x) {
2587
- if (!x.rgb) {
2588
- return -1;
2589
- }
2590
-
2591
- return (x.rgb[0] === this.rgb[0] &&
2592
- x.rgb[1] === this.rgb[1] &&
2593
- x.rgb[2] === this.rgb[2] &&
2594
- x.alpha === this.alpha) ? 0 : -1;
2595
- }
2596
- };
2597
-
2598
-
2599
- })(require('../tree'));
2600
- (function (tree) {
2601
-
2602
- tree.Comment = function (value, silent) {
2603
- this.value = value;
2604
- this.silent = !!silent;
2605
- };
2606
- tree.Comment.prototype = {
2607
- type: "Comment",
2608
- toCSS: function (env) {
2609
- return env.compress ? '' : this.value;
2610
- },
2611
- eval: function () { return this }
2612
- };
2613
-
2614
- })(require('../tree'));
2615
- (function (tree) {
2616
-
2617
- tree.Condition = function (op, l, r, i, negate) {
2618
- this.op = op.trim();
2619
- this.lvalue = l;
2620
- this.rvalue = r;
2621
- this.index = i;
2622
- this.negate = negate;
2623
- };
2624
- tree.Condition.prototype = {
2625
- type: "Condition",
2626
- accept: function (visitor) {
2627
- this.lvalue = visitor.visit(this.lvalue);
2628
- this.rvalue = visitor.visit(this.rvalue);
2629
- },
2630
- eval: function (env) {
2631
- var a = this.lvalue.eval(env),
2632
- b = this.rvalue.eval(env);
2633
-
2634
- var i = this.index, result;
2635
-
2636
- var result = (function (op) {
2637
- switch (op) {
2638
- case 'and':
2639
- return a && b;
2640
- case 'or':
2641
- return a || b;
2642
- default:
2643
- if (a.compare) {
2644
- result = a.compare(b);
2645
- } else if (b.compare) {
2646
- result = b.compare(a);
2647
- } else {
2648
- throw { type: "Type",
2649
- message: "Unable to perform comparison",
2650
- index: i };
2651
- }
2652
- switch (result) {
2653
- case -1: return op === '<' || op === '=<';
2654
- case 0: return op === '=' || op === '>=' || op === '=<';
2655
- case 1: return op === '>' || op === '>=';
2656
- }
2657
- }
2658
- })(this.op);
2659
- return this.negate ? !result : result;
2660
- }
2661
- };
2662
-
2663
- })(require('../tree'));
2664
- (function (tree) {
2665
-
2666
- //
2667
- // A number with a unit
2668
- //
2669
- tree.Dimension = function (value, unit) {
2670
- this.value = parseFloat(value);
2671
- this.unit = (unit && unit instanceof tree.Unit) ? unit :
2672
- new(tree.Unit)(unit ? [unit] : undefined);
2673
- };
2674
-
2675
- tree.Dimension.prototype = {
2676
- type: "Dimension",
2677
- accept: function (visitor) {
2678
- this.unit = visitor.visit(this.unit);
2679
- },
2680
- eval: function (env) {
2681
- return this;
2682
- },
2683
- toColor: function () {
2684
- return new(tree.Color)([this.value, this.value, this.value]);
2685
- },
2686
- toCSS: function (env) {
2687
- if ((env && env.strictUnits) && !this.unit.isSingular()) {
2688
- throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());
2689
- }
2690
-
2691
- var value = this.value,
2692
- strValue = String(value);
2693
-
2694
- if (value !== 0 && value < 0.000001 && value > -0.000001) {
2695
- // would be output 1e-6 etc.
2696
- strValue = value.toFixed(20).replace(/0+$/, "");
2697
- }
2698
-
2699
- if (env && env.compress) {
2700
- // Zero values doesn't need a unit
2701
- if (value === 0 && !this.unit.isAngle()) {
2702
- return strValue;
2703
- }
2704
-
2705
- // Float values doesn't need a leading zero
2706
- if (value > 0 && value < 1) {
2707
- strValue = (strValue).substr(1);
2708
- }
2709
- }
2710
-
2711
- return strValue + this.unit.toCSS(env);
2712
- },
2713
-
2714
- // In an operation between two Dimensions,
2715
- // we default to the first Dimension's unit,
2716
- // so `1px + 2` will yield `3px`.
2717
- operate: function (env, op, other) {
2718
- var value = tree.operate(env, op, this.value, other.value),
2719
- unit = this.unit.clone();
2720
-
2721
- if (op === '+' || op === '-') {
2722
- if (unit.numerator.length === 0 && unit.denominator.length === 0) {
2723
- unit.numerator = other.unit.numerator.slice(0);
2724
- unit.denominator = other.unit.denominator.slice(0);
2725
- } else if (other.unit.numerator.length == 0 && unit.denominator.length == 0) {
2726
- // do nothing
2727
- } else {
2728
- other = other.convertTo(this.unit.usedUnits());
2729
-
2730
- if(env.strictUnits && other.unit.toString() !== unit.toString()) {
2731
- throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '" + unit.toString() +
2732
- "' and '" + other.unit.toString() + "'.");
2733
- }
2734
-
2735
- value = tree.operate(env, op, this.value, other.value);
2736
- }
2737
- } else if (op === '*') {
2738
- unit.numerator = unit.numerator.concat(other.unit.numerator).sort();
2739
- unit.denominator = unit.denominator.concat(other.unit.denominator).sort();
2740
- unit.cancel();
2741
- } else if (op === '/') {
2742
- unit.numerator = unit.numerator.concat(other.unit.denominator).sort();
2743
- unit.denominator = unit.denominator.concat(other.unit.numerator).sort();
2744
- unit.cancel();
2745
- }
2746
- return new(tree.Dimension)(value, unit);
2747
- },
2748
-
2749
- compare: function (other) {
2750
- if (other instanceof tree.Dimension) {
2751
- var a = this.unify(), b = other.unify(),
2752
- aValue = a.value, bValue = b.value;
2753
-
2754
- if (bValue > aValue) {
2755
- return -1;
2756
- } else if (bValue < aValue) {
2757
- return 1;
2758
- } else {
2759
- if (!b.unit.isEmpty() && a.unit.compare(b.unit) !== 0) {
2760
- return -1;
2761
- }
2762
- return 0;
2763
- }
2764
- } else {
2765
- return -1;
2766
- }
2767
- },
2768
-
2769
- unify: function () {
2770
- return this.convertTo({ length: 'm', duration: 's', angle: 'rad' });
2771
- },
2772
-
2773
- convertTo: function (conversions) {
2774
- var value = this.value, unit = this.unit.clone(),
2775
- i, groupName, group, conversion, targetUnit, derivedConversions = {};
2776
-
2777
- if (typeof conversions === 'string') {
2778
- for(i in tree.UnitConversions) {
2779
- if (tree.UnitConversions[i].hasOwnProperty(conversions)) {
2780
- derivedConversions = {};
2781
- derivedConversions[i] = conversions;
2782
- }
2783
- }
2784
- conversions = derivedConversions;
2785
- }
2786
-
2787
- for (groupName in conversions) {
2788
- if (conversions.hasOwnProperty(groupName)) {
2789
- targetUnit = conversions[groupName];
2790
- group = tree.UnitConversions[groupName];
2791
-
2792
- unit.map(function (atomicUnit, denominator) {
2793
- if (group.hasOwnProperty(atomicUnit)) {
2794
- if (denominator) {
2795
- value = value / (group[atomicUnit] / group[targetUnit]);
2796
- } else {
2797
- value = value * (group[atomicUnit] / group[targetUnit]);
2798
- }
2799
-
2800
- return targetUnit;
2801
- }
2802
-
2803
- return atomicUnit;
2804
- });
2805
- }
2806
- }
2807
-
2808
- unit.cancel();
2809
-
2810
- return new(tree.Dimension)(value, unit);
2811
- }
2812
- };
2813
-
2814
- // http://www.w3.org/TR/css3-values/#absolute-lengths
2815
- tree.UnitConversions = {
2816
- length: {
2817
- 'm': 1,
2818
- 'cm': 0.01,
2819
- 'mm': 0.001,
2820
- 'in': 0.0254,
2821
- 'pt': 0.0254 / 72,
2822
- 'pc': 0.0254 / 72 * 12
2823
- },
2824
- duration: {
2825
- 's': 1,
2826
- 'ms': 0.001
2827
- },
2828
- angle: {
2829
- 'rad': 1/(2*Math.PI),
2830
- 'deg': 1/360,
2831
- 'grad': 1/400,
2832
- 'turn': 1
2833
- }
2834
- };
2835
-
2836
- tree.Unit = function (numerator, denominator, backupUnit) {
2837
- this.numerator = numerator ? numerator.slice(0).sort() : [];
2838
- this.denominator = denominator ? denominator.slice(0).sort() : [];
2839
- this.backupUnit = backupUnit;
2840
- };
2841
-
2842
- tree.Unit.prototype = {
2843
- type: "Unit",
2844
- clone: function () {
2845
- return new tree.Unit(this.numerator.slice(0), this.denominator.slice(0), this.backupUnit);
2846
- },
2847
-
2848
- toCSS: function (env) {
2849
- if (this.numerator.length >= 1) {
2850
- return this.numerator[0];
2851
- }
2852
- if (this.denominator.length >= 1) {
2853
- return this.denominator[0];
2854
- }
2855
- if ((!env || !env.strictUnits) && this.backupUnit) {
2856
- return this.backupUnit;
2857
- }
2858
- return "";
2859
- },
2860
-
2861
- toString: function () {
2862
- var i, returnStr = this.numerator.join("*");
2863
- for (i = 0; i < this.denominator.length; i++) {
2864
- returnStr += "/" + this.denominator[i];
2865
- }
2866
- return returnStr;
2867
- },
2868
-
2869
- compare: function (other) {
2870
- return this.is(other.toString()) ? 0 : -1;
2871
- },
2872
-
2873
- is: function (unitString) {
2874
- return this.toString() === unitString;
2875
- },
2876
-
2877
- isAngle: function () {
2878
- return tree.UnitConversions.angle.hasOwnProperty(this.toCSS());
2879
- },
2880
-
2881
- isEmpty: function () {
2882
- return this.numerator.length == 0 && this.denominator.length == 0;
2883
- },
2884
-
2885
- isSingular: function() {
2886
- return this.numerator.length <= 1 && this.denominator.length == 0;
2887
- },
2888
-
2889
- map: function(callback) {
2890
- var i;
2891
-
2892
- for (i = 0; i < this.numerator.length; i++) {
2893
- this.numerator[i] = callback(this.numerator[i], false);
2894
- }
2895
-
2896
- for (i = 0; i < this.denominator.length; i++) {
2897
- this.denominator[i] = callback(this.denominator[i], true);
2898
- }
2899
- },
2900
-
2901
- usedUnits: function() {
2902
- var group, groupName, result = {};
2903
-
2904
- for (groupName in tree.UnitConversions) {
2905
- if (tree.UnitConversions.hasOwnProperty(groupName)) {
2906
- group = tree.UnitConversions[groupName];
2907
-
2908
- this.map(function (atomicUnit) {
2909
- if (group.hasOwnProperty(atomicUnit) && !result[groupName]) {
2910
- result[groupName] = atomicUnit;
2911
- }
2912
-
2913
- return atomicUnit;
2914
- });
2915
- }
2916
- }
2917
-
2918
- return result;
2919
- },
2920
-
2921
- cancel: function () {
2922
- var counter = {}, atomicUnit, i, backup;
2923
-
2924
- for (i = 0; i < this.numerator.length; i++) {
2925
- atomicUnit = this.numerator[i];
2926
- if (!backup) {
2927
- backup = atomicUnit;
2928
- }
2929
- counter[atomicUnit] = (counter[atomicUnit] || 0) + 1;
2930
- }
2931
-
2932
- for (i = 0; i < this.denominator.length; i++) {
2933
- atomicUnit = this.denominator[i];
2934
- if (!backup) {
2935
- backup = atomicUnit;
2936
- }
2937
- counter[atomicUnit] = (counter[atomicUnit] || 0) - 1;
2938
- }
2939
-
2940
- this.numerator = [];
2941
- this.denominator = [];
2942
-
2943
- for (atomicUnit in counter) {
2944
- if (counter.hasOwnProperty(atomicUnit)) {
2945
- var count = counter[atomicUnit];
2946
-
2947
- if (count > 0) {
2948
- for (i = 0; i < count; i++) {
2949
- this.numerator.push(atomicUnit);
2950
- }
2951
- } else if (count < 0) {
2952
- for (i = 0; i < -count; i++) {
2953
- this.denominator.push(atomicUnit);
2954
- }
2955
- }
2956
- }
2957
- }
2958
-
2959
- if (this.numerator.length === 0 && this.denominator.length === 0 && backup) {
2960
- this.backupUnit = backup;
2961
- }
2962
-
2963
- this.numerator.sort();
2964
- this.denominator.sort();
2965
- }
2966
- };
2967
-
2968
- })(require('../tree'));
2969
- (function (tree) {
2970
-
2971
- tree.Directive = function (name, value) {
2972
- this.name = name;
2973
-
2974
- if (Array.isArray(value)) {
2975
- this.ruleset = new(tree.Ruleset)([], value);
2976
- this.ruleset.allowImports = true;
2977
- } else {
2978
- this.value = value;
2979
- }
2980
- };
2981
- tree.Directive.prototype = {
2982
- type: "Directive",
2983
- accept: function (visitor) {
2984
- this.ruleset = visitor.visit(this.ruleset);
2985
- this.value = visitor.visit(this.value);
2986
- },
2987
- toCSS: function (env) {
2988
- if (this.ruleset) {
2989
- this.ruleset.root = true;
2990
- return this.name + (env.compress ? '{' : ' {\n ') +
2991
- this.ruleset.toCSS(env).trim().replace(/\n/g, '\n ') +
2992
- (env.compress ? '}': '\n}\n');
2993
- } else {
2994
- return this.name + ' ' + this.value.toCSS() + ';\n';
2995
- }
2996
- },
2997
- eval: function (env) {
2998
- var evaldDirective = this;
2999
- if (this.ruleset) {
3000
- env.frames.unshift(this);
3001
- evaldDirective = new(tree.Directive)(this.name);
3002
- evaldDirective.ruleset = this.ruleset.eval(env);
3003
- env.frames.shift();
3004
- }
3005
- return evaldDirective;
3006
- },
3007
- variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
3008
- find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
3009
- rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
3010
- };
3011
-
3012
- })(require('../tree'));
3013
- (function (tree) {
3014
-
3015
- tree.Element = function (combinator, value, index) {
3016
- this.combinator = combinator instanceof tree.Combinator ?
3017
- combinator : new(tree.Combinator)(combinator);
3018
-
3019
- if (typeof(value) === 'string') {
3020
- this.value = value.trim();
3021
- } else if (value) {
3022
- this.value = value;
3023
- } else {
3024
- this.value = "";
3025
- }
3026
- this.index = index;
3027
- };
3028
- tree.Element.prototype = {
3029
- type: "Element",
3030
- accept: function (visitor) {
3031
- this.combinator = visitor.visit(this.combinator);
3032
- this.value = visitor.visit(this.value);
3033
- },
3034
- eval: function (env) {
3035
- return new(tree.Element)(this.combinator,
3036
- this.value.eval ? this.value.eval(env) : this.value,
3037
- this.index);
3038
- },
3039
- toCSS: function (env) {
3040
- var value = (this.value.toCSS ? this.value.toCSS(env) : this.value);
3041
- if (value == '' && this.combinator.value.charAt(0) == '&') {
3042
- return '';
3043
- } else {
3044
- return this.combinator.toCSS(env || {}) + value;
3045
- }
3046
- }
3047
- };
3048
-
3049
- tree.Attribute = function (key, op, value) {
3050
- this.key = key;
3051
- this.op = op;
3052
- this.value = value;
3053
- };
3054
- tree.Attribute.prototype = {
3055
- type: "Attribute",
3056
- accept: function (visitor) {
3057
- this.value = visitor.visit(this.value);
3058
- },
3059
- eval: function (env) {
3060
- return new(tree.Attribute)(this.key.eval ? this.key.eval(env) : this.key,
3061
- this.op, (this.value && this.value.eval) ? this.value.eval(env) : this.value);
3062
- },
3063
- toCSS: function (env) {
3064
- var value = this.key.toCSS ? this.key.toCSS(env) : this.key;
3065
-
3066
- if (this.op) {
3067
- value += this.op;
3068
- value += (this.value.toCSS ? this.value.toCSS(env) : this.value);
3069
- }
3070
-
3071
- return '[' + value + ']';
3072
- }
3073
- };
3074
-
3075
- tree.Combinator = function (value) {
3076
- if (value === ' ') {
3077
- this.value = ' ';
3078
- } else {
3079
- this.value = value ? value.trim() : "";
3080
- }
3081
- };
3082
- tree.Combinator.prototype = {
3083
- type: "Combinator",
3084
- toCSS: function (env) {
3085
- return {
3086
- '' : '',
3087
- ' ' : ' ',
3088
- ':' : ' :',
3089
- '+' : env.compress ? '+' : ' + ',
3090
- '~' : env.compress ? '~' : ' ~ ',
3091
- '>' : env.compress ? '>' : ' > ',
3092
- '|' : env.compress ? '|' : ' | '
3093
- }[this.value];
3094
- }
3095
- };
3096
-
3097
- })(require('../tree'));
3098
- (function (tree) {
3099
-
3100
- tree.Expression = function (value) { this.value = value; };
3101
- tree.Expression.prototype = {
3102
- type: "Expression",
3103
- accept: function (visitor) {
3104
- this.value = visitor.visit(this.value);
3105
- },
3106
- eval: function (env) {
3107
- var returnValue,
3108
- inParenthesis = this.parens && !this.parensInOp,
3109
- doubleParen = false;
3110
- if (inParenthesis) {
3111
- env.inParenthesis();
3112
- }
3113
- if (this.value.length > 1) {
3114
- returnValue = new(tree.Expression)(this.value.map(function (e) {
3115
- return e.eval(env);
3116
- }));
3117
- } else if (this.value.length === 1) {
3118
- if (this.value[0].parens && !this.value[0].parensInOp) {
3119
- doubleParen = true;
3120
- }
3121
- returnValue = this.value[0].eval(env);
3122
- } else {
3123
- returnValue = this;
3124
- }
3125
- if (inParenthesis) {
3126
- env.outOfParenthesis();
3127
- }
3128
- if (this.parens && this.parensInOp && !(env.isMathOn()) && !doubleParen) {
3129
- returnValue = new(tree.Paren)(returnValue);
3130
- }
3131
- return returnValue;
3132
- },
3133
- toCSS: function (env) {
3134
- return this.value.map(function (e) {
3135
- return e.toCSS ? e.toCSS(env) : '';
3136
- }).join(' ');
3137
- },
3138
- throwAwayComments: function () {
3139
- this.value = this.value.filter(function(v) {
3140
- return !(v instanceof tree.Comment);
3141
- });
3142
- }
3143
- };
3144
-
3145
- })(require('../tree'));
3146
- (function (tree) {
3147
-
3148
- tree.Extend = function Extend(selector, option, index) {
3149
- this.selector = selector;
3150
- this.option = option;
3151
- this.index = index;
3152
-
3153
- switch(option) {
3154
- case "all":
3155
- this.allowBefore = true;
3156
- this.allowAfter = true;
3157
- break;
3158
- default:
3159
- this.allowBefore = false;
3160
- this.allowAfter = false;
3161
- break;
3162
- }
3163
- };
3164
-
3165
- tree.Extend.prototype = {
3166
- type: "Extend",
3167
- accept: function (visitor) {
3168
- this.selector = visitor.visit(this.selector);
3169
- },
3170
- eval: function (env) {
3171
- return new(tree.Extend)(this.selector.eval(env), this.option, this.index);
3172
- },
3173
- clone: function (env) {
3174
- return new(tree.Extend)(this.selector, this.option, this.index);
3175
- },
3176
- findSelfSelectors: function (selectors) {
3177
- var selfElements = [],
3178
- i;
3179
-
3180
- for(i = 0; i < selectors.length; i++) {
3181
- selfElements = selfElements.concat(selectors[i].elements);
3182
- }
3183
-
3184
- this.selfSelectors = [{ elements: selfElements }];
3185
- }
3186
- };
3187
-
3188
- })(require('../tree'));
3189
- (function (tree) {
3190
- //
3191
- // CSS @import node
3192
- //
3193
- // The general strategy here is that we don't want to wait
3194
- // for the parsing to be completed, before we start importing
3195
- // the file. That's because in the context of a browser,
3196
- // most of the time will be spent waiting for the server to respond.
3197
- //
3198
- // On creation, we push the import path to our import queue, though
3199
- // `import,push`, we also pass it a callback, which it'll call once
3200
- // the file has been fetched, and parsed.
3201
- //
3202
- tree.Import = function (path, features, options, index, currentFileInfo) {
3203
- var that = this;
3204
-
3205
- this.options = options;
3206
- this.index = index;
3207
- this.path = path;
3208
- this.features = features;
3209
- this.currentFileInfo = currentFileInfo;
3210
-
3211
- if (this.options.less !== undefined) {
3212
- this.css = !this.options.less;
3213
- } else {
3214
- var pathValue = this.getPath();
3215
- if (pathValue && /css([\?;].*)?$/.test(pathValue)) {
3216
- this.css = true;
3217
- }
3218
- }
3219
- };
3220
-
3221
- //
3222
- // The actual import node doesn't return anything, when converted to CSS.
3223
- // The reason is that it's used at the evaluation stage, so that the rules
3224
- // it imports can be treated like any other rules.
3225
- //
3226
- // In `eval`, we make sure all Import nodes get evaluated, recursively, so
3227
- // we end up with a flat structure, which can easily be imported in the parent
3228
- // ruleset.
3229
- //
3230
- tree.Import.prototype = {
3231
- type: "Import",
3232
- accept: function (visitor) {
3233
- this.features = visitor.visit(this.features);
3234
- this.path = visitor.visit(this.path);
3235
- this.root = visitor.visit(this.root);
3236
- },
3237
- toCSS: function (env) {
3238
- var features = this.features ? ' ' + this.features.toCSS(env) : '';
3239
-
3240
- if (this.css) {
3241
- return "@import " + this.path.toCSS() + features + ';\n';
3242
- } else {
3243
- return "";
3244
- }
3245
- },
3246
- getPath: function () {
3247
- if (this.path instanceof tree.Quoted) {
3248
- var path = this.path.value;
3249
- return (this.css !== undefined || /(\.[a-z]*$)|([\?;].*)$/.test(path)) ? path : path + '.less';
3250
- } else if (this.path instanceof tree.URL) {
3251
- return this.path.value.value;
3252
- }
3253
- return null;
3254
- },
3255
- evalForImport: function (env) {
3256
- return new(tree.Import)(this.path.eval(env), this.features, this.options, this.index, this.currentFileInfo);
3257
- },
3258
- evalPath: function (env) {
3259
- var path = this.path.eval(env);
3260
- var rootpath = this.currentFileInfo && this.currentFileInfo.rootpath;
3261
- if (rootpath && !(path instanceof tree.URL)) {
3262
- var pathValue = path.value;
3263
- // Add the base path if the import is relative
3264
- if (pathValue && env.isPathRelative(pathValue)) {
3265
- path.value = rootpath + pathValue;
3266
- }
3267
- }
3268
- return path;
3269
- },
3270
- eval: function (env) {
3271
- var ruleset, features = this.features && this.features.eval(env);
3272
-
3273
- if (this.skip) { return []; }
3274
-
3275
- if (this.css) {
3276
- var newImport = new(tree.Import)(this.evalPath(env), features, this.options, this.index);
3277
- if (!newImport.css && this.error) {
3278
- throw this.error;
3279
- }
3280
- return newImport;
3281
- } else {
3282
- ruleset = new(tree.Ruleset)([], this.root.rules.slice(0));
3283
-
3284
- ruleset.evalImports(env);
3285
-
3286
- return this.features ? new(tree.Media)(ruleset.rules, this.features.value) : ruleset.rules;
3287
- }
3288
- }
3289
- };
3290
-
3291
- })(require('../tree'));
3292
- (function (tree) {
3293
-
3294
- tree.JavaScript = function (string, index, escaped) {
3295
- this.escaped = escaped;
3296
- this.expression = string;
3297
- this.index = index;
3298
- };
3299
- tree.JavaScript.prototype = {
3300
- type: "JavaScript",
3301
- eval: function (env) {
3302
- var result,
3303
- that = this,
3304
- context = {};
3305
-
3306
- var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
3307
- return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env));
3308
- });
3309
-
3310
- try {
3311
- expression = new(Function)('return (' + expression + ')');
3312
- } catch (e) {
3313
- throw { message: "JavaScript evaluation error: `" + expression + "`" ,
3314
- index: this.index };
3315
- }
3316
-
3317
- for (var k in env.frames[0].variables()) {
3318
- context[k.slice(1)] = {
3319
- value: env.frames[0].variables()[k].value,
3320
- toJS: function () {
3321
- return this.value.eval(env).toCSS();
3322
- }
3323
- };
3324
- }
3325
-
3326
- try {
3327
- result = expression.call(context);
3328
- } catch (e) {
3329
- throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
3330
- index: this.index };
3331
- }
3332
- if (typeof(result) === 'string') {
3333
- return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index);
3334
- } else if (Array.isArray(result)) {
3335
- return new(tree.Anonymous)(result.join(', '));
3336
- } else {
3337
- return new(tree.Anonymous)(result);
3338
- }
3339
- }
3340
- };
3341
-
3342
- })(require('../tree'));
3343
-
3344
- (function (tree) {
3345
-
3346
- tree.Keyword = function (value) { this.value = value };
3347
- tree.Keyword.prototype = {
3348
- type: "Keyword",
3349
- eval: function () { return this; },
3350
- toCSS: function () { return this.value; },
3351
- compare: function (other) {
3352
- if (other instanceof tree.Keyword) {
3353
- return other.value === this.value ? 0 : 1;
3354
- } else {
3355
- return -1;
3356
- }
3357
- }
3358
- };
3359
-
3360
- tree.True = new(tree.Keyword)('true');
3361
- tree.False = new(tree.Keyword)('false');
3362
-
3363
- })(require('../tree'));
3364
- (function (tree) {
3365
-
3366
- tree.Media = function (value, features) {
3367
- var selectors = this.emptySelectors();
3368
-
3369
- this.features = new(tree.Value)(features);
3370
- this.ruleset = new(tree.Ruleset)(selectors, value);
3371
- this.ruleset.allowImports = true;
3372
- };
3373
- tree.Media.prototype = {
3374
- type: "Media",
3375
- accept: function (visitor) {
3376
- this.features = visitor.visit(this.features);
3377
- this.ruleset = visitor.visit(this.ruleset);
3378
- },
3379
- toCSS: function (env) {
3380
- var features = this.features.toCSS(env);
3381
-
3382
- return '@media ' + features + (env.compress ? '{' : ' {\n ') +
3383
- this.ruleset.toCSS(env).trim().replace(/\n/g, '\n ') +
3384
- (env.compress ? '}': '\n}\n');
3385
- },
3386
- eval: function (env) {
3387
- if (!env.mediaBlocks) {
3388
- env.mediaBlocks = [];
3389
- env.mediaPath = [];
3390
- }
3391
-
3392
- var media = new(tree.Media)([], []);
3393
- if(this.debugInfo) {
3394
- this.ruleset.debugInfo = this.debugInfo;
3395
- media.debugInfo = this.debugInfo;
3396
- }
3397
- var strictMathBypass = false;
3398
- if (!env.strictMath) {
3399
- strictMathBypass = true;
3400
- env.strictMath = true;
3401
- }
3402
- try {
3403
- media.features = this.features.eval(env);
3404
- }
3405
- finally {
3406
- if (strictMathBypass) {
3407
- env.strictMath = false;
3408
- }
3409
- }
3410
-
3411
- env.mediaPath.push(media);
3412
- env.mediaBlocks.push(media);
3413
-
3414
- env.frames.unshift(this.ruleset);
3415
- media.ruleset = this.ruleset.eval(env);
3416
- env.frames.shift();
3417
-
3418
- env.mediaPath.pop();
3419
-
3420
- return env.mediaPath.length === 0 ? media.evalTop(env) :
3421
- media.evalNested(env)
3422
- },
3423
- variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
3424
- find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
3425
- rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) },
3426
- emptySelectors: function() {
3427
- var el = new(tree.Element)('', '&', 0);
3428
- return [new(tree.Selector)([el])];
3429
- },
3430
-
3431
- evalTop: function (env) {
3432
- var result = this;
3433
-
3434
- // Render all dependent Media blocks.
3435
- if (env.mediaBlocks.length > 1) {
3436
- var selectors = this.emptySelectors();
3437
- result = new(tree.Ruleset)(selectors, env.mediaBlocks);
3438
- result.multiMedia = true;
3439
- }
3440
-
3441
- delete env.mediaBlocks;
3442
- delete env.mediaPath;
3443
-
3444
- return result;
3445
- },
3446
- evalNested: function (env) {
3447
- var i, value,
3448
- path = env.mediaPath.concat([this]);
3449
-
3450
- // Extract the media-query conditions separated with `,` (OR).
3451
- for (i = 0; i < path.length; i++) {
3452
- value = path[i].features instanceof tree.Value ?
3453
- path[i].features.value : path[i].features;
3454
- path[i] = Array.isArray(value) ? value : [value];
3455
- }
3456
-
3457
- // Trace all permutations to generate the resulting media-query.
3458
- //
3459
- // (a, b and c) with nested (d, e) ->
3460
- // a and d
3461
- // a and e
3462
- // b and c and d
3463
- // b and c and e
3464
- this.features = new(tree.Value)(this.permute(path).map(function (path) {
3465
- path = path.map(function (fragment) {
3466
- return fragment.toCSS ? fragment : new(tree.Anonymous)(fragment);
3467
- });
3468
-
3469
- for(i = path.length - 1; i > 0; i--) {
3470
- path.splice(i, 0, new(tree.Anonymous)("and"));
3471
- }
3472
-
3473
- return new(tree.Expression)(path);
3474
- }));
3475
-
3476
- // Fake a tree-node that doesn't output anything.
3477
- return new(tree.Ruleset)([], []);
3478
- },
3479
- permute: function (arr) {
3480
- if (arr.length === 0) {
3481
- return [];
3482
- } else if (arr.length === 1) {
3483
- return arr[0];
3484
- } else {
3485
- var result = [];
3486
- var rest = this.permute(arr.slice(1));
3487
- for (var i = 0; i < rest.length; i++) {
3488
- for (var j = 0; j < arr[0].length; j++) {
3489
- result.push([arr[0][j]].concat(rest[i]));
3490
- }
3491
- }
3492
- return result;
3493
- }
3494
- },
3495
- bubbleSelectors: function (selectors) {
3496
- this.ruleset = new(tree.Ruleset)(selectors.slice(0), [this.ruleset]);
3497
- }
3498
- };
3499
-
3500
- })(require('../tree'));
3501
- (function (tree) {
3502
-
3503
- tree.mixin = {};
3504
- tree.mixin.Call = function (elements, args, index, currentFileInfo, important) {
3505
- this.selector = new(tree.Selector)(elements);
3506
- this.arguments = args;
3507
- this.index = index;
3508
- this.currentFileInfo = currentFileInfo;
3509
- this.important = important;
3510
- };
3511
- tree.mixin.Call.prototype = {
3512
- type: "MixinCall",
3513
- accept: function (visitor) {
3514
- this.selector = visitor.visit(this.selector);
3515
- this.arguments = visitor.visit(this.arguments);
3516
- },
3517
- eval: function (env) {
3518
- var mixins, mixin, args, rules = [], match = false, i, m, f, isRecursive, isOneFound;
3519
-
3520
- args = this.arguments && this.arguments.map(function (a) {
3521
- return { name: a.name, value: a.value.eval(env) };
3522
- });
3523
-
3524
- for (i = 0; i < env.frames.length; i++) {
3525
- if ((mixins = env.frames[i].find(this.selector)).length > 0) {
3526
- isOneFound = true;
3527
- for (m = 0; m < mixins.length; m++) {
3528
- mixin = mixins[m];
3529
- isRecursive = false;
3530
- for(f = 0; f < env.frames.length; f++) {
3531
- if ((!(mixin instanceof tree.mixin.Definition)) && mixin === (env.frames[f].originalRuleset || env.frames[f])) {
3532
- isRecursive = true;
3533
- break;
3534
- }
3535
- }
3536
- if (isRecursive) {
3537
- continue;
3538
- }
3539
- if (mixin.matchArgs(args, env)) {
3540
- if (!mixin.matchCondition || mixin.matchCondition(args, env)) {
3541
- try {
3542
- Array.prototype.push.apply(
3543
- rules, mixin.eval(env, args, this.important).rules);
3544
- } catch (e) {
3545
- throw { message: e.message, index: this.index, filename: this.currentFileInfo.filename, stack: e.stack };
3546
- }
3547
- }
3548
- match = true;
3549
- }
3550
- }
3551
- if (match) {
3552
- return rules;
3553
- }
3554
- }
3555
- }
3556
- if (isOneFound) {
3557
- throw { type: 'Runtime',
3558
- message: 'No matching definition was found for `' +
3559
- this.selector.toCSS().trim() + '(' +
3560
- (args ? args.map(function (a) {
3561
- var argValue = "";
3562
- if (a.name) {
3563
- argValue += a.name + ":";
3564
- }
3565
- if (a.value.toCSS) {
3566
- argValue += a.value.toCSS();
3567
- } else {
3568
- argValue += "???";
3569
- }
3570
- return argValue;
3571
- }).join(', ') : "") + ")`",
3572
- index: this.index, filename: this.currentFileInfo.filename };
3573
- } else {
3574
- throw { type: 'Name',
3575
- message: this.selector.toCSS().trim() + " is undefined",
3576
- index: this.index, filename: this.currentFileInfo.filename };
3577
- }
3578
- }
3579
- };
3580
-
3581
- tree.mixin.Definition = function (name, params, rules, condition, variadic) {
3582
- this.name = name;
3583
- this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
3584
- this.params = params;
3585
- this.condition = condition;
3586
- this.variadic = variadic;
3587
- this.arity = params.length;
3588
- this.rules = rules;
3589
- this._lookups = {};
3590
- this.required = params.reduce(function (count, p) {
3591
- if (!p.name || (p.name && !p.value)) { return count + 1 }
3592
- else { return count }
3593
- }, 0);
3594
- this.parent = tree.Ruleset.prototype;
3595
- this.frames = [];
3596
- };
3597
- tree.mixin.Definition.prototype = {
3598
- type: "MixinDefinition",
3599
- accept: function (visitor) {
3600
- this.params = visitor.visit(this.params);
3601
- this.rules = visitor.visit(this.rules);
3602
- this.condition = visitor.visit(this.condition);
3603
- },
3604
- toCSS: function () { return ""; },
3605
- variable: function (name) { return this.parent.variable.call(this, name); },
3606
- variables: function () { return this.parent.variables.call(this); },
3607
- find: function () { return this.parent.find.apply(this, arguments); },
3608
- rulesets: function () { return this.parent.rulesets.apply(this); },
3609
-
3610
- evalParams: function (env, mixinEnv, args, evaldArguments) {
3611
- var frame = new(tree.Ruleset)(null, []),
3612
- varargs, arg,
3613
- params = this.params.slice(0),
3614
- i, j, val, name, isNamedFound, argIndex;
3615
-
3616
- mixinEnv = new tree.evalEnv(mixinEnv, [frame].concat(mixinEnv.frames));
3617
-
3618
- if (args) {
3619
- args = args.slice(0);
3620
-
3621
- for(i = 0; i < args.length; i++) {
3622
- arg = args[i];
3623
- if (name = (arg && arg.name)) {
3624
- isNamedFound = false;
3625
- for(j = 0; j < params.length; j++) {
3626
- if (!evaldArguments[j] && name === params[j].name) {
3627
- evaldArguments[j] = arg.value.eval(env);
3628
- frame.rules.unshift(new(tree.Rule)(name, arg.value.eval(env)));
3629
- isNamedFound = true;
3630
- break;
3631
- }
3632
- }
3633
- if (isNamedFound) {
3634
- args.splice(i, 1);
3635
- i--;
3636
- continue;
3637
- } else {
3638
- throw { type: 'Runtime', message: "Named argument for " + this.name +
3639
- ' ' + args[i].name + ' not found' };
3640
- }
3641
- }
3642
- }
3643
- }
3644
- argIndex = 0;
3645
- for (i = 0; i < params.length; i++) {
3646
- if (evaldArguments[i]) continue;
3647
-
3648
- arg = args && args[argIndex];
3649
-
3650
- if (name = params[i].name) {
3651
- if (params[i].variadic && args) {
3652
- varargs = [];
3653
- for (j = argIndex; j < args.length; j++) {
3654
- varargs.push(args[j].value.eval(env));
3655
- }
3656
- frame.rules.unshift(new(tree.Rule)(name, new(tree.Expression)(varargs).eval(env)));
3657
- } else {
3658
- val = arg && arg.value;
3659
- if (val) {
3660
- val = val.eval(env);
3661
- } else if (params[i].value) {
3662
- val = params[i].value.eval(mixinEnv);
3663
- frame.resetCache();
3664
- } else {
3665
- throw { type: 'Runtime', message: "wrong number of arguments for " + this.name +
3666
- ' (' + args.length + ' for ' + this.arity + ')' };
3667
- }
3668
-
3669
- frame.rules.unshift(new(tree.Rule)(name, val));
3670
- evaldArguments[i] = val;
3671
- }
3672
- }
3673
-
3674
- if (params[i].variadic && args) {
3675
- for (j = argIndex; j < args.length; j++) {
3676
- evaldArguments[j] = args[j].value.eval(env);
3677
- }
3678
- }
3679
- argIndex++;
3680
- }
3681
-
3682
- return frame;
3683
- },
3684
- eval: function (env, args, important) {
3685
- var _arguments = [],
3686
- mixinFrames = this.frames.concat(env.frames),
3687
- frame = this.evalParams(env, new(tree.evalEnv)(env, mixinFrames), args, _arguments),
3688
- context, rules, start, ruleset;
3689
-
3690
- frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env)));
3691
-
3692
- rules = important ?
3693
- this.parent.makeImportant.apply(this).rules : this.rules.slice(0);
3694
-
3695
- ruleset = new(tree.Ruleset)(null, rules).eval(new(tree.evalEnv)(env,
3696
- [this, frame].concat(mixinFrames)));
3697
- ruleset.originalRuleset = this;
3698
- return ruleset;
3699
- },
3700
- matchCondition: function (args, env) {
3701
-
3702
- if (this.condition && !this.condition.eval(
3703
- new(tree.evalEnv)(env,
3704
- [this.evalParams(env, new(tree.evalEnv)(env, this.frames.concat(env.frames)), args, [])]
3705
- .concat(env.frames)))) {
3706
- return false;
3707
- }
3708
- return true;
3709
- },
3710
- matchArgs: function (args, env) {
3711
- var argsLength = (args && args.length) || 0, len, frame;
3712
-
3713
- if (! this.variadic) {
3714
- if (argsLength < this.required) { return false }
3715
- if (argsLength > this.params.length) { return false }
3716
- if ((this.required > 0) && (argsLength > this.params.length)) { return false }
3717
- }
3718
-
3719
- len = Math.min(argsLength, this.arity);
3720
-
3721
- for (var i = 0; i < len; i++) {
3722
- if (!this.params[i].name && !this.params[i].variadic) {
3723
- if (args[i].value.eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
3724
- return false;
3725
- }
3726
- }
3727
- }
3728
- return true;
3729
- }
3730
- };
3731
-
3732
- })(require('../tree'));
3733
- (function (tree) {
3734
-
3735
- tree.Negative = function (node) {
3736
- this.value = node;
3737
- };
3738
- tree.Negative.prototype = {
3739
- type: "Negative",
3740
- accept: function (visitor) {
3741
- this.value = visitor.visit(this.value);
3742
- },
3743
- toCSS: function (env) {
3744
- return '-' + this.value.toCSS(env);
3745
- },
3746
- eval: function (env) {
3747
- if (env.isMathOn()) {
3748
- return (new(tree.Operation)('*', [new(tree.Dimension)(-1), this.value])).eval(env);
3749
- }
3750
- return new(tree.Negative)(this.value.eval(env));
3751
- }
3752
- };
3753
-
3754
- })(require('../tree'));
3755
- (function (tree) {
3756
-
3757
- tree.Operation = function (op, operands, isSpaced) {
3758
- this.op = op.trim();
3759
- this.operands = operands;
3760
- this.isSpaced = isSpaced;
3761
- };
3762
- tree.Operation.prototype = {
3763
- type: "Operation",
3764
- accept: function (visitor) {
3765
- this.operands = visitor.visit(this.operands);
3766
- },
3767
- eval: function (env) {
3768
- var a = this.operands[0].eval(env),
3769
- b = this.operands[1].eval(env),
3770
- temp;
3771
-
3772
- if (env.isMathOn()) {
3773
- if (a instanceof tree.Dimension && b instanceof tree.Color) {
3774
- if (this.op === '*' || this.op === '+') {
3775
- temp = b, b = a, a = temp;
3776
- } else {
3777
- throw { type: "Operation",
3778
- message: "Can't substract or divide a color from a number" };
3779
- }
3780
- }
3781
- if (!a.operate) {
3782
- throw { type: "Operation",
3783
- message: "Operation on an invalid type" };
3784
- }
3785
-
3786
- return a.operate(env, this.op, b);
3787
- } else {
3788
- return new(tree.Operation)(this.op, [a, b], this.isSpaced);
3789
- }
3790
- },
3791
- toCSS: function (env) {
3792
- var separator = this.isSpaced ? " " : "";
3793
- return this.operands[0].toCSS() + separator + this.op + separator + this.operands[1].toCSS();
3794
- }
3795
- };
3796
-
3797
- tree.operate = function (env, op, a, b) {
3798
- switch (op) {
3799
- case '+': return a + b;
3800
- case '-': return a - b;
3801
- case '*': return a * b;
3802
- case '/': return a / b;
3803
- }
3804
- };
3805
-
3806
- })(require('../tree'));
3807
-
3808
- (function (tree) {
3809
-
3810
- tree.Paren = function (node) {
3811
- this.value = node;
3812
- };
3813
- tree.Paren.prototype = {
3814
- type: "Paren",
3815
- accept: function (visitor) {
3816
- this.value = visitor.visit(this.value);
3817
- },
3818
- toCSS: function (env) {
3819
- return '(' + this.value.toCSS(env).trim() + ')';
3820
- },
3821
- eval: function (env) {
3822
- return new(tree.Paren)(this.value.eval(env));
3823
- }
3824
- };
3825
-
3826
- })(require('../tree'));
3827
- (function (tree) {
3828
-
3829
- tree.Quoted = function (str, content, escaped, index, currentFileInfo) {
3830
- this.escaped = escaped;
3831
- this.value = content || '';
3832
- this.quote = str.charAt(0);
3833
- this.index = index;
3834
- this.currentFileInfo = currentFileInfo;
3835
- };
3836
- tree.Quoted.prototype = {
3837
- type: "Quoted",
3838
- toCSS: function () {
3839
- if (this.escaped) {
3840
- return this.value;
3841
- } else {
3842
- return this.quote + this.value + this.quote;
3843
- }
3844
- },
3845
- eval: function (env) {
3846
- var that = this;
3847
- var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
3848
- return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
3849
- }).replace(/@\{([\w-]+)\}/g, function (_, name) {
3850
- var v = new(tree.Variable)('@' + name, that.index, that.currentFileInfo).eval(env, true);
3851
- return (v instanceof tree.Quoted) ? v.value : v.toCSS();
3852
- });
3853
- return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index);
3854
- },
3855
- compare: function (x) {
3856
- if (!x.toCSS) {
3857
- return -1;
3858
- }
3859
-
3860
- var left = this.toCSS(),
3861
- right = x.toCSS();
3862
-
3863
- if (left === right) {
3864
- return 0;
3865
- }
3866
-
3867
- return left < right ? -1 : 1;
3868
- }
3869
- };
3870
-
3871
- })(require('../tree'));
3872
- (function (tree) {
3873
-
3874
- tree.Rule = function (name, value, important, index, currentFileInfo, inline) {
3875
- this.name = name;
3876
- this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
3877
- this.important = important ? ' ' + important.trim() : '';
3878
- this.index = index;
3879
- this.currentFileInfo = currentFileInfo;
3880
- this.inline = inline || false;
3881
-
3882
- if (name.charAt(0) === '@') {
3883
- this.variable = true;
3884
- } else { this.variable = false }
3885
- };
3886
-
3887
- tree.Rule.prototype = {
3888
- type: "Rule",
3889
- accept: function (visitor) {
3890
- this.value = visitor.visit(this.value);
3891
- },
3892
- toCSS: function (env) {
3893
- if (this.variable) { return "" }
3894
- else {
3895
- try {
3896
- return this.name + (env.compress ? ':' : ': ') +
3897
- this.value.toCSS(env) +
3898
- this.important + (this.inline ? "" : ";");
3899
- }
3900
- catch(e) {
3901
- e.index = this.index;
3902
- e.filename = this.currentFileInfo.filename;
3903
- throw e;
3904
- }
3905
- }
3906
- },
3907
- eval: function (env) {
3908
- var strictMathBypass = false;
3909
- if (this.name === "font" && !env.strictMath) {
3910
- strictMathBypass = true;
3911
- env.strictMath = true;
3912
- }
3913
- try {
3914
- return new(tree.Rule)(this.name,
3915
- this.value.eval(env),
3916
- this.important,
3917
- this.index, this.currentFileInfo, this.inline);
3918
- }
3919
- finally {
3920
- if (strictMathBypass) {
3921
- env.strictMath = false;
3922
- }
3923
- }
3924
- },
3925
- makeImportant: function () {
3926
- return new(tree.Rule)(this.name,
3927
- this.value,
3928
- "!important",
3929
- this.index, this.currentFileInfo, this.inline);
3930
- }
3931
- };
3932
-
3933
- })(require('../tree'));
3934
- (function (tree) {
3935
-
3936
- tree.Ruleset = function (selectors, rules, strictImports) {
3937
- this.selectors = selectors;
3938
- this.rules = rules;
3939
- this._lookups = {};
3940
- this.strictImports = strictImports;
3941
- };
3942
- tree.Ruleset.prototype = {
3943
- type: "Ruleset",
3944
- accept: function (visitor) {
3945
- this.selectors = visitor.visit(this.selectors);
3946
- this.rules = visitor.visit(this.rules);
3947
- },
3948
- eval: function (env) {
3949
- var selectors = this.selectors && this.selectors.map(function (s) { return s.eval(env) });
3950
- var ruleset = new(tree.Ruleset)(selectors, this.rules.slice(0), this.strictImports);
3951
- var rules;
3952
-
3953
- ruleset.originalRuleset = this;
3954
- ruleset.root = this.root;
3955
- ruleset.firstRoot = this.firstRoot;
3956
- ruleset.allowImports = this.allowImports;
3957
-
3958
- if(this.debugInfo) {
3959
- ruleset.debugInfo = this.debugInfo;
3960
- }
3961
-
3962
- // push the current ruleset to the frames stack
3963
- env.frames.unshift(ruleset);
3964
-
3965
- // currrent selectors
3966
- if (!env.selectors) {
3967
- env.selectors = [];
3968
- }
3969
- env.selectors.unshift(this.selectors);
3970
-
3971
- // Evaluate imports
3972
- if (ruleset.root || ruleset.allowImports || !ruleset.strictImports) {
3973
- ruleset.evalImports(env);
3974
- }
3975
-
3976
- // Store the frames around mixin definitions,
3977
- // so they can be evaluated like closures when the time comes.
3978
- for (var i = 0; i < ruleset.rules.length; i++) {
3979
- if (ruleset.rules[i] instanceof tree.mixin.Definition) {
3980
- ruleset.rules[i].frames = env.frames.slice(0);
3981
- }
3982
- }
3983
-
3984
- var mediaBlockCount = (env.mediaBlocks && env.mediaBlocks.length) || 0;
3985
-
3986
- // Evaluate mixin calls.
3987
- for (var i = 0; i < ruleset.rules.length; i++) {
3988
- if (ruleset.rules[i] instanceof tree.mixin.Call) {
3989
- rules = ruleset.rules[i].eval(env).filter(function(r) {
3990
- if ((r instanceof tree.Rule) && r.variable) {
3991
- // do not pollute the scope if the variable is
3992
- // already there. consider returning false here
3993
- // but we need a way to "return" variable from mixins
3994
- return !(ruleset.variable(r.name));
3995
- }
3996
- return true;
3997
- });
3998
- ruleset.rules.splice.apply(ruleset.rules, [i, 1].concat(rules));
3999
- i += rules.length-1;
4000
- ruleset.resetCache();
4001
- }
4002
- }
4003
-
4004
- // Evaluate everything else
4005
- for (var i = 0, rule; i < ruleset.rules.length; i++) {
4006
- rule = ruleset.rules[i];
4007
-
4008
- if (! (rule instanceof tree.mixin.Definition)) {
4009
- ruleset.rules[i] = rule.eval ? rule.eval(env) : rule;
4010
- }
4011
- }
4012
-
4013
- // Pop the stack
4014
- env.frames.shift();
4015
- env.selectors.shift();
4016
-
4017
- if (env.mediaBlocks) {
4018
- for(var i = mediaBlockCount; i < env.mediaBlocks.length; i++) {
4019
- env.mediaBlocks[i].bubbleSelectors(selectors);
4020
- }
4021
- }
4022
-
4023
- return ruleset;
4024
- },
4025
- evalImports: function(env) {
4026
- var i, rules;
4027
- for (i = 0; i < this.rules.length; i++) {
4028
- if (this.rules[i] instanceof tree.Import) {
4029
- rules = this.rules[i].eval(env);
4030
- if (typeof rules.length === "number") {
4031
- this.rules.splice.apply(this.rules, [i, 1].concat(rules));
4032
- i+= rules.length-1;
4033
- } else {
4034
- this.rules.splice(i, 1, rules);
4035
- }
4036
- this.resetCache();
4037
- }
4038
- }
4039
- },
4040
- makeImportant: function() {
4041
- return new tree.Ruleset(this.selectors, this.rules.map(function (r) {
4042
- if (r.makeImportant) {
4043
- return r.makeImportant();
4044
- } else {
4045
- return r;
4046
- }
4047
- }), this.strictImports);
4048
- },
4049
- matchArgs: function (args) {
4050
- return !args || args.length === 0;
4051
- },
4052
- resetCache: function () {
4053
- this._rulesets = null;
4054
- this._variables = null;
4055
- this._lookups = {};
4056
- },
4057
- variables: function () {
4058
- if (this._variables) { return this._variables }
4059
- else {
4060
- return this._variables = this.rules.reduce(function (hash, r) {
4061
- if (r instanceof tree.Rule && r.variable === true) {
4062
- hash[r.name] = r;
4063
- }
4064
- return hash;
4065
- }, {});
4066
- }
4067
- },
4068
- variable: function (name) {
4069
- return this.variables()[name];
4070
- },
4071
- rulesets: function () {
4072
- return this.rules.filter(function (r) {
4073
- return (r instanceof tree.Ruleset) || (r instanceof tree.mixin.Definition);
4074
- });
4075
- },
4076
- find: function (selector, self) {
4077
- self = self || this;
4078
- var rules = [], rule, match,
4079
- key = selector.toCSS();
4080
-
4081
- if (key in this._lookups) { return this._lookups[key] }
4082
-
4083
- this.rulesets().forEach(function (rule) {
4084
- if (rule !== self) {
4085
- for (var j = 0; j < rule.selectors.length; j++) {
4086
- if (match = selector.match(rule.selectors[j])) {
4087
- if (selector.elements.length > rule.selectors[j].elements.length) {
4088
- Array.prototype.push.apply(rules, rule.find(
4089
- new(tree.Selector)(selector.elements.slice(1)), self));
4090
- } else {
4091
- rules.push(rule);
4092
- }
4093
- break;
4094
- }
4095
- }
4096
- }
4097
- });
4098
- return this._lookups[key] = rules;
4099
- },
4100
- //
4101
- // Entry point for code generation
4102
- //
4103
- // `context` holds an array of arrays.
4104
- //
4105
- toCSS: function (env) {
4106
- var css = [], // The CSS output
4107
- rules = [], // node.Rule instances
4108
- _rules = [], //
4109
- rulesets = [], // node.Ruleset instances
4110
- selector, // The fully rendered selector
4111
- debugInfo, // Line number debugging
4112
- rule;
4113
-
4114
- // Compile rules and rulesets
4115
- for (var i = 0; i < this.rules.length; i++) {
4116
- rule = this.rules[i];
4117
-
4118
- if (rule.rules || (rule instanceof tree.Media)) {
4119
- rulesets.push(rule.toCSS(env));
4120
- } else if (rule instanceof tree.Directive) {
4121
- var cssValue = rule.toCSS(env);
4122
- // Output only the first @charset definition as such - convert the others
4123
- // to comments in case debug is enabled
4124
- if (rule.name === "@charset") {
4125
- // Only output the debug info together with subsequent @charset definitions
4126
- // a comment (or @media statement) before the actual @charset directive would
4127
- // be considered illegal css as it has to be on the first line
4128
- if (env.charset) {
4129
- if (rule.debugInfo) {
4130
- rulesets.push(tree.debugInfo(env, rule));
4131
- rulesets.push(new tree.Comment("/* "+cssValue.replace(/\n/g, "")+" */\n").toCSS(env));
4132
- }
4133
- continue;
4134
- }
4135
- env.charset = true;
4136
- }
4137
- rulesets.push(cssValue);
4138
- } else if (rule instanceof tree.Comment) {
4139
- if (!rule.silent) {
4140
- if (this.root) {
4141
- rulesets.push(rule.toCSS(env));
4142
- } else {
4143
- rules.push(rule.toCSS(env));
4144
- }
4145
- }
4146
- } else {
4147
- if (rule.toCSS && !rule.variable) {
4148
- if (this.firstRoot && rule instanceof tree.Rule) {
4149
- throw { message: "properties must be inside selector blocks, they cannot be in the root.",
4150
- index: rule.index, filename: rule.currentFileInfo ? rule.currentFileInfo.filename : null};
4151
- }
4152
- rules.push(rule.toCSS(env));
4153
- } else if (rule.value && !rule.variable) {
4154
- rules.push(rule.value.toString());
4155
- }
4156
- }
4157
- }
4158
-
4159
- // Remove last semicolon
4160
- if (env.compress && rules.length) {
4161
- rule = rules[rules.length - 1];
4162
- if (rule.charAt(rule.length - 1) === ';') {
4163
- rules[rules.length - 1] = rule.substring(0, rule.length - 1);
4164
- }
4165
- }
4166
-
4167
- rulesets = rulesets.join('');
4168
-
4169
- // If this is the root node, we don't render
4170
- // a selector, or {}.
4171
- // Otherwise, only output if this ruleset has rules.
4172
- if (this.root) {
4173
- css.push(rules.join(env.compress ? '' : '\n'));
4174
- } else {
4175
- if (rules.length > 0) {
4176
- debugInfo = tree.debugInfo(env, this);
4177
- selector = this.paths.map(function (p) {
4178
- return p.map(function (s) {
4179
- return s.toCSS(env);
4180
- }).join('').trim();
4181
- }).join(env.compress ? ',' : ',\n');
4182
-
4183
- // Remove duplicates
4184
- for (var i = rules.length - 1; i >= 0; i--) {
4185
- if (rules[i].slice(0, 2) === "/*" || _rules.indexOf(rules[i]) === -1) {
4186
- _rules.unshift(rules[i]);
4187
- }
4188
- }
4189
- rules = _rules;
4190
-
4191
- css.push(debugInfo + selector +
4192
- (env.compress ? '{' : ' {\n ') +
4193
- rules.join(env.compress ? '' : '\n ') +
4194
- (env.compress ? '}' : '\n}\n'));
4195
- }
4196
- }
4197
- css.push(rulesets);
4198
-
4199
- return css.join('') + (env.compress ? '\n' : '');
4200
- },
4201
-
4202
- joinSelectors: function (paths, context, selectors) {
4203
- for (var s = 0; s < selectors.length; s++) {
4204
- this.joinSelector(paths, context, selectors[s]);
4205
- }
4206
- },
4207
-
4208
- joinSelector: function (paths, context, selector) {
4209
-
4210
- var i, j, k,
4211
- hasParentSelector, newSelectors, el, sel, parentSel,
4212
- newSelectorPath, afterParentJoin, newJoinedSelector,
4213
- newJoinedSelectorEmpty, lastSelector, currentElements,
4214
- selectorsMultiplied;
4215
-
4216
- for (i = 0; i < selector.elements.length; i++) {
4217
- el = selector.elements[i];
4218
- if (el.value === '&') {
4219
- hasParentSelector = true;
4220
- }
4221
- }
4222
-
4223
- if (!hasParentSelector) {
4224
- if (context.length > 0) {
4225
- for(i = 0; i < context.length; i++) {
4226
- paths.push(context[i].concat(selector));
4227
- }
4228
- }
4229
- else {
4230
- paths.push([selector]);
4231
- }
4232
- retu