WP User Avatar - Version 3.0

Version Description

(The rebrand to ProfilePress) = * Added custom login forms. * Added frontend user registration form. * Added User Profiles. * Added Member Directories. * Added Content Protection. * Added Admin bar and dashboard access restriction.

See the changelog file for full change log information.

Download this release

Release Info

Developer Collizo4sky
Plugin Icon 128x128 WP User Avatar
Version 3.0
Comparing to
See all releases

Code changes from version 2.2.16 to 3.0

Files changed (147) hide show
  1. assets/codemirror/codemirror.css +348 -0
  2. assets/codemirror/codemirror.js +9730 -0
  3. assets/codemirror/css.js +730 -0
  4. assets/codemirror/htmlmixed.js +152 -0
  5. assets/codemirror/index.php +5 -0
  6. assets/codemirror/javascript.js +900 -0
  7. assets/codemirror/xml.js +402 -0
  8. assets/css/admin-style.css +1905 -0
  9. assets/css/form-builder.css +1042 -0
  10. assets/css/frontend.css +2499 -0
  11. assets/css/frontend.min.css +1 -0
  12. assets/css/hint.min.css +5 -0
  13. assets/css/images/bg_fallback.png +0 -0
  14. assets/css/images/icon_sprite.png +0 -0
  15. assets/css/images/ui-icons_222222_256x240.png +0 -0
  16. assets/css/images/ui-icons_454545_256x240.png +0 -0
  17. assets/css/material-icons/MaterialIcons-Regular.eot +0 -0
  18. assets/css/material-icons/MaterialIcons-Regular.ttf +0 -0
  19. assets/css/material-icons/MaterialIcons-Regular.woff +0 -0
  20. assets/css/material-icons/MaterialIcons-Regular.woff2 +0 -0
  21. assets/flatpickr/flatpickr.min.css +13 -0
  22. assets/flatpickr/flatpickr.min.js +2 -0
  23. assets/images/admin/car.svg +67 -0
  24. assets/images/admin/dragdrop-builder-icon.png +0 -0
  25. assets/images/admin/index.php +5 -0
  26. assets/images/admin/mo-pro-upgrade.jpg +0 -0
  27. assets/images/admin/shortcode-builder-icon.png +0 -0
  28. assets/images/bash/bash-facebook.png +0 -0
  29. assets/images/bash/bash-google.png +0 -0
  30. assets/images/bash/bash-twitter.png +0 -0
  31. assets/images/dixon-fe-profile/bg.jpg +0 -0
  32. assets/images/dixon-fe-profile/facebook.png +0 -0
  33. assets/images/dixon-fe-profile/index.php +5 -0
  34. assets/images/dixon-fe-profile/inn.png +0 -0
  35. assets/images/dixon-fe-profile/linkedin.png +0 -0
  36. assets/images/dixon-fe-profile/twitter.png +0 -0
  37. assets/images/frontend/arrow-down.png +0 -0
  38. assets/images/frontend/jc_dft_img.jpg +0 -0
  39. assets/images/index.php +5 -0
  40. assets/images/monochrome/dribbble.png +0 -0
  41. assets/images/monochrome/facebook.png +0 -0
  42. assets/images/monochrome/flickr.png +0 -0
  43. assets/images/monochrome/github.png +0 -0
  44. assets/images/monochrome/instagram.png +0 -0
  45. assets/images/monochrome/pinterest.png +0 -0
  46. assets/images/monochrome/soundcloud.png +0 -0
  47. assets/images/monochrome/spotify.png +0 -0
  48. assets/images/monochrome/twitter.png +0 -0
  49. assets/images/monochrome/youtube.png +0 -0
  50. assets/images/parallel/dots.png +0 -0
  51. assets/images/parallel/facebook.png +0 -0
  52. assets/images/parallel/github.png +0 -0
  53. assets/images/parallel/google.png +0 -0
  54. assets/images/parallel/linkedin.png +0 -0
  55. assets/images/parallel/twitter.png +0 -0
  56. assets/images/smiley/avatar.gif +0 -0
  57. assets/images/smiley/bg1.png +0 -0
  58. assets/images/smiley/bg2.png +0 -0
  59. assets/images/smiley/facebook.png +0 -0
  60. assets/images/smiley/linkedin.png +0 -0
  61. assets/images/smiley/twitter.png +0 -0
  62. assets/images/social-login/amazon.svg +1 -0
  63. assets/images/social-login/disqus.svg +1 -0
  64. assets/images/social-login/facebook.svg +1 -0
  65. assets/images/social-login/github-fa.svg +1 -0
  66. assets/images/social-login/google.svg +1 -0
  67. assets/images/social-login/instagram.svg +1 -0
  68. assets/images/social-login/linkedin.svg +1 -0
  69. assets/images/social-login/paypal.svg +1 -0
  70. assets/images/social-login/twitter.svg +1 -0
  71. assets/images/social-login/vk-fa.svg +1 -0
  72. assets/images/social-login/vkontakte.svg +1 -0
  73. assets/images/social-login/yahoo.svg +240 -0
  74. assets/images/themes/bash-account-form.gif +0 -0
  75. assets/images/themes/bash-login.png +0 -0
  76. assets/images/themes/bash-password-reset.png +0 -0
  77. assets/images/themes/bash-registration.png +0 -0
  78. assets/images/themes/boson-edit-profile.png +0 -0
  79. assets/images/themes/boson-registration.png +0 -0
  80. assets/images/themes/daffodil-edit-profile.png +0 -0
  81. assets/images/themes/daffodil-login.png +0 -0
  82. assets/images/themes/daffodil-password-reset.png +0 -0
  83. assets/images/themes/daffodil-registration.png +0 -0
  84. assets/images/themes/daisy-profile.png +0 -0
  85. assets/images/themes/default-member-directory.png +0 -0
  86. assets/images/themes/default-user-profile.png +0 -0
  87. assets/images/themes/dixon-profile.png +0 -0
  88. assets/images/themes/fzbuk-login.png +0 -0
  89. assets/images/themes/fzbuk-password-reset.png +0 -0
  90. assets/images/themes/fzbuk-registration.png +0 -0
  91. assets/images/themes/gerbera-member-directory.png +0 -0
  92. assets/images/themes/jakhu-login.png +0 -0
  93. assets/images/themes/jakhu-password-reset.png +0 -0
  94. assets/images/themes/jakhu-registration.png +0 -0
  95. assets/images/themes/lavender-registration.png +0 -0
  96. assets/images/themes/lucid-tab-widget.png +0 -0
  97. assets/images/themes/monochrome-profile.png +0 -0
  98. assets/images/themes/montserrat-form.gif +0 -0
  99. assets/images/themes/parallel-login.gif +0 -0
  100. assets/images/themes/parallel-password-reset.gif +0 -0
  101. assets/images/themes/parallel-registration.gif +0 -0
  102. assets/images/themes/perfectolite-edit-profile.png +0 -0
  103. assets/images/themes/perfectolite-login.png +0 -0
  104. assets/images/themes/perfectolite-password-reset.png +0 -0
  105. assets/images/themes/perfectolite-registration.png +0 -0
  106. assets/images/themes/perfectopro-login.png +0 -0
  107. assets/images/themes/perfectopro-registration.png +0 -0
  108. assets/images/themes/pinnacle-edit-profile.png +0 -0
  109. assets/images/themes/pinnacle-login-registration.png +0 -0
  110. assets/images/themes/pinnacle-password-reset.png +0 -0
  111. assets/images/themes/premium-theme.png +0 -0
  112. assets/images/themes/smiley-edit-profile.png +0 -0
  113. assets/images/themes/smiley-edit-profile2.png +0 -0
  114. assets/images/themes/smiley-login.png +0 -0
  115. assets/images/themes/smiley-password-reset.png +0 -0
  116. assets/images/themes/smiley-profile.png +0 -0
  117. assets/images/themes/smiley-registration.png +0 -0
  118. assets/images/themes/smiley2-profile.png +0 -0
  119. assets/images/themes/stride.gif +0 -0
  120. assets/images/themes/sukan-login.png +0 -0
  121. assets/images/themes/tulip-edit-profile.png +0 -0
  122. assets/images/themes/tulip-login.png +0 -0
  123. assets/images/themes/tulip-password-reset.png +0 -0
  124. assets/images/themes/tulip-registration.png +0 -0
  125. assets/index.php +5 -0
  126. assets/jbox/init.js +7 -0
  127. assets/jbox/jBox.all.min.css +1 -0
  128. assets/jbox/jBox.all.min.js +1 -0
  129. assets/js/admin.js +458 -0
  130. assets/js/builder/app.min.js +1 -0
  131. assets/js/builder/src/app.js +102 -0
  132. assets/js/builder/src/collections/form-settings.js +6 -0
  133. assets/js/builder/src/model/form-setting.js +9 -0
  134. assets/js/builder/src/util.js +18 -0
  135. assets/js/builder/src/views/field-bar.js +73 -0
  136. assets/js/builder/src/views/field-settings.js +136 -0
  137. assets/js/builder/src/views/main-layout.js +82 -0
  138. assets/js/builder/src/views/metabox.js +65 -0
  139. assets/js/builder/src/views/sidebar-layout.js +120 -0
  140. assets/js/clipboard.min.js +7 -0
  141. assets/js/content-control.js +178 -0
  142. assets/js/create-form.js +119 -0
  143. assets/js/frontend.js +474 -0
  144. assets/js/frontend.min.js +1 -0
  145. assets/js/index.php +5 -0
  146. assets/js/jcarousel.min.js +5 -0
  147. assets/js/jquery.blockUI.js +295 -0
assets/codemirror/codemirror.css ADDED
@@ -0,0 +1,348 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* BASICS */
2
+
3
+ .CodeMirror {
4
+ /* Set height, width, borders, and global font properties here */
5
+ font-family: monospace;
6
+ height: 600px;
7
+ width: 680px;
8
+ color: black;
9
+ border: 1px solid #ddd;
10
+ direction: ltr;
11
+ }
12
+
13
+ /* PADDING */
14
+
15
+ .CodeMirror-lines {
16
+ padding: 4px 0; /* Vertical padding around content */
17
+ }
18
+ .CodeMirror pre {
19
+ padding: 0 4px; /* Horizontal padding of content */
20
+ }
21
+
22
+ .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
23
+ background-color: white; /* The little square between H and V scrollbars */
24
+ }
25
+
26
+ /* GUTTER */
27
+
28
+ .CodeMirror-gutters {
29
+ border-right: 1px solid #ddd;
30
+ background-color: #f7f7f7;
31
+ white-space: nowrap;
32
+ }
33
+ .CodeMirror-linenumbers {}
34
+ .CodeMirror-linenumber {
35
+ padding: 0 3px 0 5px;
36
+ min-width: 20px;
37
+ text-align: right;
38
+ color: #999;
39
+ white-space: nowrap;
40
+ }
41
+
42
+ .CodeMirror-guttermarker { color: black; }
43
+ .CodeMirror-guttermarker-subtle { color: #999; }
44
+
45
+ /* CURSOR */
46
+
47
+ .CodeMirror-cursor {
48
+ border-left: 1px solid black;
49
+ border-right: none;
50
+ width: 0;
51
+ }
52
+ /* Shown when moving in bi-directional text */
53
+ .CodeMirror div.CodeMirror-secondarycursor {
54
+ border-left: 1px solid silver;
55
+ }
56
+ .cm-fat-cursor .CodeMirror-cursor {
57
+ width: auto;
58
+ border: 0 !important;
59
+ background: #7e7;
60
+ }
61
+ .cm-fat-cursor div.CodeMirror-cursors {
62
+ z-index: 1;
63
+ }
64
+ .cm-fat-cursor-mark {
65
+ background-color: rgba(20, 255, 20, 0.5);
66
+ -webkit-animation: blink 1.06s steps(1) infinite;
67
+ -moz-animation: blink 1.06s steps(1) infinite;
68
+ animation: blink 1.06s steps(1) infinite;
69
+ }
70
+ .cm-animate-fat-cursor {
71
+ width: auto;
72
+ border: 0;
73
+ -webkit-animation: blink 1.06s steps(1) infinite;
74
+ -moz-animation: blink 1.06s steps(1) infinite;
75
+ animation: blink 1.06s steps(1) infinite;
76
+ background-color: #7e7;
77
+ }
78
+ @-moz-keyframes blink {
79
+ 0% {}
80
+ 50% { background-color: transparent; }
81
+ 100% {}
82
+ }
83
+ @-webkit-keyframes blink {
84
+ 0% {}
85
+ 50% { background-color: transparent; }
86
+ 100% {}
87
+ }
88
+ @keyframes blink {
89
+ 0% {}
90
+ 50% { background-color: transparent; }
91
+ 100% {}
92
+ }
93
+
94
+ /* Can style cursor different in overwrite (non-insert) mode */
95
+ .CodeMirror-overwrite .CodeMirror-cursor {}
96
+
97
+ .cm-tab { display: inline-block; text-decoration: inherit; }
98
+
99
+ .CodeMirror-rulers {
100
+ position: absolute;
101
+ left: 0; right: 0; top: -50px; bottom: -20px;
102
+ overflow: hidden;
103
+ }
104
+ .CodeMirror-ruler {
105
+ border-left: 1px solid #ccc;
106
+ top: 0; bottom: 0;
107
+ position: absolute;
108
+ }
109
+
110
+ /* DEFAULT THEME */
111
+
112
+ .cm-s-default .cm-header {color: blue;}
113
+ .cm-s-default .cm-quote {color: #090;}
114
+ .cm-negative {color: #d44;}
115
+ .cm-positive {color: #292;}
116
+ .cm-header, .cm-strong {font-weight: bold;}
117
+ .cm-em {font-style: italic;}
118
+ .cm-link {text-decoration: underline;}
119
+ .cm-strikethrough {text-decoration: line-through;}
120
+
121
+ .cm-s-default .cm-keyword {color: #708;}
122
+ .cm-s-default .cm-atom {color: #219;}
123
+ .cm-s-default .cm-number {color: #164;}
124
+ .cm-s-default .cm-def {color: #00f;}
125
+ .cm-s-default .cm-variable,
126
+ .cm-s-default .cm-punctuation,
127
+ .cm-s-default .cm-property,
128
+ .cm-s-default .cm-operator {}
129
+ .cm-s-default .cm-variable-2 {color: #05a;}
130
+ .cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
131
+ .cm-s-default .cm-comment {color: #a50;}
132
+ .cm-s-default .cm-string {color: #a11;}
133
+ .cm-s-default .cm-string-2 {color: #f50;}
134
+ .cm-s-default .cm-meta {color: #555;}
135
+ .cm-s-default .cm-qualifier {color: #555;}
136
+ .cm-s-default .cm-builtin {color: #30a;}
137
+ .cm-s-default .cm-bracket {color: #997;}
138
+ .cm-s-default .cm-tag {color: #170;}
139
+ .cm-s-default .cm-attribute {color: #00c;}
140
+ .cm-s-default .cm-hr {color: #999;}
141
+ .cm-s-default .cm-link {color: #00c;}
142
+
143
+ .cm-s-default .cm-error {color: #f00;}
144
+ .cm-invalidchar {color: #f00;}
145
+
146
+ .CodeMirror-composing { border-bottom: 2px solid; }
147
+
148
+ /* Default styles for common addons */
149
+
150
+ div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
151
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
152
+ .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
153
+ .CodeMirror-activeline-background {background: #e8f2ff;}
154
+
155
+ /* STOP */
156
+
157
+ /* The rest of this file contains styles related to the mechanics of
158
+ the editor. You probably shouldn't touch them. */
159
+
160
+ .CodeMirror {
161
+ position: relative;
162
+ overflow: hidden;
163
+ background: white;
164
+ }
165
+
166
+ .CodeMirror-scroll {
167
+ overflow: scroll !important; /* Things will break if this is overridden */
168
+ /* 30px is the magic margin used to hide the element's real scrollbars */
169
+ /* See overflow: hidden in .CodeMirror */
170
+ margin-bottom: -30px; margin-right: -30px;
171
+ padding-bottom: 30px;
172
+ height: 100%;
173
+ outline: none; /* Prevent dragging from highlighting the element */
174
+ position: relative;
175
+ }
176
+ .CodeMirror-sizer {
177
+ position: relative;
178
+ border-right: 30px solid transparent;
179
+ }
180
+
181
+ /* The fake, visible scrollbars. Used to force redraw during scrolling
182
+ before actual scrolling happens, thus preventing shaking and
183
+ flickering artifacts. */
184
+ .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
185
+ position: absolute;
186
+ z-index: 6;
187
+ display: none;
188
+ }
189
+ .CodeMirror-vscrollbar {
190
+ right: 0; top: 0;
191
+ overflow-x: hidden;
192
+ overflow-y: scroll;
193
+ }
194
+ .CodeMirror-hscrollbar {
195
+ bottom: 0; left: 0;
196
+ overflow-y: hidden;
197
+ overflow-x: scroll;
198
+ }
199
+ .CodeMirror-scrollbar-filler {
200
+ right: 0; bottom: 0;
201
+ }
202
+ .CodeMirror-gutter-filler {
203
+ left: 0; bottom: 0;
204
+ }
205
+
206
+ .CodeMirror-gutters {
207
+ position: absolute; left: 0; top: 0;
208
+ min-height: 100%;
209
+ z-index: 3;
210
+ }
211
+ .CodeMirror-gutter {
212
+ white-space: normal;
213
+ height: 100%;
214
+ display: inline-block;
215
+ vertical-align: top;
216
+ margin-bottom: -30px;
217
+ }
218
+ .CodeMirror-gutter-wrapper {
219
+ position: absolute;
220
+ z-index: 4;
221
+ background: none !important;
222
+ border: none !important;
223
+ }
224
+ .CodeMirror-gutter-background {
225
+ position: absolute;
226
+ top: 0; bottom: 0;
227
+ z-index: 4;
228
+ }
229
+ .CodeMirror-gutter-elt {
230
+ position: absolute;
231
+ cursor: default;
232
+ z-index: 4;
233
+ }
234
+ .CodeMirror-gutter-wrapper ::selection { background-color: transparent }
235
+ .CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
236
+
237
+ .CodeMirror-lines {
238
+ cursor: text;
239
+ min-height: 1px; /* prevents collapsing before first draw */
240
+ }
241
+ .CodeMirror pre {
242
+ /* Reset some styles that the rest of the page might have set */
243
+ -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
244
+ border-width: 0;
245
+ background: transparent;
246
+ font-family: inherit;
247
+ font-size: inherit;
248
+ margin: 0;
249
+ white-space: pre;
250
+ word-wrap: normal;
251
+ line-height: inherit;
252
+ color: inherit;
253
+ z-index: 2;
254
+ position: relative;
255
+ overflow: visible;
256
+ -webkit-tap-highlight-color: transparent;
257
+ -webkit-font-variant-ligatures: contextual;
258
+ font-variant-ligatures: contextual;
259
+ }
260
+ .CodeMirror-wrap pre {
261
+ word-wrap: break-word;
262
+ white-space: pre-wrap;
263
+ word-break: normal;
264
+ }
265
+
266
+ .CodeMirror-linebackground {
267
+ position: absolute;
268
+ left: 0; right: 0; top: 0; bottom: 0;
269
+ z-index: 0;
270
+ }
271
+
272
+ .CodeMirror-linewidget {
273
+ position: relative;
274
+ z-index: 2;
275
+ padding: 0.1px; /* Force widget margins to stay inside of the container */
276
+ }
277
+
278
+ .CodeMirror-widget {}
279
+
280
+ .CodeMirror-rtl pre { direction: rtl; }
281
+
282
+ .CodeMirror-code {
283
+ outline: none;
284
+ }
285
+
286
+ /* Force content-box sizing for the elements where we expect it */
287
+ .CodeMirror-scroll,
288
+ .CodeMirror-sizer,
289
+ .CodeMirror-gutter,
290
+ .CodeMirror-gutters,
291
+ .CodeMirror-linenumber {
292
+ -moz-box-sizing: content-box;
293
+ box-sizing: content-box;
294
+ }
295
+
296
+ .CodeMirror-measure {
297
+ position: absolute;
298
+ width: 100%;
299
+ height: 0;
300
+ overflow: hidden;
301
+ visibility: hidden;
302
+ }
303
+
304
+ .CodeMirror-cursor {
305
+ position: absolute;
306
+ pointer-events: none;
307
+ }
308
+ .CodeMirror-measure pre { position: static; }
309
+
310
+ div.CodeMirror-cursors {
311
+ visibility: hidden;
312
+ position: relative;
313
+ z-index: 3;
314
+ }
315
+ div.CodeMirror-dragcursors {
316
+ visibility: visible;
317
+ }
318
+
319
+ .CodeMirror-focused div.CodeMirror-cursors {
320
+ visibility: visible;
321
+ }
322
+
323
+ .CodeMirror-selected { background: #d9d9d9; }
324
+ .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
325
+ .CodeMirror-crosshair { cursor: crosshair; }
326
+ .CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
327
+ .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
328
+
329
+ .cm-searching {
330
+ background-color: #ffa;
331
+ background-color: rgba(255, 255, 0, .4);
332
+ }
333
+
334
+ /* Used to force a border model for a node */
335
+ .cm-force-border { padding-right: .1px; }
336
+
337
+ @media print {
338
+ /* Hide the cursor when printing */
339
+ .CodeMirror div.CodeMirror-cursors {
340
+ visibility: hidden;
341
+ }
342
+ }
343
+
344
+ /* See issue #2901 */
345
+ .cm-tab-wrap-hack:after { content: ''; }
346
+
347
+ /* Help users use markselection to safely style text background */
348
+ span.CodeMirror-selectedtext { background: none; }
assets/codemirror/codemirror.js ADDED
@@ -0,0 +1,9730 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ // This is CodeMirror (https://codemirror.net), a code editor
5
+ // implemented in JavaScript on top of the browser's DOM.
6
+ //
7
+ // You can find some technical background for some of the code below
8
+ // at http://marijnhaverbeke.nl/blog/#cm-internals .
9
+
10
+ (function (global, factory) {
11
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
12
+ typeof define === 'function' && define.amd ? define(factory) :
13
+ (global.CodeMirror = factory());
14
+ }(this, (function () { 'use strict';
15
+
16
+ // Kludges for bugs and behavior differences that can't be feature
17
+ // detected are enabled based on userAgent etc sniffing.
18
+ var userAgent = navigator.userAgent;
19
+ var platform = navigator.platform;
20
+
21
+ var gecko = /gecko\/\d/i.test(userAgent);
22
+ var ie_upto10 = /MSIE \d/.test(userAgent);
23
+ var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent);
24
+ var edge = /Edge\/(\d+)/.exec(userAgent);
25
+ var ie = ie_upto10 || ie_11up || edge;
26
+ var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);
27
+ var webkit = !edge && /WebKit\//.test(userAgent);
28
+ var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
29
+ var chrome = !edge && /Chrome\//.test(userAgent);
30
+ var presto = /Opera\//.test(userAgent);
31
+ var safari = /Apple Computer/.test(navigator.vendor);
32
+ var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
33
+ var phantom = /PhantomJS/.test(userAgent);
34
+
35
+ var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
36
+ var android = /Android/.test(userAgent);
37
+ // This is woefully incomplete. Suggestions for alternative methods welcome.
38
+ var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
39
+ var mac = ios || /Mac/.test(platform);
40
+ var chromeOS = /\bCrOS\b/.test(userAgent);
41
+ var windows = /win/i.test(platform);
42
+
43
+ var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
44
+ if (presto_version) { presto_version = Number(presto_version[1]); }
45
+ if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
46
+ // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
47
+ var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));
48
+ var captureRightClick = gecko || (ie && ie_version >= 9);
49
+
50
+ function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
51
+
52
+ var rmClass = function(node, cls) {
53
+ var current = node.className;
54
+ var match = classTest(cls).exec(current);
55
+ if (match) {
56
+ var after = current.slice(match.index + match[0].length);
57
+ node.className = current.slice(0, match.index) + (after ? match[1] + after : "");
58
+ }
59
+ };
60
+
61
+ function removeChildren(e) {
62
+ for (var count = e.childNodes.length; count > 0; --count)
63
+ { e.removeChild(e.firstChild); }
64
+ return e
65
+ }
66
+
67
+ function removeChildrenAndAdd(parent, e) {
68
+ return removeChildren(parent).appendChild(e)
69
+ }
70
+
71
+ function elt(tag, content, className, style) {
72
+ var e = document.createElement(tag);
73
+ if (className) { e.className = className; }
74
+ if (style) { e.style.cssText = style; }
75
+ if (typeof content == "string") { e.appendChild(document.createTextNode(content)); }
76
+ else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }
77
+ return e
78
+ }
79
+ // wrapper for elt, which removes the elt from the accessibility tree
80
+ function eltP(tag, content, className, style) {
81
+ var e = elt(tag, content, className, style);
82
+ e.setAttribute("role", "presentation");
83
+ return e
84
+ }
85
+
86
+ var range;
87
+ if (document.createRange) { range = function(node, start, end, endNode) {
88
+ var r = document.createRange();
89
+ r.setEnd(endNode || node, end);
90
+ r.setStart(node, start);
91
+ return r
92
+ }; }
93
+ else { range = function(node, start, end) {
94
+ var r = document.body.createTextRange();
95
+ try { r.moveToElementText(node.parentNode); }
96
+ catch(e) { return r }
97
+ r.collapse(true);
98
+ r.moveEnd("character", end);
99
+ r.moveStart("character", start);
100
+ return r
101
+ }; }
102
+
103
+ function contains(parent, child) {
104
+ if (child.nodeType == 3) // Android browser always returns false when child is a textnode
105
+ { child = child.parentNode; }
106
+ if (parent.contains)
107
+ { return parent.contains(child) }
108
+ do {
109
+ if (child.nodeType == 11) { child = child.host; }
110
+ if (child == parent) { return true }
111
+ } while (child = child.parentNode)
112
+ }
113
+
114
+ function activeElt() {
115
+ // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
116
+ // IE < 10 will throw when accessed while the page is loading or in an iframe.
117
+ // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
118
+ var activeElement;
119
+ try {
120
+ activeElement = document.activeElement;
121
+ } catch(e) {
122
+ activeElement = document.body || null;
123
+ }
124
+ while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
125
+ { activeElement = activeElement.shadowRoot.activeElement; }
126
+ return activeElement
127
+ }
128
+
129
+ function addClass(node, cls) {
130
+ var current = node.className;
131
+ if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; }
132
+ }
133
+ function joinClasses(a, b) {
134
+ var as = a.split(" ");
135
+ for (var i = 0; i < as.length; i++)
136
+ { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } }
137
+ return b
138
+ }
139
+
140
+ var selectInput = function(node) { node.select(); };
141
+ if (ios) // Mobile Safari apparently has a bug where select() is broken.
142
+ { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }
143
+ else if (ie) // Suppress mysterious IE10 errors
144
+ { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }
145
+
146
+ function bind(f) {
147
+ var args = Array.prototype.slice.call(arguments, 1);
148
+ return function(){return f.apply(null, args)}
149
+ }
150
+
151
+ function copyObj(obj, target, overwrite) {
152
+ if (!target) { target = {}; }
153
+ for (var prop in obj)
154
+ { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
155
+ { target[prop] = obj[prop]; } }
156
+ return target
157
+ }
158
+
159
+ // Counts the column offset in a string, taking tabs into account.
160
+ // Used mostly to find indentation.
161
+ function countColumn(string, end, tabSize, startIndex, startValue) {
162
+ if (end == null) {
163
+ end = string.search(/[^\s\u00a0]/);
164
+ if (end == -1) { end = string.length; }
165
+ }
166
+ for (var i = startIndex || 0, n = startValue || 0;;) {
167
+ var nextTab = string.indexOf("\t", i);
168
+ if (nextTab < 0 || nextTab >= end)
169
+ { return n + (end - i) }
170
+ n += nextTab - i;
171
+ n += tabSize - (n % tabSize);
172
+ i = nextTab + 1;
173
+ }
174
+ }
175
+
176
+ var Delayed = function() {this.id = null;};
177
+ Delayed.prototype.set = function (ms, f) {
178
+ clearTimeout(this.id);
179
+ this.id = setTimeout(f, ms);
180
+ };
181
+
182
+ function indexOf(array, elt) {
183
+ for (var i = 0; i < array.length; ++i)
184
+ { if (array[i] == elt) { return i } }
185
+ return -1
186
+ }
187
+
188
+ // Number of pixels added to scroller and sizer to hide scrollbar
189
+ var scrollerGap = 30;
190
+
191
+ // Returned or thrown by various protocols to signal 'I'm not
192
+ // handling this'.
193
+ var Pass = {toString: function(){return "CodeMirror.Pass"}};
194
+
195
+ // Reused option objects for setSelection & friends
196
+ var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"};
197
+
198
+ // The inverse of countColumn -- find the offset that corresponds to
199
+ // a particular column.
200
+ function findColumn(string, goal, tabSize) {
201
+ for (var pos = 0, col = 0;;) {
202
+ var nextTab = string.indexOf("\t", pos);
203
+ if (nextTab == -1) { nextTab = string.length; }
204
+ var skipped = nextTab - pos;
205
+ if (nextTab == string.length || col + skipped >= goal)
206
+ { return pos + Math.min(skipped, goal - col) }
207
+ col += nextTab - pos;
208
+ col += tabSize - (col % tabSize);
209
+ pos = nextTab + 1;
210
+ if (col >= goal) { return pos }
211
+ }
212
+ }
213
+
214
+ var spaceStrs = [""];
215
+ function spaceStr(n) {
216
+ while (spaceStrs.length <= n)
217
+ { spaceStrs.push(lst(spaceStrs) + " "); }
218
+ return spaceStrs[n]
219
+ }
220
+
221
+ function lst(arr) { return arr[arr.length-1] }
222
+
223
+ function map(array, f) {
224
+ var out = [];
225
+ for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }
226
+ return out
227
+ }
228
+
229
+ function insertSorted(array, value, score) {
230
+ var pos = 0, priority = score(value);
231
+ while (pos < array.length && score(array[pos]) <= priority) { pos++; }
232
+ array.splice(pos, 0, value);
233
+ }
234
+
235
+ function nothing() {}
236
+
237
+ function createObj(base, props) {
238
+ var inst;
239
+ if (Object.create) {
240
+ inst = Object.create(base);
241
+ } else {
242
+ nothing.prototype = base;
243
+ inst = new nothing();
244
+ }
245
+ if (props) { copyObj(props, inst); }
246
+ return inst
247
+ }
248
+
249
+ var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
250
+ function isWordCharBasic(ch) {
251
+ return /\w/.test(ch) || ch > "\x80" &&
252
+ (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))
253
+ }
254
+ function isWordChar(ch, helper) {
255
+ if (!helper) { return isWordCharBasic(ch) }
256
+ if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true }
257
+ return helper.test(ch)
258
+ }
259
+
260
+ function isEmpty(obj) {
261
+ for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }
262
+ return true
263
+ }
264
+
265
+ // Extending unicode characters. A series of a non-extending char +
266
+ // any number of extending chars is treated as a single unit as far
267
+ // as editing and measuring is concerned. This is not fully correct,
268
+ // since some scripts/fonts/browsers also treat other configurations
269
+ // of code points as a group.
270
+ var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;
271
+ function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }
272
+
273
+ // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.
274
+ function skipExtendingChars(str, pos, dir) {
275
+ while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }
276
+ return pos
277
+ }
278
+
279
+ // Returns the value from the range [`from`; `to`] that satisfies
280
+ // `pred` and is closest to `from`. Assumes that at least `to`
281
+ // satisfies `pred`. Supports `from` being greater than `to`.
282
+ function findFirst(pred, from, to) {
283
+ // At any point we are certain `to` satisfies `pred`, don't know
284
+ // whether `from` does.
285
+ var dir = from > to ? -1 : 1;
286
+ for (;;) {
287
+ if (from == to) { return from }
288
+ var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);
289
+ if (mid == from) { return pred(mid) ? from : to }
290
+ if (pred(mid)) { to = mid; }
291
+ else { from = mid + dir; }
292
+ }
293
+ }
294
+
295
+ // The display handles the DOM integration, both for input reading
296
+ // and content drawing. It holds references to DOM nodes and
297
+ // display-related state.
298
+
299
+ function Display(place, doc, input) {
300
+ var d = this;
301
+ this.input = input;
302
+
303
+ // Covers bottom-right square when both scrollbars are present.
304
+ d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
305
+ d.scrollbarFiller.setAttribute("cm-not-content", "true");
306
+ // Covers bottom of gutter when coverGutterNextToScrollbar is on
307
+ // and h scrollbar is present.
308
+ d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
309
+ d.gutterFiller.setAttribute("cm-not-content", "true");
310
+ // Will contain the actual code, positioned to cover the viewport.
311
+ d.lineDiv = eltP("div", null, "CodeMirror-code");
312
+ // Elements are added to these to represent selection and cursors.
313
+ d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
314
+ d.cursorDiv = elt("div", null, "CodeMirror-cursors");
315
+ // A visibility: hidden element used to find the size of things.
316
+ d.measure = elt("div", null, "CodeMirror-measure");
317
+ // When lines outside of the viewport are measured, they are drawn in this.
318
+ d.lineMeasure = elt("div", null, "CodeMirror-measure");
319
+ // Wraps everything that needs to exist inside the vertically-padded coordinate system
320
+ d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
321
+ null, "position: relative; outline: none");
322
+ var lines = eltP("div", [d.lineSpace], "CodeMirror-lines");
323
+ // Moved around its parent to cover visible view.
324
+ d.mover = elt("div", [lines], null, "position: relative");
325
+ // Set to the height of the document, allowing scrolling.
326
+ d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
327
+ d.sizerWidth = null;
328
+ // Behavior of elts with overflow: auto and padding is
329
+ // inconsistent across browsers. This is used to ensure the
330
+ // scrollable area is big enough.
331
+ d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;");
332
+ // Will contain the gutters, if any.
333
+ d.gutters = elt("div", null, "CodeMirror-gutters");
334
+ d.lineGutter = null;
335
+ // Actual scrollable element.
336
+ d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
337
+ d.scroller.setAttribute("tabIndex", "-1");
338
+ // The element in which the editor lives.
339
+ d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
340
+
341
+ // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
342
+ if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
343
+ if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }
344
+
345
+ if (place) {
346
+ if (place.appendChild) { place.appendChild(d.wrapper); }
347
+ else { place(d.wrapper); }
348
+ }
349
+
350
+ // Current rendered range (may be bigger than the view window).
351
+ d.viewFrom = d.viewTo = doc.first;
352
+ d.reportedViewFrom = d.reportedViewTo = doc.first;
353
+ // Information about the rendered lines.
354
+ d.view = [];
355
+ d.renderedView = null;
356
+ // Holds info about a single rendered line when it was rendered
357
+ // for measurement, while not in view.
358
+ d.externalMeasured = null;
359
+ // Empty space (in pixels) above the view
360
+ d.viewOffset = 0;
361
+ d.lastWrapHeight = d.lastWrapWidth = 0;
362
+ d.updateLineNumbers = null;
363
+
364
+ d.nativeBarWidth = d.barHeight = d.barWidth = 0;
365
+ d.scrollbarsClipped = false;
366
+
367
+ // Used to only resize the line number gutter when necessary (when
368
+ // the amount of lines crosses a boundary that makes its width change)
369
+ d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
370
+ // Set to true when a non-horizontal-scrolling line widget is
371
+ // added. As an optimization, line widget aligning is skipped when
372
+ // this is false.
373
+ d.alignWidgets = false;
374
+
375
+ d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
376
+
377
+ // Tracks the maximum line length so that the horizontal scrollbar
378
+ // can be kept static when scrolling.
379
+ d.maxLine = null;
380
+ d.maxLineLength = 0;
381
+ d.maxLineChanged = false;
382
+
383
+ // Used for measuring wheel scrolling granularity
384
+ d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
385
+
386
+ // True when shift is held down.
387
+ d.shift = false;
388
+
389
+ // Used to track whether anything happened since the context menu
390
+ // was opened.
391
+ d.selForContextMenu = null;
392
+
393
+ d.activeTouch = null;
394
+
395
+ input.init(d);
396
+ }
397
+
398
+ // Find the line object corresponding to the given line number.
399
+ function getLine(doc, n) {
400
+ n -= doc.first;
401
+ if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") }
402
+ var chunk = doc;
403
+ while (!chunk.lines) {
404
+ for (var i = 0;; ++i) {
405
+ var child = chunk.children[i], sz = child.chunkSize();
406
+ if (n < sz) { chunk = child; break }
407
+ n -= sz;
408
+ }
409
+ }
410
+ return chunk.lines[n]
411
+ }
412
+
413
+ // Get the part of a document between two positions, as an array of
414
+ // strings.
415
+ function getBetween(doc, start, end) {
416
+ var out = [], n = start.line;
417
+ doc.iter(start.line, end.line + 1, function (line) {
418
+ var text = line.text;
419
+ if (n == end.line) { text = text.slice(0, end.ch); }
420
+ if (n == start.line) { text = text.slice(start.ch); }
421
+ out.push(text);
422
+ ++n;
423
+ });
424
+ return out
425
+ }
426
+ // Get the lines between from and to, as array of strings.
427
+ function getLines(doc, from, to) {
428
+ var out = [];
429
+ doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value
430
+ return out
431
+ }
432
+
433
+ // Update the height of a line, propagating the height change
434
+ // upwards to parent nodes.
435
+ function updateLineHeight(line, height) {
436
+ var diff = height - line.height;
437
+ if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }
438
+ }
439
+
440
+ // Given a line object, find its line number by walking up through
441
+ // its parent links.
442
+ function lineNo(line) {
443
+ if (line.parent == null) { return null }
444
+ var cur = line.parent, no = indexOf(cur.lines, line);
445
+ for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
446
+ for (var i = 0;; ++i) {
447
+ if (chunk.children[i] == cur) { break }
448
+ no += chunk.children[i].chunkSize();
449
+ }
450
+ }
451
+ return no + cur.first
452
+ }
453
+
454
+ // Find the line at the given vertical position, using the height
455
+ // information in the document tree.
456
+ function lineAtHeight(chunk, h) {
457
+ var n = chunk.first;
458
+ outer: do {
459
+ for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {
460
+ var child = chunk.children[i$1], ch = child.height;
461
+ if (h < ch) { chunk = child; continue outer }
462
+ h -= ch;
463
+ n += child.chunkSize();
464
+ }
465
+ return n
466
+ } while (!chunk.lines)
467
+ var i = 0;
468
+ for (; i < chunk.lines.length; ++i) {
469
+ var line = chunk.lines[i], lh = line.height;
470
+ if (h < lh) { break }
471
+ h -= lh;
472
+ }
473
+ return n + i
474
+ }
475
+
476
+ function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}
477
+
478
+ function lineNumberFor(options, i) {
479
+ return String(options.lineNumberFormatter(i + options.firstLineNumber))
480
+ }
481
+
482
+ // A Pos instance represents a position within the text.
483
+ function Pos(line, ch, sticky) {
484
+ if ( sticky === void 0 ) sticky = null;
485
+
486
+ if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }
487
+ this.line = line;
488
+ this.ch = ch;
489
+ this.sticky = sticky;
490
+ }
491
+
492
+ // Compare two positions, return 0 if they are the same, a negative
493
+ // number when a is less, and a positive number otherwise.
494
+ function cmp(a, b) { return a.line - b.line || a.ch - b.ch }
495
+
496
+ function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }
497
+
498
+ function copyPos(x) {return Pos(x.line, x.ch)}
499
+ function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }
500
+ function minPos(a, b) { return cmp(a, b) < 0 ? a : b }
501
+
502
+ // Most of the external API clips given positions to make sure they
503
+ // actually exist within the document.
504
+ function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}
505
+ function clipPos(doc, pos) {
506
+ if (pos.line < doc.first) { return Pos(doc.first, 0) }
507
+ var last = doc.first + doc.size - 1;
508
+ if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }
509
+ return clipToLen(pos, getLine(doc, pos.line).text.length)
510
+ }
511
+ function clipToLen(pos, linelen) {
512
+ var ch = pos.ch;
513
+ if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }
514
+ else if (ch < 0) { return Pos(pos.line, 0) }
515
+ else { return pos }
516
+ }
517
+ function clipPosArray(doc, array) {
518
+ var out = [];
519
+ for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }
520
+ return out
521
+ }
522
+
523
+ // Optimize some code when these features are not used.
524
+ var sawReadOnlySpans = false, sawCollapsedSpans = false;
525
+
526
+ function seeReadOnlySpans() {
527
+ sawReadOnlySpans = true;
528
+ }
529
+
530
+ function seeCollapsedSpans() {
531
+ sawCollapsedSpans = true;
532
+ }
533
+
534
+ // TEXTMARKER SPANS
535
+
536
+ function MarkedSpan(marker, from, to) {
537
+ this.marker = marker;
538
+ this.from = from; this.to = to;
539
+ }
540
+
541
+ // Search an array of spans for a span matching the given marker.
542
+ function getMarkedSpanFor(spans, marker) {
543
+ if (spans) { for (var i = 0; i < spans.length; ++i) {
544
+ var span = spans[i];
545
+ if (span.marker == marker) { return span }
546
+ } }
547
+ }
548
+ // Remove a span from an array, returning undefined if no spans are
549
+ // left (we don't store arrays for lines without spans).
550
+ function removeMarkedSpan(spans, span) {
551
+ var r;
552
+ for (var i = 0; i < spans.length; ++i)
553
+ { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }
554
+ return r
555
+ }
556
+ // Add a span to a line.
557
+ function addMarkedSpan(line, span) {
558
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
559
+ span.marker.attachLine(line);
560
+ }
561
+
562
+ // Used for the algorithm that adjusts markers for a change in the
563
+ // document. These functions cut an array of spans at a given
564
+ // character position, returning an array of remaining chunks (or
565
+ // undefined if nothing remains).
566
+ function markedSpansBefore(old, startCh, isInsert) {
567
+ var nw;
568
+ if (old) { for (var i = 0; i < old.length; ++i) {
569
+ var span = old[i], marker = span.marker;
570
+ var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
571
+ if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
572
+ var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)
573
+ ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
574
+ }
575
+ } }
576
+ return nw
577
+ }
578
+ function markedSpansAfter(old, endCh, isInsert) {
579
+ var nw;
580
+ if (old) { for (var i = 0; i < old.length; ++i) {
581
+ var span = old[i], marker = span.marker;
582
+ var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
583
+ if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
584
+ var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)
585
+ ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
586
+ span.to == null ? null : span.to - endCh));
587
+ }
588
+ } }
589
+ return nw
590
+ }
591
+
592
+ // Given a change object, compute the new set of marker spans that
593
+ // cover the line in which the change took place. Removes spans
594
+ // entirely within the change, reconnects spans belonging to the
595
+ // same marker that appear on both sides of the change, and cuts off
596
+ // spans partially within the change. Returns an array of span
597
+ // arrays with one element for each line in (after) the change.
598
+ function stretchSpansOverChange(doc, change) {
599
+ if (change.full) { return null }
600
+ var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
601
+ var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
602
+ if (!oldFirst && !oldLast) { return null }
603
+
604
+ var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;
605
+ // Get the spans that 'stick out' on both sides
606
+ var first = markedSpansBefore(oldFirst, startCh, isInsert);
607
+ var last = markedSpansAfter(oldLast, endCh, isInsert);
608
+
609
+ // Next, merge those two ends
610
+ var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);
611
+ if (first) {
612
+ // Fix up .to properties of first
613
+ for (var i = 0; i < first.length; ++i) {
614
+ var span = first[i];
615
+ if (span.to == null) {
616
+ var found = getMarkedSpanFor(last, span.marker);
617
+ if (!found) { span.to = startCh; }
618
+ else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }
619
+ }
620
+ }
621
+ }
622
+ if (last) {
623
+ // Fix up .from in last (or move them into first in case of sameLine)
624
+ for (var i$1 = 0; i$1 < last.length; ++i$1) {
625
+ var span$1 = last[i$1];
626
+ if (span$1.to != null) { span$1.to += offset; }
627
+ if (span$1.from == null) {
628
+ var found$1 = getMarkedSpanFor(first, span$1.marker);
629
+ if (!found$1) {
630
+ span$1.from = offset;
631
+ if (sameLine) { (first || (first = [])).push(span$1); }
632
+ }
633
+ } else {
634
+ span$1.from += offset;
635
+ if (sameLine) { (first || (first = [])).push(span$1); }
636
+ }
637
+ }
638
+ }
639
+ // Make sure we didn't create any zero-length spans
640
+ if (first) { first = clearEmptySpans(first); }
641
+ if (last && last != first) { last = clearEmptySpans(last); }
642
+
643
+ var newMarkers = [first];
644
+ if (!sameLine) {
645
+ // Fill gap with whole-line-spans
646
+ var gap = change.text.length - 2, gapMarkers;
647
+ if (gap > 0 && first)
648
+ { for (var i$2 = 0; i$2 < first.length; ++i$2)
649
+ { if (first[i$2].to == null)
650
+ { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }
651
+ for (var i$3 = 0; i$3 < gap; ++i$3)
652
+ { newMarkers.push(gapMarkers); }
653
+ newMarkers.push(last);
654
+ }
655
+ return newMarkers
656
+ }
657
+
658
+ // Remove spans that are empty and don't have a clearWhenEmpty
659
+ // option of false.
660
+ function clearEmptySpans(spans) {
661
+ for (var i = 0; i < spans.length; ++i) {
662
+ var span = spans[i];
663
+ if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)
664
+ { spans.splice(i--, 1); }
665
+ }
666
+ if (!spans.length) { return null }
667
+ return spans
668
+ }
669
+
670
+ // Used to 'clip' out readOnly ranges when making a change.
671
+ function removeReadOnlyRanges(doc, from, to) {
672
+ var markers = null;
673
+ doc.iter(from.line, to.line + 1, function (line) {
674
+ if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
675
+ var mark = line.markedSpans[i].marker;
676
+ if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
677
+ { (markers || (markers = [])).push(mark); }
678
+ } }
679
+ });
680
+ if (!markers) { return null }
681
+ var parts = [{from: from, to: to}];
682
+ for (var i = 0; i < markers.length; ++i) {
683
+ var mk = markers[i], m = mk.find(0);
684
+ for (var j = 0; j < parts.length; ++j) {
685
+ var p = parts[j];
686
+ if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }
687
+ var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);
688
+ if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
689
+ { newParts.push({from: p.from, to: m.from}); }
690
+ if (dto > 0 || !mk.inclusiveRight && !dto)
691
+ { newParts.push({from: m.to, to: p.to}); }
692
+ parts.splice.apply(parts, newParts);
693
+ j += newParts.length - 3;
694
+ }
695
+ }
696
+ return parts
697
+ }
698
+
699
+ // Connect or disconnect spans from a line.
700
+ function detachMarkedSpans(line) {
701
+ var spans = line.markedSpans;
702
+ if (!spans) { return }
703
+ for (var i = 0; i < spans.length; ++i)
704
+ { spans[i].marker.detachLine(line); }
705
+ line.markedSpans = null;
706
+ }
707
+ function attachMarkedSpans(line, spans) {
708
+ if (!spans) { return }
709
+ for (var i = 0; i < spans.length; ++i)
710
+ { spans[i].marker.attachLine(line); }
711
+ line.markedSpans = spans;
712
+ }
713
+
714
+ // Helpers used when computing which overlapping collapsed span
715
+ // counts as the larger one.
716
+ function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }
717
+ function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }
718
+
719
+ // Returns a number indicating which of two overlapping collapsed
720
+ // spans is larger (and thus includes the other). Falls back to
721
+ // comparing ids when the spans cover exactly the same range.
722
+ function compareCollapsedMarkers(a, b) {
723
+ var lenDiff = a.lines.length - b.lines.length;
724
+ if (lenDiff != 0) { return lenDiff }
725
+ var aPos = a.find(), bPos = b.find();
726
+ var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);
727
+ if (fromCmp) { return -fromCmp }
728
+ var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);
729
+ if (toCmp) { return toCmp }
730
+ return b.id - a.id
731
+ }
732
+
733
+ // Find out whether a line ends or starts in a collapsed span. If
734
+ // so, return the marker for that span.
735
+ function collapsedSpanAtSide(line, start) {
736
+ var sps = sawCollapsedSpans && line.markedSpans, found;
737
+ if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
738
+ sp = sps[i];
739
+ if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&
740
+ (!found || compareCollapsedMarkers(found, sp.marker) < 0))
741
+ { found = sp.marker; }
742
+ } }
743
+ return found
744
+ }
745
+ function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }
746
+ function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }
747
+
748
+ function collapsedSpanAround(line, ch) {
749
+ var sps = sawCollapsedSpans && line.markedSpans, found;
750
+ if (sps) { for (var i = 0; i < sps.length; ++i) {
751
+ var sp = sps[i];
752
+ if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&
753
+ (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }
754
+ } }
755
+ return found
756
+ }
757
+
758
+ // Test whether there exists a collapsed span that partially
759
+ // overlaps (covers the start or end, but not both) of a new span.
760
+ // Such overlap is not allowed.
761
+ function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {
762
+ var line = getLine(doc, lineNo$$1);
763
+ var sps = sawCollapsedSpans && line.markedSpans;
764
+ if (sps) { for (var i = 0; i < sps.length; ++i) {
765
+ var sp = sps[i];
766
+ if (!sp.marker.collapsed) { continue }
767
+ var found = sp.marker.find(0);
768
+ var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);
769
+ var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);
770
+ if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }
771
+ if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||
772
+ fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))
773
+ { return true }
774
+ } }
775
+ }
776
+
777
+ // A visual line is a line as drawn on the screen. Folding, for
778
+ // example, can cause multiple logical lines to appear on the same
779
+ // visual line. This finds the start of the visual line that the
780
+ // given line is part of (usually that is the line itself).
781
+ function visualLine(line) {
782
+ var merged;
783
+ while (merged = collapsedSpanAtStart(line))
784
+ { line = merged.find(-1, true).line; }
785
+ return line
786
+ }
787
+
788
+ function visualLineEnd(line) {
789
+ var merged;
790
+ while (merged = collapsedSpanAtEnd(line))
791
+ { line = merged.find(1, true).line; }
792
+ return line
793
+ }
794
+
795
+ // Returns an array of logical lines that continue the visual line
796
+ // started by the argument, or undefined if there are no such lines.
797
+ function visualLineContinued(line) {
798
+ var merged, lines;
799
+ while (merged = collapsedSpanAtEnd(line)) {
800
+ line = merged.find(1, true).line
801
+ ;(lines || (lines = [])).push(line);
802
+ }
803
+ return lines
804
+ }
805
+
806
+ // Get the line number of the start of the visual line that the
807
+ // given line number is part of.
808
+ function visualLineNo(doc, lineN) {
809
+ var line = getLine(doc, lineN), vis = visualLine(line);
810
+ if (line == vis) { return lineN }
811
+ return lineNo(vis)
812
+ }
813
+
814
+ // Get the line number of the start of the next visual line after
815
+ // the given line.
816
+ function visualLineEndNo(doc, lineN) {
817
+ if (lineN > doc.lastLine()) { return lineN }
818
+ var line = getLine(doc, lineN), merged;
819
+ if (!lineIsHidden(doc, line)) { return lineN }
820
+ while (merged = collapsedSpanAtEnd(line))
821
+ { line = merged.find(1, true).line; }
822
+ return lineNo(line) + 1
823
+ }
824
+
825
+ // Compute whether a line is hidden. Lines count as hidden when they
826
+ // are part of a visual line that starts with another line, or when
827
+ // they are entirely covered by collapsed, non-widget span.
828
+ function lineIsHidden(doc, line) {
829
+ var sps = sawCollapsedSpans && line.markedSpans;
830
+ if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {
831
+ sp = sps[i];
832
+ if (!sp.marker.collapsed) { continue }
833
+ if (sp.from == null) { return true }
834
+ if (sp.marker.widgetNode) { continue }
835
+ if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
836
+ { return true }
837
+ } }
838
+ }
839
+ function lineIsHiddenInner(doc, line, span) {
840
+ if (span.to == null) {
841
+ var end = span.marker.find(1, true);
842
+ return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))
843
+ }
844
+ if (span.marker.inclusiveRight && span.to == line.text.length)
845
+ { return true }
846
+ for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {
847
+ sp = line.markedSpans[i];
848
+ if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
849
+ (sp.to == null || sp.to != span.from) &&
850
+ (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
851
+ lineIsHiddenInner(doc, line, sp)) { return true }
852
+ }
853
+ }
854
+
855
+ // Find the height above the given line.
856
+ function heightAtLine(lineObj) {
857
+ lineObj = visualLine(lineObj);
858
+
859
+ var h = 0, chunk = lineObj.parent;
860
+ for (var i = 0; i < chunk.lines.length; ++i) {
861
+ var line = chunk.lines[i];
862
+ if (line == lineObj) { break }
863
+ else { h += line.height; }
864
+ }
865
+ for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
866
+ for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
867
+ var cur = p.children[i$1];
868
+ if (cur == chunk) { break }
869
+ else { h += cur.height; }
870
+ }
871
+ }
872
+ return h
873
+ }
874
+
875
+ // Compute the character length of a line, taking into account
876
+ // collapsed ranges (see markText) that might hide parts, and join
877
+ // other lines onto it.
878
+ function lineLength(line) {
879
+ if (line.height == 0) { return 0 }
880
+ var len = line.text.length, merged, cur = line;
881
+ while (merged = collapsedSpanAtStart(cur)) {
882
+ var found = merged.find(0, true);
883
+ cur = found.from.line;
884
+ len += found.from.ch - found.to.ch;
885
+ }
886
+ cur = line;
887
+ while (merged = collapsedSpanAtEnd(cur)) {
888
+ var found$1 = merged.find(0, true);
889
+ len -= cur.text.length - found$1.from.ch;
890
+ cur = found$1.to.line;
891
+ len += cur.text.length - found$1.to.ch;
892
+ }
893
+ return len
894
+ }
895
+
896
+ // Find the longest line in the document.
897
+ function findMaxLine(cm) {
898
+ var d = cm.display, doc = cm.doc;
899
+ d.maxLine = getLine(doc, doc.first);
900
+ d.maxLineLength = lineLength(d.maxLine);
901
+ d.maxLineChanged = true;
902
+ doc.iter(function (line) {
903
+ var len = lineLength(line);
904
+ if (len > d.maxLineLength) {
905
+ d.maxLineLength = len;
906
+ d.maxLine = line;
907
+ }
908
+ });
909
+ }
910
+
911
+ // BIDI HELPERS
912
+
913
+ function iterateBidiSections(order, from, to, f) {
914
+ if (!order) { return f(from, to, "ltr", 0) }
915
+ var found = false;
916
+ for (var i = 0; i < order.length; ++i) {
917
+ var part = order[i];
918
+ if (part.from < to && part.to > from || from == to && part.to == from) {
919
+ f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i);
920
+ found = true;
921
+ }
922
+ }
923
+ if (!found) { f(from, to, "ltr"); }
924
+ }
925
+
926
+ var bidiOther = null;
927
+ function getBidiPartAt(order, ch, sticky) {
928
+ var found;
929
+ bidiOther = null;
930
+ for (var i = 0; i < order.length; ++i) {
931
+ var cur = order[i];
932
+ if (cur.from < ch && cur.to > ch) { return i }
933
+ if (cur.to == ch) {
934
+ if (cur.from != cur.to && sticky == "before") { found = i; }
935
+ else { bidiOther = i; }
936
+ }
937
+ if (cur.from == ch) {
938
+ if (cur.from != cur.to && sticky != "before") { found = i; }
939
+ else { bidiOther = i; }
940
+ }
941
+ }
942
+ return found != null ? found : bidiOther
943
+ }
944
+
945
+ // Bidirectional ordering algorithm
946
+ // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
947
+ // that this (partially) implements.
948
+
949
+ // One-char codes used for character types:
950
+ // L (L): Left-to-Right
951
+ // R (R): Right-to-Left
952
+ // r (AL): Right-to-Left Arabic
953
+ // 1 (EN): European Number
954
+ // + (ES): European Number Separator
955
+ // % (ET): European Number Terminator
956
+ // n (AN): Arabic Number
957
+ // , (CS): Common Number Separator
958
+ // m (NSM): Non-Spacing Mark
959
+ // b (BN): Boundary Neutral
960
+ // s (B): Paragraph Separator
961
+ // t (S): Segment Separator
962
+ // w (WS): Whitespace
963
+ // N (ON): Other Neutrals
964
+
965
+ // Returns null if characters are ordered as they appear
966
+ // (left-to-right), or an array of sections ({from, to, level}
967
+ // objects) in the order in which they occur visually.
968
+ var bidiOrdering = (function() {
969
+ // Character types for codepoints 0 to 0xff
970
+ var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";
971
+ // Character types for codepoints 0x600 to 0x6f9
972
+ var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";
973
+ function charType(code) {
974
+ if (code <= 0xf7) { return lowTypes.charAt(code) }
975
+ else if (0x590 <= code && code <= 0x5f4) { return "R" }
976
+ else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }
977
+ else if (0x6ee <= code && code <= 0x8ac) { return "r" }
978
+ else if (0x2000 <= code && code <= 0x200b) { return "w" }
979
+ else if (code == 0x200c) { return "b" }
980
+ else { return "L" }
981
+ }
982
+
983
+ var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
984
+ var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;
985
+
986
+ function BidiSpan(level, from, to) {
987
+ this.level = level;
988
+ this.from = from; this.to = to;
989
+ }
990
+
991
+ return function(str, direction) {
992
+ var outerType = direction == "ltr" ? "L" : "R";
993
+
994
+ if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false }
995
+ var len = str.length, types = [];
996
+ for (var i = 0; i < len; ++i)
997
+ { types.push(charType(str.charCodeAt(i))); }
998
+
999
+ // W1. Examine each non-spacing mark (NSM) in the level run, and
1000
+ // change the type of the NSM to the type of the previous
1001
+ // character. If the NSM is at the start of the level run, it will
1002
+ // get the type of sor.
1003
+ for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {
1004
+ var type = types[i$1];
1005
+ if (type == "m") { types[i$1] = prev; }
1006
+ else { prev = type; }
1007
+ }
1008
+
1009
+ // W2. Search backwards from each instance of a European number
1010
+ // until the first strong type (R, L, AL, or sor) is found. If an
1011
+ // AL is found, change the type of the European number to Arabic
1012
+ // number.
1013
+ // W3. Change all ALs to R.
1014
+ for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {
1015
+ var type$1 = types[i$2];
1016
+ if (type$1 == "1" && cur == "r") { types[i$2] = "n"; }
1017
+ else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } }
1018
+ }
1019
+
1020
+ // W4. A single European separator between two European numbers
1021
+ // changes to a European number. A single common separator between
1022
+ // two numbers of the same type changes to that type.
1023
+ for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {
1024
+ var type$2 = types[i$3];
1025
+ if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; }
1026
+ else if (type$2 == "," && prev$1 == types[i$3+1] &&
1027
+ (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; }
1028
+ prev$1 = type$2;
1029
+ }
1030
+
1031
+ // W5. A sequence of European terminators adjacent to European
1032
+ // numbers changes to all European numbers.
1033
+ // W6. Otherwise, separators and terminators change to Other
1034
+ // Neutral.
1035
+ for (var i$4 = 0; i$4 < len; ++i$4) {
1036
+ var type$3 = types[i$4];
1037
+ if (type$3 == ",") { types[i$4] = "N"; }
1038
+ else if (type$3 == "%") {
1039
+ var end = (void 0);
1040
+ for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {}
1041
+ var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N";
1042
+ for (var j = i$4; j < end; ++j) { types[j] = replace; }
1043
+ i$4 = end - 1;
1044
+ }
1045
+ }
1046
+
1047
+ // W7. Search backwards from each instance of a European number
1048
+ // until the first strong type (R, L, or sor) is found. If an L is
1049
+ // found, then change the type of the European number to L.
1050
+ for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {
1051
+ var type$4 = types[i$5];
1052
+ if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; }
1053
+ else if (isStrong.test(type$4)) { cur$1 = type$4; }
1054
+ }
1055
+
1056
+ // N1. A sequence of neutrals takes the direction of the
1057
+ // surrounding strong text if the text on both sides has the same
1058
+ // direction. European and Arabic numbers act as if they were R in
1059
+ // terms of their influence on neutrals. Start-of-level-run (sor)
1060
+ // and end-of-level-run (eor) are used at level run boundaries.
1061
+ // N2. Any remaining neutrals take the embedding direction.
1062
+ for (var i$6 = 0; i$6 < len; ++i$6) {
1063
+ if (isNeutral.test(types[i$6])) {
1064
+ var end$1 = (void 0);
1065
+ for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
1066
+ var before = (i$6 ? types[i$6-1] : outerType) == "L";
1067
+ var after = (end$1 < len ? types[end$1] : outerType) == "L";
1068
+ var replace$1 = before == after ? (before ? "L" : "R") : outerType;
1069
+ for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }
1070
+ i$6 = end$1 - 1;
1071
+ }
1072
+ }
1073
+
1074
+ // Here we depart from the documented algorithm, in order to avoid
1075
+ // building up an actual levels array. Since there are only three
1076
+ // levels (0, 1, 2) in an implementation that doesn't take
1077
+ // explicit embedding into account, we can build up the order on
1078
+ // the fly, without following the level-based algorithm.
1079
+ var order = [], m;
1080
+ for (var i$7 = 0; i$7 < len;) {
1081
+ if (countsAsLeft.test(types[i$7])) {
1082
+ var start = i$7;
1083
+ for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}
1084
+ order.push(new BidiSpan(0, start, i$7));
1085
+ } else {
1086
+ var pos = i$7, at = order.length;
1087
+ for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {}
1088
+ for (var j$2 = pos; j$2 < i$7;) {
1089
+ if (countsAsNum.test(types[j$2])) {
1090
+ if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }
1091
+ var nstart = j$2;
1092
+ for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}
1093
+ order.splice(at, 0, new BidiSpan(2, nstart, j$2));
1094
+ pos = j$2;
1095
+ } else { ++j$2; }
1096
+ }
1097
+ if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }
1098
+ }
1099
+ }
1100
+ if (direction == "ltr") {
1101
+ if (order[0].level == 1 && (m = str.match(/^\s+/))) {
1102
+ order[0].from = m[0].length;
1103
+ order.unshift(new BidiSpan(0, 0, m[0].length));
1104
+ }
1105
+ if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
1106
+ lst(order).to -= m[0].length;
1107
+ order.push(new BidiSpan(0, len - m[0].length, len));
1108
+ }
1109
+ }
1110
+
1111
+ return direction == "rtl" ? order.reverse() : order
1112
+ }
1113
+ })();
1114
+
1115
+ // Get the bidi ordering for the given line (and cache it). Returns
1116
+ // false for lines that are fully left-to-right, and an array of
1117
+ // BidiSpan objects otherwise.
1118
+ function getOrder(line, direction) {
1119
+ var order = line.order;
1120
+ if (order == null) { order = line.order = bidiOrdering(line.text, direction); }
1121
+ return order
1122
+ }
1123
+
1124
+ // EVENT HANDLING
1125
+
1126
+ // Lightweight event framework. on/off also work on DOM nodes,
1127
+ // registering native DOM handlers.
1128
+
1129
+ var noHandlers = [];
1130
+
1131
+ var on = function(emitter, type, f) {
1132
+ if (emitter.addEventListener) {
1133
+ emitter.addEventListener(type, f, false);
1134
+ } else if (emitter.attachEvent) {
1135
+ emitter.attachEvent("on" + type, f);
1136
+ } else {
1137
+ var map$$1 = emitter._handlers || (emitter._handlers = {});
1138
+ map$$1[type] = (map$$1[type] || noHandlers).concat(f);
1139
+ }
1140
+ };
1141
+
1142
+ function getHandlers(emitter, type) {
1143
+ return emitter._handlers && emitter._handlers[type] || noHandlers
1144
+ }
1145
+
1146
+ function off(emitter, type, f) {
1147
+ if (emitter.removeEventListener) {
1148
+ emitter.removeEventListener(type, f, false);
1149
+ } else if (emitter.detachEvent) {
1150
+ emitter.detachEvent("on" + type, f);
1151
+ } else {
1152
+ var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];
1153
+ if (arr) {
1154
+ var index = indexOf(arr, f);
1155
+ if (index > -1)
1156
+ { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }
1157
+ }
1158
+ }
1159
+ }
1160
+
1161
+ function signal(emitter, type /*, values...*/) {
1162
+ var handlers = getHandlers(emitter, type);
1163
+ if (!handlers.length) { return }
1164
+ var args = Array.prototype.slice.call(arguments, 2);
1165
+ for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }
1166
+ }
1167
+
1168
+ // The DOM events that CodeMirror handles can be overridden by
1169
+ // registering a (non-DOM) handler on the editor for the event name,
1170
+ // and preventDefault-ing the event in that handler.
1171
+ function signalDOMEvent(cm, e, override) {
1172
+ if (typeof e == "string")
1173
+ { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }
1174
+ signal(cm, override || e.type, cm, e);
1175
+ return e_defaultPrevented(e) || e.codemirrorIgnore
1176
+ }
1177
+
1178
+ function signalCursorActivity(cm) {
1179
+ var arr = cm._handlers && cm._handlers.cursorActivity;
1180
+ if (!arr) { return }
1181
+ var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);
1182
+ for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)
1183
+ { set.push(arr[i]); } }
1184
+ }
1185
+
1186
+ function hasHandler(emitter, type) {
1187
+ return getHandlers(emitter, type).length > 0
1188
+ }
1189
+
1190
+ // Add on and off methods to a constructor's prototype, to make
1191
+ // registering events on such objects more convenient.
1192
+ function eventMixin(ctor) {
1193
+ ctor.prototype.on = function(type, f) {on(this, type, f);};
1194
+ ctor.prototype.off = function(type, f) {off(this, type, f);};
1195
+ }
1196
+
1197
+ // Due to the fact that we still support jurassic IE versions, some
1198
+ // compatibility wrappers are needed.
1199
+
1200
+ function e_preventDefault(e) {
1201
+ if (e.preventDefault) { e.preventDefault(); }
1202
+ else { e.returnValue = false; }
1203
+ }
1204
+ function e_stopPropagation(e) {
1205
+ if (e.stopPropagation) { e.stopPropagation(); }
1206
+ else { e.cancelBubble = true; }
1207
+ }
1208
+ function e_defaultPrevented(e) {
1209
+ return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false
1210
+ }
1211
+ function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}
1212
+
1213
+ function e_target(e) {return e.target || e.srcElement}
1214
+ function e_button(e) {
1215
+ var b = e.which;
1216
+ if (b == null) {
1217
+ if (e.button & 1) { b = 1; }
1218
+ else if (e.button & 2) { b = 3; }
1219
+ else if (e.button & 4) { b = 2; }
1220
+ }
1221
+ if (mac && e.ctrlKey && b == 1) { b = 3; }
1222
+ return b
1223
+ }
1224
+
1225
+ // Detect drag-and-drop
1226
+ var dragAndDrop = function() {
1227
+ // There is *some* kind of drag-and-drop support in IE6-8, but I
1228
+ // couldn't get it to work yet.
1229
+ if (ie && ie_version < 9) { return false }
1230
+ var div = elt('div');
1231
+ return "draggable" in div || "dragDrop" in div
1232
+ }();
1233
+
1234
+ var zwspSupported;
1235
+ function zeroWidthElement(measure) {
1236
+ if (zwspSupported == null) {
1237
+ var test = elt("span", "\u200b");
1238
+ removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
1239
+ if (measure.firstChild.offsetHeight != 0)
1240
+ { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }
1241
+ }
1242
+ var node = zwspSupported ? elt("span", "\u200b") :
1243
+ elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
1244
+ node.setAttribute("cm-text", "");
1245
+ return node
1246
+ }
1247
+
1248
+ // Feature-detect IE's crummy client rect reporting for bidi text
1249
+ var badBidiRects;
1250
+ function hasBadBidiRects(measure) {
1251
+ if (badBidiRects != null) { return badBidiRects }
1252
+ var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA"));
1253
+ var r0 = range(txt, 0, 1).getBoundingClientRect();
1254
+ var r1 = range(txt, 1, 2).getBoundingClientRect();
1255
+ removeChildren(measure);
1256
+ if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)
1257
+ return badBidiRects = (r1.right - r0.right < 3)
1258
+ }
1259
+
1260
+ // See if "".split is the broken IE version, if so, provide an
1261
+ // alternative way to split lines.
1262
+ var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) {
1263
+ var pos = 0, result = [], l = string.length;
1264
+ while (pos <= l) {
1265
+ var nl = string.indexOf("\n", pos);
1266
+ if (nl == -1) { nl = string.length; }
1267
+ var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl);
1268
+ var rt = line.indexOf("\r");
1269
+ if (rt != -1) {
1270
+ result.push(line.slice(0, rt));
1271
+ pos += rt + 1;
1272
+ } else {
1273
+ result.push(line);
1274
+ pos = nl + 1;
1275
+ }
1276
+ }
1277
+ return result
1278
+ } : function (string) { return string.split(/\r\n?|\n/); };
1279
+
1280
+ var hasSelection = window.getSelection ? function (te) {
1281
+ try { return te.selectionStart != te.selectionEnd }
1282
+ catch(e) { return false }
1283
+ } : function (te) {
1284
+ var range$$1;
1285
+ try {range$$1 = te.ownerDocument.selection.createRange();}
1286
+ catch(e) {}
1287
+ if (!range$$1 || range$$1.parentElement() != te) { return false }
1288
+ return range$$1.compareEndPoints("StartToEnd", range$$1) != 0
1289
+ };
1290
+
1291
+ var hasCopyEvent = (function () {
1292
+ var e = elt("div");
1293
+ if ("oncopy" in e) { return true }
1294
+ e.setAttribute("oncopy", "return;");
1295
+ return typeof e.oncopy == "function"
1296
+ })();
1297
+
1298
+ var badZoomedRects = null;
1299
+ function hasBadZoomedRects(measure) {
1300
+ if (badZoomedRects != null) { return badZoomedRects }
1301
+ var node = removeChildrenAndAdd(measure, elt("span", "x"));
1302
+ var normal = node.getBoundingClientRect();
1303
+ var fromRange = range(node, 0, 1).getBoundingClientRect();
1304
+ return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1
1305
+ }
1306
+
1307
+ // Known modes, by name and by MIME
1308
+ var modes = {}, mimeModes = {};
1309
+
1310
+ // Extra arguments are stored as the mode's dependencies, which is
1311
+ // used by (legacy) mechanisms like loadmode.js to automatically
1312
+ // load a mode. (Preferred mechanism is the require/define calls.)
1313
+ function defineMode(name, mode) {
1314
+ if (arguments.length > 2)
1315
+ { mode.dependencies = Array.prototype.slice.call(arguments, 2); }
1316
+ modes[name] = mode;
1317
+ }
1318
+
1319
+ function defineMIME(mime, spec) {
1320
+ mimeModes[mime] = spec;
1321
+ }
1322
+
1323
+ // Given a MIME type, a {name, ...options} config object, or a name
1324
+ // string, return a mode config object.
1325
+ function resolveMode(spec) {
1326
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
1327
+ spec = mimeModes[spec];
1328
+ } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
1329
+ var found = mimeModes[spec.name];
1330
+ if (typeof found == "string") { found = {name: found}; }
1331
+ spec = createObj(found, spec);
1332
+ spec.name = found.name;
1333
+ } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
1334
+ return resolveMode("application/xml")
1335
+ } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
1336
+ return resolveMode("application/json")
1337
+ }
1338
+ if (typeof spec == "string") { return {name: spec} }
1339
+ else { return spec || {name: "null"} }
1340
+ }
1341
+
1342
+ // Given a mode spec (anything that resolveMode accepts), find and
1343
+ // initialize an actual mode object.
1344
+ function getMode(options, spec) {
1345
+ spec = resolveMode(spec);
1346
+ var mfactory = modes[spec.name];
1347
+ if (!mfactory) { return getMode(options, "text/plain") }
1348
+ var modeObj = mfactory(options, spec);
1349
+ if (modeExtensions.hasOwnProperty(spec.name)) {
1350
+ var exts = modeExtensions[spec.name];
1351
+ for (var prop in exts) {
1352
+ if (!exts.hasOwnProperty(prop)) { continue }
1353
+ if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; }
1354
+ modeObj[prop] = exts[prop];
1355
+ }
1356
+ }
1357
+ modeObj.name = spec.name;
1358
+ if (spec.helperType) { modeObj.helperType = spec.helperType; }
1359
+ if (spec.modeProps) { for (var prop$1 in spec.modeProps)
1360
+ { modeObj[prop$1] = spec.modeProps[prop$1]; } }
1361
+
1362
+ return modeObj
1363
+ }
1364
+
1365
+ // This can be used to attach properties to mode objects from
1366
+ // outside the actual mode definition.
1367
+ var modeExtensions = {};
1368
+ function extendMode(mode, properties) {
1369
+ var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
1370
+ copyObj(properties, exts);
1371
+ }
1372
+
1373
+ function copyState(mode, state) {
1374
+ if (state === true) { return state }
1375
+ if (mode.copyState) { return mode.copyState(state) }
1376
+ var nstate = {};
1377
+ for (var n in state) {
1378
+ var val = state[n];
1379
+ if (val instanceof Array) { val = val.concat([]); }
1380
+ nstate[n] = val;
1381
+ }
1382
+ return nstate
1383
+ }
1384
+
1385
+ // Given a mode and a state (for that mode), find the inner mode and
1386
+ // state at the position that the state refers to.
1387
+ function innerMode(mode, state) {
1388
+ var info;
1389
+ while (mode.innerMode) {
1390
+ info = mode.innerMode(state);
1391
+ if (!info || info.mode == mode) { break }
1392
+ state = info.state;
1393
+ mode = info.mode;
1394
+ }
1395
+ return info || {mode: mode, state: state}
1396
+ }
1397
+
1398
+ function startState(mode, a1, a2) {
1399
+ return mode.startState ? mode.startState(a1, a2) : true
1400
+ }
1401
+
1402
+ // STRING STREAM
1403
+
1404
+ // Fed to the mode parsers, provides helper functions to make
1405
+ // parsers more succinct.
1406
+
1407
+ var StringStream = function(string, tabSize, lineOracle) {
1408
+ this.pos = this.start = 0;
1409
+ this.string = string;
1410
+ this.tabSize = tabSize || 8;
1411
+ this.lastColumnPos = this.lastColumnValue = 0;
1412
+ this.lineStart = 0;
1413
+ this.lineOracle = lineOracle;
1414
+ };
1415
+
1416
+ StringStream.prototype.eol = function () {return this.pos >= this.string.length};
1417
+ StringStream.prototype.sol = function () {return this.pos == this.lineStart};
1418
+ StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};
1419
+ StringStream.prototype.next = function () {
1420
+ if (this.pos < this.string.length)
1421
+ { return this.string.charAt(this.pos++) }
1422
+ };
1423
+ StringStream.prototype.eat = function (match) {
1424
+ var ch = this.string.charAt(this.pos);
1425
+ var ok;
1426
+ if (typeof match == "string") { ok = ch == match; }
1427
+ else { ok = ch && (match.test ? match.test(ch) : match(ch)); }
1428
+ if (ok) {++this.pos; return ch}
1429
+ };
1430
+ StringStream.prototype.eatWhile = function (match) {
1431
+ var start = this.pos;
1432
+ while (this.eat(match)){}
1433
+ return this.pos > start
1434
+ };
1435
+ StringStream.prototype.eatSpace = function () {
1436
+ var this$1 = this;
1437
+
1438
+ var start = this.pos;
1439
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }
1440
+ return this.pos > start
1441
+ };
1442
+ StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};
1443
+ StringStream.prototype.skipTo = function (ch) {
1444
+ var found = this.string.indexOf(ch, this.pos);
1445
+ if (found > -1) {this.pos = found; return true}
1446
+ };
1447
+ StringStream.prototype.backUp = function (n) {this.pos -= n;};
1448
+ StringStream.prototype.column = function () {
1449
+ if (this.lastColumnPos < this.start) {
1450
+ this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
1451
+ this.lastColumnPos = this.start;
1452
+ }
1453
+ return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
1454
+ };
1455
+ StringStream.prototype.indentation = function () {
1456
+ return countColumn(this.string, null, this.tabSize) -
1457
+ (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)
1458
+ };
1459
+ StringStream.prototype.match = function (pattern, consume, caseInsensitive) {
1460
+ if (typeof pattern == "string") {
1461
+ var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };
1462
+ var substr = this.string.substr(this.pos, pattern.length);
1463
+ if (cased(substr) == cased(pattern)) {
1464
+ if (consume !== false) { this.pos += pattern.length; }
1465
+ return true
1466
+ }
1467
+ } else {
1468
+ var match = this.string.slice(this.pos).match(pattern);
1469
+ if (match && match.index > 0) { return null }
1470
+ if (match && consume !== false) { this.pos += match[0].length; }
1471
+ return match
1472
+ }
1473
+ };
1474
+ StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};
1475
+ StringStream.prototype.hideFirstChars = function (n, inner) {
1476
+ this.lineStart += n;
1477
+ try { return inner() }
1478
+ finally { this.lineStart -= n; }
1479
+ };
1480
+ StringStream.prototype.lookAhead = function (n) {
1481
+ var oracle = this.lineOracle;
1482
+ return oracle && oracle.lookAhead(n)
1483
+ };
1484
+ StringStream.prototype.baseToken = function () {
1485
+ var oracle = this.lineOracle;
1486
+ return oracle && oracle.baseToken(this.pos)
1487
+ };
1488
+
1489
+ var SavedContext = function(state, lookAhead) {
1490
+ this.state = state;
1491
+ this.lookAhead = lookAhead;
1492
+ };
1493
+
1494
+ var Context = function(doc, state, line, lookAhead) {
1495
+ this.state = state;
1496
+ this.doc = doc;
1497
+ this.line = line;
1498
+ this.maxLookAhead = lookAhead || 0;
1499
+ this.baseTokens = null;
1500
+ this.baseTokenPos = 1;
1501
+ };
1502
+
1503
+ Context.prototype.lookAhead = function (n) {
1504
+ var line = this.doc.getLine(this.line + n);
1505
+ if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }
1506
+ return line
1507
+ };
1508
+
1509
+ Context.prototype.baseToken = function (n) {
1510
+ var this$1 = this;
1511
+
1512
+ if (!this.baseTokens) { return null }
1513
+ while (this.baseTokens[this.baseTokenPos] <= n)
1514
+ { this$1.baseTokenPos += 2; }
1515
+ var type = this.baseTokens[this.baseTokenPos + 1];
1516
+ return {type: type && type.replace(/( |^)overlay .*/, ""),
1517
+ size: this.baseTokens[this.baseTokenPos] - n}
1518
+ };
1519
+
1520
+ Context.prototype.nextLine = function () {
1521
+ this.line++;
1522
+ if (this.maxLookAhead > 0) { this.maxLookAhead--; }
1523
+ };
1524
+
1525
+ Context.fromSaved = function (doc, saved, line) {
1526
+ if (saved instanceof SavedContext)
1527
+ { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }
1528
+ else
1529
+ { return new Context(doc, copyState(doc.mode, saved), line) }
1530
+ };
1531
+
1532
+ Context.prototype.save = function (copy) {
1533
+ var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;
1534
+ return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state
1535
+ };
1536
+
1537
+
1538
+ // Compute a style array (an array starting with a mode generation
1539
+ // -- for invalidation -- followed by pairs of end positions and
1540
+ // style strings), which is used to highlight the tokens on the
1541
+ // line.
1542
+ function highlightLine(cm, line, context, forceToEnd) {
1543
+ // A styles array always starts with a number identifying the
1544
+ // mode/overlays that it is based on (for easy invalidation).
1545
+ var st = [cm.state.modeGen], lineClasses = {};
1546
+ // Compute the base array of styles
1547
+ runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },
1548
+ lineClasses, forceToEnd);
1549
+ var state = context.state;
1550
+
1551
+ // Run overlays, adjust style array.
1552
+ var loop = function ( o ) {
1553
+ context.baseTokens = st;
1554
+ var overlay = cm.state.overlays[o], i = 1, at = 0;
1555
+ context.state = true;
1556
+ runMode(cm, line.text, overlay.mode, context, function (end, style) {
1557
+ var start = i;
1558
+ // Ensure there's a token end at the current position, and that i points at it
1559
+ while (at < end) {
1560
+ var i_end = st[i];
1561
+ if (i_end > end)
1562
+ { st.splice(i, 1, end, st[i+1], i_end); }
1563
+ i += 2;
1564
+ at = Math.min(end, i_end);
1565
+ }
1566
+ if (!style) { return }
1567
+ if (overlay.opaque) {
1568
+ st.splice(start, i - start, end, "overlay " + style);
1569
+ i = start + 2;
1570
+ } else {
1571
+ for (; start < i; start += 2) {
1572
+ var cur = st[start+1];
1573
+ st[start+1] = (cur ? cur + " " : "") + "overlay " + style;
1574
+ }
1575
+ }
1576
+ }, lineClasses);
1577
+ context.state = state;
1578
+ context.baseTokens = null;
1579
+ context.baseTokenPos = 1;
1580
+ };
1581
+
1582
+ for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
1583
+
1584
+ return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}
1585
+ }
1586
+
1587
+ function getLineStyles(cm, line, updateFrontier) {
1588
+ if (!line.styles || line.styles[0] != cm.state.modeGen) {
1589
+ var context = getContextBefore(cm, lineNo(line));
1590
+ var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);
1591
+ var result = highlightLine(cm, line, context);
1592
+ if (resetState) { context.state = resetState; }
1593
+ line.stateAfter = context.save(!resetState);
1594
+ line.styles = result.styles;
1595
+ if (result.classes) { line.styleClasses = result.classes; }
1596
+ else if (line.styleClasses) { line.styleClasses = null; }
1597
+ if (updateFrontier === cm.doc.highlightFrontier)
1598
+ { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }
1599
+ }
1600
+ return line.styles
1601
+ }
1602
+
1603
+ function getContextBefore(cm, n, precise) {
1604
+ var doc = cm.doc, display = cm.display;
1605
+ if (!doc.mode.startState) { return new Context(doc, true, n) }
1606
+ var start = findStartLine(cm, n, precise);
1607
+ var saved = start > doc.first && getLine(doc, start - 1).stateAfter;
1608
+ var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);
1609
+
1610
+ doc.iter(start, n, function (line) {
1611
+ processLine(cm, line.text, context);
1612
+ var pos = context.line;
1613
+ line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;
1614
+ context.nextLine();
1615
+ });
1616
+ if (precise) { doc.modeFrontier = context.line; }
1617
+ return context
1618
+ }
1619
+
1620
+ // Lightweight form of highlight -- proceed over this line and
1621
+ // update state, but don't save a style array. Used for lines that
1622
+ // aren't currently visible.
1623
+ function processLine(cm, text, context, startAt) {
1624
+ var mode = cm.doc.mode;
1625
+ var stream = new StringStream(text, cm.options.tabSize, context);
1626
+ stream.start = stream.pos = startAt || 0;
1627
+ if (text == "") { callBlankLine(mode, context.state); }
1628
+ while (!stream.eol()) {
1629
+ readToken(mode, stream, context.state);
1630
+ stream.start = stream.pos;
1631
+ }
1632
+ }
1633
+
1634
+ function callBlankLine(mode, state) {
1635
+ if (mode.blankLine) { return mode.blankLine(state) }
1636
+ if (!mode.innerMode) { return }
1637
+ var inner = innerMode(mode, state);
1638
+ if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }
1639
+ }
1640
+
1641
+ function readToken(mode, stream, state, inner) {
1642
+ for (var i = 0; i < 10; i++) {
1643
+ if (inner) { inner[0] = innerMode(mode, state).mode; }
1644
+ var style = mode.token(stream, state);
1645
+ if (stream.pos > stream.start) { return style }
1646
+ }
1647
+ throw new Error("Mode " + mode.name + " failed to advance stream.")
1648
+ }
1649
+
1650
+ var Token = function(stream, type, state) {
1651
+ this.start = stream.start; this.end = stream.pos;
1652
+ this.string = stream.current();
1653
+ this.type = type || null;
1654
+ this.state = state;
1655
+ };
1656
+
1657
+ // Utility for getTokenAt and getLineTokens
1658
+ function takeToken(cm, pos, precise, asArray) {
1659
+ var doc = cm.doc, mode = doc.mode, style;
1660
+ pos = clipPos(doc, pos);
1661
+ var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);
1662
+ var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;
1663
+ if (asArray) { tokens = []; }
1664
+ while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
1665
+ stream.start = stream.pos;
1666
+ style = readToken(mode, stream, context.state);
1667
+ if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }
1668
+ }
1669
+ return asArray ? tokens : new Token(stream, style, context.state)
1670
+ }
1671
+
1672
+ function extractLineClasses(type, output) {
1673
+ if (type) { for (;;) {
1674
+ var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/);
1675
+ if (!lineClass) { break }
1676
+ type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);
1677
+ var prop = lineClass[1] ? "bgClass" : "textClass";
1678
+ if (output[prop] == null)
1679
+ { output[prop] = lineClass[2]; }
1680
+ else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
1681
+ { output[prop] += " " + lineClass[2]; }
1682
+ } }
1683
+ return type
1684
+ }
1685
+
1686
+ // Run the given mode's parser over a line, calling f for each token.
1687
+ function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
1688
+ var flattenSpans = mode.flattenSpans;
1689
+ if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }
1690
+ var curStart = 0, curStyle = null;
1691
+ var stream = new StringStream(text, cm.options.tabSize, context), style;
1692
+ var inner = cm.options.addModeClass && [null];
1693
+ if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }
1694
+ while (!stream.eol()) {
1695
+ if (stream.pos > cm.options.maxHighlightLength) {
1696
+ flattenSpans = false;
1697
+ if (forceToEnd) { processLine(cm, text, context, stream.pos); }
1698
+ stream.pos = text.length;
1699
+ style = null;
1700
+ } else {
1701
+ style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);
1702
+ }
1703
+ if (inner) {
1704
+ var mName = inner[0].name;
1705
+ if (mName) { style = "m-" + (style ? mName + " " + style : mName); }
1706
+ }
1707
+ if (!flattenSpans || curStyle != style) {
1708
+ while (curStart < stream.start) {
1709
+ curStart = Math.min(stream.start, curStart + 5000);
1710
+ f(curStart, curStyle);
1711
+ }
1712
+ curStyle = style;
1713
+ }
1714
+ stream.start = stream.pos;
1715
+ }
1716
+ while (curStart < stream.pos) {
1717
+ // Webkit seems to refuse to render text nodes longer than 57444
1718
+ // characters, and returns inaccurate measurements in nodes
1719
+ // starting around 5000 chars.
1720
+ var pos = Math.min(stream.pos, curStart + 5000);
1721
+ f(pos, curStyle);
1722
+ curStart = pos;
1723
+ }
1724
+ }
1725
+
1726
+ // Finds the line to start with when starting a parse. Tries to
1727
+ // find a line with a stateAfter, so that it can start with a
1728
+ // valid state. If that fails, it returns the line with the
1729
+ // smallest indentation, which tends to need the least context to
1730
+ // parse correctly.
1731
+ function findStartLine(cm, n, precise) {
1732
+ var minindent, minline, doc = cm.doc;
1733
+ var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);
1734
+ for (var search = n; search > lim; --search) {
1735
+ if (search <= doc.first) { return doc.first }
1736
+ var line = getLine(doc, search - 1), after = line.stateAfter;
1737
+ if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))
1738
+ { return search }
1739
+ var indented = countColumn(line.text, null, cm.options.tabSize);
1740
+ if (minline == null || minindent > indented) {
1741
+ minline = search - 1;
1742
+ minindent = indented;
1743
+ }
1744
+ }
1745
+ return minline
1746
+ }
1747
+
1748
+ function retreatFrontier(doc, n) {
1749
+ doc.modeFrontier = Math.min(doc.modeFrontier, n);
1750
+ if (doc.highlightFrontier < n - 10) { return }
1751
+ var start = doc.first;
1752
+ for (var line = n - 1; line > start; line--) {
1753
+ var saved = getLine(doc, line).stateAfter;
1754
+ // change is on 3
1755
+ // state on line 1 looked ahead 2 -- so saw 3
1756
+ // test 1 + 2 < 3 should cover this
1757
+ if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
1758
+ start = line + 1;
1759
+ break
1760
+ }
1761
+ }
1762
+ doc.highlightFrontier = Math.min(doc.highlightFrontier, start);
1763
+ }
1764
+
1765
+ // LINE DATA STRUCTURE
1766
+
1767
+ // Line objects. These hold state related to a line, including
1768
+ // highlighting info (the styles array).
1769
+ var Line = function(text, markedSpans, estimateHeight) {
1770
+ this.text = text;
1771
+ attachMarkedSpans(this, markedSpans);
1772
+ this.height = estimateHeight ? estimateHeight(this) : 1;
1773
+ };
1774
+
1775
+ Line.prototype.lineNo = function () { return lineNo(this) };
1776
+ eventMixin(Line);
1777
+
1778
+ // Change the content (text, markers) of a line. Automatically
1779
+ // invalidates cached information and tries to re-estimate the
1780
+ // line's height.
1781
+ function updateLine(line, text, markedSpans, estimateHeight) {
1782
+ line.text = text;
1783
+ if (line.stateAfter) { line.stateAfter = null; }
1784
+ if (line.styles) { line.styles = null; }
1785
+ if (line.order != null) { line.order = null; }
1786
+ detachMarkedSpans(line);
1787
+ attachMarkedSpans(line, markedSpans);
1788
+ var estHeight = estimateHeight ? estimateHeight(line) : 1;
1789
+ if (estHeight != line.height) { updateLineHeight(line, estHeight); }
1790
+ }
1791
+
1792
+ // Detach a line from the document tree and its markers.
1793
+ function cleanUpLine(line) {
1794
+ line.parent = null;
1795
+ detachMarkedSpans(line);
1796
+ }
1797
+
1798
+ // Convert a style as returned by a mode (either null, or a string
1799
+ // containing one or more styles) to a CSS style. This is cached,
1800
+ // and also looks for line-wide styles.
1801
+ var styleToClassCache = {}, styleToClassCacheWithMode = {};
1802
+ function interpretTokenStyle(style, options) {
1803
+ if (!style || /^\s*$/.test(style)) { return null }
1804
+ var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;
1805
+ return cache[style] ||
1806
+ (cache[style] = style.replace(/\S+/g, "cm-$&"))
1807
+ }
1808
+
1809
+ // Render the DOM representation of the text of a line. Also builds
1810
+ // up a 'line map', which points at the DOM nodes that represent
1811
+ // specific stretches of text, and is used by the measuring code.
1812
+ // The returned object contains the DOM node, this map, and
1813
+ // information about line-wide styles that were set by the mode.
1814
+ function buildLineContent(cm, lineView) {
1815
+ // The padding-right forces the element to have a 'border', which
1816
+ // is needed on Webkit to be able to get line-level bounding
1817
+ // rectangles for it (in measureChar).
1818
+ var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null);
1819
+ var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
1820
+ col: 0, pos: 0, cm: cm,
1821
+ trailingSpace: false,
1822
+ splitSpaces: cm.getOption("lineWrapping")};
1823
+ lineView.measure = {};
1824
+
1825
+ // Iterate over the logical lines that make up this visual line.
1826
+ for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {
1827
+ var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);
1828
+ builder.pos = 0;
1829
+ builder.addToken = buildToken;
1830
+ // Optionally wire in some hacks into the token-rendering
1831
+ // algorithm, to deal with browser quirks.
1832
+ if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))
1833
+ { builder.addToken = buildTokenBadBidi(builder.addToken, order); }
1834
+ builder.map = [];
1835
+ var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);
1836
+ insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));
1837
+ if (line.styleClasses) {
1838
+ if (line.styleClasses.bgClass)
1839
+ { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); }
1840
+ if (line.styleClasses.textClass)
1841
+ { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); }
1842
+ }
1843
+
1844
+ // Ensure at least a single node is present, for measuring.
1845
+ if (builder.map.length == 0)
1846
+ { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }
1847
+
1848
+ // Store the map and a cache object for the current logical line
1849
+ if (i == 0) {
1850
+ lineView.measure.map = builder.map;
1851
+ lineView.measure.cache = {};
1852
+ } else {
1853
+ (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)
1854
+ ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});
1855
+ }
1856
+ }
1857
+
1858
+ // See issue #2901
1859
+ if (webkit) {
1860
+ var last = builder.content.lastChild;
1861
+ if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab")))
1862
+ { builder.content.className = "cm-tab-wrap-hack"; }
1863
+ }
1864
+
1865
+ signal(cm, "renderLine", cm, lineView.line, builder.pre);
1866
+ if (builder.pre.className)
1867
+ { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); }
1868
+
1869
+ return builder
1870
+ }
1871
+
1872
+ function defaultSpecialCharPlaceholder(ch) {
1873
+ var token = elt("span", "\u2022", "cm-invalidchar");
1874
+ token.title = "\\u" + ch.charCodeAt(0).toString(16);
1875
+ token.setAttribute("aria-label", token.title);
1876
+ return token
1877
+ }
1878
+
1879
+ // Build up the DOM representation for a single token, and add it to
1880
+ // the line map. Takes care to render special characters separately.
1881
+ function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {
1882
+ if (!text) { return }
1883
+ var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;
1884
+ var special = builder.cm.state.specialChars, mustWrap = false;
1885
+ var content;
1886
+ if (!special.test(text)) {
1887
+ builder.col += text.length;
1888
+ content = document.createTextNode(displayText);
1889
+ builder.map.push(builder.pos, builder.pos + text.length, content);
1890
+ if (ie && ie_version < 9) { mustWrap = true; }
1891
+ builder.pos += text.length;
1892
+ } else {
1893
+ content = document.createDocumentFragment();
1894
+ var pos = 0;
1895
+ while (true) {
1896
+ special.lastIndex = pos;
1897
+ var m = special.exec(text);
1898
+ var skipped = m ? m.index - pos : text.length - pos;
1899
+ if (skipped) {
1900
+ var txt = document.createTextNode(displayText.slice(pos, pos + skipped));
1901
+ if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); }
1902
+ else { content.appendChild(txt); }
1903
+ builder.map.push(builder.pos, builder.pos + skipped, txt);
1904
+ builder.col += skipped;
1905
+ builder.pos += skipped;
1906
+ }
1907
+ if (!m) { break }
1908
+ pos += skipped + 1;
1909
+ var txt$1 = (void 0);
1910
+ if (m[0] == "\t") {
1911
+ var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;
1912
+ txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"));
1913
+ txt$1.setAttribute("role", "presentation");
1914
+ txt$1.setAttribute("cm-text", "\t");
1915
+ builder.col += tabWidth;
1916
+ } else if (m[0] == "\r" || m[0] == "\n") {
1917
+ txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar"));
1918
+ txt$1.setAttribute("cm-text", m[0]);
1919
+ builder.col += 1;
1920
+ } else {
1921
+ txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);
1922
+ txt$1.setAttribute("cm-text", m[0]);
1923
+ if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); }
1924
+ else { content.appendChild(txt$1); }
1925
+ builder.col += 1;
1926
+ }
1927
+ builder.map.push(builder.pos, builder.pos + 1, txt$1);
1928
+ builder.pos++;
1929
+ }
1930
+ }
1931
+ builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;
1932
+ if (style || startStyle || endStyle || mustWrap || css) {
1933
+ var fullStyle = style || "";
1934
+ if (startStyle) { fullStyle += startStyle; }
1935
+ if (endStyle) { fullStyle += endStyle; }
1936
+ var token = elt("span", [content], fullStyle, css);
1937
+ if (attributes) {
1938
+ for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class")
1939
+ { token.setAttribute(attr, attributes[attr]); } }
1940
+ }
1941
+ return builder.content.appendChild(token)
1942
+ }
1943
+ builder.content.appendChild(content);
1944
+ }
1945
+
1946
+ // Change some spaces to NBSP to prevent the browser from collapsing
1947
+ // trailing spaces at the end of a line when rendering text (issue #1362).
1948
+ function splitSpaces(text, trailingBefore) {
1949
+ if (text.length > 1 && !/ /.test(text)) { return text }
1950
+ var spaceBefore = trailingBefore, result = "";
1951
+ for (var i = 0; i < text.length; i++) {
1952
+ var ch = text.charAt(i);
1953
+ if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))
1954
+ { ch = "\u00a0"; }
1955
+ result += ch;
1956
+ spaceBefore = ch == " ";
1957
+ }
1958
+ return result
1959
+ }
1960
+
1961
+ // Work around nonsense dimensions being reported for stretches of
1962
+ // right-to-left text.
1963
+ function buildTokenBadBidi(inner, order) {
1964
+ return function (builder, text, style, startStyle, endStyle, css, attributes) {
1965
+ style = style ? style + " cm-force-border" : "cm-force-border";
1966
+ var start = builder.pos, end = start + text.length;
1967
+ for (;;) {
1968
+ // Find the part that overlaps with the start of this text
1969
+ var part = (void 0);
1970
+ for (var i = 0; i < order.length; i++) {
1971
+ part = order[i];
1972
+ if (part.to > start && part.from <= start) { break }
1973
+ }
1974
+ if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }
1975
+ inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);
1976
+ startStyle = null;
1977
+ text = text.slice(part.to - start);
1978
+ start = part.to;
1979
+ }
1980
+ }
1981
+ }
1982
+
1983
+ function buildCollapsedSpan(builder, size, marker, ignoreWidget) {
1984
+ var widget = !ignoreWidget && marker.widgetNode;
1985
+ if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }
1986
+ if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {
1987
+ if (!widget)
1988
+ { widget = builder.content.appendChild(document.createElement("span")); }
1989
+ widget.setAttribute("cm-marker", marker.id);
1990
+ }
1991
+ if (widget) {
1992
+ builder.cm.display.input.setUneditable(widget);
1993
+ builder.content.appendChild(widget);
1994
+ }
1995
+ builder.pos += size;
1996
+ builder.trailingSpace = false;
1997
+ }
1998
+
1999
+ // Outputs a number of spans to make up a line, taking highlighting
2000
+ // and marked text into account.
2001
+ function insertLineContent(line, builder, styles) {
2002
+ var spans = line.markedSpans, allText = line.text, at = 0;
2003
+ if (!spans) {
2004
+ for (var i$1 = 1; i$1 < styles.length; i$1+=2)
2005
+ { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }
2006
+ return
2007
+ }
2008
+
2009
+ var len = allText.length, pos = 0, i = 1, text = "", style, css;
2010
+ var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;
2011
+ for (;;) {
2012
+ if (nextChange == pos) { // Update current marker set
2013
+ spanStyle = spanEndStyle = spanStartStyle = css = "";
2014
+ attributes = null;
2015
+ collapsed = null; nextChange = Infinity;
2016
+ var foundBookmarks = [], endStyles = (void 0);
2017
+ for (var j = 0; j < spans.length; ++j) {
2018
+ var sp = spans[j], m = sp.marker;
2019
+ if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
2020
+ foundBookmarks.push(m);
2021
+ } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
2022
+ if (sp.to != null && sp.to != pos && nextChange > sp.to) {
2023
+ nextChange = sp.to;
2024
+ spanEndStyle = "";
2025
+ }
2026
+ if (m.className) { spanStyle += " " + m.className; }
2027
+ if (m.css) { css = (css ? css + ";" : "") + m.css; }
2028
+ if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
2029
+ if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
2030
+ // support for the old title property
2031
+ // https://github.com/codemirror/CodeMirror/pull/5673
2032
+ if (m.title) { (attributes || (attributes = {})).title = m.title; }
2033
+ if (m.attributes) {
2034
+ for (var attr in m.attributes)
2035
+ { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }
2036
+ }
2037
+ if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
2038
+ { collapsed = sp; }
2039
+ } else if (sp.from > pos && nextChange > sp.from) {
2040
+ nextChange = sp.from;
2041
+ }
2042
+ }
2043
+ if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)
2044
+ { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } }
2045
+
2046
+ if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)
2047
+ { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }
2048
+ if (collapsed && (collapsed.from || 0) == pos) {
2049
+ buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
2050
+ collapsed.marker, collapsed.from == null);
2051
+ if (collapsed.to == null) { return }
2052
+ if (collapsed.to == pos) { collapsed = false; }
2053
+ }
2054
+ }
2055
+ if (pos >= len) { break }
2056
+
2057
+ var upto = Math.min(len, nextChange);
2058
+ while (true) {
2059
+ if (text) {
2060
+ var end = pos + text.length;
2061
+ if (!collapsed) {
2062
+ var tokenText = end > upto ? text.slice(0, upto - pos) : text;
2063
+ builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
2064
+ spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes);
2065
+ }
2066
+ if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}
2067
+ pos = end;
2068
+ spanStartStyle = "";
2069
+ }
2070
+ text = allText.slice(at, at = styles[i++]);
2071
+ style = interpretTokenStyle(styles[i++], builder.cm.options);
2072
+ }
2073
+ }
2074
+ }
2075
+
2076
+
2077
+ // These objects are used to represent the visible (currently drawn)
2078
+ // part of the document. A LineView may correspond to multiple
2079
+ // logical lines, if those are connected by collapsed ranges.
2080
+ function LineView(doc, line, lineN) {
2081
+ // The starting line
2082
+ this.line = line;
2083
+ // Continuing lines, if any
2084
+ this.rest = visualLineContinued(line);
2085
+ // Number of logical lines in this visual line
2086
+ this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;
2087
+ this.node = this.text = null;
2088
+ this.hidden = lineIsHidden(doc, line);
2089
+ }
2090
+
2091
+ // Create a range of LineView objects for the given lines.
2092
+ function buildViewArray(cm, from, to) {
2093
+ var array = [], nextPos;
2094
+ for (var pos = from; pos < to; pos = nextPos) {
2095
+ var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);
2096
+ nextPos = pos + view.size;
2097
+ array.push(view);
2098
+ }
2099
+ return array
2100
+ }
2101
+
2102
+ var operationGroup = null;
2103
+
2104
+ function pushOperation(op) {
2105
+ if (operationGroup) {
2106
+ operationGroup.ops.push(op);
2107
+ } else {
2108
+ op.ownsGroup = operationGroup = {
2109
+ ops: [op],
2110
+ delayedCallbacks: []
2111
+ };
2112
+ }
2113
+ }
2114
+
2115
+ function fireCallbacksForOps(group) {
2116
+ // Calls delayed callbacks and cursorActivity handlers until no
2117
+ // new ones appear
2118
+ var callbacks = group.delayedCallbacks, i = 0;
2119
+ do {
2120
+ for (; i < callbacks.length; i++)
2121
+ { callbacks[i].call(null); }
2122
+ for (var j = 0; j < group.ops.length; j++) {
2123
+ var op = group.ops[j];
2124
+ if (op.cursorActivityHandlers)
2125
+ { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)
2126
+ { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }
2127
+ }
2128
+ } while (i < callbacks.length)
2129
+ }
2130
+
2131
+ function finishOperation(op, endCb) {
2132
+ var group = op.ownsGroup;
2133
+ if (!group) { return }
2134
+
2135
+ try { fireCallbacksForOps(group); }
2136
+ finally {
2137
+ operationGroup = null;
2138
+ endCb(group);
2139
+ }
2140
+ }
2141
+
2142
+ var orphanDelayedCallbacks = null;
2143
+
2144
+ // Often, we want to signal events at a point where we are in the
2145
+ // middle of some work, but don't want the handler to start calling
2146
+ // other methods on the editor, which might be in an inconsistent
2147
+ // state or simply not expect any other events to happen.
2148
+ // signalLater looks whether there are any handlers, and schedules
2149
+ // them to be executed when the last operation ends, or, if no
2150
+ // operation is active, when a timeout fires.
2151
+ function signalLater(emitter, type /*, values...*/) {
2152
+ var arr = getHandlers(emitter, type);
2153
+ if (!arr.length) { return }
2154
+ var args = Array.prototype.slice.call(arguments, 2), list;
2155
+ if (operationGroup) {
2156
+ list = operationGroup.delayedCallbacks;
2157
+ } else if (orphanDelayedCallbacks) {
2158
+ list = orphanDelayedCallbacks;
2159
+ } else {
2160
+ list = orphanDelayedCallbacks = [];
2161
+ setTimeout(fireOrphanDelayed, 0);
2162
+ }
2163
+ var loop = function ( i ) {
2164
+ list.push(function () { return arr[i].apply(null, args); });
2165
+ };
2166
+
2167
+ for (var i = 0; i < arr.length; ++i)
2168
+ loop( i );
2169
+ }
2170
+
2171
+ function fireOrphanDelayed() {
2172
+ var delayed = orphanDelayedCallbacks;
2173
+ orphanDelayedCallbacks = null;
2174
+ for (var i = 0; i < delayed.length; ++i) { delayed[i](); }
2175
+ }
2176
+
2177
+ // When an aspect of a line changes, a string is added to
2178
+ // lineView.changes. This updates the relevant part of the line's
2179
+ // DOM structure.
2180
+ function updateLineForChanges(cm, lineView, lineN, dims) {
2181
+ for (var j = 0; j < lineView.changes.length; j++) {
2182
+ var type = lineView.changes[j];
2183
+ if (type == "text") { updateLineText(cm, lineView); }
2184
+ else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); }
2185
+ else if (type == "class") { updateLineClasses(cm, lineView); }
2186
+ else if (type == "widget") { updateLineWidgets(cm, lineView, dims); }
2187
+ }
2188
+ lineView.changes = null;
2189
+ }
2190
+
2191
+ // Lines with gutter elements, widgets or a background class need to
2192
+ // be wrapped, and have the extra elements added to the wrapper div
2193
+ function ensureLineWrapped(lineView) {
2194
+ if (lineView.node == lineView.text) {
2195
+ lineView.node = elt("div", null, null, "position: relative");
2196
+ if (lineView.text.parentNode)
2197
+ { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }
2198
+ lineView.node.appendChild(lineView.text);
2199
+ if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }
2200
+ }
2201
+ return lineView.node
2202
+ }
2203
+
2204
+ function updateLineBackground(cm, lineView) {
2205
+ var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
2206
+ if (cls) { cls += " CodeMirror-linebackground"; }
2207
+ if (lineView.background) {
2208
+ if (cls) { lineView.background.className = cls; }
2209
+ else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }
2210
+ } else if (cls) {
2211
+ var wrap = ensureLineWrapped(lineView);
2212
+ lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild);
2213
+ cm.display.input.setUneditable(lineView.background);
2214
+ }
2215
+ }
2216
+
2217
+ // Wrapper around buildLineContent which will reuse the structure
2218
+ // in display.externalMeasured when possible.
2219
+ function getLineContent(cm, lineView) {
2220
+ var ext = cm.display.externalMeasured;
2221
+ if (ext && ext.line == lineView.line) {
2222
+ cm.display.externalMeasured = null;
2223
+ lineView.measure = ext.measure;
2224
+ return ext.built
2225
+ }
2226
+ return buildLineContent(cm, lineView)
2227
+ }
2228
+
2229
+ // Redraw the line's text. Interacts with the background and text
2230
+ // classes because the mode may output tokens that influence these
2231
+ // classes.
2232
+ function updateLineText(cm, lineView) {
2233
+ var cls = lineView.text.className;
2234
+ var built = getLineContent(cm, lineView);
2235
+ if (lineView.text == lineView.node) { lineView.node = built.pre; }
2236
+ lineView.text.parentNode.replaceChild(built.pre, lineView.text);
2237
+ lineView.text = built.pre;
2238
+ if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
2239
+ lineView.bgClass = built.bgClass;
2240
+ lineView.textClass = built.textClass;
2241
+ updateLineClasses(cm, lineView);
2242
+ } else if (cls) {
2243
+ lineView.text.className = cls;
2244
+ }
2245
+ }
2246
+
2247
+ function updateLineClasses(cm, lineView) {
2248
+ updateLineBackground(cm, lineView);
2249
+ if (lineView.line.wrapClass)
2250
+ { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }
2251
+ else if (lineView.node != lineView.text)
2252
+ { lineView.node.className = ""; }
2253
+ var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass;
2254
+ lineView.text.className = textClass || "";
2255
+ }
2256
+
2257
+ function updateLineGutter(cm, lineView, lineN, dims) {
2258
+ if (lineView.gutter) {
2259
+ lineView.node.removeChild(lineView.gutter);
2260
+ lineView.gutter = null;
2261
+ }
2262
+ if (lineView.gutterBackground) {
2263
+ lineView.node.removeChild(lineView.gutterBackground);
2264
+ lineView.gutterBackground = null;
2265
+ }
2266
+ if (lineView.line.gutterClass) {
2267
+ var wrap = ensureLineWrapped(lineView);
2268
+ lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
2269
+ ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"));
2270
+ cm.display.input.setUneditable(lineView.gutterBackground);
2271
+ wrap.insertBefore(lineView.gutterBackground, lineView.text);
2272
+ }
2273
+ var markers = lineView.line.gutterMarkers;
2274
+ if (cm.options.lineNumbers || markers) {
2275
+ var wrap$1 = ensureLineWrapped(lineView);
2276
+ var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"));
2277
+ cm.display.input.setUneditable(gutterWrap);
2278
+ wrap$1.insertBefore(gutterWrap, lineView.text);
2279
+ if (lineView.line.gutterClass)
2280
+ { gutterWrap.className += " " + lineView.line.gutterClass; }
2281
+ if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
2282
+ { lineView.lineNumber = gutterWrap.appendChild(
2283
+ elt("div", lineNumberFor(cm.options, lineN),
2284
+ "CodeMirror-linenumber CodeMirror-gutter-elt",
2285
+ ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); }
2286
+ if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {
2287
+ var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
2288
+ if (found)
2289
+ { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt",
2290
+ ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); }
2291
+ } }
2292
+ }
2293
+ }
2294
+
2295
+ function updateLineWidgets(cm, lineView, dims) {
2296
+ if (lineView.alignable) { lineView.alignable = null; }
2297
+ for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {
2298
+ next = node.nextSibling;
2299
+ if (node.className == "CodeMirror-linewidget")
2300
+ { lineView.node.removeChild(node); }
2301
+ }
2302
+ insertLineWidgets(cm, lineView, dims);
2303
+ }
2304
+
2305
+ // Build a line's DOM representation from scratch
2306
+ function buildLineElement(cm, lineView, lineN, dims) {
2307
+ var built = getLineContent(cm, lineView);
2308
+ lineView.text = lineView.node = built.pre;
2309
+ if (built.bgClass) { lineView.bgClass = built.bgClass; }
2310
+ if (built.textClass) { lineView.textClass = built.textClass; }
2311
+
2312
+ updateLineClasses(cm, lineView);
2313
+ updateLineGutter(cm, lineView, lineN, dims);
2314
+ insertLineWidgets(cm, lineView, dims);
2315
+ return lineView.node
2316
+ }
2317
+
2318
+ // A lineView may contain multiple logical lines (when merged by
2319
+ // collapsed spans). The widgets for all of them need to be drawn.
2320
+ function insertLineWidgets(cm, lineView, dims) {
2321
+ insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);
2322
+ if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
2323
+ { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }
2324
+ }
2325
+
2326
+ function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
2327
+ if (!line.widgets) { return }
2328
+ var wrap = ensureLineWrapped(lineView);
2329
+ for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
2330
+ var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
2331
+ if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); }
2332
+ positionLineWidget(widget, node, lineView, dims);
2333
+ cm.display.input.setUneditable(node);
2334
+ if (allowAbove && widget.above)
2335
+ { wrap.insertBefore(node, lineView.gutter || lineView.text); }
2336
+ else
2337
+ { wrap.appendChild(node); }
2338
+ signalLater(widget, "redraw");
2339
+ }
2340
+ }
2341
+
2342
+ function positionLineWidget(widget, node, lineView, dims) {
2343
+ if (widget.noHScroll) {
2344
+ (lineView.alignable || (lineView.alignable = [])).push(node);
2345
+ var width = dims.wrapperWidth;
2346
+ node.style.left = dims.fixedPos + "px";
2347
+ if (!widget.coverGutter) {
2348
+ width -= dims.gutterTotalWidth;
2349
+ node.style.paddingLeft = dims.gutterTotalWidth + "px";
2350
+ }
2351
+ node.style.width = width + "px";
2352
+ }
2353
+ if (widget.coverGutter) {
2354
+ node.style.zIndex = 5;
2355
+ node.style.position = "relative";
2356
+ if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; }
2357
+ }
2358
+ }
2359
+
2360
+ function widgetHeight(widget) {
2361
+ if (widget.height != null) { return widget.height }
2362
+ var cm = widget.doc.cm;
2363
+ if (!cm) { return 0 }
2364
+ if (!contains(document.body, widget.node)) {
2365
+ var parentStyle = "position: relative;";
2366
+ if (widget.coverGutter)
2367
+ { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; }
2368
+ if (widget.noHScroll)
2369
+ { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; }
2370
+ removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle));
2371
+ }
2372
+ return widget.height = widget.node.parentNode.offsetHeight
2373
+ }
2374
+
2375
+ // Return true when the given mouse event happened in a widget
2376
+ function eventInWidget(display, e) {
2377
+ for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
2378
+ if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") ||
2379
+ (n.parentNode == display.sizer && n != display.mover))
2380
+ { return true }
2381
+ }
2382
+ }
2383
+
2384
+ // POSITION MEASUREMENT
2385
+
2386
+ function paddingTop(display) {return display.lineSpace.offsetTop}
2387
+ function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}
2388
+ function paddingH(display) {
2389
+ if (display.cachedPaddingH) { return display.cachedPaddingH }
2390
+ var e = removeChildrenAndAdd(display.measure, elt("pre", "x"));
2391
+ var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;
2392
+ var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};
2393
+ if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }
2394
+ return data
2395
+ }
2396
+
2397
+ function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }
2398
+ function displayWidth(cm) {
2399
+ return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth
2400
+ }
2401
+ function displayHeight(cm) {
2402
+ return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight
2403
+ }
2404
+
2405
+ // Ensure the lineView.wrapping.heights array is populated. This is
2406
+ // an array of bottom offsets for the lines that make up a drawn
2407
+ // line. When lineWrapping is on, there might be more than one
2408
+ // height.
2409
+ function ensureLineHeights(cm, lineView, rect) {
2410
+ var wrapping = cm.options.lineWrapping;
2411
+ var curWidth = wrapping && displayWidth(cm);
2412
+ if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {
2413
+ var heights = lineView.measure.heights = [];
2414
+ if (wrapping) {
2415
+ lineView.measure.width = curWidth;
2416
+ var rects = lineView.text.firstChild.getClientRects();
2417
+ for (var i = 0; i < rects.length - 1; i++) {
2418
+ var cur = rects[i], next = rects[i + 1];
2419
+ if (Math.abs(cur.bottom - next.bottom) > 2)
2420
+ { heights.push((cur.bottom + next.top) / 2 - rect.top); }
2421
+ }
2422
+ }
2423
+ heights.push(rect.bottom - rect.top);
2424
+ }
2425
+ }
2426
+
2427
+ // Find a line map (mapping character offsets to text nodes) and a
2428
+ // measurement cache for the given line number. (A line view might
2429
+ // contain multiple lines when collapsed ranges are present.)
2430
+ function mapFromLineView(lineView, line, lineN) {
2431
+ if (lineView.line == line)
2432
+ { return {map: lineView.measure.map, cache: lineView.measure.cache} }
2433
+ for (var i = 0; i < lineView.rest.length; i++)
2434
+ { if (lineView.rest[i] == line)
2435
+ { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }
2436
+ for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)
2437
+ { if (lineNo(lineView.rest[i$1]) > lineN)
2438
+ { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }
2439
+ }
2440
+
2441
+ // Render a line into the hidden node display.externalMeasured. Used
2442
+ // when measurement is needed for a line that's not in the viewport.
2443
+ function updateExternalMeasurement(cm, line) {
2444
+ line = visualLine(line);
2445
+ var lineN = lineNo(line);
2446
+ var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);
2447
+ view.lineN = lineN;
2448
+ var built = view.built = buildLineContent(cm, view);
2449
+ view.text = built.pre;
2450
+ removeChildrenAndAdd(cm.display.lineMeasure, built.pre);
2451
+ return view
2452
+ }
2453
+
2454
+ // Get a {top, bottom, left, right} box (in line-local coordinates)
2455
+ // for a given character.
2456
+ function measureChar(cm, line, ch, bias) {
2457
+ return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)
2458
+ }
2459
+
2460
+ // Find a line view that corresponds to the given line number.
2461
+ function findViewForLine(cm, lineN) {
2462
+ if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)
2463
+ { return cm.display.view[findViewIndex(cm, lineN)] }
2464
+ var ext = cm.display.externalMeasured;
2465
+ if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)
2466
+ { return ext }
2467
+ }
2468
+
2469
+ // Measurement can be split in two steps, the set-up work that
2470
+ // applies to the whole line, and the measurement of the actual
2471
+ // character. Functions like coordsChar, that need to do a lot of
2472
+ // measurements in a row, can thus ensure that the set-up work is
2473
+ // only done once.
2474
+ function prepareMeasureForLine(cm, line) {
2475
+ var lineN = lineNo(line);
2476
+ var view = findViewForLine(cm, lineN);
2477
+ if (view && !view.text) {
2478
+ view = null;
2479
+ } else if (view && view.changes) {
2480
+ updateLineForChanges(cm, view, lineN, getDimensions(cm));
2481
+ cm.curOp.forceUpdate = true;
2482
+ }
2483
+ if (!view)
2484
+ { view = updateExternalMeasurement(cm, line); }
2485
+
2486
+ var info = mapFromLineView(view, line, lineN);
2487
+ return {
2488
+ line: line, view: view, rect: null,
2489
+ map: info.map, cache: info.cache, before: info.before,
2490
+ hasHeights: false
2491
+ }
2492
+ }
2493
+
2494
+ // Given a prepared measurement object, measures the position of an
2495
+ // actual character (or fetches it from the cache).
2496
+ function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
2497
+ if (prepared.before) { ch = -1; }
2498
+ var key = ch + (bias || ""), found;
2499
+ if (prepared.cache.hasOwnProperty(key)) {
2500
+ found = prepared.cache[key];
2501
+ } else {
2502
+ if (!prepared.rect)
2503
+ { prepared.rect = prepared.view.text.getBoundingClientRect(); }
2504
+ if (!prepared.hasHeights) {
2505
+ ensureLineHeights(cm, prepared.view, prepared.rect);
2506
+ prepared.hasHeights = true;
2507
+ }
2508
+ found = measureCharInner(cm, prepared, ch, bias);
2509
+ if (!found.bogus) { prepared.cache[key] = found; }
2510
+ }
2511
+ return {left: found.left, right: found.right,
2512
+ top: varHeight ? found.rtop : found.top,
2513
+ bottom: varHeight ? found.rbottom : found.bottom}
2514
+ }
2515
+
2516
+ var nullRect = {left: 0, right: 0, top: 0, bottom: 0};
2517
+
2518
+ function nodeAndOffsetInLineMap(map$$1, ch, bias) {
2519
+ var node, start, end, collapse, mStart, mEnd;
2520
+ // First, search the line map for the text node corresponding to,
2521
+ // or closest to, the target character.
2522
+ for (var i = 0; i < map$$1.length; i += 3) {
2523
+ mStart = map$$1[i];
2524
+ mEnd = map$$1[i + 1];
2525
+ if (ch < mStart) {
2526
+ start = 0; end = 1;
2527
+ collapse = "left";
2528
+ } else if (ch < mEnd) {
2529
+ start = ch - mStart;
2530
+ end = start + 1;
2531
+ } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {
2532
+ end = mEnd - mStart;
2533
+ start = end - 1;
2534
+ if (ch >= mEnd) { collapse = "right"; }
2535
+ }
2536
+ if (start != null) {
2537
+ node = map$$1[i + 2];
2538
+ if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right"))
2539
+ { collapse = bias; }
2540
+ if (bias == "left" && start == 0)
2541
+ { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {
2542
+ node = map$$1[(i -= 3) + 2];
2543
+ collapse = "left";
2544
+ } }
2545
+ if (bias == "right" && start == mEnd - mStart)
2546
+ { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {
2547
+ node = map$$1[(i += 3) + 2];
2548
+ collapse = "right";
2549
+ } }
2550
+ break
2551
+ }
2552
+ }
2553
+ return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}
2554
+ }
2555
+
2556
+ function getUsefulRect(rects, bias) {
2557
+ var rect = nullRect;
2558
+ if (bias == "left") { for (var i = 0; i < rects.length; i++) {
2559
+ if ((rect = rects[i]).left != rect.right) { break }
2560
+ } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {
2561
+ if ((rect = rects[i$1]).left != rect.right) { break }
2562
+ } }
2563
+ return rect
2564
+ }
2565
+
2566
+ function measureCharInner(cm, prepared, ch, bias) {
2567
+ var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);
2568
+ var node = place.node, start = place.start, end = place.end, collapse = place.collapse;
2569
+
2570
+ var rect;
2571
+ if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.
2572
+ for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned
2573
+ while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }
2574
+ while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }
2575
+ if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)
2576
+ { rect = node.parentNode.getBoundingClientRect(); }
2577
+ else
2578
+ { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }
2579
+ if (rect.left || rect.right || start == 0) { break }
2580
+ end = start;
2581
+ start = start - 1;
2582
+ collapse = "right";
2583
+ }
2584
+ if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }
2585
+ } else { // If it is a widget, simply get the box for the whole widget.
2586
+ if (start > 0) { collapse = bias = "right"; }
2587
+ var rects;
2588
+ if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)
2589
+ { rect = rects[bias == "right" ? rects.length - 1 : 0]; }
2590
+ else
2591
+ { rect = node.getBoundingClientRect(); }
2592
+ }
2593
+ if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
2594
+ var rSpan = node.parentNode.getClientRects()[0];
2595
+ if (rSpan)
2596
+ { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }
2597
+ else
2598
+ { rect = nullRect; }
2599
+ }
2600
+
2601
+ var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;
2602
+ var mid = (rtop + rbot) / 2;
2603
+ var heights = prepared.view.measure.heights;
2604
+ var i = 0;
2605
+ for (; i < heights.length - 1; i++)
2606
+ { if (mid < heights[i]) { break } }
2607
+ var top = i ? heights[i - 1] : 0, bot = heights[i];
2608
+ var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left,
2609
+ right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left,
2610
+ top: top, bottom: bot};
2611
+ if (!rect.left && !rect.right) { result.bogus = true; }
2612
+ if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }
2613
+
2614
+ return result
2615
+ }
2616
+
2617
+ // Work around problem with bounding client rects on ranges being
2618
+ // returned incorrectly when zoomed on IE10 and below.
2619
+ function maybeUpdateRectForZooming(measure, rect) {
2620
+ if (!window.screen || screen.logicalXDPI == null ||
2621
+ screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))
2622
+ { return rect }
2623
+ var scaleX = screen.logicalXDPI / screen.deviceXDPI;
2624
+ var scaleY = screen.logicalYDPI / screen.deviceYDPI;
2625
+ return {left: rect.left * scaleX, right: rect.right * scaleX,
2626
+ top: rect.top * scaleY, bottom: rect.bottom * scaleY}
2627
+ }
2628
+
2629
+ function clearLineMeasurementCacheFor(lineView) {
2630
+ if (lineView.measure) {
2631
+ lineView.measure.cache = {};
2632
+ lineView.measure.heights = null;
2633
+ if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)
2634
+ { lineView.measure.caches[i] = {}; } }
2635
+ }
2636
+ }
2637
+
2638
+ function clearLineMeasurementCache(cm) {
2639
+ cm.display.externalMeasure = null;
2640
+ removeChildren(cm.display.lineMeasure);
2641
+ for (var i = 0; i < cm.display.view.length; i++)
2642
+ { clearLineMeasurementCacheFor(cm.display.view[i]); }
2643
+ }
2644
+
2645
+ function clearCaches(cm) {
2646
+ clearLineMeasurementCache(cm);
2647
+ cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;
2648
+ if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }
2649
+ cm.display.lineNumChars = null;
2650
+ }
2651
+
2652
+ function pageScrollX() {
2653
+ // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
2654
+ // which causes page_Offset and bounding client rects to use
2655
+ // different reference viewports and invalidate our calculations.
2656
+ if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
2657
+ return window.pageXOffset || (document.documentElement || document.body).scrollLeft
2658
+ }
2659
+ function pageScrollY() {
2660
+ if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
2661
+ return window.pageYOffset || (document.documentElement || document.body).scrollTop
2662
+ }
2663
+
2664
+ function widgetTopHeight(lineObj) {
2665
+ var height = 0;
2666
+ if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)
2667
+ { height += widgetHeight(lineObj.widgets[i]); } } }
2668
+ return height
2669
+ }
2670
+
2671
+ // Converts a {top, bottom, left, right} box from line-local
2672
+ // coordinates into another coordinate system. Context may be one of
2673
+ // "line", "div" (display.lineDiv), "local"./null (editor), "window",
2674
+ // or "page".
2675
+ function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
2676
+ if (!includeWidgets) {
2677
+ var height = widgetTopHeight(lineObj);
2678
+ rect.top += height; rect.bottom += height;
2679
+ }
2680
+ if (context == "line") { return rect }
2681
+ if (!context) { context = "local"; }
2682
+ var yOff = heightAtLine(lineObj);
2683
+ if (context == "local") { yOff += paddingTop(cm.display); }
2684
+ else { yOff -= cm.display.viewOffset; }
2685
+ if (context == "page" || context == "window") {
2686
+ var lOff = cm.display.lineSpace.getBoundingClientRect();
2687
+ yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
2688
+ var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
2689
+ rect.left += xOff; rect.right += xOff;
2690
+ }
2691
+ rect.top += yOff; rect.bottom += yOff;
2692
+ return rect
2693
+ }
2694
+
2695
+ // Coverts a box from "div" coords to another coordinate system.
2696
+ // Context may be "window", "page", "div", or "local"./null.
2697
+ function fromCoordSystem(cm, coords, context) {
2698
+ if (context == "div") { return coords }
2699
+ var left = coords.left, top = coords.top;
2700
+ // First move into "page" coordinate system
2701
+ if (context == "page") {
2702
+ left -= pageScrollX();
2703
+ top -= pageScrollY();
2704
+ } else if (context == "local" || !context) {
2705
+ var localBox = cm.display.sizer.getBoundingClientRect();
2706
+ left += localBox.left;
2707
+ top += localBox.top;
2708
+ }
2709
+
2710
+ var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();
2711
+ return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}
2712
+ }
2713
+
2714
+ function charCoords(cm, pos, context, lineObj, bias) {
2715
+ if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }
2716
+ return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)
2717
+ }
2718
+
2719
+ // Returns a box for a given cursor position, which may have an
2720
+ // 'other' property containing the position of the secondary cursor
2721
+ // on a bidi boundary.
2722
+ // A cursor Pos(line, char, "before") is on the same visual line as `char - 1`
2723
+ // and after `char - 1` in writing order of `char - 1`
2724
+ // A cursor Pos(line, char, "after") is on the same visual line as `char`
2725
+ // and before `char` in writing order of `char`
2726
+ // Examples (upper-case letters are RTL, lower-case are LTR):
2727
+ // Pos(0, 1, ...)
2728
+ // before after
2729
+ // ab a|b a|b
2730
+ // aB a|B aB|
2731
+ // Ab |Ab A|b
2732
+ // AB B|A B|A
2733
+ // Every position after the last character on a line is considered to stick
2734
+ // to the last character on the line.
2735
+ function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
2736
+ lineObj = lineObj || getLine(cm.doc, pos.line);
2737
+ if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }
2738
+ function get(ch, right) {
2739
+ var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight);
2740
+ if (right) { m.left = m.right; } else { m.right = m.left; }
2741
+ return intoCoordSystem(cm, lineObj, m, context)
2742
+ }
2743
+ var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;
2744
+ if (ch >= lineObj.text.length) {
2745
+ ch = lineObj.text.length;
2746
+ sticky = "before";
2747
+ } else if (ch <= 0) {
2748
+ ch = 0;
2749
+ sticky = "after";
2750
+ }
2751
+ if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") }
2752
+
2753
+ function getBidi(ch, partPos, invert) {
2754
+ var part = order[partPos], right = part.level == 1;
2755
+ return get(invert ? ch - 1 : ch, right != invert)
2756
+ }
2757
+ var partPos = getBidiPartAt(order, ch, sticky);
2758
+ var other = bidiOther;
2759
+ var val = getBidi(ch, partPos, sticky == "before");
2760
+ if (other != null) { val.other = getBidi(ch, other, sticky != "before"); }
2761
+ return val
2762
+ }
2763
+
2764
+ // Used to cheaply estimate the coordinates for a position. Used for
2765
+ // intermediate scroll updates.
2766
+ function estimateCoords(cm, pos) {
2767
+ var left = 0;
2768
+ pos = clipPos(cm.doc, pos);
2769
+ if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }
2770
+ var lineObj = getLine(cm.doc, pos.line);
2771
+ var top = heightAtLine(lineObj) + paddingTop(cm.display);
2772
+ return {left: left, right: left, top: top, bottom: top + lineObj.height}
2773
+ }
2774
+
2775
+ // Positions returned by coordsChar contain some extra information.
2776
+ // xRel is the relative x position of the input coordinates compared
2777
+ // to the found position (so xRel > 0 means the coordinates are to
2778
+ // the right of the character position, for example). When outside
2779
+ // is true, that means the coordinates lie outside the line's
2780
+ // vertical range.
2781
+ function PosWithInfo(line, ch, sticky, outside, xRel) {
2782
+ var pos = Pos(line, ch, sticky);
2783
+ pos.xRel = xRel;
2784
+ if (outside) { pos.outside = true; }
2785
+ return pos
2786
+ }
2787
+
2788
+ // Compute the character position closest to the given coordinates.
2789
+ // Input must be lineSpace-local ("div" coordinate system).
2790
+ function coordsChar(cm, x, y) {
2791
+ var doc = cm.doc;
2792
+ y += cm.display.viewOffset;
2793
+ if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }
2794
+ var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
2795
+ if (lineN > last)
2796
+ { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }
2797
+ if (x < 0) { x = 0; }
2798
+
2799
+ var lineObj = getLine(doc, lineN);
2800
+ for (;;) {
2801
+ var found = coordsCharInner(cm, lineObj, lineN, x, y);
2802
+ var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));
2803
+ if (!collapsed) { return found }
2804
+ var rangeEnd = collapsed.find(1);
2805
+ if (rangeEnd.line == lineN) { return rangeEnd }
2806
+ lineObj = getLine(doc, lineN = rangeEnd.line);
2807
+ }
2808
+ }
2809
+
2810
+ function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
2811
+ y -= widgetTopHeight(lineObj);
2812
+ var end = lineObj.text.length;
2813
+ var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);
2814
+ end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);
2815
+ return {begin: begin, end: end}
2816
+ }
2817
+
2818
+ function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
2819
+ if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }
2820
+ var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top;
2821
+ return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)
2822
+ }
2823
+
2824
+ // Returns true if the given side of a box is after the given
2825
+ // coordinates, in top-to-bottom, left-to-right order.
2826
+ function boxIsAfter(box, x, y, left) {
2827
+ return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
2828
+ }
2829
+
2830
+ function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {
2831
+ // Move y into line-local coordinate space
2832
+ y -= heightAtLine(lineObj);
2833
+ var preparedMeasure = prepareMeasureForLine(cm, lineObj);
2834
+ // When directly calling `measureCharPrepared`, we have to adjust
2835
+ // for the widgets at this line.
2836
+ var widgetHeight$$1 = widgetTopHeight(lineObj);
2837
+ var begin = 0, end = lineObj.text.length, ltr = true;
2838
+
2839
+ var order = getOrder(lineObj, cm.doc.direction);
2840
+ // If the line isn't plain left-to-right text, first figure out
2841
+ // which bidi section the coordinates fall into.
2842
+ if (order) {
2843
+ var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)
2844
+ (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);
2845
+ ltr = part.level != 1;
2846
+ // The awkward -1 offsets are needed because findFirst (called
2847
+ // on these below) will treat its first bound as inclusive,
2848
+ // second as exclusive, but we want to actually address the
2849
+ // characters in the part's range
2850
+ begin = ltr ? part.from : part.to - 1;
2851
+ end = ltr ? part.to : part.from - 1;
2852
+ }
2853
+
2854
+ // A binary search to find the first character whose bounding box
2855
+ // starts after the coordinates. If we run across any whose box wrap
2856
+ // the coordinates, store that.
2857
+ var chAround = null, boxAround = null;
2858
+ var ch = findFirst(function (ch) {
2859
+ var box = measureCharPrepared(cm, preparedMeasure, ch);
2860
+ box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;
2861
+ if (!boxIsAfter(box, x, y, false)) { return false }
2862
+ if (box.top <= y && box.left <= x) {
2863
+ chAround = ch;
2864
+ boxAround = box;
2865
+ }
2866
+ return true
2867
+ }, begin, end);
2868
+
2869
+ var baseX, sticky, outside = false;
2870
+ // If a box around the coordinates was found, use that
2871
+ if (boxAround) {
2872
+ // Distinguish coordinates nearer to the left or right side of the box
2873
+ var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;
2874
+ ch = chAround + (atStart ? 0 : 1);
2875
+ sticky = atStart ? "after" : "before";
2876
+ baseX = atLeft ? boxAround.left : boxAround.right;
2877
+ } else {
2878
+ // (Adjust for extended bound, if necessary.)
2879
+ if (!ltr && (ch == end || ch == begin)) { ch++; }
2880
+ // To determine which side to associate with, get the box to the
2881
+ // left of the character and compare it's vertical position to the
2882
+ // coordinates
2883
+ sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" :
2884
+ (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?
2885
+ "after" : "before";
2886
+ // Now get accurate coordinates for this place, in order to get a
2887
+ // base X position
2888
+ var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), "line", lineObj, preparedMeasure);
2889
+ baseX = coords.left;
2890
+ outside = y < coords.top || y >= coords.bottom;
2891
+ }
2892
+
2893
+ ch = skipExtendingChars(lineObj.text, ch, 1);
2894
+ return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)
2895
+ }
2896
+
2897
+ function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {
2898
+ // Bidi parts are sorted left-to-right, and in a non-line-wrapping
2899
+ // situation, we can take this ordering to correspond to the visual
2900
+ // ordering. This finds the first part whose end is after the given
2901
+ // coordinates.
2902
+ var index = findFirst(function (i) {
2903
+ var part = order[i], ltr = part.level != 1;
2904
+ return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? "before" : "after"),
2905
+ "line", lineObj, preparedMeasure), x, y, true)
2906
+ }, 0, order.length - 1);
2907
+ var part = order[index];
2908
+ // If this isn't the first part, the part's start is also after
2909
+ // the coordinates, and the coordinates aren't on the same line as
2910
+ // that start, move one part back.
2911
+ if (index > 0) {
2912
+ var ltr = part.level != 1;
2913
+ var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? "after" : "before"),
2914
+ "line", lineObj, preparedMeasure);
2915
+ if (boxIsAfter(start, x, y, true) && start.top > y)
2916
+ { part = order[index - 1]; }
2917
+ }
2918
+ return part
2919
+ }
2920
+
2921
+ function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {
2922
+ // In a wrapped line, rtl text on wrapping boundaries can do things
2923
+ // that don't correspond to the ordering in our `order` array at
2924
+ // all, so a binary search doesn't work, and we want to return a
2925
+ // part that only spans one line so that the binary search in
2926
+ // coordsCharInner is safe. As such, we first find the extent of the
2927
+ // wrapped line, and then do a flat search in which we discard any
2928
+ // spans that aren't on the line.
2929
+ var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);
2930
+ var begin = ref.begin;
2931
+ var end = ref.end;
2932
+ if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; }
2933
+ var part = null, closestDist = null;
2934
+ for (var i = 0; i < order.length; i++) {
2935
+ var p = order[i];
2936
+ if (p.from >= end || p.to <= begin) { continue }
2937
+ var ltr = p.level != 1;
2938
+ var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;
2939
+ // Weigh against spans ending before this, so that they are only
2940
+ // picked if nothing ends after
2941
+ var dist = endX < x ? x - endX + 1e9 : endX - x;
2942
+ if (!part || closestDist > dist) {
2943
+ part = p;
2944
+ closestDist = dist;
2945
+ }
2946
+ }
2947
+ if (!part) { part = order[order.length - 1]; }
2948
+ // Clip the part to the wrapped line.
2949
+ if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }
2950
+ if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }
2951
+ return part
2952
+ }
2953
+
2954
+ var measureText;
2955
+ // Compute the default text height.
2956
+ function textHeight(display) {
2957
+ if (display.cachedTextHeight != null) { return display.cachedTextHeight }
2958
+ if (measureText == null) {
2959
+ measureText = elt("pre");
2960
+ // Measure a bunch of lines, for browsers that compute
2961
+ // fractional heights.
2962
+ for (var i = 0; i < 49; ++i) {
2963
+ measureText.appendChild(document.createTextNode("x"));
2964
+ measureText.appendChild(elt("br"));
2965
+ }
2966
+ measureText.appendChild(document.createTextNode("x"));
2967
+ }
2968
+ removeChildrenAndAdd(display.measure, measureText);
2969
+ var height = measureText.offsetHeight / 50;
2970
+ if (height > 3) { display.cachedTextHeight = height; }
2971
+ removeChildren(display.measure);
2972
+ return height || 1
2973
+ }
2974
+
2975
+ // Compute the default character width.
2976
+ function charWidth(display) {
2977
+ if (display.cachedCharWidth != null) { return display.cachedCharWidth }
2978
+ var anchor = elt("span", "xxxxxxxxxx");
2979
+ var pre = elt("pre", [anchor]);
2980
+ removeChildrenAndAdd(display.measure, pre);
2981
+ var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;
2982
+ if (width > 2) { display.cachedCharWidth = width; }
2983
+ return width || 10
2984
+ }
2985
+
2986
+ // Do a bulk-read of the DOM positions and sizes needed to draw the
2987
+ // view, so that we don't interleave reading and writing to the DOM.
2988
+ function getDimensions(cm) {
2989
+ var d = cm.display, left = {}, width = {};
2990
+ var gutterLeft = d.gutters.clientLeft;
2991
+ for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
2992
+ left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;
2993
+ width[cm.options.gutters[i]] = n.clientWidth;
2994
+ }
2995
+ return {fixedPos: compensateForHScroll(d),
2996
+ gutterTotalWidth: d.gutters.offsetWidth,
2997
+ gutterLeft: left,
2998
+ gutterWidth: width,
2999
+ wrapperWidth: d.wrapper.clientWidth}
3000
+ }
3001
+
3002
+ // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
3003
+ // but using getBoundingClientRect to get a sub-pixel-accurate
3004
+ // result.
3005
+ function compensateForHScroll(display) {
3006
+ return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left
3007
+ }
3008
+
3009
+ // Returns a function that estimates the height of a line, to use as
3010
+ // first approximation until the line becomes visible (and is thus
3011
+ // properly measurable).
3012
+ function estimateHeight(cm) {
3013
+ var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
3014
+ var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
3015
+ return function (line) {
3016
+ if (lineIsHidden(cm.doc, line)) { return 0 }
3017
+
3018
+ var widgetsHeight = 0;
3019
+ if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {
3020
+ if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }
3021
+ } }
3022
+
3023
+ if (wrapping)
3024
+ { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }
3025
+ else
3026
+ { return widgetsHeight + th }
3027
+ }
3028
+ }
3029
+
3030
+ function estimateLineHeights(cm) {
3031
+ var doc = cm.doc, est = estimateHeight(cm);
3032
+ doc.iter(function (line) {
3033
+ var estHeight = est(line);
3034
+ if (estHeight != line.height) { updateLineHeight(line, estHeight); }
3035
+ });
3036
+ }
3037
+
3038
+ // Given a mouse event, find the corresponding position. If liberal
3039
+ // is false, it checks whether a gutter or scrollbar was clicked,
3040
+ // and returns null if it was. forRect is used by rectangular
3041
+ // selections, and tries to estimate a character position even for
3042
+ // coordinates beyond the right of the text.
3043
+ function posFromMouse(cm, e, liberal, forRect) {
3044
+ var display = cm.display;
3045
+ if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null }
3046
+
3047
+ var x, y, space = display.lineSpace.getBoundingClientRect();
3048
+ // Fails unpredictably on IE[67] when mouse is dragged around quickly.
3049
+ try { x = e.clientX - space.left; y = e.clientY - space.top; }
3050
+ catch (e) { return null }
3051
+ var coords = coordsChar(cm, x, y), line;
3052
+ if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {
3053
+ var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;
3054
+ coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));
3055
+ }
3056
+ return coords
3057
+ }
3058
+
3059
+ // Find the view element corresponding to a given line. Return null
3060
+ // when the line isn't visible.
3061
+ function findViewIndex(cm, n) {
3062
+ if (n >= cm.display.viewTo) { return null }
3063
+ n -= cm.display.viewFrom;
3064
+ if (n < 0) { return null }
3065
+ var view = cm.display.view;
3066
+ for (var i = 0; i < view.length; i++) {
3067
+ n -= view[i].size;
3068
+ if (n < 0) { return i }
3069
+ }
3070
+ }
3071
+
3072
+ function updateSelection(cm) {
3073
+ cm.display.input.showSelection(cm.display.input.prepareSelection());
3074
+ }
3075
+
3076
+ function prepareSelection(cm, primary) {
3077
+ if ( primary === void 0 ) primary = true;
3078
+
3079
+ var doc = cm.doc, result = {};
3080
+ var curFragment = result.cursors = document.createDocumentFragment();
3081
+ var selFragment = result.selection = document.createDocumentFragment();
3082
+
3083
+ for (var i = 0; i < doc.sel.ranges.length; i++) {
3084
+ if (!primary && i == doc.sel.primIndex) { continue }
3085
+ var range$$1 = doc.sel.ranges[i];
3086
+ if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }
3087
+ var collapsed = range$$1.empty();
3088
+ if (collapsed || cm.options.showCursorWhenSelecting)
3089
+ { drawSelectionCursor(cm, range$$1.head, curFragment); }
3090
+ if (!collapsed)
3091
+ { drawSelectionRange(cm, range$$1, selFragment); }
3092
+ }
3093
+ return result
3094
+ }
3095
+
3096
+ // Draws a cursor for the given range
3097
+ function drawSelectionCursor(cm, head, output) {
3098
+ var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine);
3099
+
3100
+ var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
3101
+ cursor.style.left = pos.left + "px";
3102
+ cursor.style.top = pos.top + "px";
3103
+ cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
3104
+
3105
+ if (pos.other) {
3106
+ // Secondary cursor, shown when on a 'jump' in bi-directional text
3107
+ var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
3108
+ otherCursor.style.display = "";
3109
+ otherCursor.style.left = pos.other.left + "px";
3110
+ otherCursor.style.top = pos.other.top + "px";
3111
+ otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
3112
+ }
3113
+ }
3114
+
3115
+ function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
3116
+
3117
+ // Draws the given range as a highlighted selection
3118
+ function drawSelectionRange(cm, range$$1, output) {
3119
+ var display = cm.display, doc = cm.doc;
3120
+ var fragment = document.createDocumentFragment();
3121
+ var padding = paddingH(cm.display), leftSide = padding.left;
3122
+ var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;
3123
+ var docLTR = doc.direction == "ltr";
3124
+
3125
+ function add(left, top, width, bottom) {
3126
+ if (top < 0) { top = 0; }
3127
+ top = Math.round(top);
3128
+ bottom = Math.round(bottom);
3129
+ fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px")));
3130
+ }
3131
+
3132
+ function drawForLine(line, fromArg, toArg) {
3133
+ var lineObj = getLine(doc, line);
3134
+ var lineLen = lineObj.text.length;
3135
+ var start, end;
3136
+ function coords(ch, bias) {
3137
+ return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
3138
+ }
3139
+
3140
+ function wrapX(pos, dir, side) {
3141
+ var extent = wrappedLineExtentChar(cm, lineObj, null, pos);
3142
+ var prop = (dir == "ltr") == (side == "after") ? "left" : "right";
3143
+ var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);
3144
+ return coords(ch, prop)[prop]
3145
+ }
3146
+
3147
+ var order = getOrder(lineObj, doc.direction);
3148
+ iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {
3149
+ var ltr = dir == "ltr";
3150
+ var fromPos = coords(from, ltr ? "left" : "right");
3151
+ var toPos = coords(to - 1, ltr ? "right" : "left");
3152
+
3153
+ var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;
3154
+ var first = i == 0, last = !order || i == order.length - 1;
3155
+ if (toPos.top - fromPos.top <= 3) { // Single line
3156
+ var openLeft = (docLTR ? openStart : openEnd) && first;
3157
+ var openRight = (docLTR ? openEnd : openStart) && last;
3158
+ var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;
3159
+ var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;
3160
+ add(left, fromPos.top, right - left, fromPos.bottom);
3161
+ } else { // Multiple lines
3162
+ var topLeft, topRight, botLeft, botRight;
3163
+ if (ltr) {
3164
+ topLeft = docLTR && openStart && first ? leftSide : fromPos.left;
3165
+ topRight = docLTR ? rightSide : wrapX(from, dir, "before");
3166
+ botLeft = docLTR ? leftSide : wrapX(to, dir, "after");
3167
+ botRight = docLTR && openEnd && last ? rightSide : toPos.right;
3168
+ } else {
3169
+ topLeft = !docLTR ? leftSide : wrapX(from, dir, "before");
3170
+ topRight = !docLTR && openStart && first ? rightSide : fromPos.right;
3171
+ botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;
3172
+ botRight = !docLTR ? rightSide : wrapX(to, dir, "after");
3173
+ }
3174
+ add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);
3175
+ if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }
3176
+ add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);
3177
+ }
3178
+
3179
+ if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }
3180
+ if (cmpCoords(toPos, start) < 0) { start = toPos; }
3181
+ if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }
3182
+ if (cmpCoords(toPos, end) < 0) { end = toPos; }
3183
+ });
3184
+ return {start: start, end: end}
3185
+ }
3186
+
3187
+ var sFrom = range$$1.from(), sTo = range$$1.to();
3188
+ if (sFrom.line == sTo.line) {
3189
+ drawForLine(sFrom.line, sFrom.ch, sTo.ch);
3190
+ } else {
3191
+ var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);
3192
+ var singleVLine = visualLine(fromLine) == visualLine(toLine);
3193
+ var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;
3194
+ var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;
3195
+ if (singleVLine) {
3196
+ if (leftEnd.top < rightStart.top - 2) {
3197
+ add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
3198
+ add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);
3199
+ } else {
3200
+ add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
3201
+ }
3202
+ }
3203
+ if (leftEnd.bottom < rightStart.top)
3204
+ { add(leftSide, leftEnd.bottom, null, rightStart.top); }
3205
+ }
3206
+
3207
+ output.appendChild(fragment);
3208
+ }
3209
+
3210
+ // Cursor-blinking
3211
+ function restartBlink(cm) {
3212
+ if (!cm.state.focused) { return }
3213
+ var display = cm.display;
3214
+ clearInterval(display.blinker);
3215
+ var on = true;
3216
+ display.cursorDiv.style.visibility = "";
3217
+ if (cm.options.cursorBlinkRate > 0)
3218
+ { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; },
3219
+ cm.options.cursorBlinkRate); }
3220
+ else if (cm.options.cursorBlinkRate < 0)
3221
+ { display.cursorDiv.style.visibility = "hidden"; }
3222
+ }
3223
+
3224
+ function ensureFocus(cm) {
3225
+ if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
3226
+ }
3227
+
3228
+ function delayBlurEvent(cm) {
3229
+ cm.state.delayingBlurEvent = true;
3230
+ setTimeout(function () { if (cm.state.delayingBlurEvent) {
3231
+ cm.state.delayingBlurEvent = false;
3232
+ onBlur(cm);
3233
+ } }, 100);
3234
+ }
3235
+
3236
+ function onFocus(cm, e) {
3237
+ if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }
3238
+
3239
+ if (cm.options.readOnly == "nocursor") { return }
3240
+ if (!cm.state.focused) {
3241
+ signal(cm, "focus", cm, e);
3242
+ cm.state.focused = true;
3243
+ addClass(cm.display.wrapper, "CodeMirror-focused");
3244
+ // This test prevents this from firing when a context
3245
+ // menu is closed (since the input reset would kill the
3246
+ // select-all detection hack)
3247
+ if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
3248
+ cm.display.input.reset();
3249
+ if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730
3250
+ }
3251
+ cm.display.input.receivedFocus();
3252
+ }
3253
+ restartBlink(cm);
3254
+ }
3255
+ function onBlur(cm, e) {
3256
+ if (cm.state.delayingBlurEvent) { return }
3257
+
3258
+ if (cm.state.focused) {
3259
+ signal(cm, "blur", cm, e);
3260
+ cm.state.focused = false;
3261
+ rmClass(cm.display.wrapper, "CodeMirror-focused");
3262
+ }
3263
+ clearInterval(cm.display.blinker);
3264
+ setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);
3265
+ }
3266
+
3267
+ // Read the actual heights of the rendered lines, and update their
3268
+ // stored heights to match.
3269
+ function updateHeightsInViewport(cm) {
3270
+ var display = cm.display;
3271
+ var prevBottom = display.lineDiv.offsetTop;
3272
+ for (var i = 0; i < display.view.length; i++) {
3273
+ var cur = display.view[i], wrapping = cm.options.lineWrapping;
3274
+ var height = (void 0), width = 0;
3275
+ if (cur.hidden) { continue }
3276
+ if (ie && ie_version < 8) {
3277
+ var bot = cur.node.offsetTop + cur.node.offsetHeight;
3278
+ height = bot - prevBottom;
3279
+ prevBottom = bot;
3280
+ } else {
3281
+ var box = cur.node.getBoundingClientRect();
3282
+ height = box.bottom - box.top;
3283
+ // Check that lines don't extend past the right of the current
3284
+ // editor width
3285
+ if (!wrapping && cur.text.firstChild)
3286
+ { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }
3287
+ }
3288
+ var diff = cur.line.height - height;
3289
+ if (height < 2) { height = textHeight(display); }
3290
+ if (diff > .005 || diff < -.005) {
3291
+ updateLineHeight(cur.line, height);
3292
+ updateWidgetHeight(cur.line);
3293
+ if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
3294
+ { updateWidgetHeight(cur.rest[j]); } }
3295
+ }
3296
+ if (width > cm.display.sizerWidth) {
3297
+ var chWidth = Math.ceil(width / charWidth(cm.display));
3298
+ if (chWidth > cm.display.maxLineLength) {
3299
+ cm.display.maxLineLength = chWidth;
3300
+ cm.display.maxLine = cur.line;
3301
+ cm.display.maxLineChanged = true;
3302
+ }
3303
+ }
3304
+ }
3305
+ }
3306
+
3307
+ // Read and store the height of line widgets associated with the
3308
+ // given line.
3309
+ function updateWidgetHeight(line) {
3310
+ if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {
3311
+ var w = line.widgets[i], parent = w.node.parentNode;
3312
+ if (parent) { w.height = parent.offsetHeight; }
3313
+ } }
3314
+ }
3315
+
3316
+ // Compute the lines that are visible in a given viewport (defaults
3317
+ // the the current scroll position). viewport may contain top,
3318
+ // height, and ensure (see op.scrollToPos) properties.
3319
+ function visibleLines(display, doc, viewport) {
3320
+ var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;
3321
+ top = Math.floor(top - paddingTop(display));
3322
+ var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;
3323
+
3324
+ var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);
3325
+ // Ensure is a {from: {line, ch}, to: {line, ch}} object, and
3326
+ // forces those lines into the viewport (if possible).
3327
+ if (viewport && viewport.ensure) {
3328
+ var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;
3329
+ if (ensureFrom < from) {
3330
+ from = ensureFrom;
3331
+ to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);
3332
+ } else if (Math.min(ensureTo, doc.lastLine()) >= to) {
3333
+ from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);
3334
+ to = ensureTo;
3335
+ }
3336
+ }
3337
+ return {from: from, to: Math.max(to, from + 1)}
3338
+ }
3339
+
3340
+ // Re-align line numbers and gutter marks to compensate for
3341
+ // horizontal scrolling.
3342
+ function alignHorizontally(cm) {
3343
+ var display = cm.display, view = display.view;
3344
+ if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
3345
+ var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
3346
+ var gutterW = display.gutters.offsetWidth, left = comp + "px";
3347
+ for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
3348
+ if (cm.options.fixedGutter) {
3349
+ if (view[i].gutter)
3350
+ { view[i].gutter.style.left = left; }
3351
+ if (view[i].gutterBackground)
3352
+ { view[i].gutterBackground.style.left = left; }
3353
+ }
3354
+ var align = view[i].alignable;
3355
+ if (align) { for (var j = 0; j < align.length; j++)
3356
+ { align[j].style.left = left; } }
3357
+ } }
3358
+ if (cm.options.fixedGutter)
3359
+ { display.gutters.style.left = (comp + gutterW) + "px"; }
3360
+ }
3361
+
3362
+ // Used to ensure that the line number gutter is still the right
3363
+ // size for the current document size. Returns true when an update
3364
+ // is needed.
3365
+ function maybeUpdateLineNumberWidth(cm) {
3366
+ if (!cm.options.lineNumbers) { return false }
3367
+ var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
3368
+ if (last.length != display.lineNumChars) {
3369
+ var test = display.measure.appendChild(elt("div", [elt("div", last)],
3370
+ "CodeMirror-linenumber CodeMirror-gutter-elt"));
3371
+ var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
3372
+ display.lineGutter.style.width = "";
3373
+ display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;
3374
+ display.lineNumWidth = display.lineNumInnerWidth + padding;
3375
+ display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
3376
+ display.lineGutter.style.width = display.lineNumWidth + "px";
3377
+ updateGutterSpace(cm);
3378
+ return true
3379
+ }
3380
+ return false
3381
+ }
3382
+
3383
+ // SCROLLING THINGS INTO VIEW
3384
+
3385
+ // If an editor sits on the top or bottom of the window, partially
3386
+ // scrolled out of view, this ensures that the cursor is visible.
3387
+ function maybeScrollWindow(cm, rect) {
3388
+ if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
3389
+
3390
+ var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
3391
+ if (rect.top + box.top < 0) { doScroll = true; }
3392
+ else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }
3393
+ if (doScroll != null && !phantom) {
3394
+ var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"));
3395
+ cm.display.lineSpace.appendChild(scrollNode);
3396
+ scrollNode.scrollIntoView(doScroll);
3397
+ cm.display.lineSpace.removeChild(scrollNode);
3398
+ }
3399
+ }
3400
+
3401
+ // Scroll a given position into view (immediately), verifying that
3402
+ // it actually became visible (as line heights are accurately
3403
+ // measured, the position of something may 'drift' during drawing).
3404
+ function scrollPosIntoView(cm, pos, end, margin) {
3405
+ if (margin == null) { margin = 0; }
3406
+ var rect;
3407
+ if (!cm.options.lineWrapping && pos == end) {
3408
+ // Set pos and end to the cursor positions around the character pos sticks to
3409
+ // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
3410
+ // If pos == Pos(_, 0, "before"), pos and end are unchanged
3411
+ pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos;
3412
+ end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos;
3413
+ }
3414
+ for (var limit = 0; limit < 5; limit++) {
3415
+ var changed = false;
3416
+ var coords = cursorCoords(cm, pos);
3417
+ var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);
3418
+ rect = {left: Math.min(coords.left, endCoords.left),
3419
+ top: Math.min(coords.top, endCoords.top) - margin,
3420
+ right: Math.max(coords.left, endCoords.left),
3421
+ bottom: Math.max(coords.bottom, endCoords.bottom) + margin};
3422
+ var scrollPos = calculateScrollPos(cm, rect);
3423
+ var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
3424
+ if (scrollPos.scrollTop != null) {
3425
+ updateScrollTop(cm, scrollPos.scrollTop);
3426
+ if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }
3427
+ }
3428
+ if (scrollPos.scrollLeft != null) {
3429
+ setScrollLeft(cm, scrollPos.scrollLeft);
3430
+ if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }
3431
+ }
3432
+ if (!changed) { break }
3433
+ }
3434
+ return rect
3435
+ }
3436
+
3437
+ // Scroll a given set of coordinates into view (immediately).
3438
+ function scrollIntoView(cm, rect) {
3439
+ var scrollPos = calculateScrollPos(cm, rect);
3440
+ if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }
3441
+ if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }
3442
+ }
3443
+
3444
+ // Calculate a new scroll position needed to scroll the given
3445
+ // rectangle into view. Returns an object with scrollTop and
3446
+ // scrollLeft properties. When these are undefined, the
3447
+ // vertical/horizontal position does not need to be adjusted.
3448
+ function calculateScrollPos(cm, rect) {
3449
+ var display = cm.display, snapMargin = textHeight(cm.display);
3450
+ if (rect.top < 0) { rect.top = 0; }
3451
+ var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
3452
+ var screen = displayHeight(cm), result = {};
3453
+ if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }
3454
+ var docBottom = cm.doc.height + paddingVert(display);
3455
+ var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;
3456
+ if (rect.top < screentop) {
3457
+ result.scrollTop = atTop ? 0 : rect.top;
3458
+ } else if (rect.bottom > screentop + screen) {
3459
+ var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);
3460
+ if (newTop != screentop) { result.scrollTop = newTop; }
3461
+ }
3462
+
3463
+ var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
3464
+ var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);
3465
+ var tooWide = rect.right - rect.left > screenw;
3466
+ if (tooWide) { rect.right = rect.left + screenw; }
3467
+ if (rect.left < 10)
3468
+ { result.scrollLeft = 0; }
3469
+ else if (rect.left < screenleft)
3470
+ { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }
3471
+ else if (rect.right > screenw + screenleft - 3)
3472
+ { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }
3473
+ return result
3474
+ }
3475
+
3476
+ // Store a relative adjustment to the scroll position in the current
3477
+ // operation (to be applied when the operation finishes).
3478
+ function addToScrollTop(cm, top) {
3479
+ if (top == null) { return }
3480
+ resolveScrollToPos(cm);
3481
+ cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
3482
+ }
3483
+
3484
+ // Make sure that at the end of the operation the current cursor is
3485
+ // shown.
3486
+ function ensureCursorVisible(cm) {
3487
+ resolveScrollToPos(cm);
3488
+ var cur = cm.getCursor();
3489
+ cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};
3490
+ }
3491
+
3492
+ function scrollToCoords(cm, x, y) {
3493
+ if (x != null || y != null) { resolveScrollToPos(cm); }
3494
+ if (x != null) { cm.curOp.scrollLeft = x; }
3495
+ if (y != null) { cm.curOp.scrollTop = y; }
3496
+ }
3497
+
3498
+ function scrollToRange(cm, range$$1) {
3499
+ resolveScrollToPos(cm);
3500
+ cm.curOp.scrollToPos = range$$1;
3501
+ }
3502
+
3503
+ // When an operation has its scrollToPos property set, and another
3504
+ // scroll action is applied before the end of the operation, this
3505
+ // 'simulates' scrolling that position into view in a cheap way, so
3506
+ // that the effect of intermediate scroll commands is not ignored.
3507
+ function resolveScrollToPos(cm) {
3508
+ var range$$1 = cm.curOp.scrollToPos;
3509
+ if (range$$1) {
3510
+ cm.curOp.scrollToPos = null;
3511
+ var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);
3512
+ scrollToCoordsRange(cm, from, to, range$$1.margin);
3513
+ }
3514
+ }
3515
+
3516
+ function scrollToCoordsRange(cm, from, to, margin) {
3517
+ var sPos = calculateScrollPos(cm, {
3518
+ left: Math.min(from.left, to.left),
3519
+ top: Math.min(from.top, to.top) - margin,
3520
+ right: Math.max(from.right, to.right),
3521
+ bottom: Math.max(from.bottom, to.bottom) + margin
3522
+ });
3523
+ scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);
3524
+ }
3525
+
3526
+ // Sync the scrollable area and scrollbars, ensure the viewport
3527
+ // covers the visible area.
3528
+ function updateScrollTop(cm, val) {
3529
+ if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
3530
+ if (!gecko) { updateDisplaySimple(cm, {top: val}); }
3531
+ setScrollTop(cm, val, true);
3532
+ if (gecko) { updateDisplaySimple(cm); }
3533
+ startWorker(cm, 100);
3534
+ }
3535
+
3536
+ function setScrollTop(cm, val, forceScroll) {
3537
+ val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);
3538
+ if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
3539
+ cm.doc.scrollTop = val;
3540
+ cm.display.scrollbars.setScrollTop(val);
3541
+ if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }
3542
+ }
3543
+
3544
+ // Sync scroller and scrollbar, ensure the gutter elements are
3545
+ // aligned.
3546
+ function setScrollLeft(cm, val, isScroller, forceScroll) {
3547
+ val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
3548
+ if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
3549
+ cm.doc.scrollLeft = val;
3550
+ alignHorizontally(cm);
3551
+ if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }
3552
+ cm.display.scrollbars.setScrollLeft(val);
3553
+ }
3554
+
3555
+ // SCROLLBARS
3556
+
3557
+ // Prepare DOM reads needed to update the scrollbars. Done in one
3558
+ // shot to minimize update/measure roundtrips.
3559
+ function measureForScrollbars(cm) {
3560
+ var d = cm.display, gutterW = d.gutters.offsetWidth;
3561
+ var docH = Math.round(cm.doc.height + paddingVert(cm.display));
3562
+ return {
3563
+ clientHeight: d.scroller.clientHeight,
3564
+ viewHeight: d.wrapper.clientHeight,
3565
+ scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
3566
+ viewWidth: d.wrapper.clientWidth,
3567
+ barLeft: cm.options.fixedGutter ? gutterW : 0,
3568
+ docHeight: docH,
3569
+ scrollHeight: docH + scrollGap(cm) + d.barHeight,
3570
+ nativeBarWidth: d.nativeBarWidth,
3571
+ gutterWidth: gutterW
3572
+ }
3573
+ }
3574
+
3575
+ var NativeScrollbars = function(place, scroll, cm) {
3576
+ this.cm = cm;
3577
+ var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar");
3578
+ var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
3579
+ vert.tabIndex = horiz.tabIndex = -1;
3580
+ place(vert); place(horiz);
3581
+
3582
+ on(vert, "scroll", function () {
3583
+ if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); }
3584
+ });
3585
+ on(horiz, "scroll", function () {
3586
+ if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); }
3587
+ });
3588
+
3589
+ this.checkedZeroWidth = false;
3590
+ // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
3591
+ if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; }
3592
+ };
3593
+
3594
+ NativeScrollbars.prototype.update = function (measure) {
3595
+ var needsH = measure.scrollWidth > measure.clientWidth + 1;
3596
+ var needsV = measure.scrollHeight > measure.clientHeight + 1;
3597
+ var sWidth = measure.nativeBarWidth;
3598
+
3599
+ if (needsV) {
3600
+ this.vert.style.display = "block";
3601
+ this.vert.style.bottom = needsH ? sWidth + "px" : "0";
3602
+ var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);
3603
+ // A bug in IE8 can cause this value to be negative, so guard it.
3604
+ this.vert.firstChild.style.height =
3605
+ Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
3606
+ } else {
3607
+ this.vert.style.display = "";
3608
+ this.vert.firstChild.style.height = "0";
3609
+ }
3610
+
3611
+ if (needsH) {
3612
+ this.horiz.style.display = "block";
3613
+ this.horiz.style.right = needsV ? sWidth + "px" : "0";
3614
+ this.horiz.style.left = measure.barLeft + "px";
3615
+ var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);
3616
+ this.horiz.firstChild.style.width =
3617
+ Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px";
3618
+ } else {
3619
+ this.horiz.style.display = "";
3620
+ this.horiz.firstChild.style.width = "0";
3621
+ }
3622
+
3623
+ if (!this.checkedZeroWidth && measure.clientHeight > 0) {
3624
+ if (sWidth == 0) { this.zeroWidthHack(); }
3625
+ this.checkedZeroWidth = true;
3626
+ }
3627
+
3628
+ return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}
3629
+ };
3630
+
3631
+ NativeScrollbars.prototype.setScrollLeft = function (pos) {
3632
+ if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }
3633
+ if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); }
3634
+ };
3635
+
3636
+ NativeScrollbars.prototype.setScrollTop = function (pos) {
3637
+ if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }
3638
+ if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); }
3639
+ };
3640
+
3641
+ NativeScrollbars.prototype.zeroWidthHack = function () {
3642
+ var w = mac && !mac_geMountainLion ? "12px" : "18px";
3643
+ this.horiz.style.height = this.vert.style.width = w;
3644
+ this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";
3645
+ this.disableHoriz = new Delayed;
3646
+ this.disableVert = new Delayed;
3647
+ };
3648
+
3649
+ NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
3650
+ bar.style.pointerEvents = "auto";
3651
+ function maybeDisable() {
3652
+ // To find out whether the scrollbar is still visible, we
3653
+ // check whether the element under the pixel in the bottom
3654
+ // right corner of the scrollbar box is the scrollbar box
3655
+ // itself (when the bar is still visible) or its filler child
3656
+ // (when the bar is hidden). If it is still visible, we keep
3657
+ // it enabled, if it's hidden, we disable pointer events.
3658
+ var box = bar.getBoundingClientRect();
3659
+ var elt$$1 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
3660
+ : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);
3661
+ if (elt$$1 != bar) { bar.style.pointerEvents = "none"; }
3662
+ else { delay.set(1000, maybeDisable); }
3663
+ }
3664
+ delay.set(1000, maybeDisable);
3665
+ };
3666
+
3667
+ NativeScrollbars.prototype.clear = function () {
3668
+ var parent = this.horiz.parentNode;
3669
+ parent.removeChild(this.horiz);
3670
+ parent.removeChild(this.vert);
3671
+ };
3672
+
3673
+ var NullScrollbars = function () {};
3674
+
3675
+ NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };
3676
+ NullScrollbars.prototype.setScrollLeft = function () {};
3677
+ NullScrollbars.prototype.setScrollTop = function () {};
3678
+ NullScrollbars.prototype.clear = function () {};
3679
+
3680
+ function updateScrollbars(cm, measure) {
3681
+ if (!measure) { measure = measureForScrollbars(cm); }
3682
+ var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;
3683
+ updateScrollbarsInner(cm, measure);
3684
+ for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
3685
+ if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
3686
+ { updateHeightsInViewport(cm); }
3687
+ updateScrollbarsInner(cm, measureForScrollbars(cm));
3688
+ startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;
3689
+ }
3690
+ }
3691
+
3692
+ // Re-synchronize the fake scrollbars with the actual size of the
3693
+ // content.
3694
+ function updateScrollbarsInner(cm, measure) {
3695
+ var d = cm.display;
3696
+ var sizes = d.scrollbars.update(measure);
3697
+
3698
+ d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
3699
+ d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
3700
+ d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent";
3701
+
3702
+ if (sizes.right && sizes.bottom) {
3703
+ d.scrollbarFiller.style.display = "block";
3704
+ d.scrollbarFiller.style.height = sizes.bottom + "px";
3705
+ d.scrollbarFiller.style.width = sizes.right + "px";
3706
+ } else { d.scrollbarFiller.style.display = ""; }
3707
+ if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
3708
+ d.gutterFiller.style.display = "block";
3709
+ d.gutterFiller.style.height = sizes.bottom + "px";
3710
+ d.gutterFiller.style.width = measure.gutterWidth + "px";
3711
+ } else { d.gutterFiller.style.display = ""; }
3712
+ }
3713
+
3714
+ var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars};
3715
+
3716
+ function initScrollbars(cm) {
3717
+ if (cm.display.scrollbars) {
3718
+ cm.display.scrollbars.clear();
3719
+ if (cm.display.scrollbars.addClass)
3720
+ { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
3721
+ }
3722
+
3723
+ cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {
3724
+ cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);
3725
+ // Prevent clicks in the scrollbars from killing focus
3726
+ on(node, "mousedown", function () {
3727
+ if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }
3728
+ });
3729
+ node.setAttribute("cm-not-content", "true");
3730
+ }, function (pos, axis) {
3731
+ if (axis == "horizontal") { setScrollLeft(cm, pos); }
3732
+ else { updateScrollTop(cm, pos); }
3733
+ }, cm);
3734
+ if (cm.display.scrollbars.addClass)
3735
+ { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }
3736
+ }
3737
+
3738
+ // Operations are used to wrap a series of changes to the editor
3739
+ // state in such a way that each change won't have to update the
3740
+ // cursor and display (which would be awkward, slow, and
3741
+ // error-prone). Instead, display updates are batched and then all
3742
+ // combined and executed at once.
3743
+
3744
+ var nextOpId = 0;
3745
+ // Start a new operation.
3746
+ function startOperation(cm) {
3747
+ cm.curOp = {
3748
+ cm: cm,
3749
+ viewChanged: false, // Flag that indicates that lines might need to be redrawn
3750
+ startHeight: cm.doc.height, // Used to detect need to update scrollbar
3751
+ forceUpdate: false, // Used to force a redraw
3752
+ updateInput: 0, // Whether to reset the input textarea
3753
+ typing: false, // Whether this reset should be careful to leave existing text (for compositing)
3754
+ changeObjs: null, // Accumulated changes, for firing change events
3755
+ cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on
3756
+ cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already
3757
+ selectionChanged: false, // Whether the selection needs to be redrawn
3758
+ updateMaxLine: false, // Set when the widest line needs to be determined anew
3759
+ scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet
3760
+ scrollToPos: null, // Used to scroll to a specific position
3761
+ focus: false,
3762
+ id: ++nextOpId // Unique ID
3763
+ };
3764
+ pushOperation(cm.curOp);
3765
+ }
3766
+
3767
+ // Finish an operation, updating the display and signalling delayed events
3768
+ function endOperation(cm) {
3769
+ var op = cm.curOp;
3770
+ if (op) { finishOperation(op, function (group) {
3771
+ for (var i = 0; i < group.ops.length; i++)
3772
+ { group.ops[i].cm.curOp = null; }
3773
+ endOperations(group);
3774
+ }); }
3775
+ }
3776
+
3777
+ // The DOM updates done when an operation finishes are batched so
3778
+ // that the minimum number of relayouts are required.
3779
+ function endOperations(group) {
3780
+ var ops = group.ops;
3781
+ for (var i = 0; i < ops.length; i++) // Read DOM
3782
+ { endOperation_R1(ops[i]); }
3783
+ for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)
3784
+ { endOperation_W1(ops[i$1]); }
3785
+ for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM
3786
+ { endOperation_R2(ops[i$2]); }
3787
+ for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)
3788
+ { endOperation_W2(ops[i$3]); }
3789
+ for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM
3790
+ { endOperation_finish(ops[i$4]); }
3791
+ }
3792
+
3793
+ function endOperation_R1(op) {
3794
+ var cm = op.cm, display = cm.display;
3795
+ maybeClipScrollbars(cm);
3796
+ if (op.updateMaxLine) { findMaxLine(cm); }
3797
+
3798
+ op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||
3799
+ op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||
3800
+ op.scrollToPos.to.line >= display.viewTo) ||
3801
+ display.maxLineChanged && cm.options.lineWrapping;
3802
+ op.update = op.mustUpdate &&
3803
+ new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);
3804
+ }
3805
+
3806
+ function endOperation_W1(op) {
3807
+ op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);
3808
+ }
3809
+
3810
+ function endOperation_R2(op) {
3811
+ var cm = op.cm, display = cm.display;
3812
+ if (op.updatedDisplay) { updateHeightsInViewport(cm); }
3813
+
3814
+ op.barMeasure = measureForScrollbars(cm);
3815
+
3816
+ // If the max line changed since it was last measured, measure it,
3817
+ // and ensure the document's width matches it.
3818
+ // updateDisplay_W2 will use these properties to do the actual resizing
3819
+ if (display.maxLineChanged && !cm.options.lineWrapping) {
3820
+ op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;
3821
+ cm.display.sizerWidth = op.adjustWidthTo;
3822
+ op.barMeasure.scrollWidth =
3823
+ Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);
3824
+ op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));
3825
+ }
3826
+
3827
+ if (op.updatedDisplay || op.selectionChanged)
3828
+ { op.preparedSelection = display.input.prepareSelection(); }
3829
+ }
3830
+
3831
+ function endOperation_W2(op) {
3832
+ var cm = op.cm;
3833
+
3834
+ if (op.adjustWidthTo != null) {
3835
+ cm.display.sizer.style.minWidth = op.adjustWidthTo + "px";
3836
+ if (op.maxScrollLeft < cm.doc.scrollLeft)
3837
+ { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }
3838
+ cm.display.maxLineChanged = false;
3839
+ }
3840
+
3841
+ var takeFocus = op.focus && op.focus == activeElt();
3842
+ if (op.preparedSelection)
3843
+ { cm.display.input.showSelection(op.preparedSelection, takeFocus); }
3844
+ if (op.updatedDisplay || op.startHeight != cm.doc.height)
3845
+ { updateScrollbars(cm, op.barMeasure); }
3846
+ if (op.updatedDisplay)
3847
+ { setDocumentHeight(cm, op.barMeasure); }
3848
+
3849
+ if (op.selectionChanged) { restartBlink(cm); }
3850
+
3851
+ if (cm.state.focused && op.updateInput)
3852
+ { cm.display.input.reset(op.typing); }
3853
+ if (takeFocus) { ensureFocus(op.cm); }
3854
+ }
3855
+
3856
+ function endOperation_finish(op) {
3857
+ var cm = op.cm, display = cm.display, doc = cm.doc;
3858
+
3859
+ if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }
3860
+
3861
+ // Abort mouse wheel delta measurement, when scrolling explicitly
3862
+ if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))
3863
+ { display.wheelStartX = display.wheelStartY = null; }
3864
+
3865
+ // Propagate the scroll position to the actual DOM scroller
3866
+ if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }
3867
+
3868
+ if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }
3869
+ // If we need to scroll a specific position into view, do so.
3870
+ if (op.scrollToPos) {
3871
+ var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
3872
+ clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);
3873
+ maybeScrollWindow(cm, rect);
3874
+ }
3875
+
3876
+ // Fire events for markers that are hidden/unidden by editing or
3877
+ // undoing
3878
+ var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
3879
+ if (hidden) { for (var i = 0; i < hidden.length; ++i)
3880
+ { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } }
3881
+ if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)
3882
+ { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } }
3883
+
3884
+ if (display.wrapper.offsetHeight)
3885
+ { doc.scrollTop = cm.display.scroller.scrollTop; }
3886
+
3887
+ // Fire change events, and delayed event handlers
3888
+ if (op.changeObjs)
3889
+ { signal(cm, "changes", cm, op.changeObjs); }
3890
+ if (op.update)
3891
+ { op.update.finish(); }
3892
+ }
3893
+
3894
+ // Run the given function in an operation
3895
+ function runInOp(cm, f) {
3896
+ if (cm.curOp) { return f() }
3897
+ startOperation(cm);
3898
+ try { return f() }
3899
+ finally { endOperation(cm); }
3900
+ }
3901
+ // Wraps a function in an operation. Returns the wrapped function.
3902
+ function operation(cm, f) {
3903
+ return function() {
3904
+ if (cm.curOp) { return f.apply(cm, arguments) }
3905
+ startOperation(cm);
3906
+ try { return f.apply(cm, arguments) }
3907
+ finally { endOperation(cm); }
3908
+ }
3909
+ }
3910
+ // Used to add methods to editor and doc instances, wrapping them in
3911
+ // operations.
3912
+ function methodOp(f) {
3913
+ return function() {
3914
+ if (this.curOp) { return f.apply(this, arguments) }
3915
+ startOperation(this);
3916
+ try { return f.apply(this, arguments) }
3917
+ finally { endOperation(this); }
3918
+ }
3919
+ }
3920
+ function docMethodOp(f) {
3921
+ return function() {
3922
+ var cm = this.cm;
3923
+ if (!cm || cm.curOp) { return f.apply(this, arguments) }
3924
+ startOperation(cm);
3925
+ try { return f.apply(this, arguments) }
3926
+ finally { endOperation(cm); }
3927
+ }
3928
+ }
3929
+
3930
+ // Updates the display.view data structure for a given change to the
3931
+ // document. From and to are in pre-change coordinates. Lendiff is
3932
+ // the amount of lines added or subtracted by the change. This is
3933
+ // used for changes that span multiple lines, or change the way
3934
+ // lines are divided into visual lines. regLineChange (below)
3935
+ // registers single-line changes.
3936
+ function regChange(cm, from, to, lendiff) {
3937
+ if (from == null) { from = cm.doc.first; }
3938
+ if (to == null) { to = cm.doc.first + cm.doc.size; }
3939
+ if (!lendiff) { lendiff = 0; }
3940
+
3941
+ var display = cm.display;
3942
+ if (lendiff && to < display.viewTo &&
3943
+ (display.updateLineNumbers == null || display.updateLineNumbers > from))
3944
+ { display.updateLineNumbers = from; }
3945
+
3946
+ cm.curOp.viewChanged = true;
3947
+
3948
+ if (from >= display.viewTo) { // Change after
3949
+ if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)
3950
+ { resetView(cm); }
3951
+ } else if (to <= display.viewFrom) { // Change before
3952
+ if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {
3953
+ resetView(cm);
3954
+ } else {
3955
+ display.viewFrom += lendiff;
3956
+ display.viewTo += lendiff;
3957
+ }
3958
+ } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap
3959
+ resetView(cm);
3960
+ } else if (from <= display.viewFrom) { // Top overlap
3961
+ var cut = viewCuttingPoint(cm, to, to + lendiff, 1);
3962
+ if (cut) {
3963
+ display.view = display.view.slice(cut.index);
3964
+ display.viewFrom = cut.lineN;
3965
+ display.viewTo += lendiff;
3966
+ } else {
3967
+ resetView(cm);
3968
+ }
3969
+ } else if (to >= display.viewTo) { // Bottom overlap
3970
+ var cut$1 = viewCuttingPoint(cm, from, from, -1);
3971
+ if (cut$1) {
3972
+ display.view = display.view.slice(0, cut$1.index);
3973
+ display.viewTo = cut$1.lineN;
3974
+ } else {
3975
+ resetView(cm);
3976
+ }
3977
+ } else { // Gap in the middle
3978
+ var cutTop = viewCuttingPoint(cm, from, from, -1);
3979
+ var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);
3980
+ if (cutTop && cutBot) {
3981
+ display.view = display.view.slice(0, cutTop.index)
3982
+ .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
3983
+ .concat(display.view.slice(cutBot.index));
3984
+ display.viewTo += lendiff;
3985
+ } else {
3986
+ resetView(cm);
3987
+ }
3988
+ }
3989
+
3990
+ var ext = display.externalMeasured;
3991
+ if (ext) {
3992
+ if (to < ext.lineN)
3993
+ { ext.lineN += lendiff; }
3994
+ else if (from < ext.lineN + ext.size)
3995
+ { display.externalMeasured = null; }
3996
+ }
3997
+ }
3998
+
3999
+ // Register a change to a single line. Type must be one of "text",
4000
+ // "gutter", "class", "widget"
4001
+ function regLineChange(cm, line, type) {
4002
+ cm.curOp.viewChanged = true;
4003
+ var display = cm.display, ext = cm.display.externalMeasured;
4004
+ if (ext && line >= ext.lineN && line < ext.lineN + ext.size)
4005
+ { display.externalMeasured = null; }
4006
+
4007
+ if (line < display.viewFrom || line >= display.viewTo) { return }
4008
+ var lineView = display.view[findViewIndex(cm, line)];
4009
+ if (lineView.node == null) { return }
4010
+ var arr = lineView.changes || (lineView.changes = []);
4011
+ if (indexOf(arr, type) == -1) { arr.push(type); }
4012
+ }
4013
+
4014
+ // Clear the view.
4015
+ function resetView(cm) {
4016
+ cm.display.viewFrom = cm.display.viewTo = cm.doc.first;
4017
+ cm.display.view = [];
4018
+ cm.display.viewOffset = 0;
4019
+ }
4020
+
4021
+ function viewCuttingPoint(cm, oldN, newN, dir) {
4022
+ var index = findViewIndex(cm, oldN), diff, view = cm.display.view;
4023
+ if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)
4024
+ { return {index: index, lineN: newN} }
4025
+ var n = cm.display.viewFrom;
4026
+ for (var i = 0; i < index; i++)
4027
+ { n += view[i].size; }
4028
+ if (n != oldN) {
4029
+ if (dir > 0) {
4030
+ if (index == view.length - 1) { return null }
4031
+ diff = (n + view[index].size) - oldN;
4032
+ index++;
4033
+ } else {
4034
+ diff = n - oldN;
4035
+ }
4036
+ oldN += diff; newN += diff;
4037
+ }
4038
+ while (visualLineNo(cm.doc, newN) != newN) {
4039
+ if (index == (dir < 0 ? 0 : view.length - 1)) { return null }
4040
+ newN += dir * view[index - (dir < 0 ? 1 : 0)].size;
4041
+ index += dir;
4042
+ }
4043
+ return {index: index, lineN: newN}
4044
+ }
4045
+
4046
+ // Force the view to cover a given range, adding empty view element
4047
+ // or clipping off existing ones as needed.
4048
+ function adjustView(cm, from, to) {
4049
+ var display = cm.display, view = display.view;
4050
+ if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {
4051
+ display.view = buildViewArray(cm, from, to);
4052
+ display.viewFrom = from;
4053
+ } else {
4054
+ if (display.viewFrom > from)
4055
+ { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }
4056
+ else if (display.viewFrom < from)
4057
+ { display.view = display.view.slice(findViewIndex(cm, from)); }
4058
+ display.viewFrom = from;
4059
+ if (display.viewTo < to)
4060
+ { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }
4061
+ else if (display.viewTo > to)
4062
+ { display.view = display.view.slice(0, findViewIndex(cm, to)); }
4063
+ }
4064
+ display.viewTo = to;
4065
+ }
4066
+
4067
+ // Count the number of lines in the view whose DOM representation is
4068
+ // out of date (or nonexistent).
4069
+ function countDirtyView(cm) {
4070
+ var view = cm.display.view, dirty = 0;
4071
+ for (var i = 0; i < view.length; i++) {
4072
+ var lineView = view[i];
4073
+ if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }
4074
+ }
4075
+ return dirty
4076
+ }
4077
+
4078
+ // HIGHLIGHT WORKER
4079
+
4080
+ function startWorker(cm, time) {
4081
+ if (cm.doc.highlightFrontier < cm.display.viewTo)
4082
+ { cm.state.highlight.set(time, bind(highlightWorker, cm)); }
4083
+ }
4084
+
4085
+ function highlightWorker(cm) {
4086
+ var doc = cm.doc;
4087
+ if (doc.highlightFrontier >= cm.display.viewTo) { return }
4088
+ var end = +new Date + cm.options.workTime;
4089
+ var context = getContextBefore(cm, doc.highlightFrontier);
4090
+ var changedLines = [];
4091
+
4092
+ doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
4093
+ if (context.line >= cm.display.viewFrom) { // Visible
4094
+ var oldStyles = line.styles;
4095
+ var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;
4096
+ var highlighted = highlightLine(cm, line, context, true);
4097
+ if (resetState) { context.state = resetState; }
4098
+ line.styles = highlighted.styles;
4099
+ var oldCls = line.styleClasses, newCls = highlighted.classes;
4100
+ if (newCls) { line.styleClasses = newCls; }
4101
+ else if (oldCls) { line.styleClasses = null; }
4102
+ var ischange = !oldStyles || oldStyles.length != line.styles.length ||
4103
+ oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);
4104
+ for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }
4105
+ if (ischange) { changedLines.push(context.line); }
4106
+ line.stateAfter = context.save();
4107
+ context.nextLine();
4108
+ } else {
4109
+ if (line.text.length <= cm.options.maxHighlightLength)
4110
+ { processLine(cm, line.text, context); }
4111
+ line.stateAfter = context.line % 5 == 0 ? context.save() : null;
4112
+ context.nextLine();
4113
+ }
4114
+ if (+new Date > end) {
4115
+ startWorker(cm, cm.options.workDelay);
4116
+ return true
4117
+ }
4118
+ });
4119
+ doc.highlightFrontier = context.line;
4120
+ doc.modeFrontier = Math.max(doc.modeFrontier, context.line);
4121
+ if (changedLines.length) { runInOp(cm, function () {
4122
+ for (var i = 0; i < changedLines.length; i++)
4123
+ { regLineChange(cm, changedLines[i], "text"); }
4124
+ }); }
4125
+ }
4126
+
4127
+ // DISPLAY DRAWING
4128
+
4129
+ var DisplayUpdate = function(cm, viewport, force) {
4130
+ var display = cm.display;
4131
+
4132
+ this.viewport = viewport;
4133
+ // Store some values that we'll need later (but don't want to force a relayout for)
4134
+ this.visible = visibleLines(display, cm.doc, viewport);
4135
+ this.editorIsHidden = !display.wrapper.offsetWidth;
4136
+ this.wrapperHeight = display.wrapper.clientHeight;
4137
+ this.wrapperWidth = display.wrapper.clientWidth;
4138
+ this.oldDisplayWidth = displayWidth(cm);
4139
+ this.force = force;
4140
+ this.dims = getDimensions(cm);
4141
+ this.events = [];
4142
+ };
4143
+
4144
+ DisplayUpdate.prototype.signal = function (emitter, type) {
4145
+ if (hasHandler(emitter, type))
4146
+ { this.events.push(arguments); }
4147
+ };
4148
+ DisplayUpdate.prototype.finish = function () {
4149
+ var this$1 = this;
4150
+
4151
+ for (var i = 0; i < this.events.length; i++)
4152
+ { signal.apply(null, this$1.events[i]); }
4153
+ };
4154
+
4155
+ function maybeClipScrollbars(cm) {
4156
+ var display = cm.display;
4157
+ if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
4158
+ display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;
4159
+ display.heightForcer.style.height = scrollGap(cm) + "px";
4160
+ display.sizer.style.marginBottom = -display.nativeBarWidth + "px";
4161
+ display.sizer.style.borderRightWidth = scrollGap(cm) + "px";
4162
+ display.scrollbarsClipped = true;
4163
+ }
4164
+ }
4165
+
4166
+ function selectionSnapshot(cm) {
4167
+ if (cm.hasFocus()) { return null }
4168
+ var active = activeElt();
4169
+ if (!active || !contains(cm.display.lineDiv, active)) { return null }
4170
+ var result = {activeElt: active};
4171
+ if (window.getSelection) {
4172
+ var sel = window.getSelection();
4173
+ if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
4174
+ result.anchorNode = sel.anchorNode;
4175
+ result.anchorOffset = sel.anchorOffset;
4176
+ result.focusNode = sel.focusNode;
4177
+ result.focusOffset = sel.focusOffset;
4178
+ }
4179
+ }
4180
+ return result
4181
+ }
4182
+
4183
+ function restoreSelection(snapshot) {
4184
+ if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
4185
+ snapshot.activeElt.focus();
4186
+ if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
4187
+ var sel = window.getSelection(), range$$1 = document.createRange();
4188
+ range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
4189
+ range$$1.collapse(false);
4190
+ sel.removeAllRanges();
4191
+ sel.addRange(range$$1);
4192
+ sel.extend(snapshot.focusNode, snapshot.focusOffset);
4193
+ }
4194
+ }
4195
+
4196
+ // Does the actual updating of the line display. Bails out
4197
+ // (returning false) when there is nothing to be done and forced is
4198
+ // false.
4199
+ function updateDisplayIfNeeded(cm, update) {
4200
+ var display = cm.display, doc = cm.doc;
4201
+
4202
+ if (update.editorIsHidden) {
4203
+ resetView(cm);
4204
+ return false
4205
+ }
4206
+
4207
+ // Bail out if the visible area is already rendered and nothing changed.
4208
+ if (!update.force &&
4209
+ update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
4210
+ (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
4211
+ display.renderedView == display.view && countDirtyView(cm) == 0)
4212
+ { return false }
4213
+
4214
+ if (maybeUpdateLineNumberWidth(cm)) {
4215
+ resetView(cm);
4216
+ update.dims = getDimensions(cm);
4217
+ }
4218
+
4219
+ // Compute a suitable new viewport (from & to)
4220
+ var end = doc.first + doc.size;
4221
+ var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);
4222
+ var to = Math.min(end, update.visible.to + cm.options.viewportMargin);
4223
+ if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }
4224
+ if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }
4225
+ if (sawCollapsedSpans) {
4226
+ from = visualLineNo(cm.doc, from);
4227
+ to = visualLineEndNo(cm.doc, to);
4228
+ }
4229
+
4230
+ var different = from != display.viewFrom || to != display.viewTo ||
4231
+ display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;
4232
+ adjustView(cm, from, to);
4233
+
4234
+ display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));
4235
+ // Position the mover div to align with the current scroll position
4236
+ cm.display.mover.style.top = display.viewOffset + "px";
4237
+
4238
+ var toUpdate = countDirtyView(cm);
4239
+ if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
4240
+ (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
4241
+ { return false }
4242
+
4243
+ // For big changes, we hide the enclosing element during the
4244
+ // update, since that speeds up the operations on most browsers.
4245
+ var selSnapshot = selectionSnapshot(cm);
4246
+ if (toUpdate > 4) { display.lineDiv.style.display = "none"; }
4247
+ patchDisplay(cm, display.updateLineNumbers, update.dims);
4248
+ if (toUpdate > 4) { display.lineDiv.style.display = ""; }
4249
+ display.renderedView = display.view;
4250
+ // There might have been a widget with a focused element that got
4251
+ // hidden or updated, if so re-focus it.
4252
+ restoreSelection(selSnapshot);
4253
+
4254
+ // Prevent selection and cursors from interfering with the scroll
4255
+ // width and height.
4256
+ removeChildren(display.cursorDiv);
4257
+ removeChildren(display.selectionDiv);
4258
+ display.gutters.style.height = display.sizer.style.minHeight = 0;
4259
+
4260
+ if (different) {
4261
+ display.lastWrapHeight = update.wrapperHeight;
4262
+ display.lastWrapWidth = update.wrapperWidth;
4263
+ startWorker(cm, 400);
4264
+ }
4265
+
4266
+ display.updateLineNumbers = null;
4267
+
4268
+ return true
4269
+ }
4270
+
4271
+ function postUpdateDisplay(cm, update) {
4272
+ var viewport = update.viewport;
4273
+
4274
+ for (var first = true;; first = false) {
4275
+ if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
4276
+ // Clip forced viewport to actual scrollable area.
4277
+ if (viewport && viewport.top != null)
4278
+ { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }
4279
+ // Updated line heights might result in the drawn area not
4280
+ // actually covering the viewport. Keep looping until it does.
4281
+ update.visible = visibleLines(cm.display, cm.doc, viewport);
4282
+ if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
4283
+ { break }
4284
+ }
4285
+ if (!updateDisplayIfNeeded(cm, update)) { break }
4286
+ updateHeightsInViewport(cm);
4287
+ var barMeasure = measureForScrollbars(cm);
4288
+ updateSelection(cm);
4289
+ updateScrollbars(cm, barMeasure);
4290
+ setDocumentHeight(cm, barMeasure);
4291
+ update.force = false;
4292
+ }
4293
+
4294
+ update.signal(cm, "update", cm);
4295
+ if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
4296
+ update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo);
4297
+ cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;
4298
+ }
4299
+ }
4300
+
4301
+ function updateDisplaySimple(cm, viewport) {
4302
+ var update = new DisplayUpdate(cm, viewport);
4303
+ if (updateDisplayIfNeeded(cm, update)) {
4304
+ updateHeightsInViewport(cm);
4305
+ postUpdateDisplay(cm, update);
4306
+ var barMeasure = measureForScrollbars(cm);
4307
+ updateSelection(cm);
4308
+ updateScrollbars(cm, barMeasure);
4309
+ setDocumentHeight(cm, barMeasure);
4310
+ update.finish();
4311
+ }
4312
+ }
4313
+
4314
+ // Sync the actual display DOM structure with display.view, removing
4315
+ // nodes for lines that are no longer in view, and creating the ones
4316
+ // that are not there yet, and updating the ones that are out of
4317
+ // date.
4318
+ function patchDisplay(cm, updateNumbersFrom, dims) {
4319
+ var display = cm.display, lineNumbers = cm.options.lineNumbers;
4320
+ var container = display.lineDiv, cur = container.firstChild;
4321
+
4322
+ function rm(node) {
4323
+ var next = node.nextSibling;
4324
+ // Works around a throw-scroll bug in OS X Webkit
4325
+ if (webkit && mac && cm.display.currentWheelTarget == node)
4326
+ { node.style.display = "none"; }
4327
+ else
4328
+ { node.parentNode.removeChild(node); }
4329
+ return next
4330
+ }
4331
+
4332
+ var view = display.view, lineN = display.viewFrom;
4333
+ // Loop over the elements in the view, syncing cur (the DOM nodes
4334
+ // in display.lineDiv) with the view as we go.
4335
+ for (var i = 0; i < view.length; i++) {
4336
+ var lineView = view[i];
4337
+ if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
4338
+ var node = buildLineElement(cm, lineView, lineN, dims);
4339
+ container.insertBefore(node, cur);
4340
+ } else { // Already drawn
4341
+ while (cur != lineView.node) { cur = rm(cur); }
4342
+ var updateNumber = lineNumbers && updateNumbersFrom != null &&
4343
+ updateNumbersFrom <= lineN && lineView.lineNumber;
4344
+ if (lineView.changes) {
4345
+ if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; }
4346
+ updateLineForChanges(cm, lineView, lineN, dims);
4347
+ }
4348
+ if (updateNumber) {
4349
+ removeChildren(lineView.lineNumber);
4350
+ lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));
4351
+ }
4352
+ cur = lineView.node.nextSibling;
4353
+ }
4354
+ lineN += lineView.size;
4355
+ }
4356
+ while (cur) { cur = rm(cur); }
4357
+ }
4358
+
4359
+ function updateGutterSpace(cm) {
4360
+ var width = cm.display.gutters.offsetWidth;
4361
+ cm.display.sizer.style.marginLeft = width + "px";
4362
+ }
4363
+
4364
+ function setDocumentHeight(cm, measure) {
4365
+ cm.display.sizer.style.minHeight = measure.docHeight + "px";
4366
+ cm.display.heightForcer.style.top = measure.docHeight + "px";
4367
+ cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px";
4368
+ }
4369
+
4370
+ // Rebuild the gutter elements, ensure the margin to the left of the
4371
+ // code matches their width.
4372
+ function updateGutters(cm) {
4373
+ var gutters = cm.display.gutters, specs = cm.options.gutters;
4374
+ removeChildren(gutters);
4375
+ var i = 0;
4376
+ for (; i < specs.length; ++i) {
4377
+ var gutterClass = specs[i];
4378
+ var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
4379
+ if (gutterClass == "CodeMirror-linenumbers") {
4380
+ cm.display.lineGutter = gElt;
4381
+ gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
4382
+ }
4383
+ }
4384
+ gutters.style.display = i ? "" : "none";
4385
+ updateGutterSpace(cm);
4386
+ }
4387
+
4388
+ // Make sure the gutters options contains the element
4389
+ // "CodeMirror-linenumbers" when the lineNumbers option is true.
4390
+ function setGuttersForLineNumbers(options) {
4391
+ var found = indexOf(options.gutters, "CodeMirror-linenumbers");
4392
+ if (found == -1 && options.lineNumbers) {
4393
+ options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);
4394
+ } else if (found > -1 && !options.lineNumbers) {
4395
+ options.gutters = options.gutters.slice(0);
4396
+ options.gutters.splice(found, 1);
4397
+ }
4398
+ }
4399
+
4400
+ // Since the delta values reported on mouse wheel events are
4401
+ // unstandardized between browsers and even browser versions, and
4402
+ // generally horribly unpredictable, this code starts by measuring
4403
+ // the scroll effect that the first few mouse wheel events have,
4404
+ // and, from that, detects the way it can convert deltas to pixel
4405
+ // offsets afterwards.
4406
+ //
4407
+ // The reason we want to know the amount a wheel event will scroll
4408
+ // is that it gives us a chance to update the display before the
4409
+ // actual scrolling happens, reducing flickering.
4410
+
4411
+ var wheelSamples = 0, wheelPixelsPerUnit = null;
4412
+ // Fill in a browser-detected starting value on browsers where we
4413
+ // know one. These don't have to be accurate -- the result of them
4414
+ // being wrong would just be a slight flicker on the first wheel
4415
+ // scroll (if it is large enough).
4416
+ if (ie) { wheelPixelsPerUnit = -.53; }
4417
+ else if (gecko) { wheelPixelsPerUnit = 15; }
4418
+ else if (chrome) { wheelPixelsPerUnit = -.7; }
4419
+ else if (safari) { wheelPixelsPerUnit = -1/3; }
4420
+
4421
+ function wheelEventDelta(e) {
4422
+ var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
4423
+ if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }
4424
+ if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }
4425
+ else if (dy == null) { dy = e.wheelDelta; }
4426
+ return {x: dx, y: dy}
4427
+ }
4428
+ function wheelEventPixels(e) {
4429
+ var delta = wheelEventDelta(e);
4430
+ delta.x *= wheelPixelsPerUnit;
4431
+ delta.y *= wheelPixelsPerUnit;
4432
+ return delta
4433
+ }
4434
+
4435
+ function onScrollWheel(cm, e) {
4436
+ var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
4437
+
4438
+ var display = cm.display, scroll = display.scroller;
4439
+ // Quit if there's nothing to scroll here
4440
+ var canScrollX = scroll.scrollWidth > scroll.clientWidth;
4441
+ var canScrollY = scroll.scrollHeight > scroll.clientHeight;
4442
+ if (!(dx && canScrollX || dy && canScrollY)) { return }
4443
+
4444
+ // Webkit browsers on OS X abort momentum scrolls when the target
4445
+ // of the scroll event is removed from the scrollable element.
4446
+ // This hack (see related code in patchDisplay) makes sure the
4447
+ // element is kept around.
4448
+ if (dy && mac && webkit) {
4449
+ outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
4450
+ for (var i = 0; i < view.length; i++) {
4451
+ if (view[i].node == cur) {
4452
+ cm.display.currentWheelTarget = cur;
4453
+ break outer
4454
+ }
4455
+ }
4456
+ }
4457
+ }
4458
+
4459
+ // On some browsers, horizontal scrolling will cause redraws to
4460
+ // happen before the gutter has been realigned, causing it to
4461
+ // wriggle around in a most unseemly way. When we have an
4462
+ // estimated pixels/delta value, we just handle horizontal
4463
+ // scrolling entirely here. It'll be slightly off from native, but
4464
+ // better than glitching out.
4465
+ if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
4466
+ if (dy && canScrollY)
4467
+ { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }
4468
+ setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));
4469
+ // Only prevent default scrolling if vertical scrolling is
4470
+ // actually possible. Otherwise, it causes vertical scroll
4471
+ // jitter on OSX trackpads when deltaX is small and deltaY
4472
+ // is large (issue #3579)
4473
+ if (!dy || (dy && canScrollY))
4474
+ { e_preventDefault(e); }
4475
+ display.wheelStartX = null; // Abort measurement, if in progress
4476
+ return
4477
+ }
4478
+
4479
+ // 'Project' the visible viewport to cover the area that is being
4480
+ // scrolled into view (if we know enough to estimate it).
4481
+ if (dy && wheelPixelsPerUnit != null) {
4482
+ var pixels = dy * wheelPixelsPerUnit;
4483
+ var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
4484
+ if (pixels < 0) { top = Math.max(0, top + pixels - 50); }
4485
+ else { bot = Math.min(cm.doc.height, bot + pixels + 50); }
4486
+ updateDisplaySimple(cm, {top: top, bottom: bot});
4487
+ }
4488
+
4489
+ if (wheelSamples < 20) {
4490
+ if (display.wheelStartX == null) {
4491
+ display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
4492
+ display.wheelDX = dx; display.wheelDY = dy;
4493
+ setTimeout(function () {
4494
+ if (display.wheelStartX == null) { return }
4495
+ var movedX = scroll.scrollLeft - display.wheelStartX;
4496
+ var movedY = scroll.scrollTop - display.wheelStartY;
4497
+ var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
4498
+ (movedX && display.wheelDX && movedX / display.wheelDX);
4499
+ display.wheelStartX = display.wheelStartY = null;
4500
+ if (!sample) { return }
4501
+ wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
4502
+ ++wheelSamples;
4503
+ }, 200);
4504
+ } else {
4505
+ display.wheelDX += dx; display.wheelDY += dy;
4506
+ }
4507
+ }
4508
+ }
4509
+
4510
+ // Selection objects are immutable. A new one is created every time
4511
+ // the selection changes. A selection is one or more non-overlapping
4512
+ // (and non-touching) ranges, sorted, and an integer that indicates
4513
+ // which one is the primary selection (the one that's scrolled into
4514
+ // view, that getCursor returns, etc).
4515
+ var Selection = function(ranges, primIndex) {
4516
+ this.ranges = ranges;
4517
+ this.primIndex = primIndex;
4518
+ };
4519
+
4520
+ Selection.prototype.primary = function () { return this.ranges[this.primIndex] };
4521
+
4522
+ Selection.prototype.equals = function (other) {
4523
+ var this$1 = this;
4524
+
4525
+ if (other == this) { return true }
4526
+ if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }
4527
+ for (var i = 0; i < this.ranges.length; i++) {
4528
+ var here = this$1.ranges[i], there = other.ranges[i];
4529
+ if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }
4530
+ }
4531
+ return true
4532
+ };
4533
+
4534
+ Selection.prototype.deepCopy = function () {
4535
+ var this$1 = this;
4536
+
4537
+ var out = [];
4538
+ for (var i = 0; i < this.ranges.length; i++)
4539
+ { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }
4540
+ return new Selection(out, this.primIndex)
4541
+ };
4542
+
4543
+ Selection.prototype.somethingSelected = function () {
4544
+ var this$1 = this;
4545
+
4546
+ for (var i = 0; i < this.ranges.length; i++)
4547
+ { if (!this$1.ranges[i].empty()) { return true } }
4548
+ return false
4549
+ };
4550
+
4551
+ Selection.prototype.contains = function (pos, end) {
4552
+ var this$1 = this;
4553
+
4554
+ if (!end) { end = pos; }
4555
+ for (var i = 0; i < this.ranges.length; i++) {
4556
+ var range = this$1.ranges[i];
4557
+ if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)
4558
+ { return i }
4559
+ }
4560
+ return -1
4561
+ };
4562
+
4563
+ var Range = function(anchor, head) {
4564
+ this.anchor = anchor; this.head = head;
4565
+ };
4566
+
4567
+ Range.prototype.from = function () { return minPos(this.anchor, this.head) };
4568
+ Range.prototype.to = function () { return maxPos(this.anchor, this.head) };
4569
+ Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };
4570
+
4571
+ // Take an unsorted, potentially overlapping set of ranges, and
4572
+ // build a selection out of it. 'Consumes' ranges array (modifying
4573
+ // it).
4574
+ function normalizeSelection(cm, ranges, primIndex) {
4575
+ var mayTouch = cm && cm.options.selectionsMayTouch;
4576
+ var prim = ranges[primIndex];
4577
+ ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });
4578
+ primIndex = indexOf(ranges, prim);
4579
+ for (var i = 1; i < ranges.length; i++) {
4580
+ var cur = ranges[i], prev = ranges[i - 1];
4581
+ var diff = cmp(prev.to(), cur.from());
4582
+ if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {
4583
+ var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());
4584
+ var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;
4585
+ if (i <= primIndex) { --primIndex; }
4586
+ ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));
4587
+ }
4588
+ }
4589
+ return new Selection(ranges, primIndex)
4590
+ }
4591
+
4592
+ function simpleSelection(anchor, head) {
4593
+ return new Selection([new Range(anchor, head || anchor)], 0)
4594
+ }
4595
+
4596
+ // Compute the position of the end of a change (its 'to' property
4597
+ // refers to the pre-change end).
4598
+ function changeEnd(change) {
4599
+ if (!change.text) { return change.to }
4600
+ return Pos(change.from.line + change.text.length - 1,
4601
+ lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))
4602
+ }
4603
+
4604
+ // Adjust a position to refer to the post-change position of the
4605
+ // same text, or the end of the change if the change covers it.
4606
+ function adjustForChange(pos, change) {
4607
+ if (cmp(pos, change.from) < 0) { return pos }
4608
+ if (cmp(pos, change.to) <= 0) { return changeEnd(change) }
4609
+
4610
+ var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
4611
+ if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }
4612
+ return Pos(line, ch)
4613
+ }
4614
+
4615
+ function computeSelAfterChange(doc, change) {
4616
+ var out = [];
4617
+ for (var i = 0; i < doc.sel.ranges.length; i++) {
4618
+ var range = doc.sel.ranges[i];
4619
+ out.push(new Range(adjustForChange(range.anchor, change),
4620
+ adjustForChange(range.head, change)));
4621
+ }
4622
+ return normalizeSelection(doc.cm, out, doc.sel.primIndex)
4623
+ }
4624
+
4625
+ function offsetPos(pos, old, nw) {
4626
+ if (pos.line == old.line)
4627
+ { return Pos(nw.line, pos.ch - old.ch + nw.ch) }
4628
+ else
4629
+ { return Pos(nw.line + (pos.line - old.line), pos.ch) }
4630
+ }
4631
+
4632
+ // Used by replaceSelections to allow moving the selection to the
4633
+ // start or around the replaced test. Hint may be "start" or "around".
4634
+ function computeReplacedSel(doc, changes, hint) {
4635
+ var out = [];
4636
+ var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;
4637
+ for (var i = 0; i < changes.length; i++) {
4638
+ var change = changes[i];
4639
+ var from = offsetPos(change.from, oldPrev, newPrev);
4640
+ var to = offsetPos(changeEnd(change), oldPrev, newPrev);
4641
+ oldPrev = change.to;
4642
+ newPrev = to;
4643
+ if (hint == "around") {
4644
+ var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;
4645
+ out[i] = new Range(inv ? to : from, inv ? from : to);
4646
+ } else {
4647
+ out[i] = new Range(from, from);
4648
+ }
4649
+ }
4650
+ return new Selection(out, doc.sel.primIndex)
4651
+ }
4652
+
4653
+ // Used to get the editor into a consistent state again when options change.
4654
+
4655
+ function loadMode(cm) {
4656
+ cm.doc.mode = getMode(cm.options, cm.doc.modeOption);
4657
+ resetModeState(cm);
4658
+ }
4659
+
4660
+ function resetModeState(cm) {
4661
+ cm.doc.iter(function (line) {
4662
+ if (line.stateAfter) { line.stateAfter = null; }
4663
+ if (line.styles) { line.styles = null; }
4664
+ });
4665
+ cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;
4666
+ startWorker(cm, 100);
4667
+ cm.state.modeGen++;
4668
+ if (cm.curOp) { regChange(cm); }
4669
+ }
4670
+
4671
+ // DOCUMENT DATA STRUCTURE
4672
+
4673
+ // By default, updates that start and end at the beginning of a line
4674
+ // are treated specially, in order to make the association of line
4675
+ // widgets and marker elements with the text behave more intuitive.
4676
+ function isWholeLineUpdate(doc, change) {
4677
+ return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" &&
4678
+ (!doc.cm || doc.cm.options.wholeLineUpdateBefore)
4679
+ }
4680
+
4681
+ // Perform a change on the document data structure.
4682
+ function updateDoc(doc, change, markedSpans, estimateHeight$$1) {
4683
+ function spansFor(n) {return markedSpans ? markedSpans[n] : null}
4684
+ function update(line, text, spans) {
4685
+ updateLine(line, text, spans, estimateHeight$$1);
4686
+ signalLater(line, "change", line, change);
4687
+ }
4688
+ function linesFor(start, end) {
4689
+ var result = [];
4690
+ for (var i = start; i < end; ++i)
4691
+ { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }
4692
+ return result
4693
+ }
4694
+
4695
+ var from = change.from, to = change.to, text = change.text;
4696
+ var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
4697
+ var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;
4698
+
4699
+ // Adjust the line structure
4700
+ if (change.full) {
4701
+ doc.insert(0, linesFor(0, text.length));
4702
+ doc.remove(text.length, doc.size - text.length);
4703
+ } else if (isWholeLineUpdate(doc, change)) {
4704
+ // This is a whole-line replace. Treated specially to make
4705
+ // sure line objects move the way they are supposed to.
4706
+ var added = linesFor(0, text.length - 1);
4707
+ update(lastLine, lastLine.text, lastSpans);
4708
+ if (nlines) { doc.remove(from.line, nlines); }
4709
+ if (added.length) { doc.insert(from.line, added); }
4710
+ } else if (firstLine == lastLine) {
4711
+ if (text.length == 1) {
4712
+ update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);
4713
+ } else {
4714
+ var added$1 = linesFor(1, text.length - 1);
4715
+ added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));
4716
+ update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
4717
+ doc.insert(from.line + 1, added$1);
4718
+ }
4719
+ } else if (text.length == 1) {
4720
+ update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));
4721
+ doc.remove(from.line + 1, nlines);
4722
+ } else {
4723
+ update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
4724
+ update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);
4725
+ var added$2 = linesFor(1, text.length - 1);
4726
+ if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }
4727
+ doc.insert(from.line + 1, added$2);
4728
+ }
4729
+
4730
+ signalLater(doc, "change", doc, change);
4731
+ }
4732
+
4733
+ // Call f for all linked documents.
4734
+ function linkedDocs(doc, f, sharedHistOnly) {
4735
+ function propagate(doc, skip, sharedHist) {
4736
+ if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {
4737
+ var rel = doc.linked[i];
4738
+ if (rel.doc == skip) { continue }
4739
+ var shared = sharedHist && rel.sharedHist;
4740
+ if (sharedHistOnly && !shared) { continue }
4741
+ f(rel.doc, shared);
4742
+ propagate(rel.doc, doc, shared);
4743
+ } }
4744
+ }
4745
+ propagate(doc, null, true);
4746
+ }
4747
+
4748
+ // Attach a document to an editor.
4749
+ function attachDoc(cm, doc) {
4750
+ if (doc.cm) { throw new Error("This document is already in use.") }
4751
+ cm.doc = doc;
4752
+ doc.cm = cm;
4753
+ estimateLineHeights(cm);
4754
+ loadMode(cm);
4755
+ setDirectionClass(cm);
4756
+ if (!cm.options.lineWrapping) { findMaxLine(cm); }
4757
+ cm.options.mode = doc.modeOption;
4758
+ regChange(cm);
4759
+ }
4760
+
4761
+ function setDirectionClass(cm) {
4762
+ (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl");
4763
+ }
4764
+
4765
+ function directionChanged(cm) {
4766
+ runInOp(cm, function () {
4767
+ setDirectionClass(cm);
4768
+ regChange(cm);
4769
+ });
4770
+ }
4771
+
4772
+ function History(startGen) {
4773
+ // Arrays of change events and selections. Doing something adds an
4774
+ // event to done and clears undo. Undoing moves events from done
4775
+ // to undone, redoing moves them in the other direction.
4776
+ this.done = []; this.undone = [];
4777
+ this.undoDepth = Infinity;
4778
+ // Used to track when changes can be merged into a single undo
4779
+ // event
4780
+ this.lastModTime = this.lastSelTime = 0;
4781
+ this.lastOp = this.lastSelOp = null;
4782
+ this.lastOrigin = this.lastSelOrigin = null;
4783
+ // Used by the isClean() method
4784
+ this.generation = this.maxGeneration = startGen || 1;
4785
+ }
4786
+
4787
+ // Create a history change event from an updateDoc-style change
4788
+ // object.
4789
+ function historyChangeFromChange(doc, change) {
4790
+ var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};
4791
+ attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);
4792
+ linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);
4793
+ return histChange
4794
+ }
4795
+
4796
+ // Pop all selection events off the end of a history array. Stop at
4797
+ // a change event.
4798
+ function clearSelectionEvents(array) {
4799
+ while (array.length) {
4800
+ var last = lst(array);
4801
+ if (last.ranges) { array.pop(); }
4802
+ else { break }
4803
+ }
4804
+ }
4805
+
4806
+ // Find the top change event in the history. Pop off selection
4807
+ // events that are in the way.
4808
+ function lastChangeEvent(hist, force) {
4809
+ if (force) {
4810
+ clearSelectionEvents(hist.done);
4811
+ return lst(hist.done)
4812
+ } else if (hist.done.length && !lst(hist.done).ranges) {
4813
+ return lst(hist.done)
4814
+ } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {
4815
+ hist.done.pop();
4816
+ return lst(hist.done)
4817
+ }
4818
+ }
4819
+
4820
+ // Register a change in the history. Merges changes that are within
4821
+ // a single operation, or are close together with an origin that
4822
+ // allows merging (starting with "+") into a single event.
4823
+ function addChangeToHistory(doc, change, selAfter, opId) {
4824
+ var hist = doc.history;
4825
+ hist.undone.length = 0;
4826
+ var time = +new Date, cur;
4827
+ var last;
4828
+
4829
+ if ((hist.lastOp == opId ||
4830
+ hist.lastOrigin == change.origin && change.origin &&
4831
+ ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||
4832
+ change.origin.charAt(0) == "*")) &&
4833
+ (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
4834
+ // Merge this change into the last event
4835
+ last = lst(cur.changes);
4836
+ if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {
4837
+ // Optimized case for simple insertion -- don't want to add
4838
+ // new changesets for every character typed
4839
+ last.to = changeEnd(change);
4840
+ } else {
4841
+ // Add new sub-event
4842
+ cur.changes.push(historyChangeFromChange(doc, change));
4843
+ }
4844
+ } else {
4845
+ // Can not be merged, start a new event.
4846
+ var before = lst(hist.done);
4847
+ if (!before || !before.ranges)
4848
+ { pushSelectionToHistory(doc.sel, hist.done); }
4849
+ cur = {changes: [historyChangeFromChange(doc, change)],
4850
+ generation: hist.generation};
4851
+ hist.done.push(cur);
4852
+ while (hist.done.length > hist.undoDepth) {
4853
+ hist.done.shift();
4854
+ if (!hist.done[0].ranges) { hist.done.shift(); }
4855
+ }
4856
+ }
4857
+ hist.done.push(selAfter);
4858
+ hist.generation = ++hist.maxGeneration;
4859
+ hist.lastModTime = hist.lastSelTime = time;
4860
+ hist.lastOp = hist.lastSelOp = opId;
4861
+ hist.lastOrigin = hist.lastSelOrigin = change.origin;
4862
+
4863
+ if (!last) { signal(doc, "historyAdded"); }
4864
+ }
4865
+
4866
+ function selectionEventCanBeMerged(doc, origin, prev, sel) {
4867
+ var ch = origin.charAt(0);
4868
+ return ch == "*" ||
4869
+ ch == "+" &&
4870
+ prev.ranges.length == sel.ranges.length &&
4871
+ prev.somethingSelected() == sel.somethingSelected() &&
4872
+ new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)
4873
+ }
4874
+
4875
+ // Called whenever the selection changes, sets the new selection as
4876
+ // the pending selection in the history, and pushes the old pending
4877
+ // selection into the 'done' array when it was significantly
4878
+ // different (in number of selected ranges, emptiness, or time).
4879
+ function addSelectionToHistory(doc, sel, opId, options) {
4880
+ var hist = doc.history, origin = options && options.origin;
4881
+
4882
+ // A new event is started when the previous origin does not match
4883
+ // the current, or the origins don't allow matching. Origins
4884
+ // starting with * are always merged, those starting with + are
4885
+ // merged when similar and close together in time.
4886
+ if (opId == hist.lastSelOp ||
4887
+ (origin && hist.lastSelOrigin == origin &&
4888
+ (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
4889
+ selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
4890
+ { hist.done[hist.done.length - 1] = sel; }
4891
+ else
4892
+ { pushSelectionToHistory(sel, hist.done); }
4893
+
4894
+ hist.lastSelTime = +new Date;
4895
+ hist.lastSelOrigin = origin;
4896
+ hist.lastSelOp = opId;
4897
+ if (options && options.clearRedo !== false)
4898
+ { clearSelectionEvents(hist.undone); }
4899
+ }
4900
+
4901
+ function pushSelectionToHistory(sel, dest) {
4902
+ var top = lst(dest);
4903
+ if (!(top && top.ranges && top.equals(sel)))
4904
+ { dest.push(sel); }
4905
+ }
4906
+
4907
+ // Used to store marked span information in the history.
4908
+ function attachLocalSpans(doc, change, from, to) {
4909
+ var existing = change["spans_" + doc.id], n = 0;
4910
+ doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {
4911
+ if (line.markedSpans)
4912
+ { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; }
4913
+ ++n;
4914
+ });
4915
+ }
4916
+
4917
+ // When un/re-doing restores text containing marked spans, those
4918
+ // that have been explicitly cleared should not be restored.
4919
+ function removeClearedSpans(spans) {
4920
+ if (!spans) { return null }
4921
+ var out;
4922
+ for (var i = 0; i < spans.length; ++i) {
4923
+ if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }
4924
+ else if (out) { out.push(spans[i]); }
4925
+ }
4926
+ return !out ? spans : out.length ? out : null
4927
+ }
4928
+
4929
+ // Retrieve and filter the old marked spans stored in a change event.
4930
+ function getOldSpans(doc, change) {
4931
+ var found = change["spans_" + doc.id];
4932
+ if (!found) { return null }
4933
+ var nw = [];
4934
+ for (var i = 0; i < change.text.length; ++i)
4935
+ { nw.push(removeClearedSpans(found[i])); }
4936
+ return nw
4937
+ }
4938
+
4939
+ // Used for un/re-doing changes from the history. Combines the
4940
+ // result of computing the existing spans with the set of spans that
4941
+ // existed in the history (so that deleting around a span and then
4942
+ // undoing brings back the span).
4943
+ function mergeOldSpans(doc, change) {
4944
+ var old = getOldSpans(doc, change);
4945
+ var stretched = stretchSpansOverChange(doc, change);
4946
+ if (!old) { return stretched }
4947
+ if (!stretched) { return old }
4948
+
4949
+ for (var i = 0; i < old.length; ++i) {
4950
+ var oldCur = old[i], stretchCur = stretched[i];
4951
+ if (oldCur && stretchCur) {
4952
+ spans: for (var j = 0; j < stretchCur.length; ++j) {
4953
+ var span = stretchCur[j];
4954
+ for (var k = 0; k < oldCur.length; ++k)
4955
+ { if (oldCur[k].marker == span.marker) { continue spans } }
4956
+ oldCur.push(span);
4957
+ }
4958
+ } else if (stretchCur) {
4959
+ old[i] = stretchCur;
4960
+ }
4961
+ }
4962
+ return old
4963
+ }
4964
+
4965
+ // Used both to provide a JSON-safe object in .getHistory, and, when
4966
+ // detaching a document, to split the history in two
4967
+ function copyHistoryArray(events, newGroup, instantiateSel) {
4968
+ var copy = [];
4969
+ for (var i = 0; i < events.length; ++i) {
4970
+ var event = events[i];
4971
+ if (event.ranges) {
4972
+ copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);
4973
+ continue
4974
+ }
4975
+ var changes = event.changes, newChanges = [];
4976
+ copy.push({changes: newChanges});
4977
+ for (var j = 0; j < changes.length; ++j) {
4978
+ var change = changes[j], m = (void 0);
4979
+ newChanges.push({from: change.from, to: change.to, text: change.text});
4980
+ if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) {
4981
+ if (indexOf(newGroup, Number(m[1])) > -1) {
4982
+ lst(newChanges)[prop] = change[prop];
4983
+ delete change[prop];
4984
+ }
4985
+ } } }
4986
+ }
4987
+ }
4988
+ return copy
4989
+ }
4990
+
4991
+ // The 'scroll' parameter given to many of these indicated whether
4992
+ // the new cursor position should be scrolled into view after
4993
+ // modifying the selection.
4994
+
4995
+ // If shift is held or the extend flag is set, extends a range to
4996
+ // include a given position (and optionally a second position).
4997
+ // Otherwise, simply returns the range between the given positions.
4998
+ // Used for cursor motion and such.
4999
+ function extendRange(range, head, other, extend) {
5000
+ if (extend) {
5001
+ var anchor = range.anchor;
5002
+ if (other) {
5003
+ var posBefore = cmp(head, anchor) < 0;
5004
+ if (posBefore != (cmp(other, anchor) < 0)) {
5005
+ anchor = head;
5006
+ head = other;
5007
+ } else if (posBefore != (cmp(head, other) < 0)) {
5008
+ head = other;
5009
+ }
5010
+ }
5011
+ return new Range(anchor, head)
5012
+ } else {
5013
+ return new Range(other || head, head)
5014
+ }
5015
+ }
5016
+
5017
+ // Extend the primary selection range, discard the rest.
5018
+ function extendSelection(doc, head, other, options, extend) {
5019
+ if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }
5020
+ setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);
5021
+ }
5022
+
5023
+ // Extend all selections (pos is an array of selections with length
5024
+ // equal the number of selections)
5025
+ function extendSelections(doc, heads, options) {
5026
+ var out = [];
5027
+ var extend = doc.cm && (doc.cm.display.shift || doc.extend);
5028
+ for (var i = 0; i < doc.sel.ranges.length; i++)
5029
+ { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }
5030
+ var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);
5031
+ setSelection(doc, newSel, options);
5032
+ }
5033
+
5034
+ // Updates a single range in the selection.
5035
+ function replaceOneSelection(doc, i, range, options) {
5036
+ var ranges = doc.sel.ranges.slice(0);
5037
+ ranges[i] = range;
5038
+ setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);
5039
+ }
5040
+
5041
+ // Reset the selection to a single range.
5042
+ function setSimpleSelection(doc, anchor, head, options) {
5043
+ setSelection(doc, simpleSelection(anchor, head), options);
5044
+ }
5045
+
5046
+ // Give beforeSelectionChange handlers a change to influence a
5047
+ // selection update.
5048
+ function filterSelectionChange(doc, sel, options) {
5049
+ var obj = {
5050
+ ranges: sel.ranges,
5051
+ update: function(ranges) {
5052
+ var this$1 = this;
5053
+
5054
+ this.ranges = [];
5055
+ for (var i = 0; i < ranges.length; i++)
5056
+ { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),
5057
+ clipPos(doc, ranges[i].head)); }
5058
+ },
5059
+ origin: options && options.origin
5060
+ };
5061
+ signal(doc, "beforeSelectionChange", doc, obj);
5062
+ if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); }
5063
+ if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }
5064
+ else { return sel }
5065
+ }
5066
+
5067
+ function setSelectionReplaceHistory(doc, sel, options) {
5068
+ var done = doc.history.done, last = lst(done);
5069
+ if (last && last.ranges) {
5070
+ done[done.length - 1] = sel;
5071
+ setSelectionNoUndo(doc, sel, options);
5072
+ } else {
5073
+ setSelection(doc, sel, options);
5074
+ }
5075
+ }
5076
+
5077
+ // Set a new selection.
5078
+ function setSelection(doc, sel, options) {
5079
+ setSelectionNoUndo(doc, sel, options);
5080
+ addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);
5081
+ }
5082
+
5083
+ function setSelectionNoUndo(doc, sel, options) {
5084
+ if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange"))
5085
+ { sel = filterSelectionChange(doc, sel, options); }
5086
+
5087
+ var bias = options && options.bias ||
5088
+ (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
5089
+ setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));
5090
+
5091
+ if (!(options && options.scroll === false) && doc.cm)
5092
+ { ensureCursorVisible(doc.cm); }
5093
+ }
5094
+
5095
+ function setSelectionInner(doc, sel) {
5096
+ if (sel.equals(doc.sel)) { return }
5097
+
5098
+ doc.sel = sel;
5099
+
5100
+ if (doc.cm) {
5101
+ doc.cm.curOp.updateInput = 1;
5102
+ doc.cm.curOp.selectionChanged = true;
5103
+ signalCursorActivity(doc.cm);
5104
+ }
5105
+ signalLater(doc, "cursorActivity", doc);
5106
+ }
5107
+
5108
+ // Verify that the selection does not partially select any atomic
5109
+ // marked ranges.
5110
+ function reCheckSelection(doc) {
5111
+ setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));
5112
+ }
5113
+
5114
+ // Return a selection that does not partially select any atomic
5115
+ // ranges.
5116
+ function skipAtomicInSelection(doc, sel, bias, mayClear) {
5117
+ var out;
5118
+ for (var i = 0; i < sel.ranges.length; i++) {
5119
+ var range = sel.ranges[i];
5120
+ var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
5121
+ var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
5122
+ var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
5123
+ if (out || newAnchor != range.anchor || newHead != range.head) {
5124
+ if (!out) { out = sel.ranges.slice(0, i); }
5125
+ out[i] = new Range(newAnchor, newHead);
5126
+ }
5127
+ }
5128
+ return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel
5129
+ }
5130
+
5131
+ function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {
5132
+ var line = getLine(doc, pos.line);
5133
+ if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {
5134
+ var sp = line.markedSpans[i], m = sp.marker;
5135
+ if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&
5136
+ (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {
5137
+ if (mayClear) {
5138
+ signal(m, "beforeCursorEnter");
5139
+ if (m.explicitlyCleared) {
5140
+ if (!line.markedSpans) { break }
5141
+ else {--i; continue}
5142
+ }
5143
+ }
5144
+ if (!m.atomic) { continue }
5145
+
5146
+ if (oldPos) {
5147
+ var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);
5148
+ if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
5149
+ { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }
5150
+ if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
5151
+ { return skipAtomicInner(doc, near, pos, dir, mayClear) }
5152
+ }
5153
+
5154
+ var far = m.find(dir < 0 ? -1 : 1);
5155
+ if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)
5156
+ { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }
5157
+ return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null
5158
+ }
5159
+ } }
5160
+ return pos
5161
+ }
5162
+
5163
+ // Ensure a given position is not inside an atomic range.
5164
+ function skipAtomic(doc, pos, oldPos, bias, mayClear) {
5165
+ var dir = bias || 1;
5166
+ var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||
5167
+ (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||
5168
+ skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||
5169
+ (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));
5170
+ if (!found) {
5171
+ doc.cantEdit = true;
5172
+ return Pos(doc.first, 0)
5173
+ }
5174
+ return found
5175
+ }
5176
+
5177
+ function movePos(doc, pos, dir, line) {
5178
+ if (dir < 0 && pos.ch == 0) {
5179
+ if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }
5180
+ else { return null }
5181
+ } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {
5182
+ if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }
5183
+ else { return null }
5184
+ } else {
5185
+ return new Pos(pos.line, pos.ch + dir)
5186
+ }
5187
+ }
5188
+
5189
+ function selectAll(cm) {
5190
+ cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);
5191
+ }
5192
+
5193
+ // UPDATING
5194
+
5195
+ // Allow "beforeChange" event handlers to influence a change
5196
+ function filterChange(doc, change, update) {
5197
+ var obj = {
5198
+ canceled: false,
5199
+ from: change.from,
5200
+ to: change.to,
5201
+ text: change.text,
5202
+ origin: change.origin,
5203
+ cancel: function () { return obj.canceled = true; }
5204
+ };
5205
+ if (update) { obj.update = function (from, to, text, origin) {
5206
+ if (from) { obj.from = clipPos(doc, from); }
5207
+ if (to) { obj.to = clipPos(doc, to); }
5208
+ if (text) { obj.text = text; }
5209
+ if (origin !== undefined) { obj.origin = origin; }
5210
+ }; }
5211
+ signal(doc, "beforeChange", doc, obj);
5212
+ if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); }
5213
+
5214
+ if (obj.canceled) {
5215
+ if (doc.cm) { doc.cm.curOp.updateInput = 2; }
5216
+ return null
5217
+ }
5218
+ return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}
5219
+ }
5220
+
5221
+ // Apply a change to a document, and add it to the document's
5222
+ // history, and propagating it to all linked documents.
5223
+ function makeChange(doc, change, ignoreReadOnly) {
5224
+ if (doc.cm) {
5225
+ if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }
5226
+ if (doc.cm.state.suppressEdits) { return }
5227
+ }
5228
+
5229
+ if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
5230
+ change = filterChange(doc, change, true);
5231
+ if (!change) { return }
5232
+ }
5233
+
5234
+ // Possibly split or suppress the update based on the presence
5235
+ // of read-only spans in its range.
5236
+ var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);
5237
+ if (split) {
5238
+ for (var i = split.length - 1; i >= 0; --i)
5239
+ { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); }
5240
+ } else {
5241
+ makeChangeInner(doc, change);
5242
+ }
5243
+ }
5244
+
5245
+ function makeChangeInner(doc, change) {
5246
+ if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return }
5247
+ var selAfter = computeSelAfterChange(doc, change);
5248
+ addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);
5249
+
5250
+ makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));
5251
+ var rebased = [];
5252
+
5253
+ linkedDocs(doc, function (doc, sharedHist) {
5254
+ if (!sharedHist && indexOf(rebased, doc.history) == -1) {
5255
+ rebaseHist(doc.history, change);
5256
+ rebased.push(doc.history);
5257
+ }
5258
+ makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));
5259
+ });
5260
+ }
5261
+
5262
+ // Revert a change stored in a document's history.
5263
+ function makeChangeFromHistory(doc, type, allowSelectionOnly) {
5264
+ var suppress = doc.cm && doc.cm.state.suppressEdits;
5265
+ if (suppress && !allowSelectionOnly) { return }
5266
+
5267
+ var hist = doc.history, event, selAfter = doc.sel;
5268
+ var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done;
5269
+
5270
+ // Verify that there is a useable event (so that ctrl-z won't
5271
+ // needlessly clear selection events)
5272
+ var i = 0;
5273
+ for (; i < source.length; i++) {
5274
+ event = source[i];
5275
+ if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)
5276
+ { break }
5277
+ }
5278
+ if (i == source.length) { return }
5279
+ hist.lastOrigin = hist.lastSelOrigin = null;
5280
+
5281
+ for (;;) {
5282
+ event = source.pop();
5283
+ if (event.ranges) {
5284
+ pushSelectionToHistory(event, dest);
5285
+ if (allowSelectionOnly && !event.equals(doc.sel)) {
5286
+ setSelection(doc, event, {clearRedo: false});
5287
+ return
5288
+ }
5289
+ selAfter = event;
5290
+ } else if (suppress) {
5291
+ source.push(event);
5292
+ return
5293
+ } else { break }
5294
+ }
5295
+
5296
+ // Build up a reverse change object to add to the opposite history
5297
+ // stack (redo when undoing, and vice versa).
5298
+ var antiChanges = [];
5299
+ pushSelectionToHistory(selAfter, dest);
5300
+ dest.push({changes: antiChanges, generation: hist.generation});
5301
+ hist.generation = event.generation || ++hist.maxGeneration;
5302
+
5303
+ var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange");
5304
+
5305
+ var loop = function ( i ) {
5306
+ var change = event.changes[i];
5307
+ change.origin = type;
5308
+ if (filter && !filterChange(doc, change, false)) {
5309
+ source.length = 0;
5310
+ return {}
5311
+ }
5312
+
5313
+ antiChanges.push(historyChangeFromChange(doc, change));
5314
+
5315
+ var after = i ? computeSelAfterChange(doc, change) : lst(source);
5316
+ makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));
5317
+ if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }
5318
+ var rebased = [];
5319
+
5320
+ // Propagate to the linked documents
5321
+ linkedDocs(doc, function (doc, sharedHist) {
5322
+ if (!sharedHist && indexOf(rebased, doc.history) == -1) {
5323
+ rebaseHist(doc.history, change);
5324
+ rebased.push(doc.history);
5325
+ }
5326
+ makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));
5327
+ });
5328
+ };
5329
+
5330
+ for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {
5331
+ var returned = loop( i$1 );
5332
+
5333
+ if ( returned ) return returned.v;
5334
+ }
5335
+ }
5336
+
5337
+ // Sub-views need their line numbers shifted when text is added
5338
+ // above or below them in the parent document.
5339
+ function shiftDoc(doc, distance) {
5340
+ if (distance == 0) { return }
5341
+ doc.first += distance;
5342
+ doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(
5343
+ Pos(range.anchor.line + distance, range.anchor.ch),
5344
+ Pos(range.head.line + distance, range.head.ch)
5345
+ ); }), doc.sel.primIndex);
5346
+ if (doc.cm) {
5347
+ regChange(doc.cm, doc.first, doc.first - distance, distance);
5348
+ for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)
5349
+ { regLineChange(doc.cm, l, "gutter"); }
5350
+ }
5351
+ }
5352
+
5353
+ // More lower-level change function, handling only a single document
5354
+ // (not linked ones).
5355
+ function makeChangeSingleDoc(doc, change, selAfter, spans) {
5356
+ if (doc.cm && !doc.cm.curOp)
5357
+ { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }
5358
+
5359
+ if (change.to.line < doc.first) {
5360
+ shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));
5361
+ return
5362
+ }
5363
+ if (change.from.line > doc.lastLine()) { return }
5364
+
5365
+ // Clip the change to the size of this doc
5366
+ if (change.from.line < doc.first) {
5367
+ var shift = change.text.length - 1 - (doc.first - change.from.line);
5368
+ shiftDoc(doc, shift);
5369
+ change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
5370
+ text: [lst(change.text)], origin: change.origin};
5371
+ }
5372
+ var last = doc.lastLine();
5373
+ if (change.to.line > last) {
5374
+ change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
5375
+ text: [change.text[0]], origin: change.origin};
5376
+ }
5377
+
5378
+ change.removed = getBetween(doc, change.from, change.to);
5379
+
5380
+ if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }
5381
+ if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }
5382
+ else { updateDoc(doc, change, spans); }
5383
+ setSelectionNoUndo(doc, selAfter, sel_dontScroll);
5384
+ }
5385
+
5386
+ // Handle the interaction of a change to a document with the editor
5387
+ // that this document is part of.
5388
+ function makeChangeSingleDocInEditor(cm, change, spans) {
5389
+ var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
5390
+
5391
+ var recomputeMaxLength = false, checkWidthStart = from.line;
5392
+ if (!cm.options.lineWrapping) {
5393
+ checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));
5394
+ doc.iter(checkWidthStart, to.line + 1, function (line) {
5395
+ if (line == display.maxLine) {
5396
+ recomputeMaxLength = true;
5397
+ return true
5398
+ }
5399
+ });
5400
+ }
5401
+
5402
+ if (doc.sel.contains(change.from, change.to) > -1)
5403
+ { signalCursorActivity(cm); }
5404
+
5405
+ updateDoc(doc, change, spans, estimateHeight(cm));
5406
+
5407
+ if (!cm.options.lineWrapping) {
5408
+ doc.iter(checkWidthStart, from.line + change.text.length, function (line) {
5409
+ var len = lineLength(line);
5410
+ if (len > display.maxLineLength) {
5411
+ display.maxLine = line;
5412
+ display.maxLineLength = len;
5413
+ display.maxLineChanged = true;
5414
+ recomputeMaxLength = false;
5415
+ }
5416
+ });
5417
+ if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }
5418
+ }
5419
+
5420
+ retreatFrontier(doc, from.line);
5421
+ startWorker(cm, 400);
5422
+
5423
+ var lendiff = change.text.length - (to.line - from.line) - 1;
5424
+ // Remember that these lines changed, for updating the display
5425
+ if (change.full)
5426
+ { regChange(cm); }
5427
+ else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))
5428
+ { regLineChange(cm, from.line, "text"); }
5429
+ else
5430
+ { regChange(cm, from.line, to.line + 1, lendiff); }
5431
+
5432
+ var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change");
5433
+ if (changeHandler || changesHandler) {
5434
+ var obj = {
5435
+ from: from, to: to,
5436
+ text: change.text,
5437
+ removed: change.removed,
5438
+ origin: change.origin
5439
+ };
5440
+ if (changeHandler) { signalLater(cm, "change", cm, obj); }
5441
+ if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }
5442
+ }
5443
+ cm.display.selForContextMenu = null;
5444
+ }
5445
+
5446
+ function replaceRange(doc, code, from, to, origin) {
5447
+ var assign;
5448
+
5449
+ if (!to) { to = from; }
5450
+ if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }
5451
+ if (typeof code == "string") { code = doc.splitLines(code); }
5452
+ makeChange(doc, {from: from, to: to, text: code, origin: origin});
5453
+ }
5454
+
5455
+ // Rebasing/resetting history to deal with externally-sourced changes
5456
+
5457
+ function rebaseHistSelSingle(pos, from, to, diff) {
5458
+ if (to < pos.line) {
5459
+ pos.line += diff;
5460
+ } else if (from < pos.line) {
5461
+ pos.line = from;
5462
+ pos.ch = 0;
5463
+ }
5464
+ }
5465
+
5466
+ // Tries to rebase an array of history events given a change in the
5467
+ // document. If the change touches the same lines as the event, the
5468
+ // event, and everything 'behind' it, is discarded. If the change is
5469
+ // before the event, the event's positions are updated. Uses a
5470
+ // copy-on-write scheme for the positions, to avoid having to
5471
+ // reallocate them all on every rebase, but also avoid problems with
5472
+ // shared position objects being unsafely updated.
5473
+ function rebaseHistArray(array, from, to, diff) {
5474
+ for (var i = 0; i < array.length; ++i) {
5475
+ var sub = array[i], ok = true;
5476
+ if (sub.ranges) {
5477
+ if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }
5478
+ for (var j = 0; j < sub.ranges.length; j++) {
5479
+ rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);
5480
+ rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);
5481
+ }
5482
+ continue
5483
+ }
5484
+ for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {
5485
+ var cur = sub.changes[j$1];
5486
+ if (to < cur.from.line) {
5487
+ cur.from = Pos(cur.from.line + diff, cur.from.ch);
5488
+ cur.to = Pos(cur.to.line + diff, cur.to.ch);
5489
+ } else if (from <= cur.to.line) {
5490
+ ok = false;
5491
+ break
5492
+ }
5493
+ }
5494
+ if (!ok) {
5495
+ array.splice(0, i + 1);
5496
+ i = 0;
5497
+ }
5498
+ }
5499
+ }
5500
+
5501
+ function rebaseHist(hist, change) {
5502
+ var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;
5503
+ rebaseHistArray(hist.done, from, to, diff);
5504
+ rebaseHistArray(hist.undone, from, to, diff);
5505
+ }
5506
+
5507
+ // Utility for applying a change to a line by handle or number,
5508
+ // returning the number and optionally registering the line as
5509
+ // changed.
5510
+ function changeLine(doc, handle, changeType, op) {
5511
+ var no = handle, line = handle;
5512
+ if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); }
5513
+ else { no = lineNo(handle); }
5514
+ if (no == null) { return null }
5515
+ if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }
5516
+ return line
5517
+ }
5518
+
5519
+ // The document is represented as a BTree consisting of leaves, with
5520
+ // chunk of lines in them, and branches, with up to ten leaves or
5521
+ // other branch nodes below them. The top node is always a branch
5522
+ // node, and is the document object itself (meaning it has
5523
+ // additional methods and properties).
5524
+ //
5525
+ // All nodes have parent links. The tree is used both to go from
5526
+ // line numbers to line objects, and to go from objects to numbers.
5527
+ // It also indexes by height, and is used to convert between height
5528
+ // and line object, and to find the total height of the document.
5529
+ //
5530
+ // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
5531
+
5532
+ function LeafChunk(lines) {
5533
+ var this$1 = this;
5534
+
5535
+ this.lines = lines;
5536
+ this.parent = null;
5537
+ var height = 0;
5538
+ for (var i = 0; i < lines.length; ++i) {
5539
+ lines[i].parent = this$1;
5540
+ height += lines[i].height;
5541
+ }
5542
+ this.height = height;
5543
+ }
5544
+
5545
+ LeafChunk.prototype = {
5546
+ chunkSize: function() { return this.lines.length },
5547
+
5548
+ // Remove the n lines at offset 'at'.
5549
+ removeInner: function(at, n) {
5550
+ var this$1 = this;
5551
+
5552
+ for (var i = at, e = at + n; i < e; ++i) {
5553
+ var line = this$1.lines[i];
5554
+ this$1.height -= line.height;
5555
+ cleanUpLine(line);
5556
+ signalLater(line, "delete");
5557
+ }
5558
+ this.lines.splice(at, n);
5559
+ },
5560
+
5561
+ // Helper used to collapse a small branch into a single leaf.
5562
+ collapse: function(lines) {
5563
+ lines.push.apply(lines, this.lines);
5564
+ },
5565
+
5566
+ // Insert the given array of lines at offset 'at', count them as
5567
+ // having the given height.
5568
+ insertInner: function(at, lines, height) {
5569
+ var this$1 = this;
5570
+
5571
+ this.height += height;
5572
+ this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
5573
+ for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }
5574
+ },
5575
+
5576
+ // Used to iterate over a part of the tree.
5577
+ iterN: function(at, n, op) {
5578
+ var this$1 = this;
5579
+
5580
+ for (var e = at + n; at < e; ++at)
5581
+ { if (op(this$1.lines[at])) { return true } }
5582
+ }
5583
+ };
5584
+
5585
+ function BranchChunk(children) {
5586
+ var this$1 = this;
5587
+
5588
+ this.children = children;
5589
+ var size = 0, height = 0;
5590
+ for (var i = 0; i < children.length; ++i) {
5591
+ var ch = children[i];
5592
+ size += ch.chunkSize(); height += ch.height;
5593
+ ch.parent = this$1;
5594
+ }
5595
+ this.size = size;
5596
+ this.height = height;
5597
+ this.parent = null;
5598
+ }
5599
+
5600
+ BranchChunk.prototype = {
5601
+ chunkSize: function() { return this.size },
5602
+
5603
+ removeInner: function(at, n) {
5604
+ var this$1 = this;
5605
+
5606
+ this.size -= n;
5607
+ for (var i = 0; i < this.children.length; ++i) {
5608
+ var child = this$1.children[i], sz = child.chunkSize();
5609
+ if (at < sz) {
5610
+ var rm = Math.min(n, sz - at), oldHeight = child.height;
5611
+ child.removeInner(at, rm);
5612
+ this$1.height -= oldHeight - child.height;
5613
+ if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }
5614
+ if ((n -= rm) == 0) { break }
5615
+ at = 0;
5616
+ } else { at -= sz; }
5617
+ }
5618
+ // If the result is smaller than 25 lines, ensure that it is a
5619
+ // single leaf node.
5620
+ if (this.size - n < 25 &&
5621
+ (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
5622
+ var lines = [];
5623
+ this.collapse(lines);
5624
+ this.children = [new LeafChunk(lines)];
5625
+ this.children[0].parent = this;
5626
+ }
5627
+ },
5628
+
5629
+ collapse: function(lines) {
5630
+ var this$1 = this;
5631
+
5632
+ for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }
5633
+ },
5634
+
5635
+ insertInner: function(at, lines, height) {
5636
+ var this$1 = this;
5637
+
5638
+ this.size += lines.length;
5639
+ this.height += height;
5640
+ for (var i = 0; i < this.children.length; ++i) {
5641
+ var child = this$1.children[i], sz = child.chunkSize();
5642
+ if (at <= sz) {
5643
+ child.insertInner(at, lines, height);
5644
+ if (child.lines && child.lines.length > 50) {
5645
+ // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
5646
+ // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
5647
+ var remaining = child.lines.length % 25 + 25;
5648
+ for (var pos = remaining; pos < child.lines.length;) {
5649
+ var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));
5650
+ child.height -= leaf.height;
5651
+ this$1.children.splice(++i, 0, leaf);
5652
+ leaf.parent = this$1;
5653
+ }
5654
+ child.lines = child.lines.slice(0, remaining);
5655
+ this$1.maybeSpill();
5656
+ }
5657
+ break
5658
+ }
5659
+ at -= sz;
5660
+ }
5661
+ },
5662
+
5663
+ // When a node has grown, check whether it should be split.
5664
+ maybeSpill: function() {
5665
+ if (this.children.length <= 10) { return }
5666
+ var me = this;
5667
+ do {
5668
+ var spilled = me.children.splice(me.children.length - 5, 5);
5669
+ var sibling = new BranchChunk(spilled);
5670
+ if (!me.parent) { // Become the parent node
5671
+ var copy = new BranchChunk(me.children);
5672
+ copy.parent = me;
5673
+ me.children = [copy, sibling];
5674
+ me = copy;
5675
+ } else {
5676
+ me.size -= sibling.size;
5677
+ me.height -= sibling.height;
5678
+ var myIndex = indexOf(me.parent.children, me);
5679
+ me.parent.children.splice(myIndex + 1, 0, sibling);
5680
+ }
5681
+ sibling.parent = me.parent;
5682
+ } while (me.children.length > 10)
5683
+ me.parent.maybeSpill();
5684
+ },
5685
+
5686
+ iterN: function(at, n, op) {
5687
+ var this$1 = this;
5688
+
5689
+ for (var i = 0; i < this.children.length; ++i) {
5690
+ var child = this$1.children[i], sz = child.chunkSize();
5691
+ if (at < sz) {
5692
+ var used = Math.min(n, sz - at);
5693
+ if (child.iterN(at, used, op)) { return true }
5694
+ if ((n -= used) == 0) { break }
5695
+ at = 0;
5696
+ } else { at -= sz; }
5697
+ }
5698
+ }
5699
+ };
5700
+
5701
+ // Line widgets are block elements displayed above or below a line.
5702
+
5703
+ var LineWidget = function(doc, node, options) {
5704
+ var this$1 = this;
5705
+
5706
+ if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))
5707
+ { this$1[opt] = options[opt]; } } }
5708
+ this.doc = doc;
5709
+ this.node = node;
5710
+ };
5711
+
5712
+ LineWidget.prototype.clear = function () {
5713
+ var this$1 = this;
5714
+
5715
+ var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);
5716
+ if (no == null || !ws) { return }
5717
+ for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }
5718
+ if (!ws.length) { line.widgets = null; }
5719
+ var height = widgetHeight(this);
5720
+ updateLineHeight(line, Math.max(0, line.height - height));
5721
+ if (cm) {
5722
+ runInOp(cm, function () {
5723
+ adjustScrollWhenAboveVisible(cm, line, -height);
5724
+ regLineChange(cm, no, "widget");
5725
+ });
5726
+ signalLater(cm, "lineWidgetCleared", cm, this, no);
5727
+ }
5728
+ };
5729
+
5730
+ LineWidget.prototype.changed = function () {
5731
+ var this$1 = this;
5732
+
5733
+ var oldH = this.height, cm = this.doc.cm, line = this.line;
5734
+ this.height = null;
5735
+ var diff = widgetHeight(this) - oldH;
5736
+ if (!diff) { return }
5737
+ if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }
5738
+ if (cm) {
5739
+ runInOp(cm, function () {
5740
+ cm.curOp.forceUpdate = true;
5741
+ adjustScrollWhenAboveVisible(cm, line, diff);
5742
+ signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line));
5743
+ });
5744
+ }
5745
+ };
5746
+ eventMixin(LineWidget);
5747
+
5748
+ function adjustScrollWhenAboveVisible(cm, line, diff) {
5749
+ if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
5750
+ { addToScrollTop(cm, diff); }
5751
+ }
5752
+
5753
+ function addLineWidget(doc, handle, node, options) {
5754
+ var widget = new LineWidget(doc, node, options);
5755
+ var cm = doc.cm;
5756
+ if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }
5757
+ changeLine(doc, handle, "widget", function (line) {
5758
+ var widgets = line.widgets || (line.widgets = []);
5759
+ if (widget.insertAt == null) { widgets.push(widget); }
5760
+ else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }
5761
+ widget.line = line;
5762
+ if (cm && !lineIsHidden(doc, line)) {
5763
+ var aboveVisible = heightAtLine(line) < doc.scrollTop;
5764
+ updateLineHeight(line, line.height + widgetHeight(widget));
5765
+ if (aboveVisible) { addToScrollTop(cm, widget.height); }
5766
+ cm.curOp.forceUpdate = true;
5767
+ }
5768
+ return true
5769
+ });
5770
+ if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); }
5771
+ return widget
5772
+ }
5773
+
5774
+ // TEXTMARKERS
5775
+
5776
+ // Created with markText and setBookmark methods. A TextMarker is a
5777
+ // handle that can be used to clear or find a marked position in the
5778
+ // document. Line objects hold arrays (markedSpans) containing
5779
+ // {from, to, marker} object pointing to such marker objects, and
5780
+ // indicating that such a marker is present on that line. Multiple
5781
+ // lines may point to the same marker when it spans across lines.
5782
+ // The spans will have null for their from/to properties when the
5783
+ // marker continues beyond the start/end of the line. Markers have
5784
+ // links back to the lines they currently touch.
5785
+
5786
+ // Collapsed markers have unique ids, in order to be able to order
5787
+ // them, which is needed for uniquely determining an outer marker
5788
+ // when they overlap (they may nest, but not partially overlap).
5789
+ var nextMarkerId = 0;
5790
+
5791
+ var TextMarker = function(doc, type) {
5792
+ this.lines = [];
5793
+ this.type = type;
5794
+ this.doc = doc;
5795
+ this.id = ++nextMarkerId;
5796
+ };
5797
+
5798
+ // Clear the marker.
5799
+ TextMarker.prototype.clear = function () {
5800
+ var this$1 = this;
5801
+
5802
+ if (this.explicitlyCleared) { return }
5803
+ var cm = this.doc.cm, withOp = cm && !cm.curOp;
5804
+ if (withOp) { startOperation(cm); }
5805
+ if (hasHandler(this, "clear")) {
5806
+ var found = this.find();
5807
+ if (found) { signalLater(this, "clear", found.from, found.to); }
5808
+ }
5809
+ var min = null, max = null;
5810
+ for (var i = 0; i < this.lines.length; ++i) {
5811
+ var line = this$1.lines[i];
5812
+ var span = getMarkedSpanFor(line.markedSpans, this$1);
5813
+ if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text"); }
5814
+ else if (cm) {
5815
+ if (span.to != null) { max = lineNo(line); }
5816
+ if (span.from != null) { min = lineNo(line); }
5817
+ }
5818
+ line.markedSpans = removeMarkedSpan(line.markedSpans, span);
5819
+ if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)
5820
+ { updateLineHeight(line, textHeight(cm.display)); }
5821
+ }
5822
+ if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {
5823
+ var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);
5824
+ if (len > cm.display.maxLineLength) {
5825
+ cm.display.maxLine = visual;
5826
+ cm.display.maxLineLength = len;
5827
+ cm.display.maxLineChanged = true;
5828
+ }
5829
+ } }
5830
+
5831
+ if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }
5832
+ this.lines.length = 0;
5833
+ this.explicitlyCleared = true;
5834
+ if (this.atomic && this.doc.cantEdit) {
5835
+ this.doc.cantEdit = false;
5836
+ if (cm) { reCheckSelection(cm.doc); }
5837
+ }
5838
+ if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); }
5839
+ if (withOp) { endOperation(cm); }
5840
+ if (this.parent) { this.parent.clear(); }
5841
+ };
5842
+
5843
+ // Find the position of the marker in the document. Returns a {from,
5844
+ // to} object by default. Side can be passed to get a specific side
5845
+ // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the
5846
+ // Pos objects returned contain a line object, rather than a line
5847
+ // number (used to prevent looking up the same line twice).
5848
+ TextMarker.prototype.find = function (side, lineObj) {
5849
+ var this$1 = this;
5850
+
5851
+ if (side == null && this.type == "bookmark") { side = 1; }
5852
+ var from, to;
5853
+ for (var i = 0; i < this.lines.length; ++i) {
5854
+ var line = this$1.lines[i];
5855
+ var span = getMarkedSpanFor(line.markedSpans, this$1);
5856
+ if (span.from != null) {
5857
+ from = Pos(lineObj ? line : lineNo(line), span.from);
5858
+ if (side == -1) { return from }
5859
+ }
5860
+ if (span.to != null) {
5861
+ to = Pos(lineObj ? line : lineNo(line), span.to);
5862
+ if (side == 1) { return to }
5863
+ }
5864
+ }
5865
+ return from && {from: from, to: to}
5866
+ };
5867
+
5868
+ // Signals that the marker's widget changed, and surrounding layout
5869
+ // should be recomputed.
5870
+ TextMarker.prototype.changed = function () {
5871
+ var this$1 = this;
5872
+
5873
+ var pos = this.find(-1, true), widget = this, cm = this.doc.cm;
5874
+ if (!pos || !cm) { return }
5875
+ runInOp(cm, function () {
5876
+ var line = pos.line, lineN = lineNo(pos.line);
5877
+ var view = findViewForLine(cm, lineN);
5878
+ if (view) {
5879
+ clearLineMeasurementCacheFor(view);
5880
+ cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;
5881
+ }
5882
+ cm.curOp.updateMaxLine = true;
5883
+ if (!lineIsHidden(widget.doc, line) && widget.height != null) {
5884
+ var oldHeight = widget.height;
5885
+ widget.height = null;
5886
+ var dHeight = widgetHeight(widget) - oldHeight;
5887
+ if (dHeight)
5888
+ { updateLineHeight(line, line.height + dHeight); }
5889
+ }
5890
+ signalLater(cm, "markerChanged", cm, this$1);
5891
+ });
5892
+ };
5893
+
5894
+ TextMarker.prototype.attachLine = function (line) {
5895
+ if (!this.lines.length && this.doc.cm) {
5896
+ var op = this.doc.cm.curOp;
5897
+ if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
5898
+ { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }
5899
+ }
5900
+ this.lines.push(line);
5901
+ };
5902
+
5903
+ TextMarker.prototype.detachLine = function (line) {
5904
+ this.lines.splice(indexOf(this.lines, line), 1);
5905
+ if (!this.lines.length && this.doc.cm) {
5906
+ var op = this.doc.cm.curOp
5907
+ ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);
5908
+ }
5909
+ };
5910
+ eventMixin(TextMarker);
5911
+
5912
+ // Create a marker, wire it up to the right lines, and
5913
+ function markText(doc, from, to, options, type) {
5914
+ // Shared markers (across linked documents) are handled separately
5915
+ // (markTextShared will call out to this again, once per
5916
+ // document).
5917
+ if (options && options.shared) { return markTextShared(doc, from, to, options, type) }
5918
+ // Ensure we are in an operation.
5919
+ if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }
5920
+
5921
+ var marker = new TextMarker(doc, type), diff = cmp(from, to);
5922
+ if (options) { copyObj(options, marker, false); }
5923
+ // Don't connect empty markers unless clearWhenEmpty is false
5924
+ if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)
5925
+ { return marker }
5926
+ if (marker.replacedWith) {
5927
+ // Showing up as a widget implies collapsed (widget replaces text)
5928
+ marker.collapsed = true;
5929
+ marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget");
5930
+ if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); }
5931
+ if (options.insertLeft) { marker.widgetNode.insertLeft = true; }
5932
+ }
5933
+ if (marker.collapsed) {
5934
+ if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||
5935
+ from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))
5936
+ { throw new Error("Inserting collapsed marker partially overlapping an existing one") }
5937
+ seeCollapsedSpans();
5938
+ }
5939
+
5940
+ if (marker.addToHistory)
5941
+ { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); }
5942
+
5943
+ var curLine = from.line, cm = doc.cm, updateMaxLine;
5944
+ doc.iter(curLine, to.line + 1, function (line) {
5945
+ if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)
5946
+ { updateMaxLine = true; }
5947
+ if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }
5948
+ addMarkedSpan(line, new MarkedSpan(marker,
5949
+ curLine == from.line ? from.ch : null,
5950
+ curLine == to.line ? to.ch : null));
5951
+ ++curLine;
5952
+ });
5953
+ // lineIsHidden depends on the presence of the spans, so needs a second pass
5954
+ if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {
5955
+ if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }
5956
+ }); }
5957
+
5958
+ if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); }
5959
+
5960
+ if (marker.readOnly) {
5961
+ seeReadOnlySpans();
5962
+ if (doc.history.done.length || doc.history.undone.length)
5963
+ { doc.clearHistory(); }
5964
+ }
5965
+ if (marker.collapsed) {
5966
+ marker.id = ++nextMarkerId;
5967
+ marker.atomic = true;
5968
+ }
5969
+ if (cm) {
5970
+ // Sync editor state
5971
+ if (updateMaxLine) { cm.curOp.updateMaxLine = true; }
5972
+ if (marker.collapsed)
5973
+ { regChange(cm, from.line, to.line + 1); }
5974
+ else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||
5975
+ marker.attributes || marker.title)
5976
+ { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } }
5977
+ if (marker.atomic) { reCheckSelection(cm.doc); }
5978
+ signalLater(cm, "markerAdded", cm, marker);
5979
+ }
5980
+ return marker
5981
+ }
5982
+
5983
+ // SHARED TEXTMARKERS
5984
+
5985
+ // A shared marker spans multiple linked documents. It is
5986
+ // implemented as a meta-marker-object controlling multiple normal
5987
+ // markers.
5988
+ var SharedTextMarker = function(markers, primary) {
5989
+ var this$1 = this;
5990
+
5991
+ this.markers = markers;
5992
+ this.primary = primary;
5993
+ for (var i = 0; i < markers.length; ++i)
5994
+ { markers[i].parent = this$1; }
5995
+ };
5996
+
5997
+ SharedTextMarker.prototype.clear = function () {
5998
+ var this$1 = this;
5999
+
6000
+ if (this.explicitlyCleared) { return }
6001
+ this.explicitlyCleared = true;
6002
+ for (var i = 0; i < this.markers.length; ++i)
6003
+ { this$1.markers[i].clear(); }
6004
+ signalLater(this, "clear");
6005
+ };
6006
+
6007
+ SharedTextMarker.prototype.find = function (side, lineObj) {
6008
+ return this.primary.find(side, lineObj)
6009
+ };
6010
+ eventMixin(SharedTextMarker);
6011
+
6012
+ function markTextShared(doc, from, to, options, type) {
6013
+ options = copyObj(options);
6014
+ options.shared = false;
6015
+ var markers = [markText(doc, from, to, options, type)], primary = markers[0];
6016
+ var widget = options.widgetNode;
6017
+ linkedDocs(doc, function (doc) {
6018
+ if (widget) { options.widgetNode = widget.cloneNode(true); }
6019
+ markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
6020
+ for (var i = 0; i < doc.linked.length; ++i)
6021
+ { if (doc.linked[i].isParent) { return } }
6022
+ primary = lst(markers);
6023
+ });
6024
+ return new SharedTextMarker(markers, primary)
6025
+ }
6026
+
6027
+ function findSharedMarkers(doc) {
6028
+ return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })
6029
+ }
6030
+
6031
+ function copySharedMarkers(doc, markers) {
6032
+ for (var i = 0; i < markers.length; i++) {
6033
+ var marker = markers[i], pos = marker.find();
6034
+ var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);
6035
+ if (cmp(mFrom, mTo)) {
6036
+ var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);
6037
+ marker.markers.push(subMark);
6038
+ subMark.parent = marker;
6039
+ }
6040
+ }
6041
+ }
6042
+
6043
+ function detachSharedMarkers(markers) {
6044
+ var loop = function ( i ) {
6045
+ var marker = markers[i], linked = [marker.primary.doc];
6046
+ linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });
6047
+ for (var j = 0; j < marker.markers.length; j++) {
6048
+ var subMarker = marker.markers[j];
6049
+ if (indexOf(linked, subMarker.doc) == -1) {
6050
+ subMarker.parent = null;
6051
+ marker.markers.splice(j--, 1);
6052
+ }
6053
+ }
6054
+ };
6055
+
6056
+ for (var i = 0; i < markers.length; i++) loop( i );
6057
+ }
6058
+
6059
+ var nextDocId = 0;
6060
+ var Doc = function(text, mode, firstLine, lineSep, direction) {
6061
+ if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }
6062
+ if (firstLine == null) { firstLine = 0; }
6063
+
6064
+ BranchChunk.call(this, [new LeafChunk([new Line("", null)])]);
6065
+ this.first = firstLine;
6066
+ this.scrollTop = this.scrollLeft = 0;
6067
+ this.cantEdit = false;
6068
+ this.cleanGeneration = 1;
6069
+ this.modeFrontier = this.highlightFrontier = firstLine;
6070
+ var start = Pos(firstLine, 0);
6071
+ this.sel = simpleSelection(start);
6072
+ this.history = new History(null);
6073
+ this.id = ++nextDocId;
6074
+ this.modeOption = mode;
6075
+ this.lineSep = lineSep;
6076
+ this.direction = (direction == "rtl") ? "rtl" : "ltr";
6077
+ this.extend = false;
6078
+
6079
+ if (typeof text == "string") { text = this.splitLines(text); }
6080
+ updateDoc(this, {from: start, to: start, text: text});
6081
+ setSelection(this, simpleSelection(start), sel_dontScroll);
6082
+ };
6083
+
6084
+ Doc.prototype = createObj(BranchChunk.prototype, {
6085
+ constructor: Doc,
6086
+ // Iterate over the document. Supports two forms -- with only one
6087
+ // argument, it calls that for each line in the document. With
6088
+ // three, it iterates over the range given by the first two (with
6089
+ // the second being non-inclusive).
6090
+ iter: function(from, to, op) {
6091
+ if (op) { this.iterN(from - this.first, to - from, op); }
6092
+ else { this.iterN(this.first, this.first + this.size, from); }
6093
+ },
6094
+
6095
+ // Non-public interface for adding and removing lines.
6096
+ insert: function(at, lines) {
6097
+ var height = 0;
6098
+ for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }
6099
+ this.insertInner(at - this.first, lines, height);
6100
+ },
6101
+ remove: function(at, n) { this.removeInner(at - this.first, n); },
6102
+
6103
+ // From here, the methods are part of the public interface. Most
6104
+ // are also available from CodeMirror (editor) instances.
6105
+
6106
+ getValue: function(lineSep) {
6107
+ var lines = getLines(this, this.first, this.first + this.size);
6108
+ if (lineSep === false) { return lines }
6109
+ return lines.join(lineSep || this.lineSeparator())
6110
+ },
6111
+ setValue: docMethodOp(function(code) {
6112
+ var top = Pos(this.first, 0), last = this.first + this.size - 1;
6113
+ makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
6114
+ text: this.splitLines(code), origin: "setValue", full: true}, true);
6115
+ if (this.cm) { scrollToCoords(this.cm, 0, 0); }
6116
+ setSelection(this, simpleSelection(top), sel_dontScroll);
6117
+ }),
6118
+ replaceRange: function(code, from, to, origin) {
6119
+ from = clipPos(this, from);
6120
+ to = to ? clipPos(this, to) : from;
6121
+ replaceRange(this, code, from, to, origin);
6122
+ },
6123
+ getRange: function(from, to, lineSep) {
6124
+ var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
6125
+ if (lineSep === false) { return lines }
6126
+ return lines.join(lineSep || this.lineSeparator())
6127
+ },
6128
+
6129
+ getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},
6130
+
6131
+ getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},
6132
+ getLineNumber: function(line) {return lineNo(line)},
6133
+
6134
+ getLineHandleVisualStart: function(line) {
6135
+ if (typeof line == "number") { line = getLine(this, line); }
6136
+ return visualLine(line)
6137
+ },
6138
+
6139
+ lineCount: function() {return this.size},
6140
+ firstLine: function() {return this.first},
6141
+ lastLine: function() {return this.first + this.size - 1},
6142
+
6143
+ clipPos: function(pos) {return clipPos(this, pos)},
6144
+
6145
+ getCursor: function(start) {
6146
+ var range$$1 = this.sel.primary(), pos;
6147
+ if (start == null || start == "head") { pos = range$$1.head; }
6148
+ else if (start == "anchor") { pos = range$$1.anchor; }
6149
+ else if (start == "end" || start == "to" || start === false) { pos = range$$1.to(); }
6150
+ else { pos = range$$1.from(); }
6151
+ return pos
6152
+ },
6153
+ listSelections: function() { return this.sel.ranges },
6154
+ somethingSelected: function() {return this.sel.somethingSelected()},
6155
+
6156
+ setCursor: docMethodOp(function(line, ch, options) {
6157
+ setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options);
6158
+ }),
6159
+ setSelection: docMethodOp(function(anchor, head, options) {
6160
+ setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);
6161
+ }),
6162
+ extendSelection: docMethodOp(function(head, other, options) {
6163
+ extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);
6164
+ }),
6165
+ extendSelections: docMethodOp(function(heads, options) {
6166
+ extendSelections(this, clipPosArray(this, heads), options);
6167
+ }),
6168
+ extendSelectionsBy: docMethodOp(function(f, options) {
6169
+ var heads = map(this.sel.ranges, f);
6170
+ extendSelections(this, clipPosArray(this, heads), options);
6171
+ }),
6172
+ setSelections: docMethodOp(function(ranges, primary, options) {
6173
+ var this$1 = this;
6174
+
6175
+ if (!ranges.length) { return }
6176
+ var out = [];
6177
+ for (var i = 0; i < ranges.length; i++)
6178
+ { out[i] = new Range(clipPos(this$1, ranges[i].anchor),
6179
+ clipPos(this$1, ranges[i].head)); }
6180
+ if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }
6181
+ setSelection(this, normalizeSelection(this.cm, out, primary), options);
6182
+ }),
6183
+ addSelection: docMethodOp(function(anchor, head, options) {
6184
+ var ranges = this.sel.ranges.slice(0);
6185
+ ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));
6186
+ setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);
6187
+ }),
6188
+
6189
+ getSelection: function(lineSep) {
6190
+ var this$1 = this;
6191
+
6192
+ var ranges = this.sel.ranges, lines;
6193
+ for (var i = 0; i < ranges.length; i++) {
6194
+ var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());
6195
+ lines = lines ? lines.concat(sel) : sel;
6196
+ }
6197
+ if (lineSep === false) { return lines }
6198
+ else { return lines.join(lineSep || this.lineSeparator()) }
6199
+ },
6200
+ getSelections: function(lineSep) {
6201
+ var this$1 = this;
6202
+
6203
+ var parts = [], ranges = this.sel.ranges;
6204
+ for (var i = 0; i < ranges.length; i++) {
6205
+ var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());
6206
+ if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }
6207
+ parts[i] = sel;
6208
+ }
6209
+ return parts
6210
+ },
6211
+ replaceSelection: function(code, collapse, origin) {
6212
+ var dup = [];
6213
+ for (var i = 0; i < this.sel.ranges.length; i++)
6214
+ { dup[i] = code; }
6215
+ this.replaceSelections(dup, collapse, origin || "+input");
6216
+ },
6217
+ replaceSelections: docMethodOp(function(code, collapse, origin) {
6218
+ var this$1 = this;
6219
+
6220
+ var changes = [], sel = this.sel;
6221
+ for (var i = 0; i < sel.ranges.length; i++) {
6222
+ var range$$1 = sel.ranges[i];
6223
+ changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};
6224
+ }
6225
+ var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse);
6226
+ for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)
6227
+ { makeChange(this$1, changes[i$1]); }
6228
+ if (newSel) { setSelectionReplaceHistory(this, newSel); }
6229
+ else if (this.cm) { ensureCursorVisible(this.cm); }
6230
+ }),
6231
+ undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}),
6232
+ redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}),
6233
+ undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}),
6234
+ redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}),
6235
+
6236
+ setExtending: function(val) {this.extend = val;},
6237
+ getExtending: function() {return this.extend},
6238
+
6239
+ historySize: function() {
6240
+ var hist = this.history, done = 0, undone = 0;
6241
+ for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }
6242
+ for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }
6243
+ return {undo: done, redo: undone}
6244
+ },
6245
+ clearHistory: function() {this.history = new History(this.history.maxGeneration);},
6246
+
6247
+ markClean: function() {
6248
+ this.cleanGeneration = this.changeGeneration(true);
6249
+ },
6250
+ changeGeneration: function(forceSplit) {
6251
+ if (forceSplit)
6252
+ { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }
6253
+ return this.history.generation
6254
+ },
6255
+ isClean: function (gen) {
6256
+ return this.history.generation == (gen || this.cleanGeneration)
6257
+ },
6258
+
6259
+ getHistory: function() {
6260
+ return {done: copyHistoryArray(this.history.done),
6261
+ undone: copyHistoryArray(this.history.undone)}
6262
+ },
6263
+ setHistory: function(histData) {
6264
+ var hist = this.history = new History(this.history.maxGeneration);
6265
+ hist.done = copyHistoryArray(histData.done.slice(0), null, true);
6266
+ hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);
6267
+ },
6268
+
6269
+ setGutterMarker: docMethodOp(function(line, gutterID, value) {
6270
+ return changeLine(this, line, "gutter", function (line) {
6271
+ var markers = line.gutterMarkers || (line.gutterMarkers = {});
6272
+ markers[gutterID] = value;
6273
+ if (!value && isEmpty(markers)) { line.gutterMarkers = null; }
6274
+ return true
6275
+ })
6276
+ }),
6277
+
6278
+ clearGutter: docMethodOp(function(gutterID) {
6279
+ var this$1 = this;
6280
+
6281
+ this.iter(function (line) {
6282
+ if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
6283
+ changeLine(this$1, line, "gutter", function () {
6284
+ line.gutterMarkers[gutterID] = null;
6285
+ if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }
6286
+ return true
6287
+ });
6288
+ }
6289
+ });
6290
+ }),
6291
+
6292
+ lineInfo: function(line) {
6293
+ var n;
6294
+ if (typeof line == "number") {
6295
+ if (!isLine(this, line)) { return null }
6296
+ n = line;
6297
+ line = getLine(this, line);
6298
+ if (!line) { return null }
6299
+ } else {
6300
+ n = lineNo(line);
6301
+ if (n == null) { return null }
6302
+ }
6303
+ return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
6304
+ textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
6305
+ widgets: line.widgets}
6306
+ },
6307
+
6308
+ addLineClass: docMethodOp(function(handle, where, cls) {
6309
+ return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
6310
+ var prop = where == "text" ? "textClass"
6311
+ : where == "background" ? "bgClass"
6312
+ : where == "gutter" ? "gutterClass" : "wrapClass";
6313
+ if (!line[prop]) { line[prop] = cls; }
6314
+ else if (classTest(cls).test(line[prop])) { return false }
6315
+ else { line[prop] += " " + cls; }
6316
+ return true
6317
+ })
6318
+ }),
6319
+ removeLineClass: docMethodOp(function(handle, where, cls) {
6320
+ return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) {
6321
+ var prop = where == "text" ? "textClass"
6322
+ : where == "background" ? "bgClass"
6323
+ : where == "gutter" ? "gutterClass" : "wrapClass";
6324
+ var cur = line[prop];
6325
+ if (!cur) { return false }
6326
+ else if (cls == null) { line[prop] = null; }
6327
+ else {
6328
+ var found = cur.match(classTest(cls));
6329
+ if (!found) { return false }
6330
+ var end = found.index + found[0].length;
6331
+ line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null;
6332
+ }
6333
+ return true
6334
+ })
6335
+ }),
6336
+
6337
+ addLineWidget: docMethodOp(function(handle, node, options) {
6338
+ return addLineWidget(this, handle, node, options)
6339
+ }),
6340
+ removeLineWidget: function(widget) { widget.clear(); },
6341
+
6342
+ markText: function(from, to, options) {
6343
+ return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range")
6344
+ },
6345
+ setBookmark: function(pos, options) {
6346
+ var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
6347
+ insertLeft: options && options.insertLeft,
6348
+ clearWhenEmpty: false, shared: options && options.shared,
6349
+ handleMouseEvents: options && options.handleMouseEvents};
6350
+ pos = clipPos(this, pos);
6351
+ return markText(this, pos, pos, realOpts, "bookmark")
6352
+ },
6353
+ findMarksAt: function(pos) {
6354
+ pos = clipPos(this, pos);
6355
+ var markers = [], spans = getLine(this, pos.line).markedSpans;
6356
+ if (spans) { for (var i = 0; i < spans.length; ++i) {
6357
+ var span = spans[i];
6358
+ if ((span.from == null || span.from <= pos.ch) &&
6359
+ (span.to == null || span.to >= pos.ch))
6360
+ { markers.push(span.marker.parent || span.marker); }
6361
+ } }
6362
+ return markers
6363
+ },
6364
+ findMarks: function(from, to, filter) {
6365
+ from = clipPos(this, from); to = clipPos(this, to);
6366
+ var found = [], lineNo$$1 = from.line;
6367
+ this.iter(from.line, to.line + 1, function (line) {
6368
+ var spans = line.markedSpans;
6369
+ if (spans) { for (var i = 0; i < spans.length; i++) {
6370
+ var span = spans[i];
6371
+ if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||
6372
+ span.from == null && lineNo$$1 != from.line ||
6373
+ span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&
6374
+ (!filter || filter(span.marker)))
6375
+ { found.push(span.marker.parent || span.marker); }
6376
+ } }
6377
+ ++lineNo$$1;
6378
+ });
6379
+ return found
6380
+ },
6381
+ getAllMarks: function() {
6382
+ var markers = [];
6383
+ this.iter(function (line) {
6384
+ var sps = line.markedSpans;
6385
+ if (sps) { for (var i = 0; i < sps.length; ++i)
6386
+ { if (sps[i].from != null) { markers.push(sps[i].marker); } } }
6387
+ });
6388
+ return markers
6389
+ },
6390
+
6391
+ posFromIndex: function(off) {
6392
+ var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;
6393
+ this.iter(function (line) {
6394
+ var sz = line.text.length + sepSize;
6395
+ if (sz > off) { ch = off; return true }
6396
+ off -= sz;
6397
+ ++lineNo$$1;
6398
+ });
6399
+ return clipPos(this, Pos(lineNo$$1, ch))
6400
+ },
6401
+ indexFromPos: function (coords) {
6402
+ coords = clipPos(this, coords);
6403
+ var index = coords.ch;
6404
+ if (coords.line < this.first || coords.ch < 0) { return 0 }
6405
+ var sepSize = this.lineSeparator().length;
6406
+ this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value
6407
+ index += line.text.length + sepSize;
6408
+ });
6409
+ return index
6410
+ },
6411
+
6412
+ copy: function(copyHistory) {
6413
+ var doc = new Doc(getLines(this, this.first, this.first + this.size),
6414
+ this.modeOption, this.first, this.lineSep, this.direction);
6415
+ doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
6416
+ doc.sel = this.sel;
6417
+ doc.extend = false;
6418
+ if (copyHistory) {
6419
+ doc.history.undoDepth = this.history.undoDepth;
6420
+ doc.setHistory(this.getHistory());
6421
+ }
6422
+ return doc
6423
+ },
6424
+
6425
+ linkedDoc: function(options) {
6426
+ if (!options) { options = {}; }
6427
+ var from = this.first, to = this.first + this.size;
6428
+ if (options.from != null && options.from > from) { from = options.from; }
6429
+ if (options.to != null && options.to < to) { to = options.to; }
6430
+ var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);
6431
+ if (options.sharedHist) { copy.history = this.history
6432
+ ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
6433
+ copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
6434
+ copySharedMarkers(copy, findSharedMarkers(this));
6435
+ return copy
6436
+ },
6437
+ unlinkDoc: function(other) {
6438
+ var this$1 = this;
6439
+
6440
+ if (other instanceof CodeMirror) { other = other.doc; }
6441
+ if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {
6442
+ var link = this$1.linked[i];
6443
+ if (link.doc != other) { continue }
6444
+ this$1.linked.splice(i, 1);
6445
+ other.unlinkDoc(this$1);
6446
+ detachSharedMarkers(findSharedMarkers(this$1));
6447
+ break
6448
+ } }
6449
+ // If the histories were shared, split them again
6450
+ if (other.history == this.history) {
6451
+ var splitIds = [other.id];
6452
+ linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);
6453
+ other.history = new History(null);
6454
+ other.history.done = copyHistoryArray(this.history.done, splitIds);
6455
+ other.history.undone = copyHistoryArray(this.history.undone, splitIds);
6456
+ }
6457
+ },
6458
+ iterLinkedDocs: function(f) {linkedDocs(this, f);},
6459
+
6460
+ getMode: function() {return this.mode},
6461
+ getEditor: function() {return this.cm},
6462
+
6463
+ splitLines: function(str) {
6464
+ if (this.lineSep) { return str.split(this.lineSep) }
6465
+ return splitLinesAuto(str)
6466
+ },
6467
+ lineSeparator: function() { return this.lineSep || "\n" },
6468
+
6469
+ setDirection: docMethodOp(function (dir) {
6470
+ if (dir != "rtl") { dir = "ltr"; }
6471
+ if (dir == this.direction) { return }
6472
+ this.direction = dir;
6473
+ this.iter(function (line) { return line.order = null; });
6474
+ if (this.cm) { directionChanged(this.cm); }
6475
+ })
6476
+ });
6477
+
6478
+ // Public alias.
6479
+ Doc.prototype.eachLine = Doc.prototype.iter;
6480
+
6481
+ // Kludge to work around strange IE behavior where it'll sometimes
6482
+ // re-fire a series of drag-related events right after the drop (#1551)
6483
+ var lastDrop = 0;
6484
+
6485
+ function onDrop(e) {
6486
+ var cm = this;
6487
+ clearDragCursor(cm);
6488
+ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
6489
+ { return }
6490
+ e_preventDefault(e);
6491
+ if (ie) { lastDrop = +new Date; }
6492
+ var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
6493
+ if (!pos || cm.isReadOnly()) { return }
6494
+ // Might be a file drop, in which case we simply extract the text
6495
+ // and insert it.
6496
+ if (files && files.length && window.FileReader && window.File) {
6497
+ var n = files.length, text = Array(n), read = 0;
6498
+ var loadFile = function (file, i) {
6499
+ if (cm.options.allowDropFileTypes &&
6500
+ indexOf(cm.options.allowDropFileTypes, file.type) == -1)
6501
+ { return }
6502
+
6503
+ var reader = new FileReader;
6504
+ reader.onload = operation(cm, function () {
6505
+ var content = reader.result;
6506
+ if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = ""; }
6507
+ text[i] = content;
6508
+ if (++read == n) {
6509
+ pos = clipPos(cm.doc, pos);
6510
+ var change = {from: pos, to: pos,
6511
+ text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),
6512
+ origin: "paste"};
6513
+ makeChange(cm.doc, change);
6514
+ setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));
6515
+ }
6516
+ });
6517
+ reader.readAsText(file);
6518
+ };
6519
+ for (var i = 0; i < n; ++i) { loadFile(files[i], i); }
6520
+ } else { // Normal drop
6521
+ // Don't do a replace if the drop happened inside of the selected text.
6522
+ if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {
6523
+ cm.state.draggingText(e);
6524
+ // Ensure the editor is re-focused
6525
+ setTimeout(function () { return cm.display.input.focus(); }, 20);
6526
+ return
6527
+ }
6528
+ try {
6529
+ var text$1 = e.dataTransfer.getData("Text");
6530
+ if (text$1) {
6531
+ var selected;
6532
+ if (cm.state.draggingText && !cm.state.draggingText.copy)
6533
+ { selected = cm.listSelections(); }
6534
+ setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));
6535
+ if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)
6536
+ { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } }
6537
+ cm.replaceSelection(text$1, "around", "paste");
6538
+ cm.display.input.focus();
6539
+ }
6540
+ }
6541
+ catch(e){}
6542
+ }
6543
+ }
6544
+
6545
+ function onDragStart(cm, e) {
6546
+ if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }
6547
+ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }
6548
+
6549
+ e.dataTransfer.setData("Text", cm.getSelection());
6550
+ e.dataTransfer.effectAllowed = "copyMove";
6551
+
6552
+ // Use dummy image instead of default browsers image.
6553
+ // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
6554
+ if (e.dataTransfer.setDragImage && !safari) {
6555
+ var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
6556
+ img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
6557
+ if (presto) {
6558
+ img.width = img.height = 1;
6559
+ cm.display.wrapper.appendChild(img);
6560
+ // Force a relayout, or Opera won't use our image for some obscure reason
6561
+ img._top = img.offsetTop;
6562
+ }
6563
+ e.dataTransfer.setDragImage(img, 0, 0);
6564
+ if (presto) { img.parentNode.removeChild(img); }
6565
+ }
6566
+ }
6567
+
6568
+ function onDragOver(cm, e) {
6569
+ var pos = posFromMouse(cm, e);
6570
+ if (!pos) { return }
6571
+ var frag = document.createDocumentFragment();
6572
+ drawSelectionCursor(cm, pos, frag);
6573
+ if (!cm.display.dragCursor) {
6574
+ cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors");
6575
+ cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);
6576
+ }
6577
+ removeChildrenAndAdd(cm.display.dragCursor, frag);
6578
+ }
6579
+
6580
+ function clearDragCursor(cm) {
6581
+ if (cm.display.dragCursor) {
6582
+ cm.display.lineSpace.removeChild(cm.display.dragCursor);
6583
+ cm.display.dragCursor = null;
6584
+ }
6585
+ }
6586
+
6587
+ // These must be handled carefully, because naively registering a
6588
+ // handler for each editor will cause the editors to never be
6589
+ // garbage collected.
6590
+
6591
+ function forEachCodeMirror(f) {
6592
+ if (!document.getElementsByClassName) { return }
6593
+ var byClass = document.getElementsByClassName("CodeMirror"), editors = [];
6594
+ for (var i = 0; i < byClass.length; i++) {
6595
+ var cm = byClass[i].CodeMirror;
6596
+ if (cm) { editors.push(cm); }
6597
+ }
6598
+ if (editors.length) { editors[0].operation(function () {
6599
+ for (var i = 0; i < editors.length; i++) { f(editors[i]); }
6600
+ }); }
6601
+ }
6602
+
6603
+ var globalsRegistered = false;
6604
+ function ensureGlobalHandlers() {
6605
+ if (globalsRegistered) { return }
6606
+ registerGlobalHandlers();
6607
+ globalsRegistered = true;
6608
+ }
6609
+ function registerGlobalHandlers() {
6610
+ // When the window resizes, we need to refresh active editors.
6611
+ var resizeTimer;
6612
+ on(window, "resize", function () {
6613
+ if (resizeTimer == null) { resizeTimer = setTimeout(function () {
6614
+ resizeTimer = null;
6615
+ forEachCodeMirror(onResize);
6616
+ }, 100); }
6617
+ });
6618
+ // When the window loses focus, we want to show the editor as blurred
6619
+ on(window, "blur", function () { return forEachCodeMirror(onBlur); });
6620
+ }
6621
+ // Called when the window resizes
6622
+ function onResize(cm) {
6623
+ var d = cm.display;
6624
+ // Might be a text scaling operation, clear size caches.
6625
+ d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
6626
+ d.scrollbarsClipped = false;
6627
+ cm.setSize();
6628
+ }
6629
+
6630
+ var keyNames = {
6631
+ 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
6632
+ 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
6633
+ 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
6634
+ 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
6635
+ 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", 145: "ScrollLock",
6636
+ 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
6637
+ 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
6638
+ 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
6639
+ };
6640
+
6641
+ // Number keys
6642
+ for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }
6643
+ // Alphabetic keys
6644
+ for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }
6645
+ // Function keys
6646
+ for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; }
6647
+
6648
+ var keyMap = {};
6649
+
6650
+ keyMap.basic = {
6651
+ "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
6652
+ "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
6653
+ "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
6654
+ "Tab": "defaultTab", "Shift-Tab": "indentAuto",
6655
+ "Enter": "newlineAndIndent", "Insert": "toggleOverwrite",
6656
+ "Esc": "singleSelection"
6657
+ };
6658
+ // Note that the save and find-related commands aren't defined by
6659
+ // default. User code or addons can define them. Unknown commands
6660
+ // are simply ignored.
6661
+ keyMap.pcDefault = {
6662
+ "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
6663
+ "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown",
6664
+ "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
6665
+ "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
6666
+ "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
6667
+ "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
6668
+ "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection",
6669
+ "fallthrough": "basic"
6670
+ };
6671
+ // Very basic readline/emacs-style bindings, which are standard on Mac.
6672
+ keyMap.emacsy = {
6673
+ "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
6674
+ "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
6675
+ "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
6676
+ "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars",
6677
+ "Ctrl-O": "openLine"
6678
+ };
6679
+ keyMap.macDefault = {
6680
+ "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
6681
+ "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
6682
+ "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore",
6683
+ "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
6684
+ "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
6685
+ "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight",
6686
+ "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd",
6687
+ "fallthrough": ["basic", "emacsy"]
6688
+ };
6689
+ keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault;
6690
+
6691
+ // KEYMAP DISPATCH
6692
+
6693
+ function normalizeKeyName(name) {
6694
+ var parts = name.split(/-(?!$)/);
6695
+ name = parts[parts.length - 1];
6696
+ var alt, ctrl, shift, cmd;
6697
+ for (var i = 0; i < parts.length - 1; i++) {
6698
+ var mod = parts[i];
6699
+ if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }
6700
+ else if (/^a(lt)?$/i.test(mod)) { alt = true; }
6701
+ else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }
6702
+ else if (/^s(hift)?$/i.test(mod)) { shift = true; }
6703
+ else { throw new Error("Unrecognized modifier name: " + mod) }
6704
+ }
6705
+ if (alt) { name = "Alt-" + name; }
6706
+ if (ctrl) { name = "Ctrl-" + name; }
6707
+ if (cmd) { name = "Cmd-" + name; }
6708
+ if (shift) { name = "Shift-" + name; }
6709
+ return name
6710
+ }
6711
+
6712
+ // This is a kludge to keep keymaps mostly working as raw objects
6713
+ // (backwards compatibility) while at the same time support features
6714
+ // like normalization and multi-stroke key bindings. It compiles a
6715
+ // new normalized keymap, and then updates the old object to reflect
6716
+ // this.
6717
+ function normalizeKeyMap(keymap) {
6718
+ var copy = {};
6719
+ for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {
6720
+ var value = keymap[keyname];
6721
+ if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }
6722
+ if (value == "...") { delete keymap[keyname]; continue }
6723
+
6724
+ var keys = map(keyname.split(" "), normalizeKeyName);
6725
+ for (var i = 0; i < keys.length; i++) {
6726
+ var val = (void 0), name = (void 0);
6727
+ if (i == keys.length - 1) {
6728
+ name = keys.join(" ");
6729
+ val = value;
6730
+ } else {
6731
+ name = keys.slice(0, i + 1).join(" ");
6732
+ val = "...";
6733
+ }
6734
+ var prev = copy[name];
6735
+ if (!prev) { copy[name] = val; }
6736
+ else if (prev != val) { throw new Error("Inconsistent bindings for " + name) }
6737
+ }
6738
+ delete keymap[keyname];
6739
+ } }
6740
+ for (var prop in copy) { keymap[prop] = copy[prop]; }
6741
+ return keymap
6742
+ }
6743
+
6744
+ function lookupKey(key, map$$1, handle, context) {
6745
+ map$$1 = getKeyMap(map$$1);
6746
+ var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];
6747
+ if (found === false) { return "nothing" }
6748
+ if (found === "...") { return "multi" }
6749
+ if (found != null && handle(found)) { return "handled" }
6750
+
6751
+ if (map$$1.fallthrough) {
6752
+ if (Object.prototype.toString.call(map$$1.fallthrough) != "[object Array]")
6753
+ { return lookupKey(key, map$$1.fallthrough, handle, context) }
6754
+ for (var i = 0; i < map$$1.fallthrough.length; i++) {
6755
+ var result = lookupKey(key, map$$1.fallthrough[i], handle, context);
6756
+ if (result) { return result }
6757
+ }
6758
+ }
6759
+ }
6760
+
6761
+ // Modifier key presses don't count as 'real' key presses for the
6762
+ // purpose of keymap fallthrough.
6763
+ function isModifierKey(value) {
6764
+ var name = typeof value == "string" ? value : keyNames[value.keyCode];
6765
+ return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
6766
+ }
6767
+
6768
+ function addModifierNames(name, event, noShift) {
6769
+ var base = name;
6770
+ if (event.altKey && base != "Alt") { name = "Alt-" + name; }
6771
+ if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; }
6772
+ if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; }
6773
+ if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; }
6774
+ return name
6775
+ }
6776
+
6777
+ // Look up the name of a key as indicated by an event object.
6778
+ function keyName(event, noShift) {
6779
+ if (presto && event.keyCode == 34 && event["char"]) { return false }
6780
+ var name = keyNames[event.keyCode];
6781
+ if (name == null || event.altGraphKey) { return false }
6782
+ // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,
6783
+ // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)
6784
+ if (event.keyCode == 3 && event.code) { name = event.code; }
6785
+ return addModifierNames(name, event, noShift)
6786
+ }
6787
+
6788
+ function getKeyMap(val) {
6789
+ return typeof val == "string" ? keyMap[val] : val
6790
+ }
6791
+
6792
+ // Helper for deleting text near the selection(s), used to implement
6793
+ // backspace, delete, and similar functionality.
6794
+ function deleteNearSelection(cm, compute) {
6795
+ var ranges = cm.doc.sel.ranges, kill = [];
6796
+ // Build up a set of ranges to kill first, merging overlapping
6797
+ // ranges.
6798
+ for (var i = 0; i < ranges.length; i++) {
6799
+ var toKill = compute(ranges[i]);
6800
+ while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {
6801
+ var replaced = kill.pop();
6802
+ if (cmp(replaced.from, toKill.from) < 0) {
6803
+ toKill.from = replaced.from;
6804
+ break
6805
+ }
6806
+ }
6807
+ kill.push(toKill);
6808
+ }
6809
+ // Next, remove those actual ranges.
6810
+ runInOp(cm, function () {
6811
+ for (var i = kill.length - 1; i >= 0; i--)
6812
+ { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); }
6813
+ ensureCursorVisible(cm);
6814
+ });
6815
+ }
6816
+
6817
+ function moveCharLogically(line, ch, dir) {
6818
+ var target = skipExtendingChars(line.text, ch + dir, dir);
6819
+ return target < 0 || target > line.text.length ? null : target
6820
+ }
6821
+
6822
+ function moveLogically(line, start, dir) {
6823
+ var ch = moveCharLogically(line, start.ch, dir);
6824
+ return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
6825
+ }
6826
+
6827
+ function endOfLine(visually, cm, lineObj, lineNo, dir) {
6828
+ if (visually) {
6829
+ var order = getOrder(lineObj, cm.doc.direction);
6830
+ if (order) {
6831
+ var part = dir < 0 ? lst(order) : order[0];
6832
+ var moveInStorageOrder = (dir < 0) == (part.level == 1);
6833
+ var sticky = moveInStorageOrder ? "after" : "before";
6834
+ var ch;
6835
+ // With a wrapped rtl chunk (possibly spanning multiple bidi parts),
6836
+ // it could be that the last bidi part is not on the last visual line,
6837
+ // since visual lines contain content order-consecutive chunks.
6838
+ // Thus, in rtl, we are looking for the first (content-order) character
6839
+ // in the rtl chunk that is on the last line (that is, the same line
6840
+ // as the last (content-order) character).
6841
+ if (part.level > 0 || cm.doc.direction == "rtl") {
6842
+ var prep = prepareMeasureForLine(cm, lineObj);
6843
+ ch = dir < 0 ? lineObj.text.length - 1 : 0;
6844
+ var targetTop = measureCharPrepared(cm, prep, ch).top;
6845
+ ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);
6846
+ if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); }
6847
+ } else { ch = dir < 0 ? part.to : part.from; }
6848
+ return new Pos(lineNo, ch, sticky)
6849
+ }
6850
+ }
6851
+ return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
6852
+ }
6853
+
6854
+ function moveVisually(cm, line, start, dir) {
6855
+ var bidi = getOrder(line, cm.doc.direction);
6856
+ if (!bidi) { return moveLogically(line, start, dir) }
6857
+ if (start.ch >= line.text.length) {
6858
+ start.ch = line.text.length;
6859
+ start.sticky = "before";
6860
+ } else if (start.ch <= 0) {
6861
+ start.ch = 0;
6862
+ start.sticky = "after";
6863
+ }
6864
+ var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];
6865
+ if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
6866
+ // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,
6867
+ // nothing interesting happens.
6868
+ return moveLogically(line, start, dir)
6869
+ }
6870
+
6871
+ var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };
6872
+ var prep;
6873
+ var getWrappedLineExtent = function (ch) {
6874
+ if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
6875
+ prep = prep || prepareMeasureForLine(cm, line);
6876
+ return wrappedLineExtentChar(cm, line, prep, ch)
6877
+ };
6878
+ var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch);
6879
+
6880
+ if (cm.doc.direction == "rtl" || part.level == 1) {
6881
+ var moveInStorageOrder = (part.level == 1) == (dir < 0);
6882
+ var ch = mv(start, moveInStorageOrder ? 1 : -1);
6883
+ if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
6884
+ // Case 2: We move within an rtl part or in an rtl editor on the same visual line
6885
+ var sticky = moveInStorageOrder ? "before" : "after";
6886
+ return new Pos(start.line, ch, sticky)
6887
+ }
6888
+ }
6889
+
6890
+ // Case 3: Could not move within this bidi part in this visual line, so leave
6891
+ // the current bidi part
6892
+
6893
+ var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
6894
+ var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
6895
+ ? new Pos(start.line, mv(ch, 1), "before")
6896
+ : new Pos(start.line, ch, "after"); };
6897
+
6898
+ for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
6899
+ var part = bidi[partPos];
6900
+ var moveInStorageOrder = (dir > 0) == (part.level != 1);
6901
+ var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);
6902
+ if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
6903
+ ch = moveInStorageOrder ? part.from : mv(part.to, -1);
6904
+ if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
6905
+ }
6906
+ };
6907
+
6908
+ // Case 3a: Look for other bidi parts on the same visual line
6909
+ var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);
6910
+ if (res) { return res }
6911
+
6912
+ // Case 3b: Look for other bidi parts on the next visual line
6913
+ var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);
6914
+ if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
6915
+ res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));
6916
+ if (res) { return res }
6917
+ }
6918
+
6919
+ // Case 4: Nowhere to move
6920
+ return null
6921
+ }
6922
+
6923
+ // Commands are parameter-less actions that can be performed on an
6924
+ // editor, mostly used for keybindings.
6925
+ var commands = {
6926
+ selectAll: selectAll,
6927
+ singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); },
6928
+ killLine: function (cm) { return deleteNearSelection(cm, function (range) {
6929
+ if (range.empty()) {
6930
+ var len = getLine(cm.doc, range.head.line).text.length;
6931
+ if (range.head.ch == len && range.head.line < cm.lastLine())
6932
+ { return {from: range.head, to: Pos(range.head.line + 1, 0)} }
6933
+ else
6934
+ { return {from: range.head, to: Pos(range.head.line, len)} }
6935
+ } else {
6936
+ return {from: range.from(), to: range.to()}
6937
+ }
6938
+ }); },
6939
+ deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({
6940
+ from: Pos(range.from().line, 0),
6941
+ to: clipPos(cm.doc, Pos(range.to().line + 1, 0))
6942
+ }); }); },
6943
+ delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({
6944
+ from: Pos(range.from().line, 0), to: range.from()
6945
+ }); }); },
6946
+ delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {
6947
+ var top = cm.charCoords(range.head, "div").top + 5;
6948
+ var leftPos = cm.coordsChar({left: 0, top: top}, "div");
6949
+ return {from: leftPos, to: range.from()}
6950
+ }); },
6951
+ delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {
6952
+ var top = cm.charCoords(range.head, "div").top + 5;
6953
+ var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div");
6954
+ return {from: range.from(), to: rightPos }
6955
+ }); },
6956
+ undo: function (cm) { return cm.undo(); },
6957
+ redo: function (cm) { return cm.redo(); },
6958
+ undoSelection: function (cm) { return cm.undoSelection(); },
6959
+ redoSelection: function (cm) { return cm.redoSelection(); },
6960
+ goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },
6961
+ goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },
6962
+ goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },
6963
+ {origin: "+move", bias: 1}
6964
+ ); },
6965
+ goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },
6966
+ {origin: "+move", bias: 1}
6967
+ ); },
6968
+ goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },
6969
+ {origin: "+move", bias: -1}
6970
+ ); },
6971
+ goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
6972
+ var top = cm.cursorCoords(range.head, "div").top + 5;
6973
+ return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
6974
+ }, sel_move); },
6975
+ goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
6976
+ var top = cm.cursorCoords(range.head, "div").top + 5;
6977
+ return cm.coordsChar({left: 0, top: top}, "div")
6978
+ }, sel_move); },
6979
+ goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
6980
+ var top = cm.cursorCoords(range.head, "div").top + 5;
6981
+ var pos = cm.coordsChar({left: 0, top: top}, "div");
6982
+ if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
6983
+ return pos
6984
+ }, sel_move); },
6985
+ goLineUp: function (cm) { return cm.moveV(-1, "line"); },
6986
+ goLineDown: function (cm) { return cm.moveV(1, "line"); },
6987
+ goPageUp: function (cm) { return cm.moveV(-1, "page"); },
6988
+ goPageDown: function (cm) { return cm.moveV(1, "page"); },
6989
+ goCharLeft: function (cm) { return cm.moveH(-1, "char"); },
6990
+ goCharRight: function (cm) { return cm.moveH(1, "char"); },
6991
+ goColumnLeft: function (cm) { return cm.moveH(-1, "column"); },
6992
+ goColumnRight: function (cm) { return cm.moveH(1, "column"); },
6993
+ goWordLeft: function (cm) { return cm.moveH(-1, "word"); },
6994
+ goGroupRight: function (cm) { return cm.moveH(1, "group"); },
6995
+ goGroupLeft: function (cm) { return cm.moveH(-1, "group"); },
6996
+ goWordRight: function (cm) { return cm.moveH(1, "word"); },
6997
+ delCharBefore: function (cm) { return cm.deleteH(-1, "char"); },
6998
+ delCharAfter: function (cm) { return cm.deleteH(1, "char"); },
6999
+ delWordBefore: function (cm) { return cm.deleteH(-1, "word"); },
7000
+ delWordAfter: function (cm) { return cm.deleteH(1, "word"); },
7001
+ delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); },
7002
+ delGroupAfter: function (cm) { return cm.deleteH(1, "group"); },
7003
+ indentAuto: function (cm) { return cm.indentSelection("smart"); },
7004
+ indentMore: function (cm) { return cm.indentSelection("add"); },
7005
+ indentLess: function (cm) { return cm.indentSelection("subtract"); },
7006
+ insertTab: function (cm) { return cm.replaceSelection("\t"); },
7007
+ insertSoftTab: function (cm) {
7008
+ var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;
7009
+ for (var i = 0; i < ranges.length; i++) {
7010
+ var pos = ranges[i].from();
7011
+ var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);
7012
+ spaces.push(spaceStr(tabSize - col % tabSize));
7013
+ }
7014
+ cm.replaceSelections(spaces);
7015
+ },
7016
+ defaultTab: function (cm) {
7017
+ if (cm.somethingSelected()) { cm.indentSelection("add"); }
7018
+ else { cm.execCommand("insertTab"); }
7019
+ },
7020
+ // Swap the two chars left and right of each selection's head.
7021
+ // Move cursor behind the two swapped characters afterwards.
7022
+ //
7023
+ // Doesn't consider line feeds a character.
7024
+ // Doesn't scan more than one line above to find a character.
7025
+ // Doesn't do anything on an empty line.
7026
+ // Doesn't do anything with non-empty selections.
7027
+ transposeChars: function (cm) { return runInOp(cm, function () {
7028
+ var ranges = cm.listSelections(), newSel = [];
7029
+ for (var i = 0; i < ranges.length; i++) {
7030
+ if (!ranges[i].empty()) { continue }
7031
+ var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;
7032
+ if (line) {
7033
+ if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }
7034
+ if (cur.ch > 0) {
7035
+ cur = new Pos(cur.line, cur.ch + 1);
7036
+ cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),
7037
+ Pos(cur.line, cur.ch - 2), cur, "+transpose");
7038
+ } else if (cur.line > cm.doc.first) {
7039
+ var prev = getLine(cm.doc, cur.line - 1).text;
7040
+ if (prev) {
7041
+ cur = new Pos(cur.line, 1);
7042
+ cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +
7043
+ prev.charAt(prev.length - 1),
7044
+ Pos(cur.line - 1, prev.length - 1), cur, "+transpose");
7045
+ }
7046
+ }
7047
+ }
7048
+ newSel.push(new Range(cur, cur));
7049
+ }
7050
+ cm.setSelections(newSel);
7051
+ }); },
7052
+ newlineAndIndent: function (cm) { return runInOp(cm, function () {
7053
+ var sels = cm.listSelections();
7054
+ for (var i = sels.length - 1; i >= 0; i--)
7055
+ { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); }
7056
+ sels = cm.listSelections();
7057
+ for (var i$1 = 0; i$1 < sels.length; i$1++)
7058
+ { cm.indentLine(sels[i$1].from().line, null, true); }
7059
+ ensureCursorVisible(cm);
7060
+ }); },
7061
+ openLine: function (cm) { return cm.replaceSelection("\n", "start"); },
7062
+ toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }
7063
+ };
7064
+
7065
+
7066
+ function lineStart(cm, lineN) {
7067
+ var line = getLine(cm.doc, lineN);
7068
+ var visual = visualLine(line);
7069
+ if (visual != line) { lineN = lineNo(visual); }
7070
+ return endOfLine(true, cm, visual, lineN, 1)
7071
+ }
7072
+ function lineEnd(cm, lineN) {
7073
+ var line = getLine(cm.doc, lineN);
7074
+ var visual = visualLineEnd(line);
7075
+ if (visual != line) { lineN = lineNo(visual); }
7076
+ return endOfLine(true, cm, line, lineN, -1)
7077
+ }
7078
+ function lineStartSmart(cm, pos) {
7079
+ var start = lineStart(cm, pos.line);
7080
+ var line = getLine(cm.doc, start.line);
7081
+ var order = getOrder(line, cm.doc.direction);
7082
+ if (!order || order[0].level == 0) {
7083
+ var firstNonWS = Math.max(0, line.text.search(/\S/));
7084
+ var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;
7085
+ return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)
7086
+ }
7087
+ return start
7088
+ }
7089
+
7090
+ // Run a handler that was bound to a key.
7091
+ function doHandleBinding(cm, bound, dropShift) {
7092
+ if (typeof bound == "string") {
7093
+ bound = commands[bound];
7094
+ if (!bound) { return false }
7095
+ }
7096
+ // Ensure previous input has been read, so that the handler sees a
7097
+ // consistent view of the document
7098
+ cm.display.input.ensurePolled();
7099
+ var prevShift = cm.display.shift, done = false;
7100
+ try {
7101
+ if (cm.isReadOnly()) { cm.state.suppressEdits = true; }
7102
+ if (dropShift) { cm.display.shift = false; }
7103
+ done = bound(cm) != Pass;
7104
+ } finally {
7105
+ cm.display.shift = prevShift;
7106
+ cm.state.suppressEdits = false;
7107
+ }
7108
+ return done
7109
+ }
7110
+
7111
+ function lookupKeyForEditor(cm, name, handle) {
7112
+ for (var i = 0; i < cm.state.keyMaps.length; i++) {
7113
+ var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);
7114
+ if (result) { return result }
7115
+ }
7116
+ return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))
7117
+ || lookupKey(name, cm.options.keyMap, handle, cm)
7118
+ }
7119
+
7120
+ // Note that, despite the name, this function is also used to check
7121
+ // for bound mouse clicks.
7122
+
7123
+ var stopSeq = new Delayed;
7124
+
7125
+ function dispatchKey(cm, name, e, handle) {
7126
+ var seq = cm.state.keySeq;
7127
+ if (seq) {
7128
+ if (isModifierKey(name)) { return "handled" }
7129
+ if (/\'$/.test(name))
7130
+ { cm.state.keySeq = null; }
7131
+ else
7132
+ { stopSeq.set(50, function () {
7133
+ if (cm.state.keySeq == seq) {
7134
+ cm.state.keySeq = null;
7135
+ cm.display.input.reset();
7136
+ }
7137
+ }); }
7138
+ if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true }
7139
+ }
7140
+ return dispatchKeyInner(cm, name, e, handle)
7141
+ }
7142
+
7143
+ function dispatchKeyInner(cm, name, e, handle) {
7144
+ var result = lookupKeyForEditor(cm, name, handle);
7145
+
7146
+ if (result == "multi")
7147
+ { cm.state.keySeq = name; }
7148
+ if (result == "handled")
7149
+ { signalLater(cm, "keyHandled", cm, name, e); }
7150
+
7151
+ if (result == "handled" || result == "multi") {
7152
+ e_preventDefault(e);
7153
+ restartBlink(cm);
7154
+ }
7155
+
7156
+ return !!result
7157
+ }
7158
+
7159
+ // Handle a key from the keydown event.
7160
+ function handleKeyBinding(cm, e) {
7161
+ var name = keyName(e, true);
7162
+ if (!name) { return false }
7163
+
7164
+ if (e.shiftKey && !cm.state.keySeq) {
7165
+ // First try to resolve full name (including 'Shift-'). Failing
7166
+ // that, see if there is a cursor-motion command (starting with
7167
+ // 'go') bound to the keyname without 'Shift-'.
7168
+ return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
7169
+ || dispatchKey(cm, name, e, function (b) {
7170
+ if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
7171
+ { return doHandleBinding(cm, b) }
7172
+ })
7173
+ } else {
7174
+ return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
7175
+ }
7176
+ }
7177
+
7178
+ // Handle a key from the keypress event
7179
+ function handleCharBinding(cm, e, ch) {
7180
+ return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); })
7181
+ }
7182
+
7183
+ var lastStoppedKey = null;
7184
+ function onKeyDown(e) {
7185
+ var cm = this;
7186
+ cm.curOp.focus = activeElt();
7187
+ if (signalDOMEvent(cm, e)) { return }
7188
+ // IE does strange things with escape.
7189
+ if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }
7190
+ var code = e.keyCode;
7191
+ cm.display.shift = code == 16 || e.shiftKey;
7192
+ var handled = handleKeyBinding(cm, e);
7193
+ if (presto) {
7194
+ lastStoppedKey = handled ? code : null;
7195
+ // Opera has no cut event... we try to at least catch the key combo
7196
+ if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
7197
+ { cm.replaceSelection("", null, "cut"); }
7198
+ }
7199
+
7200
+ // Turn mouse into crosshair when Alt is held on Mac.
7201
+ if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
7202
+ { showCrossHair(cm); }
7203
+ }
7204
+
7205
+ function showCrossHair(cm) {
7206
+ var lineDiv = cm.display.lineDiv;
7207
+ addClass(lineDiv, "CodeMirror-crosshair");
7208
+
7209
+ function up(e) {
7210
+ if (e.keyCode == 18 || !e.altKey) {
7211
+ rmClass(lineDiv, "CodeMirror-crosshair");
7212
+ off(document, "keyup", up);
7213
+ off(document, "mouseover", up);
7214
+ }
7215
+ }
7216
+ on(document, "keyup", up);
7217
+ on(document, "mouseover", up);
7218
+ }
7219
+
7220
+ function onKeyUp(e) {
7221
+ if (e.keyCode == 16) { this.doc.sel.shift = false; }
7222
+ signalDOMEvent(this, e);
7223
+ }
7224
+
7225
+ function onKeyPress(e) {
7226
+ var cm = this;
7227
+ if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
7228
+ var keyCode = e.keyCode, charCode = e.charCode;
7229
+ if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
7230
+ if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
7231
+ var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
7232
+ // Some browsers fire keypress events for backspace
7233
+ if (ch == "\x08") { return }
7234
+ if (handleCharBinding(cm, e, ch)) { return }
7235
+ cm.display.input.onKeyPress(e);
7236
+ }
7237
+
7238
+ var DOUBLECLICK_DELAY = 400;
7239
+
7240
+ var PastClick = function(time, pos, button) {
7241
+ this.time = time;
7242
+ this.pos = pos;
7243
+ this.button = button;
7244
+ };
7245
+
7246
+ PastClick.prototype.compare = function (time, pos, button) {
7247
+ return this.time + DOUBLECLICK_DELAY > time &&
7248
+ cmp(pos, this.pos) == 0 && button == this.button
7249
+ };
7250
+
7251
+ var lastClick, lastDoubleClick;
7252
+ function clickRepeat(pos, button) {
7253
+ var now = +new Date;
7254
+ if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {
7255
+ lastClick = lastDoubleClick = null;
7256
+ return "triple"
7257
+ } else if (lastClick && lastClick.compare(now, pos, button)) {
7258
+ lastDoubleClick = new PastClick(now, pos, button);
7259
+ lastClick = null;
7260
+ return "double"
7261
+ } else {
7262
+ lastClick = new PastClick(now, pos, button);
7263
+ lastDoubleClick = null;
7264
+ return "single"
7265
+ }
7266
+ }
7267
+
7268
+ // A mouse down can be a single click, double click, triple click,
7269
+ // start of selection drag, start of text drag, new cursor
7270
+ // (ctrl-click), rectangle drag (alt-drag), or xwin
7271
+ // middle-click-paste. Or it might be a click on something we should
7272
+ // not interfere with, such as a scrollbar or widget.
7273
+ function onMouseDown(e) {
7274
+ var cm = this, display = cm.display;
7275
+ if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
7276
+ display.input.ensurePolled();
7277
+ display.shift = e.shiftKey;
7278
+
7279
+ if (eventInWidget(display, e)) {
7280
+ if (!webkit) {
7281
+ // Briefly turn off draggability, to allow widgets to do
7282
+ // normal dragging things.
7283
+ display.scroller.draggable = false;
7284
+ setTimeout(function () { return display.scroller.draggable = true; }, 100);
7285
+ }
7286
+ return
7287
+ }
7288
+ if (clickInGutter(cm, e)) { return }
7289
+ var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single";
7290
+ window.focus();
7291
+
7292
+ // #3261: make sure, that we're not starting a second selection
7293
+ if (button == 1 && cm.state.selectingText)
7294
+ { cm.state.selectingText(e); }
7295
+
7296
+ if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }
7297
+
7298
+ if (button == 1) {
7299
+ if (pos) { leftButtonDown(cm, pos, repeat, e); }
7300
+ else if (e_target(e) == display.scroller) { e_preventDefault(e); }
7301
+ } else if (button == 2) {
7302
+ if (pos) { extendSelection(cm.doc, pos); }
7303
+ setTimeout(function () { return display.input.focus(); }, 20);
7304
+ } else if (button == 3) {
7305
+ if (captureRightClick) { cm.display.input.onContextMenu(e); }
7306
+ else { delayBlurEvent(cm); }
7307
+ }
7308
+ }
7309
+
7310
+ function handleMappedButton(cm, button, pos, repeat, event) {
7311
+ var name = "Click";
7312
+ if (repeat == "double") { name = "Double" + name; }
7313
+ else if (repeat == "triple") { name = "Triple" + name; }
7314
+ name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name;
7315
+
7316
+ return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {
7317
+ if (typeof bound == "string") { bound = commands[bound]; }
7318
+ if (!bound) { return false }
7319
+ var done = false;
7320
+ try {
7321
+ if (cm.isReadOnly()) { cm.state.suppressEdits = true; }
7322
+ done = bound(cm, pos) != Pass;
7323
+ } finally {
7324
+ cm.state.suppressEdits = false;
7325
+ }
7326
+ return done
7327
+ })
7328
+ }
7329
+
7330
+ function configureMouse(cm, repeat, event) {
7331
+ var option = cm.getOption("configureMouse");
7332
+ var value = option ? option(cm, repeat, event) : {};
7333
+ if (value.unit == null) {
7334
+ var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;
7335
+ value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line";
7336
+ }
7337
+ if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }
7338
+ if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }
7339
+ if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }
7340
+ return value
7341
+ }
7342
+
7343
+ function leftButtonDown(cm, pos, repeat, event) {
7344
+ if (ie) { setTimeout(bind(ensureFocus, cm), 0); }
7345
+ else { cm.curOp.focus = activeElt(); }
7346
+
7347
+ var behavior = configureMouse(cm, repeat, event);
7348
+
7349
+ var sel = cm.doc.sel, contained;
7350
+ if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
7351
+ repeat == "single" && (contained = sel.contains(pos)) > -1 &&
7352
+ (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&
7353
+ (cmp(contained.to(), pos) > 0 || pos.xRel < 0))
7354
+ { leftButtonStartDrag(cm, event, pos, behavior); }
7355
+ else
7356
+ { leftButtonSelect(cm, event, pos, behavior); }
7357
+ }
7358
+
7359
+ // Start a text drag. When it ends, see if any dragging actually
7360
+ // happen, and treat as a click if it didn't.
7361
+ function leftButtonStartDrag(cm, event, pos, behavior) {
7362
+ var display = cm.display, moved = false;
7363
+ var dragEnd = operation(cm, function (e) {
7364
+ if (webkit) { display.scroller.draggable = false; }
7365
+ cm.state.draggingText = false;
7366
+ off(display.wrapper.ownerDocument, "mouseup", dragEnd);
7367
+ off(display.wrapper.ownerDocument, "mousemove", mouseMove);
7368
+ off(display.scroller, "dragstart", dragStart);
7369
+ off(display.scroller, "drop", dragEnd);
7370
+ if (!moved) {
7371
+ e_preventDefault(e);
7372
+ if (!behavior.addNew)
7373
+ { extendSelection(cm.doc, pos, null, null, behavior.extend); }
7374
+ // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
7375
+ if (webkit || ie && ie_version == 9)
7376
+ { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }
7377
+ else
7378
+ { display.input.focus(); }
7379
+ }
7380
+ });
7381
+ var mouseMove = function(e2) {
7382
+ moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;
7383
+ };
7384
+ var dragStart = function () { return moved = true; };
7385
+ // Let the drag handler handle this.
7386
+ if (webkit) { display.scroller.draggable = true; }
7387
+ cm.state.draggingText = dragEnd;
7388
+ dragEnd.copy = !behavior.moveOnDrag;
7389
+ // IE's approach to draggable
7390
+ if (display.scroller.dragDrop) { display.scroller.dragDrop(); }
7391
+ on(display.wrapper.ownerDocument, "mouseup", dragEnd);
7392
+ on(display.wrapper.ownerDocument, "mousemove", mouseMove);
7393
+ on(display.scroller, "dragstart", dragStart);
7394
+ on(display.scroller, "drop", dragEnd);
7395
+
7396
+ delayBlurEvent(cm);
7397
+ setTimeout(function () { return display.input.focus(); }, 20);
7398
+ }
7399
+
7400
+ function rangeForUnit(cm, pos, unit) {
7401
+ if (unit == "char") { return new Range(pos, pos) }
7402
+ if (unit == "word") { return cm.findWordAt(pos) }
7403
+ if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
7404
+ var result = unit(cm, pos);
7405
+ return new Range(result.from, result.to)
7406
+ }
7407
+
7408
+ // Normal selection, as opposed to text dragging.
7409
+ function leftButtonSelect(cm, event, start, behavior) {
7410
+ var display = cm.display, doc = cm.doc;
7411
+ e_preventDefault(event);
7412
+
7413
+ var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
7414
+ if (behavior.addNew && !behavior.extend) {
7415
+ ourIndex = doc.sel.contains(start);
7416
+ if (ourIndex > -1)
7417
+ { ourRange = ranges[ourIndex]; }
7418
+ else
7419
+ { ourRange = new Range(start, start); }
7420
+ } else {
7421
+ ourRange = doc.sel.primary();
7422
+ ourIndex = doc.sel.primIndex;
7423
+ }
7424
+
7425
+ if (behavior.unit == "rectangle") {
7426
+ if (!behavior.addNew) { ourRange = new Range(start, start); }
7427
+ start = posFromMouse(cm, event, true, true);
7428
+ ourIndex = -1;
7429
+ } else {
7430
+ var range$$1 = rangeForUnit(cm, start, behavior.unit);
7431
+ if (behavior.extend)
7432
+ { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }
7433
+ else
7434
+ { ourRange = range$$1; }
7435
+ }
7436
+
7437
+ if (!behavior.addNew) {
7438
+ ourIndex = 0;
7439
+ setSelection(doc, new Selection([ourRange], 0), sel_mouse);
7440
+ startSel = doc.sel;
7441
+ } else if (ourIndex == -1) {
7442
+ ourIndex = ranges.length;
7443
+ setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
7444
+ {scroll: false, origin: "*mouse"});
7445
+ } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
7446
+ setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
7447
+ {scroll: false, origin: "*mouse"});
7448
+ startSel = doc.sel;
7449
+ } else {
7450
+ replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
7451
+ }
7452
+
7453
+ var lastPos = start;
7454
+ function extendTo(pos) {
7455
+ if (cmp(lastPos, pos) == 0) { return }
7456
+ lastPos = pos;
7457
+
7458
+ if (behavior.unit == "rectangle") {
7459
+ var ranges = [], tabSize = cm.options.tabSize;
7460
+ var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
7461
+ var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
7462
+ var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);
7463
+ for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
7464
+ line <= end; line++) {
7465
+ var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);
7466
+ if (left == right)
7467
+ { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }
7468
+ else if (text.length > leftPos)
7469
+ { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }
7470
+ }
7471
+ if (!ranges.length) { ranges.push(new Range(start, start)); }
7472
+ setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
7473
+ {origin: "*mouse", scroll: false});
7474
+ cm.scrollIntoView(pos);
7475
+ } else {
7476
+ var oldRange = ourRange;
7477
+ var range$$1 = rangeForUnit(cm, pos, behavior.unit);
7478
+ var anchor = oldRange.anchor, head;
7479
+ if (cmp(range$$1.anchor, anchor) > 0) {
7480
+ head = range$$1.head;
7481
+ anchor = minPos(oldRange.from(), range$$1.anchor);
7482
+ } else {
7483
+ head = range$$1.anchor;
7484
+ anchor = maxPos(oldRange.to(), range$$1.head);
7485
+ }
7486
+ var ranges$1 = startSel.ranges.slice(0);
7487
+ ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));
7488
+ setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
7489
+ }
7490
+ }
7491
+
7492
+ var editorSize = display.wrapper.getBoundingClientRect();
7493
+ // Used to ensure timeout re-tries don't fire when another extend
7494
+ // happened in the meantime (clearTimeout isn't reliable -- at
7495
+ // least on Chrome, the timeouts still happen even when cleared,
7496
+ // if the clear happens after their scheduled firing time).
7497
+ var counter = 0;
7498
+
7499
+ function extend(e) {
7500
+ var curCount = ++counter;
7501
+ var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle");
7502
+ if (!cur) { return }
7503
+ if (cmp(cur, lastPos) != 0) {
7504
+ cm.curOp.focus = activeElt();
7505
+ extendTo(cur);
7506
+ var visible = visibleLines(display, doc);
7507
+ if (cur.line >= visible.to || cur.line < visible.from)
7508
+ { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }
7509
+ } else {
7510
+ var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
7511
+ if (outside) { setTimeout(operation(cm, function () {
7512
+ if (counter != curCount) { return }
7513
+ display.scroller.scrollTop += outside;
7514
+ extend(e);
7515
+ }), 50); }
7516
+ }
7517
+ }
7518
+
7519
+ function done(e) {
7520
+ cm.state.selectingText = false;
7521
+ counter = Infinity;
7522
+ e_preventDefault(e);
7523
+ display.input.focus();
7524
+ off(display.wrapper.ownerDocument, "mousemove", move);
7525
+ off(display.wrapper.ownerDocument, "mouseup", up);
7526
+ doc.history.lastSelOrigin = null;
7527
+ }
7528
+
7529
+ var move = operation(cm, function (e) {
7530
+ if (e.buttons === 0 || !e_button(e)) { done(e); }
7531
+ else { extend(e); }
7532
+ });
7533
+ var up = operation(cm, done);
7534
+ cm.state.selectingText = up;
7535
+ on(display.wrapper.ownerDocument, "mousemove", move);
7536
+ on(display.wrapper.ownerDocument, "mouseup", up);
7537
+ }
7538
+
7539
+ // Used when mouse-selecting to adjust the anchor to the proper side
7540
+ // of a bidi jump depending on the visual position of the head.
7541
+ function bidiSimplify(cm, range$$1) {
7542
+ var anchor = range$$1.anchor;
7543
+ var head = range$$1.head;
7544
+ var anchorLine = getLine(cm.doc, anchor.line);
7545
+ if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }
7546
+ var order = getOrder(anchorLine);
7547
+ if (!order) { return range$$1 }
7548
+ var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];
7549
+ if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }
7550
+ var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);
7551
+ if (boundary == 0 || boundary == order.length) { return range$$1 }
7552
+
7553
+ // Compute the relative visual position of the head compared to the
7554
+ // anchor (<0 is to the left, >0 to the right)
7555
+ var leftSide;
7556
+ if (head.line != anchor.line) {
7557
+ leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0;
7558
+ } else {
7559
+ var headIndex = getBidiPartAt(order, head.ch, head.sticky);
7560
+ var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);
7561
+ if (headIndex == boundary - 1 || headIndex == boundary)
7562
+ { leftSide = dir < 0; }
7563
+ else
7564
+ { leftSide = dir > 0; }
7565
+ }
7566
+
7567
+ var usePart = order[boundary + (leftSide ? -1 : 0)];
7568
+ var from = leftSide == (usePart.level == 1);
7569
+ var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before";
7570
+ return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)
7571
+ }
7572
+
7573
+
7574
+ // Determines whether an event happened in the gutter, and fires the
7575
+ // handlers for the corresponding event.
7576
+ function gutterEvent(cm, e, type, prevent) {
7577
+ var mX, mY;
7578
+ if (e.touches) {
7579
+ mX = e.touches[0].clientX;
7580
+ mY = e.touches[0].clientY;
7581
+ } else {
7582
+ try { mX = e.clientX; mY = e.clientY; }
7583
+ catch(e) { return false }
7584
+ }
7585
+ if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
7586
+ if (prevent) { e_preventDefault(e); }
7587
+
7588
+ var display = cm.display;
7589
+ var lineBox = display.lineDiv.getBoundingClientRect();
7590
+
7591
+ if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
7592
+ mY -= lineBox.top - display.viewOffset;
7593
+
7594
+ for (var i = 0; i < cm.options.gutters.length; ++i) {
7595
+ var g = display.gutters.childNodes[i];
7596
+ if (g && g.getBoundingClientRect().right >= mX) {
7597
+ var line = lineAtHeight(cm.doc, mY);
7598
+ var gutter = cm.options.gutters[i];
7599
+ signal(cm, type, cm, line, gutter, e);
7600
+ return e_defaultPrevented(e)
7601
+ }
7602
+ }
7603
+ }
7604
+
7605
+ function clickInGutter(cm, e) {
7606
+ return gutterEvent(cm, e, "gutterClick", true)
7607
+ }
7608
+
7609
+ // CONTEXT MENU HANDLING
7610
+
7611
+ // To make the context menu work, we need to briefly unhide the
7612
+ // textarea (making it as unobtrusive as possible) to let the
7613
+ // right-click take effect on it.
7614
+ function onContextMenu(cm, e) {
7615
+ if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }
7616
+ if (signalDOMEvent(cm, e, "contextmenu")) { return }
7617
+ if (!captureRightClick) { cm.display.input.onContextMenu(e); }
7618
+ }
7619
+
7620
+ function contextMenuInGutter(cm, e) {
7621
+ if (!hasHandler(cm, "gutterContextMenu")) { return false }
7622
+ return gutterEvent(cm, e, "gutterContextMenu", false)
7623
+ }
7624
+
7625
+ function themeChanged(cm) {
7626
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
7627
+ cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
7628
+ clearCaches(cm);
7629
+ }
7630
+
7631
+ var Init = {toString: function(){return "CodeMirror.Init"}};
7632
+
7633
+ var defaults = {};
7634
+ var optionHandlers = {};
7635
+
7636
+ function defineOptions(CodeMirror) {
7637
+ var optionHandlers = CodeMirror.optionHandlers;
7638
+
7639
+ function option(name, deflt, handle, notOnInit) {
7640
+ CodeMirror.defaults[name] = deflt;
7641
+ if (handle) { optionHandlers[name] =
7642
+ notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }
7643
+ }
7644
+
7645
+ CodeMirror.defineOption = option;
7646
+
7647
+ // Passed to option handlers when there is no old value.
7648
+ CodeMirror.Init = Init;
7649
+
7650
+ // These two are, on init, called from the constructor because they
7651
+ // have to be initialized before the editor can start at all.
7652
+ option("value", "", function (cm, val) { return cm.setValue(val); }, true);
7653
+ option("mode", null, function (cm, val) {
7654
+ cm.doc.modeOption = val;
7655
+ loadMode(cm);
7656
+ }, true);
7657
+
7658
+ option("indentUnit", 2, loadMode, true);
7659
+ option("indentWithTabs", false);
7660
+ option("smartIndent", true);
7661
+ option("tabSize", 4, function (cm) {
7662
+ resetModeState(cm);
7663
+ clearCaches(cm);
7664
+ regChange(cm);
7665
+ }, true);
7666
+
7667
+ option("lineSeparator", null, function (cm, val) {
7668
+ cm.doc.lineSep = val;
7669
+ if (!val) { return }
7670
+ var newBreaks = [], lineNo = cm.doc.first;
7671
+ cm.doc.iter(function (line) {
7672
+ for (var pos = 0;;) {
7673
+ var found = line.text.indexOf(val, pos);
7674
+ if (found == -1) { break }
7675
+ pos = found + val.length;
7676
+ newBreaks.push(Pos(lineNo, found));
7677
+ }
7678
+ lineNo++;
7679
+ });
7680
+ for (var i = newBreaks.length - 1; i >= 0; i--)
7681
+ { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
7682
+ });
7683
+ option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
7684
+ cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
7685
+ if (old != Init) { cm.refresh(); }
7686
+ });
7687
+ option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);
7688
+ option("electricChars", true);
7689
+ option("inputStyle", mobile ? "contenteditable" : "textarea", function () {
7690
+ throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME
7691
+ }, true);
7692
+ option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);
7693
+ option("rtlMoveVisually", !windows);
7694
+ option("wholeLineUpdateBefore", true);
7695
+
7696
+ option("theme", "default", function (cm) {
7697
+ themeChanged(cm);
7698
+ guttersChanged(cm);
7699
+ }, true);
7700
+ option("keyMap", "default", function (cm, val, old) {
7701
+ var next = getKeyMap(val);
7702
+ var prev = old != Init && getKeyMap(old);
7703
+ if (prev && prev.detach) { prev.detach(cm, next); }
7704
+ if (next.attach) { next.attach(cm, prev || null); }
7705
+ });
7706
+ option("extraKeys", null);
7707
+ option("configureMouse", null);
7708
+
7709
+ option("lineWrapping", false, wrappingChanged, true);
7710
+ option("gutters", [], function (cm) {
7711
+ setGuttersForLineNumbers(cm.options);
7712
+ guttersChanged(cm);
7713
+ }, true);
7714
+ option("fixedGutter", true, function (cm, val) {
7715
+ cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0";
7716
+ cm.refresh();
7717
+ }, true);
7718
+ option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true);
7719
+ option("scrollbarStyle", "native", function (cm) {
7720
+ initScrollbars(cm);
7721
+ updateScrollbars(cm);
7722
+ cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);
7723
+ cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);
7724
+ }, true);
7725
+ option("lineNumbers", false, function (cm) {
7726
+ setGuttersForLineNumbers(cm.options);
7727
+ guttersChanged(cm);
7728
+ }, true);
7729
+ option("firstLineNumber", 1, guttersChanged, true);
7730
+ option("lineNumberFormatter", function (integer) { return integer; }, guttersChanged, true);
7731
+ option("showCursorWhenSelecting", false, updateSelection, true);
7732
+
7733
+ option("resetSelectionOnContextMenu", true);
7734
+ option("lineWiseCopyCut", true);
7735
+ option("pasteLinesPerSelection", true);
7736
+ option("selectionsMayTouch", false);
7737
+
7738
+ option("readOnly", false, function (cm, val) {
7739
+ if (val == "nocursor") {
7740
+ onBlur(cm);
7741
+ cm.display.input.blur();
7742
+ }
7743
+ cm.display.input.readOnlyChanged(val);
7744
+ });
7745
+ option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);
7746
+ option("dragDrop", true, dragDropChanged);
7747
+ option("allowDropFileTypes", null);
7748
+
7749
+ option("cursorBlinkRate", 530);
7750
+ option("cursorScrollMargin", 0);
7751
+ option("cursorHeight", 1, updateSelection, true);
7752
+ option("singleCursorHeightPerLine", true, updateSelection, true);
7753
+ option("workTime", 100);
7754
+ option("workDelay", 100);
7755
+ option("flattenSpans", true, resetModeState, true);
7756
+ option("addModeClass", false, resetModeState, true);
7757
+ option("pollInterval", 100);
7758
+ option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });
7759
+ option("historyEventDelay", 1250);
7760
+ option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true);
7761
+ option("maxHighlightLength", 10000, resetModeState, true);
7762
+ option("moveInputWithCursor", true, function (cm, val) {
7763
+ if (!val) { cm.display.input.resetPosition(); }
7764
+ });
7765
+
7766
+ option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; });
7767
+ option("autofocus", null);
7768
+ option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true);
7769
+ option("phrases", null);
7770
+ }
7771
+
7772
+ function guttersChanged(cm) {
7773
+ updateGutters(cm);
7774
+ regChange(cm);
7775
+ alignHorizontally(cm);
7776
+ }
7777
+
7778
+ function dragDropChanged(cm, value, old) {
7779
+ var wasOn = old && old != Init;
7780
+ if (!value != !wasOn) {
7781
+ var funcs = cm.display.dragFunctions;
7782
+ var toggle = value ? on : off;
7783
+ toggle(cm.display.scroller, "dragstart", funcs.start);
7784
+ toggle(cm.display.scroller, "dragenter", funcs.enter);
7785
+ toggle(cm.display.scroller, "dragover", funcs.over);
7786
+ toggle(cm.display.scroller, "dragleave", funcs.leave);
7787
+ toggle(cm.display.scroller, "drop", funcs.drop);
7788
+ }
7789
+ }
7790
+
7791
+ function wrappingChanged(cm) {
7792
+ if (cm.options.lineWrapping) {
7793
+ addClass(cm.display.wrapper, "CodeMirror-wrap");
7794
+ cm.display.sizer.style.minWidth = "";
7795
+ cm.display.sizerWidth = null;
7796
+ } else {
7797
+ rmClass(cm.display.wrapper, "CodeMirror-wrap");
7798
+ findMaxLine(cm);
7799
+ }
7800
+ estimateLineHeights(cm);
7801
+ regChange(cm);
7802
+ clearCaches(cm);
7803
+ setTimeout(function () { return updateScrollbars(cm); }, 100);
7804
+ }
7805
+
7806
+ // A CodeMirror instance represents an editor. This is the object
7807
+ // that user code is usually dealing with.
7808
+
7809
+ function CodeMirror(place, options) {
7810
+ var this$1 = this;
7811
+
7812
+ if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }
7813
+
7814
+ this.options = options = options ? copyObj(options) : {};
7815
+ // Determine effective options based on given values and defaults.
7816
+ copyObj(defaults, options, false);
7817
+ setGuttersForLineNumbers(options);
7818
+
7819
+ var doc = options.value;
7820
+ if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }
7821
+ else if (options.mode) { doc.modeOption = options.mode; }
7822
+ this.doc = doc;
7823
+
7824
+ var input = new CodeMirror.inputStyles[options.inputStyle](this);
7825
+ var display = this.display = new Display(place, doc, input);
7826
+ display.wrapper.CodeMirror = this;
7827
+ updateGutters(this);
7828
+ themeChanged(this);
7829
+ if (options.lineWrapping)
7830
+ { this.display.wrapper.className += " CodeMirror-wrap"; }
7831
+ initScrollbars(this);
7832
+
7833
+ this.state = {
7834
+ keyMaps: [], // stores maps added by addKeyMap
7835
+ overlays: [], // highlighting overlays, as added by addOverlay
7836
+ modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
7837
+ overwrite: false,
7838
+ delayingBlurEvent: false,
7839
+ focused: false,
7840
+ suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
7841
+ pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
7842
+ selectingText: false,
7843
+ draggingText: false,
7844
+ highlight: new Delayed(), // stores highlight worker timeout
7845
+ keySeq: null, // Unfinished key sequence
7846
+ specialChars: null
7847
+ };
7848
+
7849
+ if (options.autofocus && !mobile) { display.input.focus(); }
7850
+
7851
+ // Override magic textarea content restore that IE sometimes does
7852
+ // on our hidden textarea on reload
7853
+ if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }
7854
+
7855
+ registerEventHandlers(this);
7856
+ ensureGlobalHandlers();
7857
+
7858
+ startOperation(this);
7859
+ this.curOp.forceUpdate = true;
7860
+ attachDoc(this, doc);
7861
+
7862
+ if ((options.autofocus && !mobile) || this.hasFocus())
7863
+ { setTimeout(bind(onFocus, this), 20); }
7864
+ else
7865
+ { onBlur(this); }
7866
+
7867
+ for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))
7868
+ { optionHandlers[opt](this$1, options[opt], Init); } }
7869
+ maybeUpdateLineNumberWidth(this);
7870
+ if (options.finishInit) { options.finishInit(this); }
7871
+ for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }
7872
+ endOperation(this);
7873
+ // Suppress optimizelegibility in Webkit, since it breaks text
7874
+ // measuring on line wrapping boundaries.
7875
+ if (webkit && options.lineWrapping &&
7876
+ getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
7877
+ { display.lineDiv.style.textRendering = "auto"; }
7878
+ }
7879
+
7880
+ // The default configuration options.
7881
+ CodeMirror.defaults = defaults;
7882
+ // Functions to run when options are changed.
7883
+ CodeMirror.optionHandlers = optionHandlers;
7884
+
7885
+ // Attach the necessary event handlers when initializing the editor
7886
+ function registerEventHandlers(cm) {
7887
+ var d = cm.display;
7888
+ on(d.scroller, "mousedown", operation(cm, onMouseDown));
7889
+ // Older IE's will not fire a second mousedown for a double click
7890
+ if (ie && ie_version < 11)
7891
+ { on(d.scroller, "dblclick", operation(cm, function (e) {
7892
+ if (signalDOMEvent(cm, e)) { return }
7893
+ var pos = posFromMouse(cm, e);
7894
+ if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }
7895
+ e_preventDefault(e);
7896
+ var word = cm.findWordAt(pos);
7897
+ extendSelection(cm.doc, word.anchor, word.head);
7898
+ })); }
7899
+ else
7900
+ { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }
7901
+ // Some browsers fire contextmenu *after* opening the menu, at
7902
+ // which point we can't mess with it anymore. Context menu is
7903
+ // handled in onMouseDown for these browsers.
7904
+ on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); });
7905
+
7906
+ // Used to suppress mouse event handling when a touch happens
7907
+ var touchFinished, prevTouch = {end: 0};
7908
+ function finishTouch() {
7909
+ if (d.activeTouch) {
7910
+ touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);
7911
+ prevTouch = d.activeTouch;
7912
+ prevTouch.end = +new Date;
7913
+ }
7914
+ }
7915
+ function isMouseLikeTouchEvent(e) {
7916
+ if (e.touches.length != 1) { return false }
7917
+ var touch = e.touches[0];
7918
+ return touch.radiusX <= 1 && touch.radiusY <= 1
7919
+ }
7920
+ function farAway(touch, other) {
7921
+ if (other.left == null) { return true }
7922
+ var dx = other.left - touch.left, dy = other.top - touch.top;
7923
+ return dx * dx + dy * dy > 20 * 20
7924
+ }
7925
+ on(d.scroller, "touchstart", function (e) {
7926
+ if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {
7927
+ d.input.ensurePolled();
7928
+ clearTimeout(touchFinished);
7929
+ var now = +new Date;
7930
+ d.activeTouch = {start: now, moved: false,
7931
+ prev: now - prevTouch.end <= 300 ? prevTouch : null};
7932
+ if (e.touches.length == 1) {
7933
+ d.activeTouch.left = e.touches[0].pageX;
7934
+ d.activeTouch.top = e.touches[0].pageY;
7935
+ }
7936
+ }
7937
+ });
7938
+ on(d.scroller, "touchmove", function () {
7939
+ if (d.activeTouch) { d.activeTouch.moved = true; }
7940
+ });
7941
+ on(d.scroller, "touchend", function (e) {
7942
+ var touch = d.activeTouch;
7943
+ if (touch && !eventInWidget(d, e) && touch.left != null &&
7944
+ !touch.moved && new Date - touch.start < 300) {
7945
+ var pos = cm.coordsChar(d.activeTouch, "page"), range;
7946
+ if (!touch.prev || farAway(touch, touch.prev)) // Single tap
7947
+ { range = new Range(pos, pos); }
7948
+ else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap
7949
+ { range = cm.findWordAt(pos); }
7950
+ else // Triple tap
7951
+ { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }
7952
+ cm.setSelection(range.anchor, range.head);
7953
+ cm.focus();
7954
+ e_preventDefault(e);
7955
+ }
7956
+ finishTouch();
7957
+ });
7958
+ on(d.scroller, "touchcancel", finishTouch);
7959
+
7960
+ // Sync scrolling between fake scrollbars and real scrollable
7961
+ // area, ensure viewport is updated when scrolling.
7962
+ on(d.scroller, "scroll", function () {
7963
+ if (d.scroller.clientHeight) {
7964
+ updateScrollTop(cm, d.scroller.scrollTop);
7965
+ setScrollLeft(cm, d.scroller.scrollLeft, true);
7966
+ signal(cm, "scroll", cm);
7967
+ }
7968
+ });
7969
+
7970
+ // Listen to wheel events in order to try and update the viewport on time.
7971
+ on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); });
7972
+ on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); });
7973
+
7974
+ // Prevent wrapper from ever scrolling
7975
+ on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
7976
+
7977
+ d.dragFunctions = {
7978
+ enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},
7979
+ over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},
7980
+ start: function (e) { return onDragStart(cm, e); },
7981
+ drop: operation(cm, onDrop),
7982
+ leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}
7983
+ };
7984
+
7985
+ var inp = d.input.getField();
7986
+ on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); });
7987
+ on(inp, "keydown", operation(cm, onKeyDown));
7988
+ on(inp, "keypress", operation(cm, onKeyPress));
7989
+ on(inp, "focus", function (e) { return onFocus(cm, e); });
7990
+ on(inp, "blur", function (e) { return onBlur(cm, e); });
7991
+ }
7992
+
7993
+ var initHooks = [];
7994
+ CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };
7995
+
7996
+ // Indent the given line. The how parameter can be "smart",
7997
+ // "add"/null, "subtract", or "prev". When aggressive is false
7998
+ // (typically set to true for forced single-line indents), empty
7999
+ // lines are not indented, and places where the mode returns Pass
8000
+ // are left alone.
8001
+ function indentLine(cm, n, how, aggressive) {
8002
+ var doc = cm.doc, state;
8003
+ if (how == null) { how = "add"; }
8004
+ if (how == "smart") {
8005
+ // Fall back to "prev" when the mode doesn't have an indentation
8006
+ // method.
8007
+ if (!doc.mode.indent) { how = "prev"; }
8008
+ else { state = getContextBefore(cm, n).state; }
8009
+ }
8010
+
8011
+ var tabSize = cm.options.tabSize;
8012
+ var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);
8013
+ if (line.stateAfter) { line.stateAfter = null; }
8014
+ var curSpaceString = line.text.match(/^\s*/)[0], indentation;
8015
+ if (!aggressive && !/\S/.test(line.text)) {
8016
+ indentation = 0;
8017
+ how = "not";
8018
+ } else if (how == "smart") {
8019
+ indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);
8020
+ if (indentation == Pass || indentation > 150) {
8021
+ if (!aggressive) { return }
8022
+ how = "prev";
8023
+ }
8024
+ }
8025
+ if (how == "prev") {
8026
+ if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }
8027
+ else { indentation = 0; }
8028
+ } else if (how == "add") {
8029
+ indentation = curSpace + cm.options.indentUnit;
8030
+ } else if (how == "subtract") {
8031
+ indentation = curSpace - cm.options.indentUnit;
8032
+ } else if (typeof how == "number") {
8033
+ indentation = curSpace + how;
8034
+ }
8035
+ indentation = Math.max(0, indentation);
8036
+
8037
+ var indentString = "", pos = 0;
8038
+ if (cm.options.indentWithTabs)
8039
+ { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} }
8040
+ if (pos < indentation) { indentString += spaceStr(indentation - pos); }
8041
+
8042
+ if (indentString != curSpaceString) {
8043
+ replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");
8044
+ line.stateAfter = null;
8045
+ return true
8046
+ } else {
8047
+ // Ensure that, if the cursor was in the whitespace at the start
8048
+ // of the line, it is moved to the end of that space.
8049
+ for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {
8050
+ var range = doc.sel.ranges[i$1];
8051
+ if (range.head.line == n && range.head.ch < curSpaceString.length) {
8052
+ var pos$1 = Pos(n, curSpaceString.length);
8053
+ replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));
8054
+ break
8055
+ }
8056
+ }
8057
+ }
8058
+ }
8059
+
8060
+ // This will be set to a {lineWise: bool, text: [string]} object, so
8061
+ // that, when pasting, we know what kind of selections the copied
8062
+ // text was made out of.
8063
+ var lastCopied = null;
8064
+
8065
+ function setLastCopied(newLastCopied) {
8066
+ lastCopied = newLastCopied;
8067
+ }
8068
+
8069
+ function applyTextInput(cm, inserted, deleted, sel, origin) {
8070
+ var doc = cm.doc;
8071
+ cm.display.shift = false;
8072
+ if (!sel) { sel = doc.sel; }
8073
+
8074
+ var paste = cm.state.pasteIncoming || origin == "paste";
8075
+ var textLines = splitLinesAuto(inserted), multiPaste = null;
8076
+ // When pasting N lines into N selections, insert one line per selection
8077
+ if (paste && sel.ranges.length > 1) {
8078
+ if (lastCopied && lastCopied.text.join("\n") == inserted) {
8079
+ if (sel.ranges.length % lastCopied.text.length == 0) {
8080
+ multiPaste = [];
8081
+ for (var i = 0; i < lastCopied.text.length; i++)
8082
+ { multiPaste.push(doc.splitLines(lastCopied.text[i])); }
8083
+ }
8084
+ } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {
8085
+ multiPaste = map(textLines, function (l) { return [l]; });
8086
+ }
8087
+ }
8088
+
8089
+ var updateInput = cm.curOp.updateInput;
8090
+ // Normal behavior is to insert the new text into every selection
8091
+ for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {
8092
+ var range$$1 = sel.ranges[i$1];
8093
+ var from = range$$1.from(), to = range$$1.to();
8094
+ if (range$$1.empty()) {
8095
+ if (deleted && deleted > 0) // Handle deletion
8096
+ { from = Pos(from.line, from.ch - deleted); }
8097
+ else if (cm.state.overwrite && !paste) // Handle overwrite
8098
+ { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }
8099
+ else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted)
8100
+ { from = to = Pos(from.line, 0); }
8101
+ }
8102
+ var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,
8103
+ origin: origin || (paste ? "paste" : cm.state.cutIncoming ? "cut" : "+input")};
8104
+ makeChange(cm.doc, changeEvent);
8105
+ signalLater(cm, "inputRead", cm, changeEvent);
8106
+ }
8107
+ if (inserted && !paste)
8108
+ { triggerElectric(cm, inserted); }
8109
+
8110
+ ensureCursorVisible(cm);
8111
+ if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }
8112
+ cm.curOp.typing = true;
8113
+ cm.state.pasteIncoming = cm.state.cutIncoming = false;
8114
+ }
8115
+
8116
+ function handlePaste(e, cm) {
8117
+ var pasted = e.clipboardData && e.clipboardData.getData("Text");
8118
+ if (pasted) {
8119
+ e.preventDefault();
8120
+ if (!cm.isReadOnly() && !cm.options.disableInput)
8121
+ { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); }
8122
+ return true
8123
+ }
8124
+ }
8125
+
8126
+ function triggerElectric(cm, inserted) {
8127
+ // When an 'electric' character is inserted, immediately trigger a reindent
8128
+ if (!cm.options.electricChars || !cm.options.smartIndent) { return }
8129
+ var sel = cm.doc.sel;
8130
+
8131
+ for (var i = sel.ranges.length - 1; i >= 0; i--) {
8132
+ var range$$1 = sel.ranges[i];
8133
+ if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }
8134
+ var mode = cm.getModeAt(range$$1.head);
8135
+ var indented = false;
8136
+ if (mode.electricChars) {
8137
+ for (var j = 0; j < mode.electricChars.length; j++)
8138
+ { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
8139
+ indented = indentLine(cm, range$$1.head.line, "smart");
8140
+ break
8141
+ } }
8142
+ } else if (mode.electricInput) {
8143
+ if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))
8144
+ { indented = indentLine(cm, range$$1.head.line, "smart"); }
8145
+ }
8146
+ if (indented) { signalLater(cm, "electricInput", cm, range$$1.head.line); }
8147
+ }
8148
+ }
8149
+
8150
+ function copyableRanges(cm) {
8151
+ var text = [], ranges = [];
8152
+ for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
8153
+ var line = cm.doc.sel.ranges[i].head.line;
8154
+ var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
8155
+ ranges.push(lineRange);
8156
+ text.push(cm.getRange(lineRange.anchor, lineRange.head));
8157
+ }
8158
+ return {text: text, ranges: ranges}
8159
+ }
8160
+
8161
+ function disableBrowserMagic(field, spellcheck) {
8162
+ field.setAttribute("autocorrect", "off");
8163
+ field.setAttribute("autocapitalize", "off");
8164
+ field.setAttribute("spellcheck", !!spellcheck);
8165
+ }
8166
+
8167
+ function hiddenTextarea() {
8168
+ var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
8169
+ var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
8170
+ // The textarea is kept positioned near the cursor to prevent the
8171
+ // fact that it'll be scrolled into view on input from scrolling
8172
+ // our fake cursor out of view. On webkit, when wrap=off, paste is
8173
+ // very slow. So make the area wide instead.
8174
+ if (webkit) { te.style.width = "1000px"; }
8175
+ else { te.setAttribute("wrap", "off"); }
8176
+ // If border: 0; -- iOS fails to open keyboard (issue #1287)
8177
+ if (ios) { te.style.border = "1px solid black"; }
8178
+ disableBrowserMagic(te);
8179
+ return div
8180
+ }
8181
+
8182
+ // The publicly visible API. Note that methodOp(f) means
8183
+ // 'wrap f in an operation, performed on its `this` parameter'.
8184
+
8185
+ // This is not the complete set of editor methods. Most of the
8186
+ // methods defined on the Doc type are also injected into
8187
+ // CodeMirror.prototype, for backwards compatibility and
8188
+ // convenience.
8189
+
8190
+ function addEditorMethods(CodeMirror) {
8191
+ var optionHandlers = CodeMirror.optionHandlers;
8192
+
8193
+ var helpers = CodeMirror.helpers = {};
8194
+
8195
+ CodeMirror.prototype = {
8196
+ constructor: CodeMirror,
8197
+ focus: function(){window.focus(); this.display.input.focus();},
8198
+
8199
+ setOption: function(option, value) {
8200
+ var options = this.options, old = options[option];
8201
+ if (options[option] == value && option != "mode") { return }
8202
+ options[option] = value;
8203
+ if (optionHandlers.hasOwnProperty(option))
8204
+ { operation(this, optionHandlers[option])(this, value, old); }
8205
+ signal(this, "optionChange", this, option);
8206
+ },
8207
+
8208
+ getOption: function(option) {return this.options[option]},
8209
+ getDoc: function() {return this.doc},
8210
+
8211
+ addKeyMap: function(map$$1, bottom) {
8212
+ this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map$$1));
8213
+ },
8214
+ removeKeyMap: function(map$$1) {
8215
+ var maps = this.state.keyMaps;
8216
+ for (var i = 0; i < maps.length; ++i)
8217
+ { if (maps[i] == map$$1 || maps[i].name == map$$1) {
8218
+ maps.splice(i, 1);
8219
+ return true
8220
+ } }
8221
+ },
8222
+
8223
+ addOverlay: methodOp(function(spec, options) {
8224
+ var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);
8225
+ if (mode.startState) { throw new Error("Overlays may not be stateful.") }
8226
+ insertSorted(this.state.overlays,
8227
+ {mode: mode, modeSpec: spec, opaque: options && options.opaque,
8228
+ priority: (options && options.priority) || 0},
8229
+ function (overlay) { return overlay.priority; });
8230
+ this.state.modeGen++;
8231
+ regChange(this);
8232
+ }),
8233
+ removeOverlay: methodOp(function(spec) {
8234
+ var this$1 = this;
8235
+
8236
+ var overlays = this.state.overlays;
8237
+ for (var i = 0; i < overlays.length; ++i) {
8238
+ var cur = overlays[i].modeSpec;
8239
+ if (cur == spec || typeof spec == "string" && cur.name == spec) {
8240
+ overlays.splice(i, 1);
8241
+ this$1.state.modeGen++;
8242
+ regChange(this$1);
8243
+ return
8244
+ }
8245
+ }
8246
+ }),
8247
+
8248
+ indentLine: methodOp(function(n, dir, aggressive) {
8249
+ if (typeof dir != "string" && typeof dir != "number") {
8250
+ if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; }
8251
+ else { dir = dir ? "add" : "subtract"; }
8252
+ }
8253
+ if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }
8254
+ }),
8255
+ indentSelection: methodOp(function(how) {
8256
+ var this$1 = this;
8257
+
8258
+ var ranges = this.doc.sel.ranges, end = -1;
8259
+ for (var i = 0; i < ranges.length; i++) {
8260
+ var range$$1 = ranges[i];
8261
+ if (!range$$1.empty()) {
8262
+ var from = range$$1.from(), to = range$$1.to();
8263
+ var start = Math.max(end, from.line);
8264
+ end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;
8265
+ for (var j = start; j < end; ++j)
8266
+ { indentLine(this$1, j, how); }
8267
+ var newRanges = this$1.doc.sel.ranges;
8268
+ if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)
8269
+ { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }
8270
+ } else if (range$$1.head.line > end) {
8271
+ indentLine(this$1, range$$1.head.line, how, true);
8272
+ end = range$$1.head.line;
8273
+ if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }
8274
+ }
8275
+ }
8276
+ }),
8277
+
8278
+ // Fetch the parser token for a given character. Useful for hacks
8279
+ // that want to inspect the mode state (say, for completion).
8280
+ getTokenAt: function(pos, precise) {
8281
+ return takeToken(this, pos, precise)
8282
+ },
8283
+
8284
+ getLineTokens: function(line, precise) {
8285
+ return takeToken(this, Pos(line), precise, true)
8286
+ },
8287
+
8288
+ getTokenTypeAt: function(pos) {
8289
+ pos = clipPos(this.doc, pos);
8290
+ var styles = getLineStyles(this, getLine(this.doc, pos.line));
8291
+ var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;
8292
+ var type;
8293
+ if (ch == 0) { type = styles[2]; }
8294
+ else { for (;;) {
8295
+ var mid = (before + after) >> 1;
8296
+ if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }
8297
+ else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }
8298
+ else { type = styles[mid * 2 + 2]; break }
8299
+ } }
8300
+ var cut = type ? type.indexOf("overlay ") : -1;
8301
+ return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)
8302
+ },
8303
+
8304
+ getModeAt: function(pos) {
8305
+ var mode = this.doc.mode;
8306
+ if (!mode.innerMode) { return mode }
8307
+ return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode
8308
+ },
8309
+
8310
+ getHelper: function(pos, type) {
8311
+ return this.getHelpers(pos, type)[0]
8312
+ },
8313
+
8314
+ getHelpers: function(pos, type) {
8315
+ var this$1 = this;
8316
+
8317
+ var found = [];
8318
+ if (!helpers.hasOwnProperty(type)) { return found }
8319
+ var help = helpers[type], mode = this.getModeAt(pos);
8320
+ if (typeof mode[type] == "string") {
8321
+ if (help[mode[type]]) { found.push(help[mode[type]]); }
8322
+ } else if (mode[type]) {
8323
+ for (var i = 0; i < mode[type].length; i++) {
8324
+ var val = help[mode[type][i]];
8325
+ if (val) { found.push(val); }
8326
+ }
8327
+ } else if (mode.helperType && help[mode.helperType]) {
8328
+ found.push(help[mode.helperType]);
8329
+ } else if (help[mode.name]) {
8330
+ found.push(help[mode.name]);
8331
+ }
8332
+ for (var i$1 = 0; i$1 < help._global.length; i$1++) {
8333
+ var cur = help._global[i$1];
8334
+ if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)
8335
+ { found.push(cur.val); }
8336
+ }
8337
+ return found
8338
+ },
8339
+
8340
+ getStateAfter: function(line, precise) {
8341
+ var doc = this.doc;
8342
+ line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
8343
+ return getContextBefore(this, line + 1, precise).state
8344
+ },
8345
+
8346
+ cursorCoords: function(start, mode) {
8347
+ var pos, range$$1 = this.doc.sel.primary();
8348
+ if (start == null) { pos = range$$1.head; }
8349
+ else if (typeof start == "object") { pos = clipPos(this.doc, start); }
8350
+ else { pos = start ? range$$1.from() : range$$1.to(); }
8351
+ return cursorCoords(this, pos, mode || "page")
8352
+ },
8353
+
8354
+ charCoords: function(pos, mode) {
8355
+ return charCoords(this, clipPos(this.doc, pos), mode || "page")
8356
+ },
8357
+
8358
+ coordsChar: function(coords, mode) {
8359
+ coords = fromCoordSystem(this, coords, mode || "page");
8360
+ return coordsChar(this, coords.left, coords.top)
8361
+ },
8362
+
8363
+ lineAtHeight: function(height, mode) {
8364
+ height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top;
8365
+ return lineAtHeight(this.doc, height + this.display.viewOffset)
8366
+ },
8367
+ heightAtLine: function(line, mode, includeWidgets) {
8368
+ var end = false, lineObj;
8369
+ if (typeof line == "number") {
8370
+ var last = this.doc.first + this.doc.size - 1;
8371
+ if (line < this.doc.first) { line = this.doc.first; }
8372
+ else if (line > last) { line = last; end = true; }
8373
+ lineObj = getLine(this.doc, line);
8374
+ } else {
8375
+ lineObj = line;
8376
+ }
8377
+ return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top +
8378
+ (end ? this.doc.height - heightAtLine(lineObj) : 0)
8379
+ },
8380
+
8381
+ defaultTextHeight: function() { return textHeight(this.display) },
8382
+ defaultCharWidth: function() { return charWidth(this.display) },
8383
+
8384
+ getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},
8385
+
8386
+ addWidget: function(pos, node, scroll, vert, horiz) {
8387
+ var display = this.display;
8388
+ pos = cursorCoords(this, clipPos(this.doc, pos));
8389
+ var top = pos.bottom, left = pos.left;
8390
+ node.style.position = "absolute";
8391
+ node.setAttribute("cm-ignore-events", "true");
8392
+ this.display.input.setUneditable(node);
8393
+ display.sizer.appendChild(node);
8394
+ if (vert == "over") {
8395
+ top = pos.top;
8396
+ } else if (vert == "above" || vert == "near") {
8397
+ var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
8398
+ hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);
8399
+ // Default to positioning above (if specified and possible); otherwise default to positioning below
8400
+ if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
8401
+ { top = pos.top - node.offsetHeight; }
8402
+ else if (pos.bottom + node.offsetHeight <= vspace)
8403
+ { top = pos.bottom; }
8404
+ if (left + node.offsetWidth > hspace)
8405
+ { left = hspace - node.offsetWidth; }
8406
+ }
8407
+ node.style.top = top + "px";
8408
+ node.style.left = node.style.right = "";
8409
+ if (horiz == "right") {
8410
+ left = display.sizer.clientWidth - node.offsetWidth;
8411
+ node.style.right = "0px";
8412
+ } else {
8413
+ if (horiz == "left") { left = 0; }
8414
+ else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }
8415
+ node.style.left = left + "px";
8416
+ }
8417
+ if (scroll)
8418
+ { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }
8419
+ },
8420
+
8421
+ triggerOnKeyDown: methodOp(onKeyDown),
8422
+ triggerOnKeyPress: methodOp(onKeyPress),
8423
+ triggerOnKeyUp: onKeyUp,
8424
+ triggerOnMouseDown: methodOp(onMouseDown),
8425
+
8426
+ execCommand: function(cmd) {
8427
+ if (commands.hasOwnProperty(cmd))
8428
+ { return commands[cmd].call(null, this) }
8429
+ },
8430
+
8431
+ triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),
8432
+
8433
+ findPosH: function(from, amount, unit, visually) {
8434
+ var this$1 = this;
8435
+
8436
+ var dir = 1;
8437
+ if (amount < 0) { dir = -1; amount = -amount; }
8438
+ var cur = clipPos(this.doc, from);
8439
+ for (var i = 0; i < amount; ++i) {
8440
+ cur = findPosH(this$1.doc, cur, dir, unit, visually);
8441
+ if (cur.hitSide) { break }
8442
+ }
8443
+ return cur
8444
+ },
8445
+
8446
+ moveH: methodOp(function(dir, unit) {
8447
+ var this$1 = this;
8448
+
8449
+ this.extendSelectionsBy(function (range$$1) {
8450
+ if (this$1.display.shift || this$1.doc.extend || range$$1.empty())
8451
+ { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }
8452
+ else
8453
+ { return dir < 0 ? range$$1.from() : range$$1.to() }
8454
+ }, sel_move);
8455
+ }),
8456
+
8457
+ deleteH: methodOp(function(dir, unit) {
8458
+ var sel = this.doc.sel, doc = this.doc;
8459
+ if (sel.somethingSelected())
8460
+ { doc.replaceSelection("", null, "+delete"); }
8461
+ else
8462
+ { deleteNearSelection(this, function (range$$1) {
8463
+ var other = findPosH(doc, range$$1.head, dir, unit, false);
8464
+ return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}
8465
+ }); }
8466
+ }),
8467
+
8468
+ findPosV: function(from, amount, unit, goalColumn) {
8469
+ var this$1 = this;
8470
+
8471
+ var dir = 1, x = goalColumn;
8472
+ if (amount < 0) { dir = -1; amount = -amount; }
8473
+ var cur = clipPos(this.doc, from);
8474
+ for (var i = 0; i < amount; ++i) {
8475
+ var coords = cursorCoords(this$1, cur, "div");
8476
+ if (x == null) { x = coords.left; }
8477
+ else { coords.left = x; }
8478
+ cur = findPosV(this$1, coords, dir, unit);
8479
+ if (cur.hitSide) { break }
8480
+ }
8481
+ return cur
8482
+ },
8483
+
8484
+ moveV: methodOp(function(dir, unit) {
8485
+ var this$1 = this;
8486
+
8487
+ var doc = this.doc, goals = [];
8488
+ var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();
8489
+ doc.extendSelectionsBy(function (range$$1) {
8490
+ if (collapse)
8491
+ { return dir < 0 ? range$$1.from() : range$$1.to() }
8492
+ var headPos = cursorCoords(this$1, range$$1.head, "div");
8493
+ if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }
8494
+ goals.push(headPos.left);
8495
+ var pos = findPosV(this$1, headPos, dir, unit);
8496
+ if (unit == "page" && range$$1 == doc.sel.primary())
8497
+ { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); }
8498
+ return pos
8499
+ }, sel_move);
8500
+ if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
8501
+ { doc.sel.ranges[i].goalColumn = goals[i]; } }
8502
+ }),
8503
+
8504
+ // Find the word at the given position (as returned by coordsChar).
8505
+ findWordAt: function(pos) {
8506
+ var doc = this.doc, line = getLine(doc, pos.line).text;
8507
+ var start = pos.ch, end = pos.ch;
8508
+ if (line) {
8509
+ var helper = this.getHelper(pos, "wordChars");
8510
+ if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; }
8511
+ var startChar = line.charAt(start);
8512
+ var check = isWordChar(startChar, helper)
8513
+ ? function (ch) { return isWordChar(ch, helper); }
8514
+ : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); }
8515
+ : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); };
8516
+ while (start > 0 && check(line.charAt(start - 1))) { --start; }
8517
+ while (end < line.length && check(line.charAt(end))) { ++end; }
8518
+ }
8519
+ return new Range(Pos(pos.line, start), Pos(pos.line, end))
8520
+ },
8521
+
8522
+ toggleOverwrite: function(value) {
8523
+ if (value != null && value == this.state.overwrite) { return }
8524
+ if (this.state.overwrite = !this.state.overwrite)
8525
+ { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); }
8526
+ else
8527
+ { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); }
8528
+
8529
+ signal(this, "overwriteToggle", this, this.state.overwrite);
8530
+ },
8531
+ hasFocus: function() { return this.display.input.getField() == activeElt() },
8532
+ isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
8533
+
8534
+ scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),
8535
+ getScrollInfo: function() {
8536
+ var scroller = this.display.scroller;
8537
+ return {left: scroller.scrollLeft, top: scroller.scrollTop,
8538
+ height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,
8539
+ width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,
8540
+ clientHeight: displayHeight(this), clientWidth: displayWidth(this)}
8541
+ },
8542
+
8543
+ scrollIntoView: methodOp(function(range$$1, margin) {
8544
+ if (range$$1 == null) {
8545
+ range$$1 = {from: this.doc.sel.primary().head, to: null};
8546
+ if (margin == null) { margin = this.options.cursorScrollMargin; }
8547
+ } else if (typeof range$$1 == "number") {
8548
+ range$$1 = {from: Pos(range$$1, 0), to: null};
8549
+ } else if (range$$1.from == null) {
8550
+ range$$1 = {from: range$$1, to: null};
8551
+ }
8552
+ if (!range$$1.to) { range$$1.to = range$$1.from; }
8553
+ range$$1.margin = margin || 0;
8554
+
8555
+ if (range$$1.from.line != null) {
8556
+ scrollToRange(this, range$$1);
8557
+ } else {
8558
+ scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);
8559
+ }
8560
+ }),
8561
+
8562
+ setSize: methodOp(function(width, height) {
8563
+ var this$1 = this;
8564
+
8565
+ var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; };
8566
+ if (width != null) { this.display.wrapper.style.width = interpret(width); }
8567
+ if (height != null) { this.display.wrapper.style.height = interpret(height); }
8568
+ if (this.options.lineWrapping) { clearLineMeasurementCache(this); }
8569
+ var lineNo$$1 = this.display.viewFrom;
8570
+ this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {
8571
+ if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)
8572
+ { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, "widget"); break } } }
8573
+ ++lineNo$$1;
8574
+ });
8575
+ this.curOp.forceUpdate = true;
8576
+ signal(this, "refresh", this);
8577
+ }),
8578
+
8579
+ operation: function(f){return runInOp(this, f)},
8580
+ startOperation: function(){return startOperation(this)},
8581
+ endOperation: function(){return endOperation(this)},
8582
+
8583
+ refresh: methodOp(function() {
8584
+ var oldHeight = this.display.cachedTextHeight;
8585
+ regChange(this);
8586
+ this.curOp.forceUpdate = true;
8587
+ clearCaches(this);
8588
+ scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);
8589
+ updateGutterSpace(this);
8590
+ if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
8591
+ { estimateLineHeights(this); }
8592
+ signal(this, "refresh", this);
8593
+ }),
8594
+
8595
+ swapDoc: methodOp(function(doc) {
8596
+ var old = this.doc;
8597
+ old.cm = null;
8598
+ attachDoc(this, doc);
8599
+ clearCaches(this);
8600
+ this.display.input.reset();
8601
+ scrollToCoords(this, doc.scrollLeft, doc.scrollTop);
8602
+ this.curOp.forceScroll = true;
8603
+ signalLater(this, "swapDoc", this, old);
8604
+ return old
8605
+ }),
8606
+
8607
+ phrase: function(phraseText) {
8608
+ var phrases = this.options.phrases;
8609
+ return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText
8610
+ },
8611
+
8612
+ getInputField: function(){return this.display.input.getField()},
8613
+ getWrapperElement: function(){return this.display.wrapper},
8614
+ getScrollerElement: function(){return this.display.scroller},
8615
+ getGutterElement: function(){return this.display.gutters}
8616
+ };
8617
+ eventMixin(CodeMirror);
8618
+
8619
+ CodeMirror.registerHelper = function(type, name, value) {
8620
+ if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }
8621
+ helpers[type][name] = value;
8622
+ };
8623
+ CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {
8624
+ CodeMirror.registerHelper(type, name, value);
8625
+ helpers[type]._global.push({pred: predicate, val: value});
8626
+ };
8627
+ }
8628
+
8629
+ // Used for horizontal relative motion. Dir is -1 or 1 (left or
8630
+ // right), unit can be "char", "column" (like char, but doesn't
8631
+ // cross line boundaries), "word" (across next word), or "group" (to
8632
+ // the start of next group of word or non-word-non-whitespace
8633
+ // chars). The visually param controls whether, in right-to-left
8634
+ // text, direction 1 means to move towards the next index in the
8635
+ // string, or towards the character to the right of the current
8636
+ // position. The resulting position will have a hitSide=true
8637
+ // property if it reached the end of the document.
8638
+ function findPosH(doc, pos, dir, unit, visually) {
8639
+ var oldPos = pos;
8640
+ var origDir = dir;
8641
+ var lineObj = getLine(doc, pos.line);
8642
+ function findNextLine() {
8643
+ var l = pos.line + dir;
8644
+ if (l < doc.first || l >= doc.first + doc.size) { return false }
8645
+ pos = new Pos(l, pos.ch, pos.sticky);
8646
+ return lineObj = getLine(doc, l)
8647
+ }
8648
+ function moveOnce(boundToLine) {
8649
+ var next;
8650
+ if (visually) {
8651
+ next = moveVisually(doc.cm, lineObj, pos, dir);
8652
+ } else {
8653
+ next = moveLogically(lineObj, pos, dir);
8654
+ }
8655
+ if (next == null) {
8656
+ if (!boundToLine && findNextLine())
8657
+ { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }
8658
+ else
8659
+ { return false }
8660
+ } else {
8661
+ pos = next;
8662
+ }
8663
+ return true
8664
+ }
8665
+
8666
+ if (unit == "char") {
8667
+ moveOnce();
8668
+ } else if (unit == "column") {
8669
+ moveOnce(true);
8670
+ } else if (unit == "word" || unit == "group") {
8671
+ var sawType = null, group = unit == "group";
8672
+ var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
8673
+ for (var first = true;; first = false) {
8674
+ if (dir < 0 && !moveOnce(!first)) { break }
8675
+ var cur = lineObj.text.charAt(pos.ch) || "\n";
8676
+ var type = isWordChar(cur, helper) ? "w"
8677
+ : group && cur == "\n" ? "n"
8678
+ : !group || /\s/.test(cur) ? null
8679
+ : "p";
8680
+ if (group && !first && !type) { type = "s"; }
8681
+ if (sawType && sawType != type) {
8682
+ if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";}
8683
+ break
8684
+ }
8685
+
8686
+ if (type) { sawType = type; }
8687
+ if (dir > 0 && !moveOnce(!first)) { break }
8688
+ }
8689
+ }
8690
+ var result = skipAtomic(doc, pos, oldPos, origDir, true);
8691
+ if (equalCursorPos(oldPos, result)) { result.hitSide = true; }
8692
+ return result
8693
+ }
8694
+
8695
+ // For relative vertical movement. Dir may be -1 or 1. Unit can be
8696
+ // "page" or "line". The resulting position will have a hitSide=true
8697
+ // property if it reached the end of the document.
8698
+ function findPosV(cm, pos, dir, unit) {
8699
+ var doc = cm.doc, x = pos.left, y;
8700
+ if (unit == "page") {
8701
+ var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
8702
+ var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);
8703
+ y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;
8704
+
8705
+ } else if (unit == "line") {
8706
+ y = dir > 0 ? pos.bottom + 3 : pos.top - 3;
8707
+ }
8708
+ var target;
8709
+ for (;;) {
8710
+ target = coordsChar(cm, x, y);
8711
+ if (!target.outside) { break }
8712
+ if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }
8713
+ y += dir * 5;
8714
+ }
8715
+ return target
8716
+ }
8717
+
8718
+ // CONTENTEDITABLE INPUT STYLE
8719
+
8720
+ var ContentEditableInput = function(cm) {
8721
+ this.cm = cm;
8722
+ this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;
8723
+ this.polling = new Delayed();
8724
+ this.composing = null;
8725
+ this.gracePeriod = false;
8726
+ this.readDOMTimeout = null;
8727
+ };
8728
+
8729
+ ContentEditableInput.prototype.init = function (display) {
8730
+ var this$1 = this;
8731
+
8732
+ var input = this, cm = input.cm;
8733
+ var div = input.div = display.lineDiv;
8734
+ disableBrowserMagic(div, cm.options.spellcheck);
8735
+
8736
+ on(div, "paste", function (e) {
8737
+ if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
8738
+ // IE doesn't fire input events, so we schedule a read for the pasted content in this way
8739
+ if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }
8740
+ });
8741
+
8742
+ on(div, "compositionstart", function (e) {
8743
+ this$1.composing = {data: e.data, done: false};
8744
+ });
8745
+ on(div, "compositionupdate", function (e) {
8746
+ if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }
8747
+ });
8748
+ on(div, "compositionend", function (e) {
8749
+ if (this$1.composing) {
8750
+ if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }
8751
+ this$1.composing.done = true;
8752
+ }
8753
+ });
8754
+
8755
+ on(div, "touchstart", function () { return input.forceCompositionEnd(); });
8756
+
8757
+ on(div, "input", function () {
8758
+ if (!this$1.composing) { this$1.readFromDOMSoon(); }
8759
+ });
8760
+
8761
+ function onCopyCut(e) {
8762
+ if (signalDOMEvent(cm, e)) { return }
8763
+ if (cm.somethingSelected()) {
8764
+ setLastCopied({lineWise: false, text: cm.getSelections()});
8765
+ if (e.type == "cut") { cm.replaceSelection("", null, "cut"); }
8766
+ } else if (!cm.options.lineWiseCopyCut) {
8767
+ return
8768
+ } else {
8769
+ var ranges = copyableRanges(cm);
8770
+ setLastCopied({lineWise: true, text: ranges.text});
8771
+ if (e.type == "cut") {
8772
+ cm.operation(function () {
8773
+ cm.setSelections(ranges.ranges, 0, sel_dontScroll);
8774
+ cm.replaceSelection("", null, "cut");
8775
+ });
8776
+ }
8777
+ }
8778
+ if (e.clipboardData) {
8779
+ e.clipboardData.clearData();
8780
+ var content = lastCopied.text.join("\n");
8781
+ // iOS exposes the clipboard API, but seems to discard content inserted into it
8782
+ e.clipboardData.setData("Text", content);
8783
+ if (e.clipboardData.getData("Text") == content) {
8784
+ e.preventDefault();
8785
+ return
8786
+ }
8787
+ }
8788
+ // Old-fashioned briefly-focus-a-textarea hack
8789
+ var kludge = hiddenTextarea(), te = kludge.firstChild;
8790
+ cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
8791
+ te.value = lastCopied.text.join("\n");
8792
+ var hadFocus = document.activeElement;
8793
+ selectInput(te);
8794
+ setTimeout(function () {
8795
+ cm.display.lineSpace.removeChild(kludge);
8796
+ hadFocus.focus();
8797
+ if (hadFocus == div) { input.showPrimarySelection(); }
8798
+ }, 50);
8799
+ }
8800
+ on(div, "copy", onCopyCut);
8801
+ on(div, "cut", onCopyCut);
8802
+ };
8803
+
8804
+ ContentEditableInput.prototype.prepareSelection = function () {
8805
+ var result = prepareSelection(this.cm, false);
8806
+ result.focus = this.cm.state.focused;
8807
+ return result
8808
+ };
8809
+
8810
+ ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
8811
+ if (!info || !this.cm.display.view.length) { return }
8812
+ if (info.focus || takeFocus) { this.showPrimarySelection(); }
8813
+ this.showMultipleSelections(info);
8814
+ };
8815
+
8816
+ ContentEditableInput.prototype.getSelection = function () {
8817
+ return this.cm.display.wrapper.ownerDocument.getSelection()
8818
+ };
8819
+
8820
+ ContentEditableInput.prototype.showPrimarySelection = function () {
8821
+ var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();
8822
+ var from = prim.from(), to = prim.to();
8823
+
8824
+ if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
8825
+ sel.removeAllRanges();
8826
+ return
8827
+ }
8828
+
8829
+ var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);
8830
+ var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);
8831
+ if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
8832
+ cmp(minPos(curAnchor, curFocus), from) == 0 &&
8833
+ cmp(maxPos(curAnchor, curFocus), to) == 0)
8834
+ { return }
8835
+
8836
+ var view = cm.display.view;
8837
+ var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||
8838
+ {node: view[0].measure.map[2], offset: 0};
8839
+ var end = to.line < cm.display.viewTo && posToDOM(cm, to);
8840
+ if (!end) {
8841
+ var measure = view[view.length - 1].measure;
8842
+ var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;
8843
+ end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};
8844
+ }
8845
+
8846
+ if (!start || !end) {
8847
+ sel.removeAllRanges();
8848
+ return
8849
+ }
8850
+
8851
+ var old = sel.rangeCount && sel.getRangeAt(0), rng;
8852
+ try { rng = range(start.node, start.offset, end.offset, end.node); }
8853
+ catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
8854
+ if (rng) {
8855
+ if (!gecko && cm.state.focused) {
8856
+ sel.collapse(start.node, start.offset);
8857
+ if (!rng.collapsed) {
8858
+ sel.removeAllRanges();
8859
+ sel.addRange(rng);
8860
+ }
8861
+ } else {
8862
+ sel.removeAllRanges();
8863
+ sel.addRange(rng);
8864
+ }
8865
+ if (old && sel.anchorNode == null) { sel.addRange(old); }
8866
+ else if (gecko) { this.startGracePeriod(); }
8867
+ }
8868
+ this.rememberSelection();
8869
+ };
8870
+
8871
+ ContentEditableInput.prototype.startGracePeriod = function () {
8872
+ var this$1 = this;
8873
+
8874
+ clearTimeout(this.gracePeriod);
8875
+ this.gracePeriod = setTimeout(function () {
8876
+ this$1.gracePeriod = false;
8877
+ if (this$1.selectionChanged())
8878
+ { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }
8879
+ }, 20);
8880
+ };
8881
+
8882
+ ContentEditableInput.prototype.showMultipleSelections = function (info) {
8883
+ removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);
8884
+ removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);
8885
+ };
8886
+
8887
+ ContentEditableInput.prototype.rememberSelection = function () {
8888
+ var sel = this.getSelection();
8889
+ this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;
8890
+ this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;
8891
+ };
8892
+
8893
+ ContentEditableInput.prototype.selectionInEditor = function () {
8894
+ var sel = this.getSelection();
8895
+ if (!sel.rangeCount) { return false }
8896
+ var node = sel.getRangeAt(0).commonAncestorContainer;
8897
+ return contains(this.div, node)
8898
+ };
8899
+
8900
+ ContentEditableInput.prototype.focus = function () {
8901
+ if (this.cm.options.readOnly != "nocursor") {
8902
+ if (!this.selectionInEditor())
8903
+ { this.showSelection(this.prepareSelection(), true); }
8904
+ this.div.focus();
8905
+ }
8906
+ };
8907
+ ContentEditableInput.prototype.blur = function () { this.div.blur(); };
8908
+ ContentEditableInput.prototype.getField = function () { return this.div };
8909
+
8910
+ ContentEditableInput.prototype.supportsTouch = function () { return true };
8911
+
8912
+ ContentEditableInput.prototype.receivedFocus = function () {
8913
+ var input = this;
8914
+ if (this.selectionInEditor())
8915
+ { this.pollSelection(); }
8916
+ else
8917
+ { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }
8918
+
8919
+ function poll() {
8920
+ if (input.cm.state.focused) {
8921
+ input.pollSelection();
8922
+ input.polling.set(input.cm.options.pollInterval, poll);
8923
+ }
8924
+ }
8925
+ this.polling.set(this.cm.options.pollInterval, poll);
8926
+ };
8927
+
8928
+ ContentEditableInput.prototype.selectionChanged = function () {
8929
+ var sel = this.getSelection();
8930
+ return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||
8931
+ sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset
8932
+ };
8933
+
8934
+ ContentEditableInput.prototype.pollSelection = function () {
8935
+ if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }
8936
+ var sel = this.getSelection(), cm = this.cm;
8937
+ // On Android Chrome (version 56, at least), backspacing into an
8938
+ // uneditable block element will put the cursor in that element,
8939
+ // and then, because it's not editable, hide the virtual keyboard.
8940
+ // Because Android doesn't allow us to actually detect backspace
8941
+ // presses in a sane way, this code checks for when that happens
8942
+ // and simulates a backspace press in this case.
8943
+ if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {
8944
+ this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs});
8945
+ this.blur();
8946
+ this.focus();
8947
+ return
8948
+ }
8949
+ if (this.composing) { return }
8950
+ this.rememberSelection();
8951
+ var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);
8952
+ var head = domToPos(cm, sel.focusNode, sel.focusOffset);
8953
+ if (anchor && head) { runInOp(cm, function () {
8954
+ setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);
8955
+ if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }
8956
+ }); }
8957
+ };
8958
+
8959
+ ContentEditableInput.prototype.pollContent = function () {
8960
+ if (this.readDOMTimeout != null) {
8961
+ clearTimeout(this.readDOMTimeout);
8962
+ this.readDOMTimeout = null;
8963
+ }
8964
+
8965
+ var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();
8966
+ var from = sel.from(), to = sel.to();
8967
+ if (from.ch == 0 && from.line > cm.firstLine())
8968
+ { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }
8969
+ if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())
8970
+ { to = Pos(to.line + 1, 0); }
8971
+ if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }
8972
+
8973
+ var fromIndex, fromLine, fromNode;
8974
+ if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {
8975
+ fromLine = lineNo(display.view[0].line);
8976
+ fromNode = display.view[0].node;
8977
+ } else {
8978
+ fromLine = lineNo(display.view[fromIndex].line);
8979
+ fromNode = display.view[fromIndex - 1].node.nextSibling;
8980
+ }
8981
+ var toIndex = findViewIndex(cm, to.line);
8982
+ var toLine, toNode;
8983
+ if (toIndex == display.view.length - 1) {
8984
+ toLine = display.viewTo - 1;
8985
+ toNode = display.lineDiv.lastChild;
8986
+ } else {
8987
+ toLine = lineNo(display.view[toIndex + 1].line) - 1;
8988
+ toNode = display.view[toIndex + 1].node.previousSibling;
8989
+ }
8990
+
8991
+ if (!fromNode) { return false }
8992
+ var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));
8993
+ var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));
8994
+ while (newText.length > 1 && oldText.length > 1) {
8995
+ if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }
8996
+ else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }
8997
+ else { break }
8998
+ }
8999
+
9000
+ var cutFront = 0, cutEnd = 0;
9001
+ var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);
9002
+ while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))
9003
+ { ++cutFront; }
9004
+ var newBot = lst(newText), oldBot = lst(oldText);
9005
+ var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),
9006
+ oldBot.length - (oldText.length == 1 ? cutFront : 0));
9007
+ while (cutEnd < maxCutEnd &&
9008
+ newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
9009
+ { ++cutEnd; }
9010
+ // Try to move start of change to start of selection if ambiguous
9011
+ if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {
9012
+ while (cutFront && cutFront > from.ch &&
9013
+ newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {
9014
+ cutFront--;
9015
+ cutEnd++;
9016
+ }
9017
+ }
9018
+
9019
+ newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "");
9020
+ newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "");
9021
+
9022
+ var chFrom = Pos(fromLine, cutFront);
9023
+ var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);
9024
+ if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {
9025
+ replaceRange(cm.doc, newText, chFrom, chTo, "+input");
9026
+ return true
9027
+ }
9028
+ };
9029
+
9030
+ ContentEditableInput.prototype.ensurePolled = function () {
9031
+ this.forceCompositionEnd();
9032
+ };
9033
+ ContentEditableInput.prototype.reset = function () {
9034
+ this.forceCompositionEnd();
9035
+ };
9036
+ ContentEditableInput.prototype.forceCompositionEnd = function () {
9037
+ if (!this.composing) { return }
9038
+ clearTimeout(this.readDOMTimeout);
9039
+ this.composing = null;
9040
+ this.updateFromDOM();
9041
+ this.div.blur();
9042
+ this.div.focus();
9043
+ };
9044
+ ContentEditableInput.prototype.readFromDOMSoon = function () {
9045
+ var this$1 = this;
9046
+
9047
+ if (this.readDOMTimeout != null) { return }
9048
+ this.readDOMTimeout = setTimeout(function () {
9049
+ this$1.readDOMTimeout = null;
9050
+ if (this$1.composing) {
9051
+ if (this$1.composing.done) { this$1.composing = null; }
9052
+ else { return }
9053
+ }
9054
+ this$1.updateFromDOM();
9055
+ }, 80);
9056
+ };
9057
+
9058
+ ContentEditableInput.prototype.updateFromDOM = function () {
9059
+ var this$1 = this;
9060
+
9061
+ if (this.cm.isReadOnly() || !this.pollContent())
9062
+ { runInOp(this.cm, function () { return regChange(this$1.cm); }); }
9063
+ };
9064
+
9065
+ ContentEditableInput.prototype.setUneditable = function (node) {
9066
+ node.contentEditable = "false";
9067
+ };
9068
+
9069
+ ContentEditableInput.prototype.onKeyPress = function (e) {
9070
+ if (e.charCode == 0 || this.composing) { return }
9071
+ e.preventDefault();
9072
+ if (!this.cm.isReadOnly())
9073
+ { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }
9074
+ };
9075
+
9076
+ ContentEditableInput.prototype.readOnlyChanged = function (val) {
9077
+ this.div.contentEditable = String(val != "nocursor");
9078
+ };
9079
+
9080
+ ContentEditableInput.prototype.onContextMenu = function () {};
9081
+ ContentEditableInput.prototype.resetPosition = function () {};
9082
+
9083
+ ContentEditableInput.prototype.needsContentAttribute = true;
9084
+
9085
+ function posToDOM(cm, pos) {
9086
+ var view = findViewForLine(cm, pos.line);
9087
+ if (!view || view.hidden) { return null }
9088
+ var line = getLine(cm.doc, pos.line);
9089
+ var info = mapFromLineView(view, line, pos.line);
9090
+
9091
+ var order = getOrder(line, cm.doc.direction), side = "left";
9092
+ if (order) {
9093
+ var partPos = getBidiPartAt(order, pos.ch);
9094
+ side = partPos % 2 ? "right" : "left";
9095
+ }
9096
+ var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
9097
+ result.offset = result.collapse == "right" ? result.end : result.start;
9098
+ return result
9099
+ }
9100
+
9101
+ function isInGutter(node) {
9102
+ for (var scan = node; scan; scan = scan.parentNode)
9103
+ { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }
9104
+ return false
9105
+ }
9106
+
9107
+ function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
9108
+
9109
+ function domTextBetween(cm, from, to, fromLine, toLine) {
9110
+ var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;
9111
+ function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
9112
+ function close() {
9113
+ if (closing) {
9114
+ text += lineSep;
9115
+ if (extraLinebreak) { text += lineSep; }
9116
+ closing = extraLinebreak = false;
9117
+ }
9118
+ }
9119
+ function addText(str) {
9120
+ if (str) {
9121
+ close();
9122
+ text += str;
9123
+ }
9124
+ }
9125
+ function walk(node) {
9126
+ if (node.nodeType == 1) {
9127
+ var cmText = node.getAttribute("cm-text");
9128
+ if (cmText) {
9129
+ addText(cmText);
9130
+ return
9131
+ }
9132
+ var markerID = node.getAttribute("cm-marker"), range$$1;
9133
+ if (markerID) {
9134
+ var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));
9135
+ if (found.length && (range$$1 = found[0].find(0)))
9136
+ { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }
9137
+ return
9138
+ }
9139
+ if (node.getAttribute("contenteditable") == "false") { return }
9140
+ var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);
9141
+ if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }
9142
+
9143
+ if (isBlock) { close(); }
9144
+ for (var i = 0; i < node.childNodes.length; i++)
9145
+ { walk(node.childNodes[i]); }
9146
+
9147
+ if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }
9148
+ if (isBlock) { closing = true; }
9149
+ } else if (node.nodeType == 3) {
9150
+ addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " "));
9151
+ }
9152
+ }
9153
+ for (;;) {
9154
+ walk(from);
9155
+ if (from == to) { break }
9156
+ from = from.nextSibling;
9157
+ extraLinebreak = false;
9158
+ }
9159
+ return text
9160
+ }
9161
+
9162
+ function domToPos(cm, node, offset) {
9163
+ var lineNode;
9164
+ if (node == cm.display.lineDiv) {
9165
+ lineNode = cm.display.lineDiv.childNodes[offset];
9166
+ if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }
9167
+ node = null; offset = 0;
9168
+ } else {
9169
+ for (lineNode = node;; lineNode = lineNode.parentNode) {
9170
+ if (!lineNode || lineNode == cm.display.lineDiv) { return null }
9171
+ if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }
9172
+ }
9173
+ }
9174
+ for (var i = 0; i < cm.display.view.length; i++) {
9175
+ var lineView = cm.display.view[i];
9176
+ if (lineView.node == lineNode)
9177
+ { return locateNodeInLineView(lineView, node, offset) }
9178
+ }
9179
+ }
9180
+
9181
+ function locateNodeInLineView(lineView, node, offset) {
9182
+ var wrapper = lineView.text.firstChild, bad = false;
9183
+ if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }
9184
+ if (node == wrapper) {
9185
+ bad = true;
9186
+ node = wrapper.childNodes[offset];
9187
+ offset = 0;
9188
+ if (!node) {
9189
+ var line = lineView.rest ? lst(lineView.rest) : lineView.line;
9190
+ return badPos(Pos(lineNo(line), line.text.length), bad)
9191
+ }
9192
+ }
9193
+
9194
+ var textNode = node.nodeType == 3 ? node : null, topNode = node;
9195
+ if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
9196
+ textNode = node.firstChild;
9197
+ if (offset) { offset = textNode.nodeValue.length; }
9198
+ }
9199
+ while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }
9200
+ var measure = lineView.measure, maps = measure.maps;
9201
+
9202
+ function find(textNode, topNode, offset) {
9203
+ for (var i = -1; i < (maps ? maps.length : 0); i++) {
9204
+ var map$$1 = i < 0 ? measure.map : maps[i];
9205
+ for (var j = 0; j < map$$1.length; j += 3) {
9206
+ var curNode = map$$1[j + 2];
9207
+ if (curNode == textNode || curNode == topNode) {
9208
+ var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);
9209
+ var ch = map$$1[j] + offset;
9210
+ if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }
9211
+ return Pos(line, ch)
9212
+ }
9213
+ }
9214
+ }
9215
+ }
9216
+ var found = find(textNode, topNode, offset);
9217
+ if (found) { return badPos(found, bad) }
9218
+
9219
+ // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems
9220
+ for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {
9221
+ found = find(after, after.firstChild, 0);
9222
+ if (found)
9223
+ { return badPos(Pos(found.line, found.ch - dist), bad) }
9224
+ else
9225
+ { dist += after.textContent.length; }
9226
+ }
9227
+ for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {
9228
+ found = find(before, before.firstChild, -1);
9229
+ if (found)
9230
+ { return badPos(Pos(found.line, found.ch + dist$1), bad) }
9231
+ else
9232
+ { dist$1 += before.textContent.length; }
9233
+ }
9234
+ }
9235
+
9236
+ // TEXTAREA INPUT STYLE
9237
+
9238
+ var TextareaInput = function(cm) {
9239
+ this.cm = cm;
9240
+ // See input.poll and input.reset
9241
+ this.prevInput = "";
9242
+
9243
+ // Flag that indicates whether we expect input to appear real soon
9244
+ // now (after some event like 'keypress' or 'input') and are
9245
+ // polling intensively.
9246
+ this.pollingFast = false;
9247
+ // Self-resetting timeout for the poller
9248
+ this.polling = new Delayed();
9249
+ // Used to work around IE issue with selection being forgotten when focus moves away from textarea
9250
+ this.hasSelection = false;
9251
+ this.composing = null;
9252
+ };
9253
+
9254
+ TextareaInput.prototype.init = function (display) {
9255
+ var this$1 = this;
9256
+
9257
+ var input = this, cm = this.cm;
9258
+ this.createField(display);
9259
+ var te = this.textarea;
9260
+
9261
+ display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);
9262
+
9263
+ // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
9264
+ if (ios) { te.style.width = "0px"; }
9265
+
9266
+ on(te, "input", function () {
9267
+ if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }
9268
+ input.poll();
9269
+ });
9270
+
9271
+ on(te, "paste", function (e) {
9272
+ if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
9273
+
9274
+ cm.state.pasteIncoming = true;
9275
+ input.fastPoll();
9276
+ });
9277
+
9278
+ function prepareCopyCut(e) {
9279
+ if (signalDOMEvent(cm, e)) { return }
9280
+ if (cm.somethingSelected()) {
9281
+ setLastCopied({lineWise: false, text: cm.getSelections()});
9282
+ } else if (!cm.options.lineWiseCopyCut) {
9283
+ return
9284
+ } else {
9285
+ var ranges = copyableRanges(cm);
9286
+ setLastCopied({lineWise: true, text: ranges.text});
9287
+ if (e.type == "cut") {
9288
+ cm.setSelections(ranges.ranges, null, sel_dontScroll);
9289
+ } else {
9290
+ input.prevInput = "";
9291
+ te.value = ranges.text.join("\n");
9292
+ selectInput(te);
9293
+ }
9294
+ }
9295
+ if (e.type == "cut") { cm.state.cutIncoming = true; }
9296
+ }
9297
+ on(te, "cut", prepareCopyCut);
9298
+ on(te, "copy", prepareCopyCut);
9299
+
9300
+ on(display.scroller, "paste", function (e) {
9301
+ if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }
9302
+ cm.state.pasteIncoming = true;
9303
+ input.focus();
9304
+ });
9305
+
9306
+ // Prevent normal selection in the editor (we handle our own)
9307
+ on(display.lineSpace, "selectstart", function (e) {
9308
+ if (!eventInWidget(display, e)) { e_preventDefault(e); }
9309
+ });
9310
+
9311
+ on(te, "compositionstart", function () {
9312
+ var start = cm.getCursor("from");
9313
+ if (input.composing) { input.composing.range.clear(); }
9314
+ input.composing = {
9315
+ start: start,
9316
+ range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"})
9317
+ };
9318
+ });
9319
+ on(te, "compositionend", function () {
9320
+ if (input.composing) {
9321
+ input.poll();
9322
+ input.composing.range.clear();
9323
+ input.composing = null;
9324
+ }
9325
+ });
9326
+ };
9327
+
9328
+ TextareaInput.prototype.createField = function (_display) {
9329
+ // Wraps and hides input textarea
9330
+ this.wrapper = hiddenTextarea();
9331
+ // The semihidden textarea that is focused when the editor is
9332
+ // focused, and receives input.
9333
+ this.textarea = this.wrapper.firstChild;
9334
+ };
9335
+
9336
+ TextareaInput.prototype.prepareSelection = function () {
9337
+ // Redraw the selection and/or cursor
9338
+ var cm = this.cm, display = cm.display, doc = cm.doc;
9339
+ var result = prepareSelection(cm);
9340
+
9341
+ // Move the hidden textarea near the cursor to prevent scrolling artifacts
9342
+ if (cm.options.moveInputWithCursor) {
9343
+ var headPos = cursorCoords(cm, doc.sel.primary().head, "div");
9344
+ var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();
9345
+ result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
9346
+ headPos.top + lineOff.top - wrapOff.top));
9347
+ result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
9348
+ headPos.left + lineOff.left - wrapOff.left));
9349
+ }
9350
+
9351
+ return result
9352
+ };
9353
+
9354
+ TextareaInput.prototype.showSelection = function (drawn) {
9355
+ var cm = this.cm, display = cm.display;
9356
+ removeChildrenAndAdd(display.cursorDiv, drawn.cursors);
9357
+ removeChildrenAndAdd(display.selectionDiv, drawn.selection);
9358
+ if (drawn.teTop != null) {
9359
+ this.wrapper.style.top = drawn.teTop + "px";
9360
+ this.wrapper.style.left = drawn.teLeft + "px";
9361
+ }
9362
+ };
9363
+
9364
+ // Reset the input to correspond to the selection (or to be empty,
9365
+ // when not typing and nothing is selected)
9366
+ TextareaInput.prototype.reset = function (typing) {
9367
+ if (this.contextMenuPending || this.composing) { return }
9368
+ var cm = this.cm;
9369
+ if (cm.somethingSelected()) {
9370
+ this.prevInput = "";
9371
+ var content = cm.getSelection();
9372
+ this.textarea.value = content;
9373
+ if (cm.state.focused) { selectInput(this.textarea); }
9374
+ if (ie && ie_version >= 9) { this.hasSelection = content; }
9375
+ } else if (!typing) {
9376
+ this.prevInput = this.textarea.value = "";
9377
+ if (ie && ie_version >= 9) { this.hasSelection = null; }
9378
+ }
9379
+ };
9380
+
9381
+ TextareaInput.prototype.getField = function () { return this.textarea };
9382
+
9383
+ TextareaInput.prototype.supportsTouch = function () { return false };
9384
+
9385
+ TextareaInput.prototype.focus = function () {
9386
+ if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
9387
+ try { this.textarea.focus(); }
9388
+ catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
9389
+ }
9390
+ };
9391
+
9392
+ TextareaInput.prototype.blur = function () { this.textarea.blur(); };
9393
+
9394
+ TextareaInput.prototype.resetPosition = function () {
9395
+ this.wrapper.style.top = this.wrapper.style.left = 0;
9396
+ };
9397
+
9398
+ TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };
9399
+
9400
+ // Poll for input changes, using the normal rate of polling. This
9401
+ // runs as long as the editor is focused.
9402
+ TextareaInput.prototype.slowPoll = function () {
9403
+ var this$1 = this;
9404
+
9405
+ if (this.pollingFast) { return }
9406
+ this.polling.set(this.cm.options.pollInterval, function () {
9407
+ this$1.poll();
9408
+ if (this$1.cm.state.focused) { this$1.slowPoll(); }
9409
+ });
9410
+ };
9411
+
9412
+ // When an event has just come in that is likely to add or change
9413
+ // something in the input textarea, we poll faster, to ensure that
9414
+ // the change appears on the screen quickly.
9415
+ TextareaInput.prototype.fastPoll = function () {
9416
+ var missed = false, input = this;
9417
+ input.pollingFast = true;
9418
+ function p() {
9419
+ var changed = input.poll();
9420
+ if (!changed && !missed) {missed = true; input.polling.set(60, p);}
9421
+ else {input.pollingFast = false; input.slowPoll();}
9422
+ }
9423
+ input.polling.set(20, p);
9424
+ };
9425
+
9426
+ // Read input from the textarea, and update the document to match.
9427
+ // When something is selected, it is present in the textarea, and
9428
+ // selected (unless it is huge, in which case a placeholder is
9429
+ // used). When nothing is selected, the cursor sits after previously
9430
+ // seen text (can be empty), which is stored in prevInput (we must
9431
+ // not reset the textarea when typing, because that breaks IME).
9432
+ TextareaInput.prototype.poll = function () {
9433
+ var this$1 = this;
9434
+
9435
+ var cm = this.cm, input = this.textarea, prevInput = this.prevInput;
9436
+ // Since this is called a *lot*, try to bail out as cheaply as
9437
+ // possible when it is clear that nothing happened. hasSelection
9438
+ // will be the case when there is a lot of text in the textarea,
9439
+ // in which case reading its value would be expensive.
9440
+ if (this.contextMenuPending || !cm.state.focused ||
9441
+ (hasSelection(input) && !prevInput && !this.composing) ||
9442
+ cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
9443
+ { return false }
9444
+
9445
+ var text = input.value;
9446
+ // If nothing changed, bail.
9447
+ if (text == prevInput && !cm.somethingSelected()) { return false }
9448
+ // Work around nonsensical selection resetting in IE9/10, and
9449
+ // inexplicable appearance of private area unicode characters on
9450
+ // some key combos in Mac (#2689).
9451
+ if (ie && ie_version >= 9 && this.hasSelection === text ||
9452
+ mac && /[\uf700-\uf7ff]/.test(text)) {
9453
+ cm.display.input.reset();
9454
+ return false
9455
+ }
9456
+
9457
+ if (cm.doc.sel == cm.display.selForContextMenu) {
9458
+ var first = text.charCodeAt(0);
9459
+ if (first == 0x200b && !prevInput) { prevInput = "\u200b"; }
9460
+ if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") }
9461
+ }
9462
+ // Find the part of the input that is actually new
9463
+ var same = 0, l = Math.min(prevInput.length, text.length);
9464
+ while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }
9465
+
9466
+ runInOp(cm, function () {
9467
+ applyTextInput(cm, text.slice(same), prevInput.length - same,
9468
+ null, this$1.composing ? "*compose" : null);
9469
+
9470
+ // Don't leave long text in the textarea, since it makes further polling slow
9471
+ if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; }
9472
+ else { this$1.prevInput = text; }
9473
+
9474
+ if (this$1.composing) {
9475
+ this$1.composing.range.clear();
9476
+ this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"),
9477
+ {className: "CodeMirror-composing"});
9478
+ }
9479
+ });
9480
+ return true
9481
+ };
9482
+
9483
+ TextareaInput.prototype.ensurePolled = function () {
9484
+ if (this.pollingFast && this.poll()) { this.pollingFast = false; }
9485
+ };
9486
+
9487
+ TextareaInput.prototype.onKeyPress = function () {
9488
+ if (ie && ie_version >= 9) { this.hasSelection = null; }
9489
+ this.fastPoll();
9490
+ };
9491
+
9492
+ TextareaInput.prototype.onContextMenu = function (e) {
9493
+ var input = this, cm = input.cm, display = cm.display, te = input.textarea;
9494
+ if (input.contextMenuPending) { input.contextMenuPending(); }
9495
+ var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
9496
+ if (!pos || presto) { return } // Opera is difficult.
9497
+
9498
+ // Reset the current text selection only if the click is done outside of the selection
9499
+ // and 'resetSelectionOnContextMenu' option is true.
9500
+ var reset = cm.options.resetSelectionOnContextMenu;
9501
+ if (reset && cm.doc.sel.contains(pos) == -1)
9502
+ { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }
9503
+
9504
+ var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;
9505
+ var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();
9506
+ input.wrapper.style.cssText = "position: static";
9507
+ te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
9508
+ var oldScrollY;
9509
+ if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)
9510
+ display.input.focus();
9511
+ if (webkit) { window.scrollTo(null, oldScrollY); }
9512
+ display.input.reset();
9513
+ // Adds "Select all" to context menu in FF
9514
+ if (!cm.somethingSelected()) { te.value = input.prevInput = " "; }
9515
+ input.contextMenuPending = rehide;
9516
+ display.selForContextMenu = cm.doc.sel;
9517
+ clearTimeout(display.detectingSelectAll);
9518
+
9519
+ // Select-all will be greyed out if there's nothing to select, so
9520
+ // this adds a zero-width space so that we can later check whether
9521
+ // it got selected.
9522
+ function prepareSelectAllHack() {
9523
+ if (te.selectionStart != null) {
9524
+ var selected = cm.somethingSelected();
9525
+ var extval = "\u200b" + (selected ? te.value : "");
9526
+ te.value = "\u21da"; // Used to catch context-menu undo
9527
+ te.value = extval;
9528
+ input.prevInput = selected ? "" : "\u200b";
9529
+ te.selectionStart = 1; te.selectionEnd = extval.length;
9530
+ // Re-set this, in case some other handler touched the
9531
+ // selection in the meantime.
9532
+ display.selForContextMenu = cm.doc.sel;
9533
+ }
9534
+ }
9535
+ function rehide() {
9536
+ if (input.contextMenuPending != rehide) { return }
9537
+ input.contextMenuPending = false;
9538
+ input.wrapper.style.cssText = oldWrapperCSS;
9539
+ te.style.cssText = oldCSS;
9540
+ if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }
9541
+
9542
+ // Try to detect the user choosing select-all
9543
+ if (te.selectionStart != null) {
9544
+ if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }
9545
+ var i = 0, poll = function () {
9546
+ if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&
9547
+ te.selectionEnd > 0 && input.prevInput == "\u200b") {
9548
+ operation(cm, selectAll)(cm);
9549
+ } else if (i++ < 10) {
9550
+ display.detectingSelectAll = setTimeout(poll, 500);
9551
+ } else {
9552
+ display.selForContextMenu = null;
9553
+ display.input.reset();
9554
+ }
9555
+ };
9556
+ display.detectingSelectAll = setTimeout(poll, 200);
9557
+ }
9558
+ }
9559
+
9560
+ if (ie && ie_version >= 9) { prepareSelectAllHack(); }
9561
+ if (captureRightClick) {
9562
+ e_stop(e);
9563
+ var mouseup = function () {
9564
+ off(window, "mouseup", mouseup);
9565
+ setTimeout(rehide, 20);
9566
+ };
9567
+ on(window, "mouseup", mouseup);
9568
+ } else {
9569
+ setTimeout(rehide, 50);
9570
+ }
9571
+ };
9572
+
9573
+ TextareaInput.prototype.readOnlyChanged = function (val) {
9574
+ if (!val) { this.reset(); }
9575
+ this.textarea.disabled = val == "nocursor";
9576
+ };
9577
+
9578
+ TextareaInput.prototype.setUneditable = function () {};
9579
+
9580
+ TextareaInput.prototype.needsContentAttribute = false;
9581
+
9582
+ function fromTextArea(textarea, options) {
9583
+ options = options ? copyObj(options) : {};
9584
+ options.value = textarea.value;
9585
+ if (!options.tabindex && textarea.tabIndex)
9586
+ { options.tabindex = textarea.tabIndex; }
9587
+ if (!options.placeholder && textarea.placeholder)
9588
+ { options.placeholder = textarea.placeholder; }
9589
+ // Set autofocus to true if this textarea is focused, or if it has
9590
+ // autofocus and no other element is focused.
9591
+ if (options.autofocus == null) {
9592
+ var hasFocus = activeElt();
9593
+ options.autofocus = hasFocus == textarea ||
9594
+ textarea.getAttribute("autofocus") != null && hasFocus == document.body;
9595
+ }
9596
+
9597
+ function save() {textarea.value = cm.getValue();}
9598
+
9599
+ var realSubmit;
9600
+ if (textarea.form) {
9601
+ on(textarea.form, "submit", save);
9602
+ // Deplorable hack to make the submit method do the right thing.
9603
+ if (!options.leaveSubmitMethodAlone) {
9604
+ var form = textarea.form;
9605
+ realSubmit = form.submit;
9606
+ try {
9607
+ var wrappedSubmit = form.submit = function () {
9608
+ save();
9609
+ form.submit = realSubmit;
9610
+ form.submit();
9611
+ form.submit = wrappedSubmit;
9612
+ };
9613
+ } catch(e) {}
9614
+ }
9615
+ }
9616
+
9617
+ options.finishInit = function (cm) {
9618
+ cm.save = save;
9619
+ cm.getTextArea = function () { return textarea; };
9620
+ cm.toTextArea = function () {
9621
+ cm.toTextArea = isNaN; // Prevent this from being ran twice
9622
+ save();
9623
+ textarea.parentNode.removeChild(cm.getWrapperElement());
9624
+ textarea.style.display = "";
9625
+ if (textarea.form) {
9626
+ off(textarea.form, "submit", save);
9627
+ if (typeof textarea.form.submit == "function")
9628
+ { textarea.form.submit = realSubmit; }
9629
+ }
9630
+ };
9631
+ };
9632
+
9633
+ textarea.style.display = "none";
9634
+ var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },
9635
+ options);
9636
+ return cm
9637
+ }
9638
+
9639
+ function addLegacyProps(CodeMirror) {
9640
+ CodeMirror.off = off;
9641
+ CodeMirror.on = on;
9642
+ CodeMirror.wheelEventPixels = wheelEventPixels;
9643
+ CodeMirror.Doc = Doc;
9644
+ CodeMirror.splitLines = splitLinesAuto;
9645
+ CodeMirror.countColumn = countColumn;
9646
+ CodeMirror.findColumn = findColumn;
9647
+ CodeMirror.isWordChar = isWordCharBasic;
9648
+ CodeMirror.Pass = Pass;
9649
+ CodeMirror.signal = signal;
9650
+ CodeMirror.Line = Line;
9651
+ CodeMirror.changeEnd = changeEnd;
9652
+ CodeMirror.scrollbarModel = scrollbarModel;
9653
+ CodeMirror.Pos = Pos;
9654
+ CodeMirror.cmpPos = cmp;
9655
+ CodeMirror.modes = modes;
9656
+ CodeMirror.mimeModes = mimeModes;
9657
+ CodeMirror.resolveMode = resolveMode;
9658
+ CodeMirror.getMode = getMode;
9659
+ CodeMirror.modeExtensions = modeExtensions;
9660
+ CodeMirror.extendMode = extendMode;
9661
+ CodeMirror.copyState = copyState;
9662
+ CodeMirror.startState = startState;
9663
+ CodeMirror.innerMode = innerMode;
9664
+ CodeMirror.commands = commands;
9665
+ CodeMirror.keyMap = keyMap;
9666
+ CodeMirror.keyName = keyName;
9667
+ CodeMirror.isModifierKey = isModifierKey;
9668
+ CodeMirror.lookupKey = lookupKey;
9669
+ CodeMirror.normalizeKeyMap = normalizeKeyMap;
9670
+ CodeMirror.StringStream = StringStream;
9671
+ CodeMirror.SharedTextMarker = SharedTextMarker;
9672
+ CodeMirror.TextMarker = TextMarker;
9673
+ CodeMirror.LineWidget = LineWidget;
9674
+ CodeMirror.e_preventDefault = e_preventDefault;
9675
+ CodeMirror.e_stopPropagation = e_stopPropagation;
9676
+ CodeMirror.e_stop = e_stop;
9677
+ CodeMirror.addClass = addClass;
9678
+ CodeMirror.contains = contains;
9679
+ CodeMirror.rmClass = rmClass;
9680
+ CodeMirror.keyNames = keyNames;
9681
+ }
9682
+
9683
+ // EDITOR CONSTRUCTOR
9684
+
9685
+ defineOptions(CodeMirror);
9686
+
9687
+ addEditorMethods(CodeMirror);
9688
+
9689
+ // Set up methods on CodeMirror's prototype to redirect to the editor's document.
9690
+ var dontDelegate = "iter insert remove copy getEditor constructor".split(" ");
9691
+ for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
9692
+ { CodeMirror.prototype[prop] = (function(method) {
9693
+ return function() {return method.apply(this.doc, arguments)}
9694
+ })(Doc.prototype[prop]); } }
9695
+
9696
+ eventMixin(Doc);
9697
+ CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput};
9698
+
9699
+ // Extra arguments are stored as the mode's dependencies, which is
9700
+ // used by (legacy) mechanisms like loadmode.js to automatically
9701
+ // load a mode. (Preferred mechanism is the require/define calls.)
9702
+ CodeMirror.defineMode = function(name/*, mode, …*/) {
9703
+ if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; }
9704
+ defineMode.apply(this, arguments);
9705
+ };
9706
+
9707
+ CodeMirror.defineMIME = defineMIME;
9708
+
9709
+ // Minimal default mode.
9710
+ CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });
9711
+ CodeMirror.defineMIME("text/plain", "null");
9712
+
9713
+ // EXTENSIONS
9714
+
9715
+ CodeMirror.defineExtension = function (name, func) {
9716
+ CodeMirror.prototype[name] = func;
9717
+ };
9718
+ CodeMirror.defineDocExtension = function (name, func) {
9719
+ Doc.prototype[name] = func;
9720
+ };
9721
+
9722
+ CodeMirror.fromTextArea = fromTextArea;
9723
+
9724
+ addLegacyProps(CodeMirror);
9725
+
9726
+ CodeMirror.version = "5.42.2";
9727
+
9728
+ return CodeMirror;
9729
+
9730
+ })));
assets/codemirror/css.js ADDED
@@ -0,0 +1,730 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function (mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["codemirror-css"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function (CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("css", function (config, parserConfig) {
15
+ if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css");
16
+
17
+ var indentUnit = config.indentUnit,
18
+ tokenHooks = parserConfig.tokenHooks,
19
+ mediaTypes = parserConfig.mediaTypes || {},
20
+ mediaFeatures = parserConfig.mediaFeatures || {},
21
+ propertyKeywords = parserConfig.propertyKeywords || {},
22
+ nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},
23
+ colorKeywords = parserConfig.colorKeywords || {},
24
+ valueKeywords = parserConfig.valueKeywords || {},
25
+ fontProperties = parserConfig.fontProperties || {},
26
+ allowNested = parserConfig.allowNested;
27
+
28
+ var type, override;
29
+
30
+ function ret(style, tp) {
31
+ type = tp;
32
+ return style;
33
+ }
34
+
35
+ // Tokenizers
36
+
37
+ function tokenBase(stream, state) {
38
+ var ch = stream.next();
39
+ if (tokenHooks[ch]) {
40
+ var result = tokenHooks[ch](stream, state);
41
+ if (result !== false) return result;
42
+ }
43
+ if (ch == "@") {
44
+ stream.eatWhile(/[\w\\\-]/);
45
+ return ret("def", stream.current());
46
+ } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) {
47
+ return ret(null, "compare");
48
+ } else if (ch == "\"" || ch == "'") {
49
+ state.tokenize = tokenString(ch);
50
+ return state.tokenize(stream, state);
51
+ } else if (ch == "#") {
52
+ stream.eatWhile(/[\w\\\-]/);
53
+ return ret("atom", "hash");
54
+ } else if (ch == "!") {
55
+ stream.match(/^\s*\w*/);
56
+ return ret("keyword", "important");
57
+ } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) {
58
+ stream.eatWhile(/[\w.%]/);
59
+ return ret("number", "unit");
60
+ } else if (ch === "-") {
61
+ if (/[\d.]/.test(stream.peek())) {
62
+ stream.eatWhile(/[\w.%]/);
63
+ return ret("number", "unit");
64
+ } else if (stream.match(/^\w+-/)) {
65
+ return ret("meta", "meta");
66
+ }
67
+ } else if (/[,+>*\/]/.test(ch)) {
68
+ return ret(null, "select-op");
69
+ } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {
70
+ return ret("qualifier", "qualifier");
71
+ } else if (/[:;{}\[\]\(\)]/.test(ch)) {
72
+ return ret(null, ch);
73
+ } else if (ch == "u" && stream.match("rl(")) {
74
+ stream.backUp(1);
75
+ state.tokenize = tokenParenthesized;
76
+ return ret("property", "word");
77
+ } else if (/[\w\\\-]/.test(ch)) {
78
+ stream.eatWhile(/[\w\\\-]/);
79
+ return ret("property", "word");
80
+ } else {
81
+ return ret(null, null);
82
+ }
83
+ }
84
+
85
+ function tokenString(quote) {
86
+ return function (stream, state) {
87
+ var escaped = false, ch;
88
+ while ((ch = stream.next()) != null) {
89
+ if (ch == quote && !escaped) {
90
+ if (quote == ")") stream.backUp(1);
91
+ break;
92
+ }
93
+ escaped = !escaped && ch == "\\";
94
+ }
95
+ if (ch == quote || !escaped && quote != ")") state.tokenize = null;
96
+ return ret("string", "string");
97
+ };
98
+ }
99
+
100
+ function tokenParenthesized(stream, state) {
101
+ stream.next(); // Must be '('
102
+ if (!stream.match(/\s*[\"\')]/, false))
103
+ state.tokenize = tokenString(")");
104
+ else
105
+ state.tokenize = null;
106
+ return ret(null, "(");
107
+ }
108
+
109
+ // Context management
110
+
111
+ function Context(type, indent, prev) {
112
+ this.type = type;
113
+ this.indent = indent;
114
+ this.prev = prev;
115
+ }
116
+
117
+ function pushContext(state, stream, type) {
118
+ state.context = new Context(type, stream.indentation() + indentUnit, state.context);
119
+ return type;
120
+ }
121
+
122
+ function popContext(state) {
123
+ state.context = state.context.prev;
124
+ return state.context.type;
125
+ }
126
+
127
+ function pass(type, stream, state) {
128
+ return states[state.context.type](type, stream, state);
129
+ }
130
+
131
+ function popAndPass(type, stream, state, n) {
132
+ for (var i = n || 1; i > 0; i--)
133
+ state.context = state.context.prev;
134
+ return pass(type, stream, state);
135
+ }
136
+
137
+ // Parser
138
+
139
+ function wordAsValue(stream) {
140
+ var word = stream.current().toLowerCase();
141
+ if (valueKeywords.hasOwnProperty(word))
142
+ override = "atom";
143
+ else if (colorKeywords.hasOwnProperty(word))
144
+ override = "keyword";
145
+ else
146
+ override = "variable";
147
+ }
148
+
149
+ var states = {};
150
+
151
+ states.top = function (type, stream, state) {
152
+ if (type == "{") {
153
+ return pushContext(state, stream, "block");
154
+ } else if (type == "}" && state.context.prev) {
155
+ return popContext(state);
156
+ } else if (type == "@media") {
157
+ return pushContext(state, stream, "media");
158
+ } else if (type == "@font-face") {
159
+ return "font_face_before";
160
+ } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
161
+ return "keyframes";
162
+ } else if (type && type.charAt(0) == "@") {
163
+ return pushContext(state, stream, "at");
164
+ } else if (type == "hash") {
165
+ override = "builtin";
166
+ } else if (type == "word") {
167
+ override = "tag";
168
+ } else if (type == "variable-definition") {
169
+ return "maybeprop";
170
+ } else if (type == "interpolation") {
171
+ return pushContext(state, stream, "interpolation");
172
+ } else if (type == ":") {
173
+ return "pseudo";
174
+ } else if (allowNested && type == "(") {
175
+ return pushContext(state, stream, "parens");
176
+ }
177
+ return state.context.type;
178
+ };
179
+
180
+ states.block = function (type, stream, state) {
181
+ if (type == "word") {
182
+ var word = stream.current().toLowerCase();
183
+ if (propertyKeywords.hasOwnProperty(word)) {
184
+ override = "property";
185
+ return "maybeprop";
186
+ } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {
187
+ override = "string-2";
188
+ return "maybeprop";
189
+ } else if (allowNested) {
190
+ override = stream.match(/^\s*:/, false) ? "property" : "tag";
191
+ return "block";
192
+ } else {
193
+ override += " error";
194
+ return "maybeprop";
195
+ }
196
+ } else if (type == "meta") {
197
+ return "block";
198
+ } else if (!allowNested && (type == "hash" || type == "qualifier")) {
199
+ override = "error";
200
+ return "block";
201
+ } else {
202
+ return states.top(type, stream, state);
203
+ }
204
+ };
205
+
206
+ states.maybeprop = function (type, stream, state) {
207
+ if (type == ":") return pushContext(state, stream, "prop");
208
+ return pass(type, stream, state);
209
+ };
210
+
211
+ states.prop = function (type, stream, state) {
212
+ if (type == ";") return popContext(state);
213
+ if (type == "{" && allowNested) return pushContext(state, stream, "propBlock");
214
+ if (type == "}" || type == "{") return popAndPass(type, stream, state);
215
+ if (type == "(") return pushContext(state, stream, "parens");
216
+
217
+ if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
218
+ override += " error";
219
+ } else if (type == "word") {
220
+ wordAsValue(stream);
221
+ } else if (type == "interpolation") {
222
+ return pushContext(state, stream, "interpolation");
223
+ }
224
+ return "prop";
225
+ };
226
+
227
+ states.propBlock = function (type, _stream, state) {
228
+ if (type == "}") return popContext(state);
229
+ if (type == "word") {
230
+ override = "property";
231
+ return "maybeprop";
232
+ }
233
+ return state.context.type;
234
+ };
235
+
236
+ states.parens = function (type, stream, state) {
237
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
238
+ if (type == ")") return popContext(state);
239
+ if (type == "(") return pushContext(state, stream, "parens");
240
+ if (type == "word") wordAsValue(stream);
241
+ return "parens";
242
+ };
243
+
244
+ states.pseudo = function (type, stream, state) {
245
+ if (type == "word") {
246
+ override = "variable-3";
247
+ return state.context.type;
248
+ }
249
+ return pass(type, stream, state);
250
+ };
251
+
252
+ states.media = function (type, stream, state) {
253
+ if (type == "(") return pushContext(state, stream, "media_parens");
254
+ if (type == "}") return popAndPass(type, stream, state);
255
+ if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top");
256
+
257
+ if (type == "word") {
258
+ var word = stream.current().toLowerCase();
259
+ if (word == "only" || word == "not" || word == "and")
260
+ override = "keyword";
261
+ else if (mediaTypes.hasOwnProperty(word))
262
+ override = "attribute";
263
+ else if (mediaFeatures.hasOwnProperty(word))
264
+ override = "property";
265
+ else
266
+ override = "error";
267
+ }
268
+ return state.context.type;
269
+ };
270
+
271
+ states.media_parens = function (type, stream, state) {
272
+ if (type == ")") return popContext(state);
273
+ if (type == "{" || type == "}") return popAndPass(type, stream, state, 2);
274
+ return states.media(type, stream, state);
275
+ };
276
+
277
+ states.font_face_before = function (type, stream, state) {
278
+ if (type == "{")
279
+ return pushContext(state, stream, "font_face");
280
+ return pass(type, stream, state);
281
+ };
282
+
283
+ states.font_face = function (type, stream, state) {
284
+ if (type == "}") return popContext(state);
285
+ if (type == "word") {
286
+ if (!fontProperties.hasOwnProperty(stream.current().toLowerCase()))
287
+ override = "error";
288
+ else
289
+ override = "property";
290
+ return "maybeprop";
291
+ }
292
+ return "font_face";
293
+ };
294
+
295
+ states.keyframes = function (type, stream, state) {
296
+ if (type == "word") {
297
+ override = "variable";
298
+ return "keyframes";
299
+ }
300
+ if (type == "{") return pushContext(state, stream, "top");
301
+ return pass(type, stream, state);
302
+ };
303
+
304
+ states.at = function (type, stream, state) {
305
+ if (type == ";") return popContext(state);
306
+ if (type == "{" || type == "}") return popAndPass(type, stream, state);
307
+ if (type == "word") override = "tag";
308
+ else if (type == "hash") override = "builtin";
309
+ return "at";
310
+ };
311
+
312
+ states.interpolation = function (type, stream, state) {
313
+ if (type == "}") return popContext(state);
314
+ if (type == "{" || type == ";") return popAndPass(type, stream, state);
315
+ if (type != "variable") override = "error";
316
+ return "interpolation";
317
+ };
318
+
319
+ return {
320
+ startState: function (base) {
321
+ return {
322
+ tokenize: null,
323
+ state: "top",
324
+ context: new Context("top", base || 0, null)
325
+ };
326
+ },
327
+
328
+ token: function (stream, state) {
329
+ if (!state.tokenize && stream.eatSpace()) return null;
330
+ var style = (state.tokenize || tokenBase)(stream, state);
331
+ if (style && typeof style == "object") {
332
+ type = style[1];
333
+ style = style[0];
334
+ }
335
+ override = style;
336
+ state.state = states[state.state](type, stream, state);
337
+ return override;
338
+ },
339
+
340
+ indent: function (state, textAfter) {
341
+ var cx = state.context, ch = textAfter && textAfter.charAt(0);
342
+ var indent = cx.indent;
343
+ if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev;
344
+ if (cx.prev &&
345
+ (ch == "}" && (cx.type == "block" || cx.type == "top" || cx.type == "interpolation" || cx.type == "font_face") ||
346
+ ch == ")" && (cx.type == "parens" || cx.type == "media_parens") ||
347
+ ch == "{" && (cx.type == "at" || cx.type == "media"))) {
348
+ indent = cx.indent - indentUnit;
349
+ cx = cx.prev;
350
+ }
351
+ return indent;
352
+ },
353
+
354
+ electricChars: "}",
355
+ blockCommentStart: "/*",
356
+ blockCommentEnd: "*/",
357
+ fold: "brace"
358
+ };
359
+ });
360
+
361
+ function keySet(array) {
362
+ var keys = {};
363
+ for (var i = 0; i < array.length; ++i) {
364
+ keys[array[i]] = true;
365
+ }
366
+ return keys;
367
+ }
368
+
369
+ var mediaTypes_ = [
370
+ "all", "aural", "braille", "handheld", "print", "projection", "screen",
371
+ "tty", "tv", "embossed"
372
+ ], mediaTypes = keySet(mediaTypes_);
373
+
374
+ var mediaFeatures_ = [
375
+ "width", "min-width", "max-width", "height", "min-height", "max-height",
376
+ "device-width", "min-device-width", "max-device-width", "device-height",
377
+ "min-device-height", "max-device-height", "aspect-ratio",
378
+ "min-aspect-ratio", "max-aspect-ratio", "device-aspect-ratio",
379
+ "min-device-aspect-ratio", "max-device-aspect-ratio", "color", "min-color",
380
+ "max-color", "color-index", "min-color-index", "max-color-index",
381
+ "monochrome", "min-monochrome", "max-monochrome", "resolution",
382
+ "min-resolution", "max-resolution", "scan", "grid"
383
+ ], mediaFeatures = keySet(mediaFeatures_);
384
+
385
+ var propertyKeywords_ = [
386
+ "align-content", "align-items", "align-self", "alignment-adjust",
387
+ "alignment-baseline", "anchor-point", "animation", "animation-delay",
388
+ "animation-direction", "animation-duration", "animation-fill-mode",
389
+ "animation-iteration-count", "animation-name", "animation-play-state",
390
+ "animation-timing-function", "appearance", "azimuth", "backface-visibility",
391
+ "background", "background-attachment", "background-clip", "background-color",
392
+ "background-image", "background-origin", "background-position",
393
+ "background-repeat", "background-size", "baseline-shift", "binding",
394
+ "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
395
+ "bookmark-target", "border", "border-bottom", "border-bottom-color",
396
+ "border-bottom-left-radius", "border-bottom-right-radius",
397
+ "border-bottom-style", "border-bottom-width", "border-collapse",
398
+ "border-color", "border-image", "border-image-outset",
399
+ "border-image-repeat", "border-image-slice", "border-image-source",
400
+ "border-image-width", "border-left", "border-left-color",
401
+ "border-left-style", "border-left-width", "border-radius", "border-right",
402
+ "border-right-color", "border-right-style", "border-right-width",
403
+ "border-spacing", "border-style", "border-top", "border-top-color",
404
+ "border-top-left-radius", "border-top-right-radius", "border-top-style",
405
+ "border-top-width", "border-width", "bottom", "box-decoration-break",
406
+ "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
407
+ "caption-side", "clear", "clip", "color", "color-profile", "column-count",
408
+ "column-fill", "column-gap", "column-rule", "column-rule-color",
409
+ "column-rule-style", "column-rule-width", "column-span", "column-width",
410
+ "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
411
+ "cue-after", "cue-before", "cursor", "direction", "display",
412
+ "dominant-baseline", "drop-initial-after-adjust",
413
+ "drop-initial-after-align", "drop-initial-before-adjust",
414
+ "drop-initial-before-align", "drop-initial-size", "drop-initial-value",
415
+ "elevation", "empty-cells", "fit", "fit-position", "flex", "flex-basis",
416
+ "flex-direction", "flex-flow", "flex-grow", "flex-shrink", "flex-wrap",
417
+ "float", "float-offset", "flow-from", "flow-into", "font", "font-feature-settings",
418
+ "font-family", "font-kerning", "font-language-override", "font-size", "font-size-adjust",
419
+ "font-stretch", "font-style", "font-synthesis", "font-variant",
420
+ "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
421
+ "font-variant-ligatures", "font-variant-numeric", "font-variant-position",
422
+ "font-weight", "grid", "grid-area", "grid-auto-columns", "grid-auto-flow",
423
+ "grid-auto-position", "grid-auto-rows", "grid-column", "grid-column-end",
424
+ "grid-column-start", "grid-row", "grid-row-end", "grid-row-start",
425
+ "grid-template", "grid-template-areas", "grid-template-columns",
426
+ "grid-template-rows", "hanging-punctuation", "height", "hyphens",
427
+ "icon", "image-orientation", "image-rendering", "image-resolution",
428
+ "inline-box-align", "justify-content", "left", "letter-spacing",
429
+ "line-break", "line-height", "line-stacking", "line-stacking-ruby",
430
+ "line-stacking-shift", "line-stacking-strategy", "list-style",
431
+ "list-style-image", "list-style-position", "list-style-type", "margin",
432
+ "margin-bottom", "margin-left", "margin-right", "margin-top",
433
+ "marker-offset", "marks", "marquee-direction", "marquee-loop",
434
+ "marquee-play-count", "marquee-speed", "marquee-style", "max-height",
435
+ "max-width", "min-height", "min-width", "move-to", "nav-down", "nav-index",
436
+ "nav-left", "nav-right", "nav-up", "object-fit", "object-position",
437
+ "opacity", "order", "orphans", "outline",
438
+ "outline-color", "outline-offset", "outline-style", "outline-width",
439
+ "overflow", "overflow-style", "overflow-wrap", "overflow-x", "overflow-y",
440
+ "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
441
+ "page", "page-break-after", "page-break-before", "page-break-inside",
442
+ "page-policy", "pause", "pause-after", "pause-before", "perspective",
443
+ "perspective-origin", "pitch", "pitch-range", "play-during", "position",
444
+ "presentation-level", "punctuation-trim", "quotes", "region-break-after",
445
+ "region-break-before", "region-break-inside", "region-fragment",
446
+ "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
447
+ "right", "rotation", "rotation-point", "ruby-align", "ruby-overhang",
448
+ "ruby-position", "ruby-span", "shape-image-threshold", "shape-inside", "shape-margin",
449
+ "shape-outside", "size", "speak", "speak-as", "speak-header",
450
+ "speak-numeral", "speak-punctuation", "speech-rate", "stress", "string-set",
451
+ "tab-size", "table-layout", "target", "target-name", "target-new",
452
+ "target-position", "text-align", "text-align-last", "text-decoration",
453
+ "text-decoration-color", "text-decoration-line", "text-decoration-skip",
454
+ "text-decoration-style", "text-emphasis", "text-emphasis-color",
455
+ "text-emphasis-position", "text-emphasis-style", "text-height",
456
+ "text-indent", "text-justify", "text-outline", "text-overflow", "text-shadow",
457
+ "text-size-adjust", "text-space-collapse", "text-transform", "text-underline-position",
458
+ "text-wrap", "top", "transform", "transform-origin", "transform-style",
459
+ "transition", "transition-delay", "transition-duration",
460
+ "transition-property", "transition-timing-function", "unicode-bidi",
461
+ "vertical-align", "visibility", "voice-balance", "voice-duration",
462
+ "voice-family", "voice-pitch", "voice-range", "voice-rate", "voice-stress",
463
+ "voice-volume", "volume", "white-space", "widows", "width", "word-break",
464
+ "word-spacing", "word-wrap", "z-index",
465
+ // SVG-specific
466
+ "clip-path", "clip-rule", "mask", "enable-background", "filter", "flood-color",
467
+ "flood-opacity", "lighting-color", "stop-color", "stop-opacity", "pointer-events",
468
+ "color-interpolation", "color-interpolation-filters",
469
+ "color-rendering", "fill", "fill-opacity", "fill-rule", "image-rendering",
470
+ "marker", "marker-end", "marker-mid", "marker-start", "shape-rendering", "stroke",
471
+ "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin",
472
+ "stroke-miterlimit", "stroke-opacity", "stroke-width", "text-rendering",
473
+ "baseline-shift", "dominant-baseline", "glyph-orientation-horizontal",
474
+ "glyph-orientation-vertical", "text-anchor", "writing-mode"
475
+ ], propertyKeywords = keySet(propertyKeywords_);
476
+
477
+ var nonStandardPropertyKeywords_ = [
478
+ "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color",
479
+ "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color",
480
+ "scrollbar-3d-light-color", "scrollbar-track-color", "shape-inside",
481
+ "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
482
+ "searchfield-results-decoration", "zoom"
483
+ ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);
484
+
485
+ var colorKeywords_ = [
486
+ "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige",
487
+ "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown",
488
+ "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue",
489
+ "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod",
490
+ "darkgray", "darkgreen", "darkkhaki", "darkmagenta", "darkolivegreen",
491
+ "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
492
+ "darkslateblue", "darkslategray", "darkturquoise", "darkviolet",
493
+ "deeppink", "deepskyblue", "dimgray", "dodgerblue", "firebrick",
494
+ "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
495
+ "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew",
496
+ "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender",
497
+ "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral",
498
+ "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightpink",
499
+ "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray",
500
+ "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta",
501
+ "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple",
502
+ "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise",
503
+ "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin",
504
+ "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered",
505
+ "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred",
506
+ "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue",
507
+ "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown",
508
+ "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue",
509
+ "slateblue", "slategray", "snow", "springgreen", "steelblue", "tan",
510
+ "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white",
511
+ "whitesmoke", "yellow", "yellowgreen"
512
+ ], colorKeywords = keySet(colorKeywords_);
513
+
514
+ var valueKeywords_ = [
515
+ "above", "absolute", "activeborder", "activecaption", "afar",
516
+ "after-white-space", "ahead", "alias", "all", "all-scroll", "alternate",
517
+ "always", "amharic", "amharic-abegede", "antialiased", "appworkspace",
518
+ "arabic-indic", "armenian", "asterisks", "auto", "avoid", "avoid-column", "avoid-page",
519
+ "avoid-region", "background", "backwards", "baseline", "below", "bidi-override", "binary",
520
+ "bengali", "blink", "block", "block-axis", "bold", "bolder", "border", "border-box",
521
+ "both", "bottom", "break", "break-all", "break-word", "button", "button-bevel",
522
+ "buttonface", "buttonhighlight", "buttonshadow", "buttontext", "cambodian",
523
+ "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
524
+ "cell", "center", "checkbox", "circle", "cjk-earthly-branch",
525
+ "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
526
+ "col-resize", "collapse", "column", "compact", "condensed", "contain", "content",
527
+ "content-box", "context-menu", "continuous", "copy", "cover", "crop",
528
+ "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal",
529
+ "decimal-leading-zero", "default", "default-button", "destination-atop",
530
+ "destination-in", "destination-out", "destination-over", "devanagari",
531
+ "disc", "discard", "document", "dot-dash", "dot-dot-dash", "dotted",
532
+ "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
533
+ "element", "ellipse", "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede",
534
+ "ethiopic-abegede-am-et", "ethiopic-abegede-gez", "ethiopic-abegede-ti-er",
535
+ "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er",
536
+ "ethiopic-halehame-aa-et", "ethiopic-halehame-am-et",
537
+ "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
538
+ "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
539
+ "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et",
540
+ "ethiopic-halehame-tig", "ew-resize", "expanded", "extra-condensed",
541
+ "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "footnotes",
542
+ "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
543
+ "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
544
+ "help", "hidden", "hide", "higher", "highlight", "highlighttext",
545
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
546
+ "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
547
+ "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
548
+ "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert",
549
+ "italic", "justify", "kannada", "katakana", "katakana-iroha", "keep-all", "khmer",
550
+ "landscape", "lao", "large", "larger", "left", "level", "lighter",
551
+ "line-through", "linear", "lines", "list-item", "listbox", "listitem",
552
+ "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
553
+ "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
554
+ "lower-roman", "lowercase", "ltr", "malayalam", "match",
555
+ "media-controls-background", "media-current-time-display",
556
+ "media-fullscreen-button", "media-mute-button", "media-play-button",
557
+ "media-return-to-realtime-button", "media-rewind-button",
558
+ "media-seek-back-button", "media-seek-forward-button", "media-slider",
559
+ "media-sliderthumb", "media-time-remaining-display", "media-volume-slider",
560
+ "media-volume-slider-container", "media-volume-sliderthumb", "medium",
561
+ "menu", "menulist", "menulist-button", "menulist-text",
562
+ "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
563
+ "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
564
+ "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
565
+ "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
566
+ "ns-resize", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
567
+ "optimizeLegibility", "optimizeSpeed", "oriya", "oromo", "outset",
568
+ "outside", "outside-shape", "overlay", "overline", "padding", "padding-box",
569
+ "painted", "page", "paused", "persian", "plus-darker", "plus-lighter", "pointer",
570
+ "polygon", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "push-button",
571
+ "radio", "read-only", "read-write", "read-write-plaintext-only", "rectangle", "region",
572
+ "relative", "repeat", "repeat-x", "repeat-y", "reset", "reverse", "rgb", "rgba",
573
+ "ridge", "right", "round", "row-resize", "rtl", "run-in", "running",
574
+ "s-resize", "sans-serif", "scroll", "scrollbar", "se-resize", "searchfield",
575
+ "searchfield-cancel-button", "searchfield-decoration",
576
+ "searchfield-results-button", "searchfield-results-decoration",
577
+ "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
578
+ "single", "skip-white-space", "slide", "slider-horizontal",
579
+ "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
580
+ "small", "small-caps", "small-caption", "smaller", "solid", "somali",
581
+ "source-atop", "source-in", "source-out", "source-over", "space", "square",
582
+ "square-button", "start", "static", "status-bar", "stretch", "stroke",
583
+ "sub", "subpixel-antialiased", "super", "sw-resize", "table",
584
+ "table-caption", "table-cell", "table-column", "table-column-group",
585
+ "table-footer-group", "table-header-group", "table-row", "table-row-group",
586
+ "telugu", "text", "text-bottom", "text-top", "textarea", "textfield", "thai",
587
+ "thick", "thin", "threeddarkshadow", "threedface", "threedhighlight",
588
+ "threedlightshadow", "threedshadow", "tibetan", "tigre", "tigrinya-er",
589
+ "tigrinya-er-abegede", "tigrinya-et", "tigrinya-et-abegede", "to", "top",
590
+ "transparent", "ultra-condensed", "ultra-expanded", "underline", "up",
591
+ "upper-alpha", "upper-armenian", "upper-greek", "upper-hexadecimal",
592
+ "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "urdu", "url",
593
+ "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
594
+ "visibleStroke", "visual", "w-resize", "wait", "wave", "wider",
595
+ "window", "windowframe", "windowtext", "x-large", "x-small", "xor",
596
+ "xx-large", "xx-small"
597
+ ], valueKeywords = keySet(valueKeywords_);
598
+
599
+ var fontProperties_ = [
600
+ "font-family", "src", "unicode-range", "font-variant", "font-feature-settings",
601
+ "font-stretch", "font-weight", "font-style"
602
+ ], fontProperties = keySet(fontProperties_);
603
+
604
+ var allWords = mediaTypes_.concat(mediaFeatures_).concat(propertyKeywords_)
605
+ .concat(nonStandardPropertyKeywords_).concat(colorKeywords_).concat(valueKeywords_);
606
+ CodeMirror.registerHelper("hintWords", "css", allWords);
607
+
608
+ function tokenCComment(stream, state) {
609
+ var maybeEnd = false, ch;
610
+ while ((ch = stream.next()) != null) {
611
+ if (maybeEnd && ch == "/") {
612
+ state.tokenize = null;
613
+ break;
614
+ }
615
+ maybeEnd = (ch == "*");
616
+ }
617
+ return ["comment", "comment"];
618
+ }
619
+
620
+ function tokenSGMLComment(stream, state) {
621
+ if (stream.skipTo("-->")) {
622
+ stream.match("-->");
623
+ state.tokenize = null;
624
+ } else {
625
+ stream.skipToEnd();
626
+ }
627
+ return ["comment", "comment"];
628
+ }
629
+
630
+ CodeMirror.defineMIME("text/css", {
631
+ mediaTypes: mediaTypes,
632
+ mediaFeatures: mediaFeatures,
633
+ propertyKeywords: propertyKeywords,
634
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
635
+ colorKeywords: colorKeywords,
636
+ valueKeywords: valueKeywords,
637
+ fontProperties: fontProperties,
638
+ tokenHooks: {
639
+ "<": function (stream, state) {
640
+ if (!stream.match("!--")) return false;
641
+ state.tokenize = tokenSGMLComment;
642
+ return tokenSGMLComment(stream, state);
643
+ },
644
+ "/": function (stream, state) {
645
+ if (!stream.eat("*")) return false;
646
+ state.tokenize = tokenCComment;
647
+ return tokenCComment(stream, state);
648
+ }
649
+ },
650
+ name: "css"
651
+ });
652
+
653
+ CodeMirror.defineMIME("text/x-scss", {
654
+ mediaTypes: mediaTypes,
655
+ mediaFeatures: mediaFeatures,
656
+ propertyKeywords: propertyKeywords,
657
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
658
+ colorKeywords: colorKeywords,
659
+ valueKeywords: valueKeywords,
660
+ fontProperties: fontProperties,
661
+ allowNested: true,
662
+ tokenHooks: {
663
+ "/": function (stream, state) {
664
+ if (stream.eat("/")) {
665
+ stream.skipToEnd();
666
+ return ["comment", "comment"];
667
+ } else if (stream.eat("*")) {
668
+ state.tokenize = tokenCComment;
669
+ return tokenCComment(stream, state);
670
+ } else {
671
+ return ["operator", "operator"];
672
+ }
673
+ },
674
+ ":": function (stream) {
675
+ if (stream.match(/\s*\{/))
676
+ return [null, "{"];
677
+ return false;
678
+ },
679
+ "$": function (stream) {
680
+ stream.match(/^[\w-]+/);
681
+ if (stream.match(/^\s*:/, false))
682
+ return ["variable-2", "variable-definition"];
683
+ return ["variable-2", "variable"];
684
+ },
685
+ "#": function (stream) {
686
+ if (!stream.eat("{")) return false;
687
+ return [null, "interpolation"];
688
+ }
689
+ },
690
+ name: "css",
691
+ helperType: "scss"
692
+ });
693
+
694
+ CodeMirror.defineMIME("text/x-less", {
695
+ mediaTypes: mediaTypes,
696
+ mediaFeatures: mediaFeatures,
697
+ propertyKeywords: propertyKeywords,
698
+ nonStandardPropertyKeywords: nonStandardPropertyKeywords,
699
+ colorKeywords: colorKeywords,
700
+ valueKeywords: valueKeywords,
701
+ fontProperties: fontProperties,
702
+ allowNested: true,
703
+ tokenHooks: {
704
+ "/": function (stream, state) {
705
+ if (stream.eat("/")) {
706
+ stream.skipToEnd();
707
+ return ["comment", "comment"];
708
+ } else if (stream.eat("*")) {
709
+ state.tokenize = tokenCComment;
710
+ return tokenCComment(stream, state);
711
+ } else {
712
+ return ["operator", "operator"];
713
+ }
714
+ },
715
+ "@": function (stream) {
716
+ if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
717
+ stream.eatWhile(/[\w\\\-]/);
718
+ if (stream.match(/^\s*:/, false))
719
+ return ["variable-2", "variable-definition"];
720
+ return ["variable-2", "variable"];
721
+ },
722
+ "&": function () {
723
+ return ["atom", "atom"];
724
+ }
725
+ },
726
+ name: "css",
727
+ helperType: "less"
728
+ });
729
+
730
+ });
assets/codemirror/htmlmixed.js ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var defaultTags = {
15
+ script: [
16
+ ["lang", /(javascript|babel)/i, "javascript"],
17
+ ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"],
18
+ ["type", /./, "text/plain"],
19
+ [null, null, "javascript"]
20
+ ],
21
+ style: [
22
+ ["lang", /^css$/i, "css"],
23
+ ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
24
+ ["type", /./, "text/plain"],
25
+ [null, null, "css"]
26
+ ]
27
+ };
28
+
29
+ function maybeBackup(stream, pat, style) {
30
+ var cur = stream.current(), close = cur.search(pat);
31
+ if (close > -1) {
32
+ stream.backUp(cur.length - close);
33
+ } else if (cur.match(/<\/?$/)) {
34
+ stream.backUp(cur.length);
35
+ if (!stream.match(pat, false)) stream.match(cur);
36
+ }
37
+ return style;
38
+ }
39
+
40
+ var attrRegexpCache = {};
41
+ function getAttrRegexp(attr) {
42
+ var regexp = attrRegexpCache[attr];
43
+ if (regexp) return regexp;
44
+ return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");
45
+ }
46
+
47
+ function getAttrValue(text, attr) {
48
+ var match = text.match(getAttrRegexp(attr))
49
+ return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : ""
50
+ }
51
+
52
+ function getTagRegexp(tagName, anchored) {
53
+ return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
54
+ }
55
+
56
+ function addTags(from, to) {
57
+ for (var tag in from) {
58
+ var dest = to[tag] || (to[tag] = []);
59
+ var source = from[tag];
60
+ for (var i = source.length - 1; i >= 0; i--)
61
+ dest.unshift(source[i])
62
+ }
63
+ }
64
+
65
+ function findMatchingMode(tagInfo, tagText) {
66
+ for (var i = 0; i < tagInfo.length; i++) {
67
+ var spec = tagInfo[i];
68
+ if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];
69
+ }
70
+ }
71
+
72
+ CodeMirror.defineMode("htmlmixed", function (config, parserConfig) {
73
+ var htmlMode = CodeMirror.getMode(config, {
74
+ name: "xml",
75
+ htmlMode: true,
76
+ multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
77
+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
78
+ });
79
+
80
+ var tags = {};
81
+ var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;
82
+ addTags(defaultTags, tags);
83
+ if (configTags) addTags(configTags, tags);
84
+ if (configScript) for (var i = configScript.length - 1; i >= 0; i--)
85
+ tags.script.unshift(["type", configScript[i].matches, configScript[i].mode])
86
+
87
+ function html(stream, state) {
88
+ var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName
89
+ if (tag && !/[<>\s\/]/.test(stream.current()) &&
90
+ (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&
91
+ tags.hasOwnProperty(tagName)) {
92
+ state.inTag = tagName + " "
93
+ } else if (state.inTag && tag && />$/.test(stream.current())) {
94
+ var inTag = /^([\S]+) (.*)/.exec(state.inTag)
95
+ state.inTag = null
96
+ var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2])
97
+ var mode = CodeMirror.getMode(config, modeSpec)
98
+ var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);
99
+ state.token = function (stream, state) {
100
+ if (stream.match(endTagA, false)) {
101
+ state.token = html;
102
+ state.localState = state.localMode = null;
103
+ return null;
104
+ }
105
+ return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
106
+ };
107
+ state.localMode = mode;
108
+ state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
109
+ } else if (state.inTag) {
110
+ state.inTag += stream.current()
111
+ if (stream.eol()) state.inTag += " "
112
+ }
113
+ return style;
114
+ };
115
+
116
+ return {
117
+ startState: function () {
118
+ var state = CodeMirror.startState(htmlMode);
119
+ return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
120
+ },
121
+
122
+ copyState: function (state) {
123
+ var local;
124
+ if (state.localState) {
125
+ local = CodeMirror.copyState(state.localMode, state.localState);
126
+ }
127
+ return {token: state.token, inTag: state.inTag,
128
+ localMode: state.localMode, localState: local,
129
+ htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
130
+ },
131
+
132
+ token: function (stream, state) {
133
+ return state.token(stream, state);
134
+ },
135
+
136
+ indent: function (state, textAfter, line) {
137
+ if (!state.localMode || /^\s*<\//.test(textAfter))
138
+ return htmlMode.indent(state.htmlState, textAfter);
139
+ else if (state.localMode.indent)
140
+ return state.localMode.indent(state.localState, textAfter, line);
141
+ else
142
+ return CodeMirror.Pass;
143
+ },
144
+
145
+ innerMode: function (state) {
146
+ return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
147
+ }
148
+ };
149
+ }, "xml", "javascript", "css");
150
+
151
+ CodeMirror.defineMIME("text/html", "htmlmixed");
152
+ });
assets/codemirror/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
assets/codemirror/javascript.js ADDED
@@ -0,0 +1,900 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("javascript", function(config, parserConfig) {
15
+ var indentUnit = config.indentUnit;
16
+ var statementIndent = parserConfig.statementIndent;
17
+ var jsonldMode = parserConfig.jsonld;
18
+ var jsonMode = parserConfig.json || jsonldMode;
19
+ var isTS = parserConfig.typescript;
20
+ var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/;
21
+
22
+ // Tokenizer
23
+
24
+ var keywords = function(){
25
+ function kw(type) {return {type: type, style: "keyword"};}
26
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
27
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"};
28
+
29
+ return {
30
+ "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
31
+ "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
32
+ "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
33
+ "function": kw("function"), "catch": kw("catch"),
34
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
35
+ "in": operator, "typeof": operator, "instanceof": operator,
36
+ "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
37
+ "this": kw("this"), "class": kw("class"), "super": kw("atom"),
38
+ "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
39
+ "await": C
40
+ };
41
+ }();
42
+
43
+ var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
44
+ var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
45
+
46
+ function readRegexp(stream) {
47
+ var escaped = false, next, inSet = false;
48
+ while ((next = stream.next()) != null) {
49
+ if (!escaped) {
50
+ if (next == "/" && !inSet) return;
51
+ if (next == "[") inSet = true;
52
+ else if (inSet && next == "]") inSet = false;
53
+ }
54
+ escaped = !escaped && next == "\\";
55
+ }
56
+ }
57
+
58
+ // Used as scratch variables to communicate multiple values without
59
+ // consing up tons of objects.
60
+ var type, content;
61
+ function ret(tp, style, cont) {
62
+ type = tp; content = cont;
63
+ return style;
64
+ }
65
+ function tokenBase(stream, state) {
66
+ var ch = stream.next();
67
+ if (ch == '"' || ch == "'") {
68
+ state.tokenize = tokenString(ch);
69
+ return state.tokenize(stream, state);
70
+ } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) {
71
+ return ret("number", "number");
72
+ } else if (ch == "." && stream.match("..")) {
73
+ return ret("spread", "meta");
74
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
75
+ return ret(ch);
76
+ } else if (ch == "=" && stream.eat(">")) {
77
+ return ret("=>", "operator");
78
+ } else if (ch == "0" && stream.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i)) {
79
+ return ret("number", "number");
80
+ } else if (/\d/.test(ch)) {
81
+ stream.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/);
82
+ return ret("number", "number");
83
+ } else if (ch == "/") {
84
+ if (stream.eat("*")) {
85
+ state.tokenize = tokenComment;
86
+ return tokenComment(stream, state);
87
+ } else if (stream.eat("/")) {
88
+ stream.skipToEnd();
89
+ return ret("comment", "comment");
90
+ } else if (expressionAllowed(stream, state, 1)) {
91
+ readRegexp(stream);
92
+ stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);
93
+ return ret("regexp", "string-2");
94
+ } else {
95
+ stream.eat("=");
96
+ return ret("operator", "operator", stream.current());
97
+ }
98
+ } else if (ch == "`") {
99
+ state.tokenize = tokenQuasi;
100
+ return tokenQuasi(stream, state);
101
+ } else if (ch == "#") {
102
+ stream.skipToEnd();
103
+ return ret("error", "error");
104
+ } else if (isOperatorChar.test(ch)) {
105
+ if (ch != ">" || !state.lexical || state.lexical.type != ">") {
106
+ if (stream.eat("=")) {
107
+ if (ch == "!" || ch == "=") stream.eat("=")
108
+ } else if (/[<>*+\-]/.test(ch)) {
109
+ stream.eat(ch)
110
+ if (ch == ">") stream.eat(ch)
111
+ }
112
+ }
113
+ return ret("operator", "operator", stream.current());
114
+ } else if (wordRE.test(ch)) {
115
+ stream.eatWhile(wordRE);
116
+ var word = stream.current()
117
+ if (state.lastType != ".") {
118
+ if (keywords.propertyIsEnumerable(word)) {
119
+ var kw = keywords[word]
120
+ return ret(kw.type, kw.style, word)
121
+ }
122
+ if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false))
123
+ return ret("async", "keyword", word)
124
+ }
125
+ return ret("variable", "variable", word)
126
+ }
127
+ }
128
+
129
+ function tokenString(quote) {
130
+ return function(stream, state) {
131
+ var escaped = false, next;
132
+ if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){
133
+ state.tokenize = tokenBase;
134
+ return ret("jsonld-keyword", "meta");
135
+ }
136
+ while ((next = stream.next()) != null) {
137
+ if (next == quote && !escaped) break;
138
+ escaped = !escaped && next == "\\";
139
+ }
140
+ if (!escaped) state.tokenize = tokenBase;
141
+ return ret("string", "string");
142
+ };
143
+ }
144
+
145
+ function tokenComment(stream, state) {
146
+ var maybeEnd = false, ch;
147
+ while (ch = stream.next()) {
148
+ if (ch == "/" && maybeEnd) {
149
+ state.tokenize = tokenBase;
150
+ break;
151
+ }
152
+ maybeEnd = (ch == "*");
153
+ }
154
+ return ret("comment", "comment");
155
+ }
156
+
157
+ function tokenQuasi(stream, state) {
158
+ var escaped = false, next;
159
+ while ((next = stream.next()) != null) {
160
+ if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) {
161
+ state.tokenize = tokenBase;
162
+ break;
163
+ }
164
+ escaped = !escaped && next == "\\";
165
+ }
166
+ return ret("quasi", "string-2", stream.current());
167
+ }
168
+
169
+ var brackets = "([{}])";
170
+ // This is a crude lookahead trick to try and notice that we're
171
+ // parsing the argument patterns for a fat-arrow function before we
172
+ // actually hit the arrow token. It only works if the arrow is on
173
+ // the same line as the arguments and there's no strange noise
174
+ // (comments) in between. Fallback is to only notice when we hit the
175
+ // arrow, and not declare the arguments as locals for the arrow
176
+ // body.
177
+ function findFatArrow(stream, state) {
178
+ if (state.fatArrowAt) state.fatArrowAt = null;
179
+ var arrow = stream.string.indexOf("=>", stream.start);
180
+ if (arrow < 0) return;
181
+
182
+ if (isTS) { // Try to skip TypeScript return type declarations after the arguments
183
+ var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow))
184
+ if (m) arrow = m.index
185
+ }
186
+
187
+ var depth = 0, sawSomething = false;
188
+ for (var pos = arrow - 1; pos >= 0; --pos) {
189
+ var ch = stream.string.charAt(pos);
190
+ var bracket = brackets.indexOf(ch);
191
+ if (bracket >= 0 && bracket < 3) {
192
+ if (!depth) { ++pos; break; }
193
+ if (--depth == 0) { if (ch == "(") sawSomething = true; break; }
194
+ } else if (bracket >= 3 && bracket < 6) {
195
+ ++depth;
196
+ } else if (wordRE.test(ch)) {
197
+ sawSomething = true;
198
+ } else if (/["'\/]/.test(ch)) {
199
+ return;
200
+ } else if (sawSomething && !depth) {
201
+ ++pos;
202
+ break;
203
+ }
204
+ }
205
+ if (sawSomething && !depth) state.fatArrowAt = pos;
206
+ }
207
+
208
+ // Parser
209
+
210
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true};
211
+
212
+ function JSLexical(indented, column, type, align, prev, info) {
213
+ this.indented = indented;
214
+ this.column = column;
215
+ this.type = type;
216
+ this.prev = prev;
217
+ this.info = info;
218
+ if (align != null) this.align = align;
219
+ }
220
+
221
+ function inScope(state, varname) {
222
+ for (var v = state.localVars; v; v = v.next)
223
+ if (v.name == varname) return true;
224
+ for (var cx = state.context; cx; cx = cx.prev) {
225
+ for (var v = cx.vars; v; v = v.next)
226
+ if (v.name == varname) return true;
227
+ }
228
+ }
229
+
230
+ function parseJS(state, style, type, content, stream) {
231
+ var cc = state.cc;
232
+ // Communicate our context to the combinators.
233
+ // (Less wasteful than consing up a hundred closures on every call.)
234
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;
235
+
236
+ if (!state.lexical.hasOwnProperty("align"))
237
+ state.lexical.align = true;
238
+
239
+ while(true) {
240
+ var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;
241
+ if (combinator(type, content)) {
242
+ while(cc.length && cc[cc.length - 1].lex)
243
+ cc.pop()();
244
+ if (cx.marked) return cx.marked;
245
+ if (type == "variable" && inScope(state, content)) return "variable-2";
246
+ return style;
247
+ }
248
+ }
249
+ }
250
+
251
+ // Combinator utils
252
+
253
+ var cx = {state: null, column: null, marked: null, cc: null};
254
+ function pass() {
255
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
256
+ }
257
+ function cont() {
258
+ pass.apply(null, arguments);
259
+ return true;
260
+ }
261
+ function inList(name, list) {
262
+ for (var v = list; v; v = v.next) if (v.name == name) return true
263
+ return false;
264
+ }
265
+ function register(varname) {
266
+ var state = cx.state;
267
+ cx.marked = "def";
268
+ if (state.context) {
269
+ if (state.lexical.info == "var" && state.context && state.context.block) {
270
+ // FIXME function decls are also not block scoped
271
+ var newContext = registerVarScoped(varname, state.context)
272
+ if (newContext != null) {
273
+ state.context = newContext
274
+ return
275
+ }
276
+ } else if (!inList(varname, state.localVars)) {
277
+ state.localVars = new Var(varname, state.localVars)
278
+ return
279
+ }
280
+ }
281
+ // Fall through means this is global
282
+ if (parserConfig.globalVars && !inList(varname, state.globalVars))
283
+ state.globalVars = new Var(varname, state.globalVars)
284
+ }
285
+ function registerVarScoped(varname, context) {
286
+ if (!context) {
287
+ return null
288
+ } else if (context.block) {
289
+ var inner = registerVarScoped(varname, context.prev)
290
+ if (!inner) return null
291
+ if (inner == context.prev) return context
292
+ return new Context(inner, context.vars, true)
293
+ } else if (inList(varname, context.vars)) {
294
+ return context
295
+ } else {
296
+ return new Context(context.prev, new Var(varname, context.vars), false)
297
+ }
298
+ }
299
+
300
+ function isModifier(name) {
301
+ return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"
302
+ }
303
+
304
+ // Combinators
305
+
306
+ function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }
307
+ function Var(name, next) { this.name = name; this.next = next }
308
+
309
+ var defaultVars = new Var("this", new Var("arguments", null))
310
+ function pushcontext() {
311
+ cx.state.context = new Context(cx.state.context, cx.state.localVars, false)
312
+ cx.state.localVars = defaultVars
313
+ }
314
+ function pushblockcontext() {
315
+ cx.state.context = new Context(cx.state.context, cx.state.localVars, true)
316
+ cx.state.localVars = null
317
+ }
318
+ function popcontext() {
319
+ cx.state.localVars = cx.state.context.vars
320
+ cx.state.context = cx.state.context.prev
321
+ }
322
+ popcontext.lex = true
323
+ function pushlex(type, info) {
324
+ var result = function() {
325
+ var state = cx.state, indent = state.indented;
326
+ if (state.lexical.type == "stat") indent = state.lexical.indented;
327
+ else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev)
328
+ indent = outer.indented;
329
+ state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);
330
+ };
331
+ result.lex = true;
332
+ return result;
333
+ }
334
+ function poplex() {
335
+ var state = cx.state;
336
+ if (state.lexical.prev) {
337
+ if (state.lexical.type == ")")
338
+ state.indented = state.lexical.indented;
339
+ state.lexical = state.lexical.prev;
340
+ }
341
+ }
342
+ poplex.lex = true;
343
+
344
+ function expect(wanted) {
345
+ function exp(type) {
346
+ if (type == wanted) return cont();
347
+ else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass();
348
+ else return cont(exp);
349
+ };
350
+ return exp;
351
+ }
352
+
353
+ function statement(type, value) {
354
+ if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex);
355
+ if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
356
+ if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
357
+ if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
358
+ if (type == "debugger") return cont(expect(";"));
359
+ if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext);
360
+ if (type == ";") return cont();
361
+ if (type == "if") {
362
+ if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex)
363
+ cx.state.cc.pop()();
364
+ return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse);
365
+ }
366
+ if (type == "function") return cont(functiondef);
367
+ if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
368
+ if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), className, poplex); }
369
+ if (type == "variable") {
370
+ if (isTS && value == "declare") {
371
+ cx.marked = "keyword"
372
+ return cont(statement)
373
+ } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
374
+ cx.marked = "keyword"
375
+ if (value == "enum") return cont(enumdef);
376
+ else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
377
+ else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
378
+ } else if (isTS && value == "namespace") {
379
+ cx.marked = "keyword"
380
+ return cont(pushlex("form"), expression, block, poplex)
381
+ } else if (isTS && value == "abstract") {
382
+ cx.marked = "keyword"
383
+ return cont(statement)
384
+ } else {
385
+ return cont(pushlex("stat"), maybelabel);
386
+ }
387
+ }
388
+ if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext,
389
+ block, poplex, poplex, popcontext);
390
+ if (type == "case") return cont(expression, expect(":"));
391
+ if (type == "default") return cont(expect(":"));
392
+ if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);
393
+ if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
394
+ if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
395
+ if (type == "async") return cont(statement)
396
+ if (value == "@") return cont(expression, statement)
397
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
398
+ }
399
+ function maybeCatchBinding(type) {
400
+ if (type == "(") return cont(funarg, expect(")"))
401
+ }
402
+ function expression(type, value) {
403
+ return expressionInner(type, value, false);
404
+ }
405
+ function expressionNoComma(type, value) {
406
+ return expressionInner(type, value, true);
407
+ }
408
+ function parenExpr(type) {
409
+ if (type != "(") return pass()
410
+ return cont(pushlex(")"), expression, expect(")"), poplex)
411
+ }
412
+ function expressionInner(type, value, noComma) {
413
+ if (cx.state.fatArrowAt == cx.stream.start) {
414
+ var body = noComma ? arrowBodyNoComma : arrowBody;
415
+ if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
416
+ else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
417
+ }
418
+
419
+ var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
420
+ if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
421
+ if (type == "function") return cont(functiondef, maybeop);
422
+ if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
423
+ if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
424
+ if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
425
+ if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
426
+ if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
427
+ if (type == "{") return contCommasep(objprop, "}", null, maybeop);
428
+ if (type == "quasi") return pass(quasi, maybeop);
429
+ if (type == "new") return cont(maybeTarget(noComma));
430
+ if (type == "import") return cont(expression);
431
+ return cont();
432
+ }
433
+ function maybeexpression(type) {
434
+ if (type.match(/[;\}\)\],]/)) return pass();
435
+ return pass(expression);
436
+ }
437
+
438
+ function maybeoperatorComma(type, value) {
439
+ if (type == ",") return cont(expression);
440
+ return maybeoperatorNoComma(type, value, false);
441
+ }
442
+ function maybeoperatorNoComma(type, value, noComma) {
443
+ var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;
444
+ var expr = noComma == false ? expression : expressionNoComma;
445
+ if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
446
+ if (type == "operator") {
447
+ if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
448
+ if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false))
449
+ return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
450
+ if (value == "?") return cont(expression, expect(":"), expr);
451
+ return cont(expr);
452
+ }
453
+ if (type == "quasi") { return pass(quasi, me); }
454
+ if (type == ";") return;
455
+ if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
456
+ if (type == ".") return cont(property, me);
457
+ if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
458
+ if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
459
+ if (type == "regexp") {
460
+ cx.state.lastType = cx.marked = "operator"
461
+ cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)
462
+ return cont(expr)
463
+ }
464
+ }
465
+ function quasi(type, value) {
466
+ if (type != "quasi") return pass();
467
+ if (value.slice(value.length - 2) != "${") return cont(quasi);
468
+ return cont(expression, continueQuasi);
469
+ }
470
+ function continueQuasi(type) {
471
+ if (type == "}") {
472
+ cx.marked = "string-2";
473
+ cx.state.tokenize = tokenQuasi;
474
+ return cont(quasi);
475
+ }
476
+ }
477
+ function arrowBody(type) {
478
+ findFatArrow(cx.stream, cx.state);
479
+ return pass(type == "{" ? statement : expression);
480
+ }
481
+ function arrowBodyNoComma(type) {
482
+ findFatArrow(cx.stream, cx.state);
483
+ return pass(type == "{" ? statement : expressionNoComma);
484
+ }
485
+ function maybeTarget(noComma) {
486
+ return function(type) {
487
+ if (type == ".") return cont(noComma ? targetNoComma : target);
488
+ else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)
489
+ else return pass(noComma ? expressionNoComma : expression);
490
+ };
491
+ }
492
+ function target(_, value) {
493
+ if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
494
+ }
495
+ function targetNoComma(_, value) {
496
+ if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
497
+ }
498
+ function maybelabel(type) {
499
+ if (type == ":") return cont(poplex, statement);
500
+ return pass(maybeoperatorComma, expect(";"), poplex);
501
+ }
502
+ function property(type) {
503
+ if (type == "variable") {cx.marked = "property"; return cont();}
504
+ }
505
+ function objprop(type, value) {
506
+ if (type == "async") {
507
+ cx.marked = "property";
508
+ return cont(objprop);
509
+ } else if (type == "variable" || cx.style == "keyword") {
510
+ cx.marked = "property";
511
+ if (value == "get" || value == "set") return cont(getterSetter);
512
+ var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params
513
+ if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
514
+ cx.state.fatArrowAt = cx.stream.pos + m[0].length
515
+ return cont(afterprop);
516
+ } else if (type == "number" || type == "string") {
517
+ cx.marked = jsonldMode ? "property" : (cx.style + " property");
518
+ return cont(afterprop);
519
+ } else if (type == "jsonld-keyword") {
520
+ return cont(afterprop);
521
+ } else if (isTS && isModifier(value)) {
522
+ cx.marked = "keyword"
523
+ return cont(objprop)
524
+ } else if (type == "[") {
525
+ return cont(expression, maybetype, expect("]"), afterprop);
526
+ } else if (type == "spread") {
527
+ return cont(expressionNoComma, afterprop);
528
+ } else if (value == "*") {
529
+ cx.marked = "keyword";
530
+ return cont(objprop);
531
+ } else if (type == ":") {
532
+ return pass(afterprop)
533
+ }
534
+ }
535
+ function getterSetter(type) {
536
+ if (type != "variable") return pass(afterprop);
537
+ cx.marked = "property";
538
+ return cont(functiondef);
539
+ }
540
+ function afterprop(type) {
541
+ if (type == ":") return cont(expressionNoComma);
542
+ if (type == "(") return pass(functiondef);
543
+ }
544
+ function commasep(what, end, sep) {
545
+ function proceed(type, value) {
546
+ if (sep ? sep.indexOf(type) > -1 : type == ",") {
547
+ var lex = cx.state.lexical;
548
+ if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
549
+ return cont(function(type, value) {
550
+ if (type == end || value == end) return pass()
551
+ return pass(what)
552
+ }, proceed);
553
+ }
554
+ if (type == end || value == end) return cont();
555
+ return cont(expect(end));
556
+ }
557
+ return function(type, value) {
558
+ if (type == end || value == end) return cont();
559
+ return pass(what, proceed);
560
+ };
561
+ }
562
+ function contCommasep(what, end, info) {
563
+ for (var i = 3; i < arguments.length; i++)
564
+ cx.cc.push(arguments[i]);
565
+ return cont(pushlex(end, info), commasep(what, end), poplex);
566
+ }
567
+ function block(type) {
568
+ if (type == "}") return cont();
569
+ return pass(statement, block);
570
+ }
571
+ function maybetype(type, value) {
572
+ if (isTS) {
573
+ if (type == ":") return cont(typeexpr);
574
+ if (value == "?") return cont(maybetype);
575
+ }
576
+ }
577
+ function mayberettype(type) {
578
+ if (isTS && type == ":") {
579
+ if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
580
+ else return cont(typeexpr)
581
+ }
582
+ }
583
+ function isKW(_, value) {
584
+ if (value == "is") {
585
+ cx.marked = "keyword"
586
+ return cont()
587
+ }
588
+ }
589
+ function typeexpr(type, value) {
590
+ if (value == "keyof" || value == "typeof") {
591
+ cx.marked = "keyword"
592
+ return cont(value == "keyof" ? typeexpr : expressionNoComma)
593
+ }
594
+ if (type == "variable" || value == "void") {
595
+ cx.marked = "type"
596
+ return cont(afterType)
597
+ }
598
+ if (type == "string" || type == "number" || type == "atom") return cont(afterType);
599
+ if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
600
+ if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
601
+ if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
602
+ if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr)
603
+ }
604
+ function maybeReturnType(type) {
605
+ if (type == "=>") return cont(typeexpr)
606
+ }
607
+ function typeprop(type, value) {
608
+ if (type == "variable" || cx.style == "keyword") {
609
+ cx.marked = "property"
610
+ return cont(typeprop)
611
+ } else if (value == "?") {
612
+ return cont(typeprop)
613
+ } else if (type == ":") {
614
+ return cont(typeexpr)
615
+ } else if (type == "[") {
616
+ return cont(expression, maybetype, expect("]"), typeprop)
617
+ }
618
+ }
619
+ function typearg(type, value) {
620
+ if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg)
621
+ if (type == ":") return cont(typeexpr)
622
+ return pass(typeexpr)
623
+ }
624
+ function afterType(type, value) {
625
+ if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
626
+ if (value == "|" || type == "." || value == "&") return cont(typeexpr)
627
+ if (type == "[") return cont(expect("]"), afterType)
628
+ if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
629
+ }
630
+ function maybeTypeArgs(_, value) {
631
+ if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
632
+ }
633
+ function typeparam() {
634
+ return pass(typeexpr, maybeTypeDefault)
635
+ }
636
+ function maybeTypeDefault(_, value) {
637
+ if (value == "=") return cont(typeexpr)
638
+ }
639
+ function vardef(_, value) {
640
+ if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)}
641
+ return pass(pattern, maybetype, maybeAssign, vardefCont);
642
+ }
643
+ function pattern(type, value) {
644
+ if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) }
645
+ if (type == "variable") { register(value); return cont(); }
646
+ if (type == "spread") return cont(pattern);
647
+ if (type == "[") return contCommasep(eltpattern, "]");
648
+ if (type == "{") return contCommasep(proppattern, "}");
649
+ }
650
+ function proppattern(type, value) {
651
+ if (type == "variable" && !cx.stream.match(/^\s*:/, false)) {
652
+ register(value);
653
+ return cont(maybeAssign);
654
+ }
655
+ if (type == "variable") cx.marked = "property";
656
+ if (type == "spread") return cont(pattern);
657
+ if (type == "}") return pass();
658
+ if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern);
659
+ return cont(expect(":"), pattern, maybeAssign);
660
+ }
661
+ function eltpattern() {
662
+ return pass(pattern, maybeAssign)
663
+ }
664
+ function maybeAssign(_type, value) {
665
+ if (value == "=") return cont(expressionNoComma);
666
+ }
667
+ function vardefCont(type) {
668
+ if (type == ",") return cont(vardef);
669
+ }
670
+ function maybeelse(type, value) {
671
+ if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
672
+ }
673
+ function forspec(type, value) {
674
+ if (value == "await") return cont(forspec);
675
+ if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
676
+ }
677
+ function forspec1(type) {
678
+ if (type == "var") return cont(vardef, expect(";"), forspec2);
679
+ if (type == ";") return cont(forspec2);
680
+ if (type == "variable") return cont(formaybeinof);
681
+ return pass(expression, expect(";"), forspec2);
682
+ }
683
+ function formaybeinof(_type, value) {
684
+ if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
685
+ return cont(maybeoperatorComma, forspec2);
686
+ }
687
+ function forspec2(type, value) {
688
+ if (type == ";") return cont(forspec3);
689
+ if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); }
690
+ return pass(expression, expect(";"), forspec3);
691
+ }
692
+ function forspec3(type) {
693
+ if (type != ")") cont(expression);
694
+ }
695
+ function functiondef(type, value) {
696
+ if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
697
+ if (type == "variable") {register(value); return cont(functiondef);}
698
+ if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
699
+ if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
700
+ }
701
+ function funarg(type, value) {
702
+ if (value == "@") cont(expression, funarg)
703
+ if (type == "spread") return cont(funarg);
704
+ if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
705
+ return pass(pattern, maybetype, maybeAssign);
706
+ }
707
+ function classExpression(type, value) {
708
+ // Class expressions may have an optional name.
709
+ if (type == "variable") return className(type, value);
710
+ return classNameAfter(type, value);
711
+ }
712
+ function className(type, value) {
713
+ if (type == "variable") {register(value); return cont(classNameAfter);}
714
+ }
715
+ function classNameAfter(type, value) {
716
+ if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
717
+ if (value == "extends" || value == "implements" || (isTS && type == ",")) {
718
+ if (value == "implements") cx.marked = "keyword";
719
+ return cont(isTS ? typeexpr : expression, classNameAfter);
720
+ }
721
+ if (type == "{") return cont(pushlex("}"), classBody, poplex);
722
+ }
723
+ function classBody(type, value) {
724
+ if (type == "async" ||
725
+ (type == "variable" &&
726
+ (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
727
+ cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
728
+ cx.marked = "keyword";
729
+ return cont(classBody);
730
+ }
731
+ if (type == "variable" || cx.style == "keyword") {
732
+ cx.marked = "property";
733
+ return cont(isTS ? classfield : functiondef, classBody);
734
+ }
735
+ if (type == "[")
736
+ return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
737
+ if (value == "*") {
738
+ cx.marked = "keyword";
739
+ return cont(classBody);
740
+ }
741
+ if (type == ";") return cont(classBody);
742
+ if (type == "}") return cont();
743
+ if (value == "@") return cont(expression, classBody)
744
+ }
745
+ function classfield(type, value) {
746
+ if (value == "?") return cont(classfield)
747
+ if (type == ":") return cont(typeexpr, maybeAssign)
748
+ if (value == "=") return cont(expressionNoComma)
749
+ return pass(functiondef)
750
+ }
751
+ function afterExport(type, value) {
752
+ if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
753
+ if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
754
+ if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
755
+ return pass(statement);
756
+ }
757
+ function exportField(type, value) {
758
+ if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
759
+ if (type == "variable") return pass(expressionNoComma, exportField);
760
+ }
761
+ function afterImport(type) {
762
+ if (type == "string") return cont();
763
+ if (type == "(") return pass(expression);
764
+ return pass(importSpec, maybeMoreImports, maybeFrom);
765
+ }
766
+ function importSpec(type, value) {
767
+ if (type == "{") return contCommasep(importSpec, "}");
768
+ if (type == "variable") register(value);
769
+ if (value == "*") cx.marked = "keyword";
770
+ return cont(maybeAs);
771
+ }
772
+ function maybeMoreImports(type) {
773
+ if (type == ",") return cont(importSpec, maybeMoreImports)
774
+ }
775
+ function maybeAs(_type, value) {
776
+ if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
777
+ }
778
+ function maybeFrom(_type, value) {
779
+ if (value == "from") { cx.marked = "keyword"; return cont(expression); }
780
+ }
781
+ function arrayLiteral(type) {
782
+ if (type == "]") return cont();
783
+ return pass(commasep(expressionNoComma, "]"));
784
+ }
785
+ function enumdef() {
786
+ return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex)
787
+ }
788
+ function enummember() {
789
+ return pass(pattern, maybeAssign);
790
+ }
791
+
792
+ function isContinuedStatement(state, textAfter) {
793
+ return state.lastType == "operator" || state.lastType == "," ||
794
+ isOperatorChar.test(textAfter.charAt(0)) ||
795
+ /[,.]/.test(textAfter.charAt(0));
796
+ }
797
+
798
+ function expressionAllowed(stream, state, backUp) {
799
+ return state.tokenize == tokenBase &&
800
+ /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
801
+ (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
802
+ }
803
+
804
+ // Interface
805
+
806
+ return {
807
+ startState: function(basecolumn) {
808
+ var state = {
809
+ tokenize: tokenBase,
810
+ lastType: "sof",
811
+ cc: [],
812
+ lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
813
+ localVars: parserConfig.localVars,
814
+ context: parserConfig.localVars && new Context(null, null, false),
815
+ indented: basecolumn || 0
816
+ };
817
+ if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
818
+ state.globalVars = parserConfig.globalVars;
819
+ return state;
820
+ },
821
+
822
+ token: function(stream, state) {
823
+ if (stream.sol()) {
824
+ if (!state.lexical.hasOwnProperty("align"))
825
+ state.lexical.align = false;
826
+ state.indented = stream.indentation();
827
+ findFatArrow(stream, state);
828
+ }
829
+ if (state.tokenize != tokenComment && stream.eatSpace()) return null;
830
+ var style = state.tokenize(stream, state);
831
+ if (type == "comment") return style;
832
+ state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type;
833
+ return parseJS(state, style, type, content, stream);
834
+ },
835
+
836
+ indent: function(state, textAfter) {
837
+ if (state.tokenize == tokenComment) return CodeMirror.Pass;
838
+ if (state.tokenize != tokenBase) return 0;
839
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top
840
+ // Kludge to prevent 'maybelse' from blocking lexical scope pops
841
+ if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {
842
+ var c = state.cc[i];
843
+ if (c == poplex) lexical = lexical.prev;
844
+ else if (c != maybeelse) break;
845
+ }
846
+ while ((lexical.type == "stat" || lexical.type == "form") &&
847
+ (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) &&
848
+ (top == maybeoperatorComma || top == maybeoperatorNoComma) &&
849
+ !/^[,\.=+\-*:?[\(]/.test(textAfter))))
850
+ lexical = lexical.prev;
851
+ if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat")
852
+ lexical = lexical.prev;
853
+ var type = lexical.type, closing = firstChar == type;
854
+
855
+ if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0);
856
+ else if (type == "form" && firstChar == "{") return lexical.indented;
857
+ else if (type == "form") return lexical.indented + indentUnit;
858
+ else if (type == "stat")
859
+ return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);
860
+ else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false)
861
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
862
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
863
+ else return lexical.indented + (closing ? 0 : indentUnit);
864
+ },
865
+
866
+ electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
867
+ blockCommentStart: jsonMode ? null : "/*",
868
+ blockCommentEnd: jsonMode ? null : "*/",
869
+ blockCommentContinue: jsonMode ? null : " * ",
870
+ lineComment: jsonMode ? null : "//",
871
+ fold: "brace",
872
+ closeBrackets: "()[]{}''\"\"``",
873
+
874
+ helperType: jsonMode ? "json" : "javascript",
875
+ jsonldMode: jsonldMode,
876
+ jsonMode: jsonMode,
877
+
878
+ expressionAllowed: expressionAllowed,
879
+
880
+ skipExpression: function(state) {
881
+ var top = state.cc[state.cc.length - 1]
882
+ if (top == expression || top == expressionNoComma) state.cc.pop()
883
+ }
884
+ };
885
+ });
886
+
887
+ CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/);
888
+
889
+ CodeMirror.defineMIME("text/javascript", "javascript");
890
+ CodeMirror.defineMIME("text/ecmascript", "javascript");
891
+ CodeMirror.defineMIME("application/javascript", "javascript");
892
+ CodeMirror.defineMIME("application/x-javascript", "javascript");
893
+ CodeMirror.defineMIME("application/ecmascript", "javascript");
894
+ CodeMirror.defineMIME("application/json", {name: "javascript", json: true});
895
+ CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true});
896
+ CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true});
897
+ CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true });
898
+ CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true });
899
+
900
+ });
assets/codemirror/xml.js ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: https://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ var htmlConfig = {
15
+ autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
16
+ 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
17
+ 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
18
+ 'track': true, 'wbr': true, 'menuitem': true},
19
+ implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
20
+ 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
21
+ 'th': true, 'tr': true},
22
+ contextGrabbers: {
23
+ 'dd': {'dd': true, 'dt': true},
24
+ 'dt': {'dd': true, 'dt': true},
25
+ 'li': {'li': true},
26
+ 'option': {'option': true, 'optgroup': true},
27
+ 'optgroup': {'optgroup': true},
28
+ 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
29
+ 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
30
+ 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
31
+ 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
32
+ 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
33
+ 'rp': {'rp': true, 'rt': true},
34
+ 'rt': {'rp': true, 'rt': true},
35
+ 'tbody': {'tbody': true, 'tfoot': true},
36
+ 'td': {'td': true, 'th': true},
37
+ 'tfoot': {'tbody': true},
38
+ 'th': {'td': true, 'th': true},
39
+ 'thead': {'tbody': true, 'tfoot': true},
40
+ 'tr': {'tr': true}
41
+ },
42
+ doNotIndent: {"pre": true},
43
+ allowUnquoted: true,
44
+ allowMissing: true,
45
+ caseFold: true
46
+ }
47
+
48
+ var xmlConfig = {
49
+ autoSelfClosers: {},
50
+ implicitlyClosed: {},
51
+ contextGrabbers: {},
52
+ doNotIndent: {},
53
+ allowUnquoted: false,
54
+ allowMissing: false,
55
+ allowMissingTagName: false,
56
+ caseFold: false
57
+ }
58
+
59
+ CodeMirror.defineMode("xml", function(editorConf, config_) {
60
+ var indentUnit = editorConf.indentUnit
61
+ var config = {}
62
+ var defaults = config_.htmlMode ? htmlConfig : xmlConfig
63
+ for (var prop in defaults) config[prop] = defaults[prop]
64
+ for (var prop in config_) config[prop] = config_[prop]
65
+
66
+ // Return variables for tokenizers
67
+ var type, setStyle;
68
+
69
+ function inText(stream, state) {
70
+ function chain(parser) {
71
+ state.tokenize = parser;
72
+ return parser(stream, state);
73
+ }
74
+
75
+ var ch = stream.next();
76
+ if (ch == "<") {
77
+ if (stream.eat("!")) {
78
+ if (stream.eat("[")) {
79
+ if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
80
+ else return null;
81
+ } else if (stream.match("--")) {
82
+ return chain(inBlock("comment", "-->"));
83
+ } else if (stream.match("DOCTYPE", true, true)) {
84
+ stream.eatWhile(/[\w\._\-]/);
85
+ return chain(doctype(1));
86
+ } else {
87
+ return null;
88
+ }
89
+ } else if (stream.eat("?")) {
90
+ stream.eatWhile(/[\w\._\-]/);
91
+ state.tokenize = inBlock("meta", "?>");
92
+ return "meta";
93
+ } else {
94
+ type = stream.eat("/") ? "closeTag" : "openTag";
95
+ state.tokenize = inTag;
96
+ return "tag bracket";
97
+ }
98
+ } else if (ch == "&") {
99
+ var ok;
100
+ if (stream.eat("#")) {
101
+ if (stream.eat("x")) {
102
+ ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
103
+ } else {
104
+ ok = stream.eatWhile(/[\d]/) && stream.eat(";");
105
+ }
106
+ } else {
107
+ ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
108
+ }
109
+ return ok ? "atom" : "error";
110
+ } else {
111
+ stream.eatWhile(/[^&<]/);
112
+ return null;
113
+ }
114
+ }
115
+ inText.isInText = true;
116
+
117
+ function inTag(stream, state) {
118
+ var ch = stream.next();
119
+ if (ch == ">" || (ch == "/" && stream.eat(">"))) {
120
+ state.tokenize = inText;
121
+ type = ch == ">" ? "endTag" : "selfcloseTag";
122
+ return "tag bracket";
123
+ } else if (ch == "=") {
124
+ type = "equals";
125
+ return null;
126
+ } else if (ch == "<") {
127
+ state.tokenize = inText;
128
+ state.state = baseState;
129
+ state.tagName = state.tagStart = null;
130
+ var next = state.tokenize(stream, state);
131
+ return next ? next + " tag error" : "tag error";
132
+ } else if (/[\'\"]/.test(ch)) {
133
+ state.tokenize = inAttribute(ch);
134
+ state.stringStartCol = stream.column();
135
+ return state.tokenize(stream, state);
136
+ } else {
137
+ stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);
138
+ return "word";
139
+ }
140
+ }
141
+
142
+ function inAttribute(quote) {
143
+ var closure = function(stream, state) {
144
+ while (!stream.eol()) {
145
+ if (stream.next() == quote) {
146
+ state.tokenize = inTag;
147
+ break;
148
+ }
149
+ }
150
+ return "string";
151
+ };
152
+ closure.isInAttribute = true;
153
+ return closure;
154
+ }
155
+
156
+ function inBlock(style, terminator) {
157
+ return function(stream, state) {
158
+ while (!stream.eol()) {
159
+ if (stream.match(terminator)) {
160
+ state.tokenize = inText;
161
+ break;
162
+ }
163
+ stream.next();
164
+ }
165
+ return style;
166
+ }
167
+ }
168
+
169
+ function doctype(depth) {
170
+ return function(stream, state) {
171
+ var ch;
172
+ while ((ch = stream.next()) != null) {
173
+ if (ch == "<") {
174
+ state.tokenize = doctype(depth + 1);
175
+ return state.tokenize(stream, state);
176
+ } else if (ch == ">") {
177
+ if (depth == 1) {
178
+ state.tokenize = inText;
179
+ break;
180
+ } else {
181
+ state.tokenize = doctype(depth - 1);
182
+ return state.tokenize(stream, state);
183
+ }
184
+ }
185
+ }
186
+ return "meta";
187
+ };
188
+ }
189
+
190
+ function Context(state, tagName, startOfLine) {
191
+ this.prev = state.context;
192
+ this.tagName = tagName;
193
+ this.indent = state.indented;
194
+ this.startOfLine = startOfLine;
195
+ if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))
196
+ this.noIndent = true;
197
+ }
198
+ function popContext(state) {
199
+ if (state.context) state.context = state.context.prev;
200
+ }
201
+ function maybePopContext(state, nextTagName) {
202
+ var parentTagName;
203
+ while (true) {
204
+ if (!state.context) {
205
+ return;
206
+ }
207
+ parentTagName = state.context.tagName;
208
+ if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||
209
+ !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
210
+ return;
211
+ }
212
+ popContext(state);
213
+ }
214
+ }
215
+
216
+ function baseState(type, stream, state) {
217
+ if (type == "openTag") {
218
+ state.tagStart = stream.column();
219
+ return tagNameState;
220
+ } else if (type == "closeTag") {
221
+ return closeTagNameState;
222
+ } else {
223
+ return baseState;
224
+ }
225
+ }
226
+ function tagNameState(type, stream, state) {
227
+ if (type == "word") {
228
+ state.tagName = stream.current();
229
+ setStyle = "tag";
230
+ return attrState;
231
+ } else if (config.allowMissingTagName && type == "endTag") {
232
+ setStyle = "tag bracket";
233
+ return attrState(type, stream, state);
234
+ } else {
235
+ setStyle = "error";
236
+ return tagNameState;
237
+ }
238
+ }
239
+ function closeTagNameState(type, stream, state) {
240
+ if (type == "word") {
241
+ var tagName = stream.current();
242
+ if (state.context && state.context.tagName != tagName &&
243
+ config.implicitlyClosed.hasOwnProperty(state.context.tagName))
244
+ popContext(state);
245
+ if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
246
+ setStyle = "tag";
247
+ return closeState;
248
+ } else {
249
+ setStyle = "tag error";
250
+ return closeStateErr;
251
+ }
252
+ } else if (config.allowMissingTagName && type == "endTag") {
253
+ setStyle = "tag bracket";
254
+ return closeState(type, stream, state);
255
+ } else {
256
+ setStyle = "error";
257
+ return closeStateErr;
258
+ }
259
+ }
260
+
261
+ function closeState(type, _stream, state) {
262
+ if (type != "endTag") {
263
+ setStyle = "error";
264
+ return closeState;
265
+ }
266
+ popContext(state);
267
+ return baseState;
268
+ }
269
+ function closeStateErr(type, stream, state) {
270
+ setStyle = "error";
271
+ return closeState(type, stream, state);
272
+ }
273
+
274
+ function attrState(type, _stream, state) {
275
+ if (type == "word") {
276
+ setStyle = "attribute";
277
+ return attrEqState;
278
+ } else if (type == "endTag" || type == "selfcloseTag") {
279
+ var tagName = state.tagName, tagStart = state.tagStart;
280
+ state.tagName = state.tagStart = null;
281
+ if (type == "selfcloseTag" ||
282
+ config.autoSelfClosers.hasOwnProperty(tagName)) {
283
+ maybePopContext(state, tagName);
284
+ } else {
285
+ maybePopContext(state, tagName);
286
+ state.context = new Context(state, tagName, tagStart == state.indented);
287
+ }
288
+ return baseState;
289
+ }
290
+ setStyle = "error";
291
+ return attrState;
292
+ }
293
+ function attrEqState(type, stream, state) {
294
+ if (type == "equals") return attrValueState;
295
+ if (!config.allowMissing) setStyle = "error";
296
+ return attrState(type, stream, state);
297
+ }
298
+ function attrValueState(type, stream, state) {
299
+ if (type == "string") return attrContinuedState;
300
+ if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;}
301
+ setStyle = "error";
302
+ return attrState(type, stream, state);
303
+ }
304
+ function attrContinuedState(type, stream, state) {
305
+ if (type == "string") return attrContinuedState;
306
+ return attrState(type, stream, state);
307
+ }
308
+
309
+ return {
310
+ startState: function(baseIndent) {
311
+ var state = {tokenize: inText,
312
+ state: baseState,
313
+ indented: baseIndent || 0,
314
+ tagName: null, tagStart: null,
315
+ context: null}
316
+ if (baseIndent != null) state.baseIndent = baseIndent
317
+ return state
318
+ },
319
+
320
+ token: function(stream, state) {
321
+ if (!state.tagName && stream.sol())
322
+ state.indented = stream.indentation();
323
+
324
+ if (stream.eatSpace()) return null;
325
+ type = null;
326
+ var style = state.tokenize(stream, state);
327
+ if ((style || type) && style != "comment") {
328
+ setStyle = null;
329
+ state.state = state.state(type || style, stream, state);
330
+ if (setStyle)
331
+ style = setStyle == "error" ? style + " error" : setStyle;
332
+ }
333
+ return style;
334
+ },
335
+
336
+ indent: function(state, textAfter, fullLine) {
337
+ var context = state.context;
338
+ // Indent multi-line strings (e.g. css).
339
+ if (state.tokenize.isInAttribute) {
340
+ if (state.tagStart == state.indented)
341
+ return state.stringStartCol + 1;
342
+ else
343
+ return state.indented + indentUnit;
344
+ }
345
+ if (context && context.noIndent) return CodeMirror.Pass;
346
+ if (state.tokenize != inTag && state.tokenize != inText)
347
+ return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
348
+ // Indent the starts of attribute names.
349
+ if (state.tagName) {
350
+ if (config.multilineTagIndentPastTag !== false)
351
+ return state.tagStart + state.tagName.length + 2;
352
+ else
353
+ return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);
354
+ }
355
+ if (config.alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
356
+ var tagAfter = textAfter && /^<(\/)?([\w_:\.-]*)/.exec(textAfter);
357
+ if (tagAfter && tagAfter[1]) { // Closing tag spotted
358
+ while (context) {
359
+ if (context.tagName == tagAfter[2]) {
360
+ context = context.prev;
361
+ break;
362
+ } else if (config.implicitlyClosed.hasOwnProperty(context.tagName)) {
363
+ context = context.prev;
364
+ } else {
365
+ break;
366
+ }
367
+ }
368
+ } else if (tagAfter) { // Opening tag spotted
369
+ while (context) {
370
+ var grabbers = config.contextGrabbers[context.tagName];
371
+ if (grabbers && grabbers.hasOwnProperty(tagAfter[2]))
372
+ context = context.prev;
373
+ else
374
+ break;
375
+ }
376
+ }
377
+ while (context && context.prev && !context.startOfLine)
378
+ context = context.prev;
379
+ if (context) return context.indent + indentUnit;
380
+ else return state.baseIndent || 0;
381
+ },
382
+
383
+ electricInput: /<\/[\s\w:]+>$/,
384
+ blockCommentStart: "<!--",
385
+ blockCommentEnd: "-->",
386
+
387
+ configuration: config.htmlMode ? "html" : "xml",
388
+ helperType: config.htmlMode ? "html" : "xml",
389
+
390
+ skipAttribute: function(state) {
391
+ if (state.state == attrValueState)
392
+ state.state = attrState
393
+ }
394
+ };
395
+ });
396
+
397
+ CodeMirror.defineMIME("text/xml", "xml");
398
+ CodeMirror.defineMIME("application/xml", "xml");
399
+ if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
400
+ CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
401
+
402
+ });
assets/css/admin-style.css ADDED
@@ -0,0 +1,1905 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url('https://fonts.googleapis.com/css?family=Open+Sans|Rye|Work+Sans');
2
+
3
+ .pp_forms th#shortcode {
4
+ width: 33%;
5
+ }
6
+
7
+ .pp_forms th#title {
8
+ width: 35%;
9
+ }
10
+
11
+ .profile-press-design-gateway {
12
+ width: 100%;
13
+ max-width: 700px;
14
+ }
15
+
16
+ .pp-half-meta-inner .pp-half-meta h2 {
17
+ font-size: 24px !important;
18
+ }
19
+
20
+ .drag-and-drop-btn {
21
+ font-family: 'Open Sans', sans-serif;
22
+ }
23
+
24
+ .profile-press-design-gateway-inner .responsive-image img {
25
+ width: 100%;
26
+ height: auto;
27
+ }
28
+
29
+ .pp-hald-first {
30
+ float: left;
31
+ width: 50%;
32
+ text-align: center;
33
+ padding: 20px;
34
+ -webkit-box-sizing: border-box;
35
+ -moz-box-sizing: border-box;
36
+ box-sizing: border-box;
37
+ text-decoration: none;
38
+ color: #555;
39
+ }
40
+
41
+ .pp-builder-select-active {
42
+ border: 2px solid #3498db;
43
+ }
44
+
45
+ .drag-and-drop-btn {
46
+ position: absolute;
47
+ right: 0;
48
+ }
49
+
50
+ .pp-half-meta-inner {
51
+ background: #fff;
52
+ padding: 20px;
53
+ position: relative;
54
+ cursor: pointer;
55
+ }
56
+
57
+ .pp-half-first-thumb.responsive-image img {
58
+ width: 70px;
59
+ height: 70px;
60
+ padding: 20px;
61
+ }
62
+
63
+ .pp-half-first-thumb.responsive-image {
64
+ text-align: center;
65
+ }
66
+
67
+ .pp-builder-create-btn {
68
+ background: #3498db;
69
+ padding: 20px;
70
+ width: 100%;
71
+ border: 0;
72
+ font-weight: 400;
73
+ text-transform: uppercase;
74
+ color: #fff;
75
+ font-family: 'Work Sans', sans-serif;;
76
+ font-size: 20px;
77
+ border-bottom: 3px solid #2980b9;
78
+ cursor: pointer;
79
+ }
80
+
81
+ .pp-half-meta p {
82
+ font-size: 17px;
83
+ line-height: 1.5;
84
+ margin-top: 20px;
85
+ }
86
+
87
+ .pp-builder-create-btn:focus {
88
+ border-bottom: 2px solid #2980b9;
89
+ }
90
+
91
+ .drag-and-drop-btn {
92
+ background: #e74c3c;
93
+ width: 47px;
94
+ height: 47px;
95
+ border-radius: 100%;
96
+ color: #fff;
97
+ font-weight: 600;
98
+ right: 27px;
99
+ border: 4px solid #c0392b;
100
+ box-shadow: 1px 4px 11px #3a3a3a;
101
+ }
102
+
103
+ .ppview .postbox input[type=number], .ppview input[type=password],
104
+ .ppview .postbox input[type=text],
105
+ .ppview .postbox select,
106
+ .ppview .postbox textarea {
107
+ width: 500px !important;
108
+ max-width: 500px !important;
109
+ }
110
+
111
+ input.shortcode-in-list-table {
112
+ width: 100% !important;
113
+ max-width: 260px;
114
+ border: none;
115
+ }
116
+
117
+ .ppSCB .pp-form-builder-shortcodes-btn {
118
+ text-align: right;
119
+ float: right
120
+ }
121
+
122
+ /* shortcode builder modal START */
123
+ #ppress-available-shortcodes-jbox {
124
+ width: 100%;
125
+ max-width: 600px;
126
+ }
127
+
128
+ #ppress-available-shortcodes-jbox * {
129
+ -webkit-box-sizing: border-box;
130
+ -moz-box-sizing: border-box;
131
+ box-sizing: border-box;
132
+ }
133
+
134
+ #ppress-available-shortcodes-jbox input#ppress_shortcode_inserter_search {
135
+ width: 100%;
136
+ height: 28px;
137
+ margin: 0;
138
+ -webkit-box-sizing: border-box;
139
+ -moz-box-sizing: border-box;
140
+ box-sizing: border-box;
141
+ }
142
+
143
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-list-wrapper {
144
+ padding: 10px 20px;
145
+ }
146
+
147
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-name {
148
+ font-weight: 700;
149
+ font-size: 15px;
150
+ -webkit-box-sizing: border-box;
151
+ -moz-box-sizing: border-box;
152
+ box-sizing: border-box;
153
+ display: inline;
154
+ }
155
+
156
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-item-btn {
157
+ width: 32%;
158
+ display: inline;
159
+ -webkit-box-sizing: border-box;
160
+ -moz-box-sizing: border-box;
161
+ box-sizing: border-box;
162
+ }
163
+
164
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-item-btn a {
165
+ float: right;
166
+ margin-top: 10px;
167
+ }
168
+
169
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-item {
170
+ width: 68%;
171
+ float: left;
172
+ }
173
+
174
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-item-wrap {
175
+ display: block;
176
+ padding-top: 5px;
177
+ }
178
+
179
+ #ppress-available-shortcodes-jbox .ppclearfix:after {
180
+ clear: both
181
+ }
182
+
183
+ #ppress-available-shortcodes-jbox .ppclearfix:after,
184
+ #ppress-available-shortcodes-jbox .ppclearfix:before {
185
+ content: " ";
186
+ display: table;
187
+ }
188
+
189
+ #ppress-available-shortcodes-jbox .jBox-content {
190
+ background-color: #fff;
191
+ }
192
+
193
+ #ppress-available-shortcodes-jbox .jBox-title {
194
+ font-size: 16px;
195
+ margin: 0;
196
+ }
197
+
198
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-item-wrap {
199
+ border-bottom: 1px solid #ddd;
200
+ border-bottom: 1px solid #d3d3d3;
201
+ padding-bottom: 10px;
202
+ }
203
+
204
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-desc {
205
+ margin: 5px 0 10px;
206
+ font-size: 14px;
207
+ }
208
+
209
+ #ppress-available-shortcodes-jbox * {
210
+ -webkit-font-smoothing: antialiased;
211
+ }
212
+
213
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-attributes-wrap {
214
+ margin: 8px 0 21px;
215
+ border: 1px solid #e5e5e5;
216
+ border-left: 0;
217
+ border-right: 0;
218
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
219
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
220
+ color: #515151;
221
+ width: 100%;
222
+ box-sizing: border-box;
223
+ }
224
+
225
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-attribute-label {
226
+ width: 38%;
227
+ display: inline-block;
228
+ box-sizing: border-box;
229
+ font-size: 13px;
230
+ font-weight: 600;
231
+ float: left;
232
+ background: #f9f9f9;
233
+ vertical-align: top;
234
+ border: 0;
235
+ border-top: 1px solid #f2f2f2;
236
+ padding: 25px 20px 18px 20px;
237
+ }
238
+
239
+ .ppress-builder-shortcode-attribute-row:first-child .ppress-builder-shortcode-attribute-label {
240
+ border-top: none;
241
+ }
242
+
243
+ #ppress-available-shortcodes-jbox .jBox-content {
244
+ background-color: #f5f5f5;
245
+ }
246
+
247
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-attribute-field {
248
+ vertical-align: top;
249
+ border: 0;
250
+ width: 62%;
251
+ box-sizing: border-box;
252
+ border-top: 1px solid #f2f2f2;
253
+ padding: 15px 20px;
254
+ float: left;
255
+ background: #fff;
256
+ }
257
+
258
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-attribute-field:first-child {
259
+ border-top: none;
260
+ }
261
+
262
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-attribute-row:after {
263
+ content: "";
264
+ display: table;
265
+ clear: both;
266
+ }
267
+
268
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-attribute-row {
269
+ border: 1px solid #e5e5e5;
270
+ border-top: 0;
271
+ border-bottom: 0;
272
+ }
273
+
274
+ #ppress-available-shortcodes-jbox .ppress-shortcode-inserter-builder-field:not([type=checkbox]) {
275
+ width: 100%;
276
+ }
277
+
278
+ #ppress-available-shortcodes-jbox .ppress-shortcode-inserter-builder-field[type=checkbox] {
279
+ margin: 10px 0;
280
+ }
281
+
282
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-clipboard-form {
283
+ padding: 0 0 12px;
284
+ }
285
+
286
+ #ppress-available-shortcodes-jbox #ppress-builder-shortcode-preview-field {
287
+ -webkit-box-sizing: border-box;
288
+ box-sizing: border-box;
289
+ line-height: 1.45;
290
+ border: 1px solid #ddd;
291
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
292
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
293
+ font-family: Consolas, Monaco, monospace;
294
+ width: 100%;
295
+ padding: 18px;
296
+ font-size: 12.5px;
297
+ margin: 0 5px 9px 0;
298
+ text-align: center;
299
+ background: #fff;
300
+ }
301
+
302
+ #ppress-available-shortcodes-jbox .ppress-builder-shortcode-btn.button {
303
+ width: 100%;
304
+ }
305
+
306
+ #ppress-available-shortcodes-jbox .ppress-shortcode-inserter-back {
307
+ cursor: pointer;
308
+ margin: 0 6px 0 0;
309
+ }
310
+
311
+ /* shortcode builder modal END */
312
+
313
+ .ppSCB .pp-form-builder-shortcodes-btn a:before {
314
+ font-family: dashicons;
315
+ content: "\f475";
316
+ padding-right: 2px;
317
+ vertical-align: middle;
318
+ display: inline-block;
319
+ }
320
+
321
+ input[readonly] {
322
+ background-color: #eee;
323
+ margin: 1px
324
+ }
325
+
326
+ .ppview .column-shortcode {
327
+ width: 30%
328
+ }
329
+
330
+ .ppview .column-widget {
331
+ width: 10%
332
+ }
333
+
334
+ .ppview .column-date {
335
+ width: 25%
336
+ }
337
+
338
+ .custom-field-anchor {
339
+ width: 30px;
340
+ border-right: 1px solid #e1e1e1;
341
+ text-align: center !important;
342
+ }
343
+
344
+ tbody tr td.custom-field-anchor {
345
+ cursor: move;
346
+ }
347
+
348
+ table.custom_profile_fields tbody tr:hover {
349
+ background-color: #e3e3e3;
350
+ }
351
+
352
+ table#pp_contact_info tbody tr:hover {
353
+ background-color: #e3e3e3;
354
+ }
355
+
356
+ .drag-highlight {
357
+ background-color: #e3e3e3;
358
+ width: 100%;
359
+ margin: 10px 0;
360
+ }
361
+
362
+ .pp_circle_green {
363
+ background: green;
364
+ border-radius: 100%;
365
+ height: 2px;
366
+ margin: 5px 15px;
367
+ padding: 5px;
368
+ width: 2px
369
+ }
370
+
371
+ .pp_circle_red {
372
+ background: red;
373
+ border-radius: 100%;
374
+ height: 2px;
375
+ margin: 5px 15px;
376
+ padding: 5px;
377
+ width: 2px
378
+ }
379
+
380
+ .pp-button-icon::before {
381
+ background: url(../images/admin/dashicon.png);
382
+ font: 400 18px/1 dashicons;
383
+ margin: 0 2px;
384
+ padding: 0;
385
+ height: 100%;
386
+ width: auto;
387
+ vertical-align: top
388
+ }
389
+
390
+ .banner {
391
+ position: absolute;
392
+ left: 10%;
393
+ display: block;
394
+ margin: 10px 5px 20px;
395
+ width: 600px;
396
+ height: 60px;
397
+ border: 1px solid #8a1;
398
+ font: 400 30px/60px Rye;
399
+ text-align: center;
400
+ color: #451;
401
+ background: #9b2;
402
+ border-radius: 4px;
403
+ box-shadow: 0 0 30px rgba(0, 0, 0, .15) inset, 0 6px 10px rgba(0, 0, 0, .15)
404
+ }
405
+
406
+ .banner::after, .banner::before {
407
+ content: '';
408
+ position: absolute;
409
+ left: -70px;
410
+ top: 24px;
411
+ display: block;
412
+ width: 40px;
413
+ height: 0;
414
+ border: 30px solid #9b2;
415
+ border-right: 20px solid #791;
416
+ border-bottom-color: #94b81e;
417
+ border-left-color: transparent;
418
+ transform: rotate(-5deg)
419
+ }
420
+
421
+ .banner::after {
422
+ left: auto;
423
+ right: -70px;
424
+ border-left: 20px solid #791;
425
+ border-right: 30px solid transparent;
426
+ transform: rotate(5deg)
427
+ }
428
+
429
+ .pp-settings-wrap {
430
+ display: flex;
431
+ border: 1px solid #c8d7e1;
432
+ border-top: 0;
433
+ }
434
+
435
+ .pp-settings-wrap .dashicons {
436
+ padding-top: 2px;
437
+ margin-right: 5px;
438
+ }
439
+
440
+ .pp-settings-wrap h2.nav-tab-wrapper {
441
+ flex: 1;
442
+ border-bottom: none;
443
+ padding: 0;
444
+ background: #f7f8fa;
445
+ border-right: 1px solid #c8d7e1;
446
+ }
447
+
448
+ .pp-settings-wrap h2.nav-tab-wrapper a {
449
+ float: none;
450
+ display: block;
451
+ margin: 0;
452
+ border: none;
453
+ padding: 15px;
454
+ background: #f7f8fa;
455
+ font-weight: 500;
456
+ border-bottom: 1px solid #c8d7e1;
457
+ }
458
+
459
+ .pp-settings-wrap h2.nav-tab-wrapper a.nav-tab-active {
460
+ background: #fff !important;
461
+ border-right: 1px solid #c8d7e1;
462
+ width: 99%;
463
+ color: #2e4453;
464
+ }
465
+
466
+ .pp-settings-wrap .metabox-holder {
467
+ flex: 3;
468
+ padding-left: 3%;
469
+ padding-right: 10px;
470
+ background: #fff;
471
+ }
472
+
473
+ .pp-settings-wrap .pp-tab-settings .postbox {
474
+ border: none;
475
+ box-shadow: none;
476
+ }
477
+
478
+ .pp-settings-wrap .metabox-holder h3.hndle {
479
+ padding: 12px;
480
+ cursor: default;
481
+ border-top: 1px solid #eee;
482
+ border-bottom: 1px solid #eee;
483
+ }
484
+
485
+ .pp-settings-wrap .postbox:first-child h3.hndle {
486
+ border-top: none !important;
487
+ }
488
+
489
+ #pp-sub-bar .pp-clear {
490
+ clear: both;
491
+ }
492
+
493
+ #pp-sub-bar .pp-clear:after {
494
+ clear: both;
495
+ content: '.';
496
+ display: block;
497
+ height: 0;
498
+ line-height: 0;
499
+ overflow: auto;
500
+ visibility: hidden;
501
+ zoom: 1;
502
+ }
503
+
504
+ #pp-sub-bar .pp-new-toolbar {
505
+ min-height: 38px;
506
+ padding: 10px;
507
+ background: #fff;
508
+ margin-bottom: 20px;
509
+ border: 1px solid #dedede;
510
+ -webkit-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
511
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
512
+ }
513
+
514
+ #pp-sub-bar .pp-new-toolbar h4 {
515
+ color: #222;
516
+ font-size: 18px;
517
+ font-weight: 600;
518
+ margin: 8px 0 0;
519
+ padding: 0;
520
+ float: left;
521
+ }
522
+
523
+ #pp-sub-bar .pp-new-toolbar ul {
524
+ float: right;
525
+ list-style: none;
526
+ padding: 0;
527
+ margin: 10px 0 0;
528
+ }
529
+
530
+ #pp-sub-bar .pp-new-toolbar ul li {
531
+ list-style: none;
532
+ padding: 0;
533
+ margin: 0;
534
+ float: left;
535
+ }
536
+
537
+ #pp-sub-bar .pp-new-toolbar ul li a {
538
+ color: #0085ba;
539
+ text-decoration: none;
540
+ text-transform: uppercase;
541
+ font-size: 13px;
542
+ letter-spacing: 1px;
543
+ padding: 21px 15px 22px;
544
+ outline: none !important;
545
+ }
546
+
547
+ #pp-sub-bar .pp-new-toolbar ul li a:hover,
548
+ #pp-sub-bar .pp-new-toolbar ul li a.pp-type-active {
549
+ color: #fff;
550
+ background: #007cba;
551
+ }
552
+
553
+ .pp-optin-clear, .pp-template-clear {
554
+ clear: both;
555
+ }
556
+
557
+ .pp-optin-clear:after, .pp-template-clear:after {
558
+ clear: both;
559
+ content: '.';
560
+ display: block;
561
+ height: 0;
562
+ line-height: 0;
563
+ overflow: auto;
564
+ visibility: hidden;
565
+ zoom: 1;
566
+ }
567
+
568
+ .pp-form-new-list .pp-dash-spinner {
569
+ visibility: hidden;
570
+ float: none;
571
+ margin-right: 0;
572
+ margin-left: 0;
573
+ }
574
+
575
+ .pp-error {
576
+ color: #ff0000;
577
+ font-size: 13px;
578
+ font-weight: 600;
579
+ vertical-align: middle;
580
+ display: inline-block;
581
+ margin-top: -3px;
582
+ }
583
+
584
+ .pp-input-error {
585
+ border-color: #ff0000 !important;
586
+ -webkit-box-shadow: 0 0 2px rgba(255, 0, 0, .8) !important;
587
+ box-shadow: 0 0 2px rgba(255, 0, 0, .8) !important;
588
+ }
589
+
590
+ .pp-form-new-list {
591
+ height: 38px;
592
+ padding: 10px;
593
+ background: #fff;
594
+ margin-bottom: 20px;
595
+ border: 1px solid #dedede;
596
+ -webkit-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
597
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
598
+ }
599
+
600
+ .pp-form-new-list h4 {
601
+ color: #222;
602
+ font-size: 18px;
603
+ font-weight: 600;
604
+ text-shadow: 0 1px rgba(255, 255, 255, .25);
605
+ margin: 2px 0 0;
606
+ padding: 0;
607
+ }
608
+
609
+ .pp-form-new-list strong {
610
+ font-size: 16px;
611
+ vertical-align: middle;
612
+ }
613
+
614
+ .pp-form-new-list input, .pp-form-new-list select {
615
+ position: relative;
616
+ top: 1px;
617
+ margin-left: 5px;
618
+ margin-right: 10px;
619
+ font-size: 16px;
620
+ font-weight: 300;
621
+ width: 350px;
622
+ height: 32px;
623
+ }
624
+
625
+ .ppress-premium-flag {
626
+ position: absolute;
627
+ top: -8px;
628
+ right: -8px;
629
+ width: 90px;
630
+ height: 81px;
631
+ background-image: url(../images/themes/premium-theme.png);
632
+ background-size: 90px 81px;
633
+ transform: rotate(70deg)
634
+ }
635
+
636
+ .pp-optin-theme {
637
+ cursor: pointer;
638
+ float: left;
639
+ margin: 0 4% 4% 0;
640
+ position: relative;
641
+ width: 30.66666666667%;
642
+ border: 1px solid #dedede;
643
+ -webkit-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
644
+ box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
645
+ -webkit-box-sizing: border-box;
646
+ -moz-box-sizing: border-box;
647
+ box-sizing: border-box;
648
+ }
649
+
650
+ .pp-optin-theme a {
651
+ text-decoration: none;
652
+ }
653
+
654
+ .pp-optin-theme:nth-child(3n) {
655
+ margin-right: 0;
656
+ }
657
+
658
+ .pp-optin-theme.pp-last-theme {
659
+ margin-right: 0;
660
+ }
661
+
662
+ .pp-optin-theme-screenshot {
663
+ display: block;
664
+ overflow: hidden;
665
+ position: relative;
666
+ -webkit-transition: opacity .2s ease-in-out;
667
+ transition: opacity .2s ease-in-out;
668
+ }
669
+
670
+ .pp-optin-theme-screenshot:after {
671
+ content: '';
672
+ display: block;
673
+ padding-top: 66.66666%;
674
+ }
675
+
676
+ .pp-email-template-screenshot img {
677
+ height: auto;
678
+ position: absolute;
679
+ left: 0;
680
+ top: 0;
681
+ width: 100%;
682
+ -webkit-transform: translateZ(0);
683
+ -webkit-transition: opacity .2s ease-in-out;
684
+ transition: opacity .2s ease-in-out;
685
+ }
686
+
687
+ .pp-optin-theme .pp-optin-theme-name {
688
+ font-size: 15px;
689
+ font-weight: 600;
690
+ height: 18px;
691
+ margin: 0;
692
+ padding: 15px;
693
+ -webkit-box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
694
+ box-shadow: inset 0 1px 0 rgba(0, 0, 0, .1);
695
+ overflow: hidden;
696
+ white-space: nowrap;
697
+ text-overflow: ellipsis;
698
+ background: #fff;
699
+ background: rgba(255, 255, 255, .65);
700
+ }
701
+
702
+ .pp-optin-theme .pp-optin-theme-actions {
703
+ position: absolute;
704
+ bottom: 0;
705
+ right: 0;
706
+ height: 38px;
707
+ padding: 9px 10px 0;
708
+ background: rgba(244, 244, 244, .7);
709
+ border-left: 1px solid rgba(0, 0, 0, .05);
710
+ }
711
+
712
+ .pp-optin-theme-screenshot img {
713
+ height: 100%;
714
+ position: absolute;
715
+ left: 0;
716
+ top: 0;
717
+ width: 100%;
718
+ -webkit-transform: translateZ(0);
719
+ -webkit-transition: opacity .2s ease-in-out;
720
+ transition: opacity .2s ease-in-out;
721
+ }
722
+
723
+ .pp-melange-jbox {
724
+ margin: 0 0 0 -18px;
725
+ font-size: 18px;
726
+ cursor: pointer;
727
+ }
728
+
729
+ .pp-form-listing.pp-forms .wp-list-table .column-date {
730
+ width: 145px;
731
+ }
732
+
733
+ .pp-form-listing.pp-user-profiles th#title {
734
+ width: 30%;
735
+ }
736
+
737
+ .pp-form-listing.pp-user-profiles th#date {
738
+ width: 20%;
739
+ }
740
+
741
+ .pp_diy_outter {
742
+ padding: 64px 20px 0 20px;
743
+ margin: 0 auto;
744
+ text-align: center;
745
+ height: 218px;
746
+ border: 1px solid #dedede;
747
+ -webkit-box-shadow: 0 1px 1px -1px rgba(0, 0, 0, .1);
748
+ box-shadow: 0px 1px 6px inset rgba(0, 0, 0, .1);
749
+ }
750
+
751
+ .pp_diy_tagling {
752
+ text-transform: capitalize;
753
+ }
754
+
755
+
756
+ .pp_create_your_own {
757
+ margin-top: 20px;
758
+ padding: 14px 25px;
759
+ text-transform: uppercase;
760
+ font-weight: 900;
761
+ font-size: 14px;
762
+ background: #0085ba;
763
+ border: 0;
764
+ color: #fff;
765
+ box-shadow: 0px 3px #2d505e;
766
+ }
767
+
768
+ .pp_diy_tagling {
769
+ margin-bottom: 50px;
770
+ }
771
+
772
+ .pp_diy_outter h1 {
773
+ font-size: 26px;
774
+ text-transform: uppercase;
775
+ font-weight: 700;
776
+ }
777
+
778
+ .pp-form-buider-settings-popup-container * {
779
+ box-sizing: border-box;
780
+ -webkit-box-sizing: border-box;
781
+ -moz-box-sizing: border-box;
782
+ }
783
+
784
+ .pp-form-buider-settings-popup-container {
785
+ position: fixed; /* Stay in place */
786
+ z-index: 1; /* Sit on top */
787
+ left: 0;
788
+ top: 0;
789
+ width: 100%; /* Full width */
790
+ height: 100%; /* Full height */
791
+ overflow: auto; /* Enable scroll if needed */
792
+ background-color: rgb(0, 0, 0); /* Fallback color */
793
+ background-color: rgba(51, 51, 51, 0.95); /* Black w/ opacity */
794
+ padding: 20px;
795
+ }
796
+
797
+
798
+ .pp-form-buider-settings-popup-content {
799
+ background-color: #fefefe;
800
+ margin: 5% auto; /* 15% from the top and centered */
801
+ border: 1px solid #888;
802
+ width: 100%; /* Could be more or less, depending on screen size */
803
+ max-width: 600px;
804
+ }
805
+
806
+ .pp-form-buider-settings-popup-header {
807
+ -webkit-font-smoothing: antialiased;
808
+ align-items: center;
809
+ border-bottom: 1px solid #e6e6e6;
810
+ box-sizing: border-box;
811
+ display: flex;
812
+ font-variant-ligatures: none;
813
+ outline: 0;
814
+ padding: 15px;
815
+ text-rendering: optimizelegibility;
816
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
817
+ }
818
+
819
+ .pp-form-buider-settings-popup-header h3 {
820
+ -webkit-font-smoothing: antialiased;
821
+ border-width: 0;
822
+ box-sizing: border-box;
823
+ color: #333;
824
+ display: block;
825
+ font-family: Arial, sans-serif;
826
+ font-size: 15px;
827
+ font-stretch: normal;
828
+ font-style: normal;
829
+ font-variant-caps: normal;
830
+ font-variant-east-asian: normal;
831
+ font-variant-ligatures: normal;
832
+ font-variant-numeric: normal;
833
+ font-weight: 700;
834
+ line-height: 30px;
835
+ margin: 0;
836
+ overflow: hidden;
837
+ padding: 0;
838
+ text-overflow: ellipsis;
839
+ text-rendering: optimizelegibility;
840
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
841
+ text-transform: none;
842
+ white-space: nowrap;
843
+ }
844
+
845
+ .pp-actions-left {
846
+ display: flex;
847
+ align-items: center;
848
+ margin-left: 10px;
849
+ margin-right: auto;
850
+ }
851
+
852
+ span.pp-form-buider-settings-field-type {
853
+ -webkit-font-smoothing: antialiased;
854
+ background-color: #f2f2f2;
855
+ border: 2px solid transparent;
856
+ border-radius: 13px;
857
+ box-sizing: border-box;
858
+ color: #333;
859
+ cursor: default;
860
+ display: inline-block;
861
+ font-family: Arial, sans-serif;
862
+ font-size: 12px;
863
+ font-stretch: normal;
864
+ font-style: normal;
865
+ font-variant-caps: normal;
866
+ font-variant-east-asian: normal;
867
+ font-variant-ligatures: normal;
868
+ font-variant-numeric: normal;
869
+ font-weight: 500;
870
+ height: 26px;
871
+ letter-spacing: -.25px;
872
+ line-height: 22px;
873
+ margin: 0;
874
+ min-width: 40px;
875
+ padding: 0 16px;
876
+ text-align: center;
877
+ text-rendering: optimizelegibility;
878
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
879
+ }
880
+
881
+ span.pp-form-buider-settings-field-type.field-bar-title {
882
+ margin-top: 3px;
883
+ margin-left: 5px;
884
+ padding: 0 8px;
885
+ font-size: 11px;
886
+ }
887
+
888
+ .pp-actions-right {
889
+ display: flex;
890
+ align-items: center;
891
+ margin-left: auto;
892
+ margin-right: 0px;
893
+ }
894
+
895
+ .pp-form-buider-settings-popup-tabs {
896
+ -webkit-font-smoothing: antialiased;
897
+ border-top: 0 solid #e6e6e6;
898
+ box-sizing: border-box;
899
+ display: flex;
900
+ font-variant-ligatures: none;
901
+ list-style: none;
902
+ margin: 0;
903
+ outline: 0;
904
+ padding: 0 30px;
905
+ text-rendering: optimizelegibility;
906
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
907
+ }
908
+
909
+ a.pp-form-buider-settings-popup-tab-menu {
910
+ -webkit-font-smoothing: antialiased;
911
+ border-bottom: 2px solid transparent;
912
+ box-shadow: none;
913
+ box-sizing: border-box;
914
+ color: #888;
915
+ cursor: pointer;
916
+ font-size: 12px;
917
+ font-variant-ligatures: none;
918
+ font-weight: 500;
919
+ line-height: 22px;
920
+ margin: 0 10px;
921
+ outline: 0 none transparent;
922
+ padding: 14px 0 12px;
923
+ text-decoration: none;
924
+ text-rendering: optimizelegibility;
925
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
926
+ text-transform: uppercase;
927
+ }
928
+
929
+ a.pp-form-buider-settings-popup-tab-menu.active {
930
+ color: rgb(51, 51, 51);
931
+ border-bottom-color: rgb(51, 51, 51);
932
+ }
933
+
934
+ .pp-form-buider-settings-popup-tab-content {
935
+ -webkit-font-smoothing: antialiased;
936
+ border-top: 1px solid #e6e6e6;
937
+ box-sizing: border-box;
938
+ display: block;
939
+ font-variant-ligatures: none;
940
+ margin-top: -1px;
941
+ outline: 0;
942
+ padding: 30px;
943
+ text-rendering: optimizelegibility;
944
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
945
+ }
946
+
947
+ .pp-form-row {
948
+ flex-direction: row;
949
+ flex-wrap: wrap;
950
+ width: 100%;
951
+ display: flex;
952
+ margin-bottom: 30px;
953
+ }
954
+
955
+ .pp-form-row:last-child {
956
+ margin-bottom: 0;
957
+ }
958
+
959
+ .pp-form-column {
960
+ display: flex;
961
+ flex-direction: column;
962
+ flex-basis: 100%;
963
+ flex: 1;
964
+ padding-left: 15px;
965
+ padding-right: 15px;
966
+ }
967
+
968
+ .pp-form-double-column {
969
+ display: flex;
970
+ flex-direction: column;
971
+ flex-basis: 100%;
972
+ flex: 2
973
+ }
974
+
975
+ .pp-form-control-icon-picker {
976
+ cursor: pointer;
977
+ }
978
+
979
+ label.pp-label {
980
+ -webkit-font-smoothing: antialiased;
981
+ border-width: 0;
982
+ box-sizing: border-box;
983
+ color: #333;
984
+ display: block;
985
+ font-family: Arial, sans-serif;
986
+ font-size: 14px;
987
+ font-stretch: normal;
988
+ font-style: normal;
989
+ font-variant-caps: normal;
990
+ font-variant-east-asian: normal;
991
+ font-variant-ligatures: normal;
992
+ font-variant-numeric: normal;
993
+ font-weight: 500;
994
+ letter-spacing: -.25px;
995
+ line-height: 22px;
996
+ margin: 0 0 5px;
997
+ padding: 0;
998
+ cursor: pointer;
999
+ text-rendering: optimizelegibility;
1000
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
1001
+ vertical-align: middle;
1002
+ }
1003
+
1004
+ .pp-form-control-description {
1005
+ -webkit-font-smoothing: antialiased;
1006
+ box-sizing: border-box;
1007
+ color: #888;
1008
+ display: block;
1009
+ font-size: 13px;
1010
+ font-variant-ligatures: none;
1011
+ font-weight: 400;
1012
+ line-height: 22px;
1013
+ margin-top: 5px;
1014
+ text-rendering: optimizelegibility;
1015
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
1016
+ }
1017
+
1018
+ .pp-form-buider-settings-popup-container .pp-form-buider-settings-popup-body .pp-form-control {
1019
+ -webkit-font-smoothing: antialiased;
1020
+ background-color: #fff;
1021
+ background-image: none;
1022
+ border: 1px solid #ddd;
1023
+ border-radius: 4px;
1024
+ box-shadow: none;
1025
+ box-sizing: border-box;
1026
+ color: #333;
1027
+ display: inline-block;
1028
+ font-family: Arial, sans-serif;
1029
+ font-size: 15px;
1030
+ font-stretch: normal;
1031
+ font-style: normal;
1032
+ font-variant-caps: normal;
1033
+ font-variant-east-asian: normal;
1034
+ font-variant-ligatures: normal;
1035
+ font-variant-numeric: normal;
1036
+ font-weight: 500;
1037
+ height: 40px;
1038
+ letter-spacing: -.25px;
1039
+ line-height: 20px;
1040
+ margin: 0;
1041
+ outline: none;
1042
+ padding: 9px 14px;
1043
+ text-rendering: optimizelegibility;
1044
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
1045
+ transition-delay: 0s;
1046
+ transition-duration: .3s;
1047
+ transition-property: all;
1048
+ transition-timing-function: ease-in-out;
1049
+ }
1050
+
1051
+ .pp-form-buider-settings-popup-container .pp-form-buider-settings-popup-body .pp-form-control[type="checkbox"],
1052
+ .pp-form-buider-settings-popup-container .pp-form-buider-settings-popup-body .pp-form-control[type="radio"] {
1053
+ height: 1rem;
1054
+ }
1055
+
1056
+ .pp-form-buider-settings-popup-container .pp-form-buider-settings-popup-body select.pp-form-control {
1057
+ background-image: url(../images/frontend/arrow-down.png);
1058
+ background-position: right 20px center;
1059
+ background-repeat: no-repeat;
1060
+ background-size: 10px auto;
1061
+ -webkit-appearance: none;
1062
+ -moz-appearance: none;
1063
+ appearance: none;
1064
+ }
1065
+
1066
+ .pp-form-control:not([type=checkbox]) {
1067
+ width: 100% !important;
1068
+ max-width: 100% !important;
1069
+ }
1070
+
1071
+ .pp-form-buider-settings-popup-footer {
1072
+ -webkit-font-smoothing: antialiased;
1073
+ align-items: center;
1074
+ border-top: 1px solid #e6e6e6;
1075
+ box-sizing: border-box;
1076
+ display: flex;
1077
+ font-variant-ligatures: none;
1078
+ outline: 0;
1079
+ padding: 30px;
1080
+ text-rendering: optimizelegibility;
1081
+ text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
1082
+ }
1083
+
1084
+ textarea.pp-form-control {
1085
+ max-width: 100%;
1086
+ min-height: 100px;
1087
+ resize: vertical;
1088
+ line-height: 20px;
1089
+ }
1090
+
1091
+ .pp-form-buider-settings-field-close-btn {
1092
+ color: #aaaaaa;
1093
+ float: right;
1094
+ font-size: 28px;
1095
+ font-weight: bold;
1096
+ }
1097
+
1098
+ .pp-form-buider-settings-field-close-btn:hover,
1099
+ .pp-form-buider-settings-field-close-btn:focus {
1100
+ color: #000;
1101
+ text-decoration: none;
1102
+ cursor: pointer;
1103
+ }
1104
+
1105
+ /*---------------------------------------------------------------------------------------------
1106
+ *
1107
+ * Shortcode form builder
1108
+ *
1109
+ *---------------------------------------------------------------------------------------------*/
1110
+ .ppSCB-tab-box-div .CodeMirror {
1111
+ width: 100% !important;
1112
+ border: 0;
1113
+ height: 617px;
1114
+ }
1115
+
1116
+ .ppSCB-tab-box-div .form-table th {
1117
+ padding: 20px 0 20px 0;
1118
+ }
1119
+
1120
+ .pp_edit_form #titlediv div#titlewrap #title {
1121
+ width: 80% !important;
1122
+ }
1123
+
1124
+ #titlewrap input.ppSCB-save-btn {
1125
+ margin: 0px 10px 5px;
1126
+ vertical-align: top;
1127
+ height: 35px;
1128
+ }
1129
+
1130
+ .ppSCB-margin-r input[type="text"], .ppSCB-margin-r textarea, .ppSCB-margin-r select {
1131
+ max-width: 500px !important;
1132
+ width: 100% !important;
1133
+ }
1134
+
1135
+ .remove_white_styling #post-body-content .form-table textarea.wp-editor-area,
1136
+ #post-body-content .form-table textarea.wp-editor-area,
1137
+ textarea.wp-editor-area {
1138
+ max-width: 100% !important;
1139
+ width: 100% !important;
1140
+ }
1141
+
1142
+ .ppSCB-tab-content {
1143
+ max-width: 840px;
1144
+ }
1145
+
1146
+ #ppSettings.ppSCB-tab-content {
1147
+ padding: 0 15px 15px;
1148
+ }
1149
+
1150
+ #ppSettings .ppSCB-tab-content-header {
1151
+ font-size: 14px;
1152
+ background: #f5f5f5;
1153
+ padding: 8px 5px;
1154
+ color: #333;
1155
+ margin: 1em 0;
1156
+ }
1157
+
1158
+ .ppSCB-margin-r {
1159
+ margin-top: 10px;
1160
+ margin-right: 460px;
1161
+ }
1162
+
1163
+ .ppSCB-clear-both {
1164
+ clear: both;
1165
+ }
1166
+
1167
+
1168
+ /* For tabs */
1169
+ .ppSCB-margin-r h2.nav-tab-wrapper {
1170
+ border-bottom: 0 !important;
1171
+ padding-bottom: 0 !important;
1172
+ padding-left: 0 !important;
1173
+ }
1174
+
1175
+ .ppSCB-margin-r h2 .nav-tab {
1176
+ font-size: 13px;
1177
+ line-height: 25px;
1178
+ font-weight: normal;
1179
+ padding: 4px 10px !important;
1180
+ border-radius: 5px 5px 0 0;
1181
+ -moz-border-radius: 5px 5px 0 0;
1182
+ -webkit-border-radius: 5px 5px 0 0;
1183
+ }
1184
+
1185
+ .ppSCB-margin-r .nav-tab-active, .ppSCB-margin-r .nav-tab-active:hover {
1186
+ background: #fff;
1187
+ font-weight: bold !important;
1188
+ border-bottom: 0;
1189
+ border-top: 2px solid #1a9ac9;
1190
+ color: #0073aa;
1191
+ }
1192
+
1193
+ .ppSCB-tab-box {
1194
+ float: left;
1195
+ width: 100%;
1196
+ }
1197
+
1198
+ .ppSCB-tab-box-div {
1199
+ background: #fff;
1200
+ border: 1px solid #ccc;
1201
+ min-height: 617px;
1202
+ padding: 0;
1203
+ }
1204
+
1205
+ .ppSCB-sidebar {
1206
+ float: right;
1207
+ border: 1px solid #ccc;
1208
+ background: #fff;
1209
+ margin-right: -460px;
1210
+ width: 440px;
1211
+ min-height: 700.6px;
1212
+ }
1213
+
1214
+ .ppSCB-margin-r.passwordReset .ppSCB-sidebar {
1215
+ min-height: 684.4px;
1216
+ }
1217
+
1218
+ .ppSCB-sidebar h2 {
1219
+ font-size: 16px;
1220
+ text-align: center;
1221
+ color: #888;
1222
+ line-height: 24px;
1223
+ }
1224
+
1225
+ .ppSCB-sidebar iframe {
1226
+ width: 100% !important;
1227
+ height: 100% !important;
1228
+ min-height: 649px;
1229
+ }
1230
+
1231
+ .ppSCB-sidebar h3 {
1232
+ border-bottom: 1px solid #eee;
1233
+ margin: 0;
1234
+ padding: 10px;
1235
+ line-height: 1.4;
1236
+ text-align: center;
1237
+ font-size: 18px;
1238
+ }
1239
+
1240
+ .ppSCB-margin-r input.shortcode-in-list-table {
1241
+ float: right;
1242
+ width: 250px !important;
1243
+ background: #fff;
1244
+ border: 3px solid #eee;
1245
+ font-weight: normal;
1246
+ font-size: 15px;
1247
+ padding: 4px 10px;
1248
+ line-height: normal;
1249
+ }
1250
+
1251
+ .ppSCB-preview-h-left,
1252
+ .ppSCB-preview-h-right {
1253
+ text-align: center;
1254
+ display: inline-block;
1255
+ width: 49%;
1256
+ padding: 14px 1.1px;
1257
+ cursor: pointer;
1258
+ }
1259
+
1260
+ .ppSCB-preview-h-right h3,
1261
+ .ppSCB-preview-h-left h3 {
1262
+ display: inline;
1263
+ border: 0;
1264
+ font-size: 14px;
1265
+ }
1266
+
1267
+ .ppSCB-preview-header {
1268
+ border-bottom: 1px solid #eee;
1269
+ }
1270
+
1271
+ .ppSCB-preview-active {
1272
+ background: #eee;
1273
+ color: #fff !important;
1274
+ border: 0;
1275
+ }
1276
+
1277
+ .ppSCB #titlediv div#titlewrap #title {
1278
+ max-width: 80% !important;
1279
+ }
1280
+
1281
+ /* email editor for settings */
1282
+ .pp-email-editor-wrap {
1283
+ margin: 0;
1284
+ padding: 0;
1285
+ }
1286
+
1287
+ .pp-email-editor-tab {
1288
+ border-bottom: 1px solid #ddd;
1289
+ margin: 0;
1290
+ padding: 0;
1291
+ }
1292
+
1293
+ .pp-email-editor-tablinks {
1294
+ padding: 8px 15px;
1295
+ color: #666;
1296
+ background-color: #fff;
1297
+ border: 0;
1298
+ margin: 0;
1299
+ cursor: pointer;
1300
+ }
1301
+
1302
+ .pp-email-editor-tabcontent {
1303
+ border: 1px solid #ddd;
1304
+ border-top: 0;
1305
+ display: none;
1306
+ }
1307
+
1308
+ .pp-email-editor-tablinks.ecode {
1309
+ margin-left: 31px;
1310
+ }
1311
+
1312
+ .pp-email-editor-tablinks.eactive {
1313
+ border: 1px solid #ddd;
1314
+ border-bottom: 0;
1315
+ margin-bottom: -1px;
1316
+ padding-bottom: 9px;
1317
+ }
1318
+
1319
+ .pp-email-editor-tabcontent.epreview {
1320
+ padding: 10px 10px 8px;
1321
+ margin: 0;
1322
+ max-height: 450px;
1323
+ overflow: scroll;
1324
+ }
1325
+
1326
+ .wrap.ppview .pp-settings-wrap .CodeMirror {
1327
+ height: 300px;
1328
+ width: 600px;
1329
+ }
1330
+
1331
+ #social_login_settings .CodeMirror {
1332
+ height: 230px;
1333
+ }
1334
+
1335
+ .wrap.ppview .pp-settings-wrap .pp-email-editor-wrap .pp-email-editor-tabcontent .CodeMirror {
1336
+ height: 400px;
1337
+ width: 600px;
1338
+ border-top: 0;
1339
+ padding: 0 5px;
1340
+ }
1341
+
1342
+ .pp-custom-field-notice {
1343
+ background: #fff;
1344
+ border-left: 4px solid #fff;
1345
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
1346
+ margin: 5px 0 10px;
1347
+ padding: 1px 12px;
1348
+ display: block;
1349
+ border-left-color: #00a0d2;
1350
+ position: relative;
1351
+ clear: left;
1352
+ }
1353
+
1354
+ .pp-custom-field-notice p {
1355
+ margin: .5em 0;
1356
+ padding: 2px 5px;
1357
+ }
1358
+
1359
+ /* Email settings page */
1360
+ .pp-email-notification-status {
1361
+ margin-right: 18px;
1362
+ font-size: 28px;
1363
+ line-height: 22px;
1364
+ color: #a00;
1365
+ float: left;
1366
+ box-sizing: border-box;
1367
+ -moz-box-sizing: border-box;
1368
+ -webkit-box-sizing: border-box;
1369
+ }
1370
+
1371
+ .pp-email-notification-status.pp-is-active {
1372
+ color: #46b450;
1373
+ }
1374
+
1375
+ .pp-email-notifications th.column-title.column-primary {
1376
+ padding-left: 48px;
1377
+ }
1378
+
1379
+ .pp-email-notifications .pp-email-configure span {
1380
+ line-height: 24px;
1381
+ }
1382
+
1383
+ .pp-email-notifications .column-configure {
1384
+ width: 60px;
1385
+ text-align: center;
1386
+ }
1387
+
1388
+ .remove_white_styling #post-body-content .form-table input[type=text],
1389
+ .remove_white_styling #post-body-content .form-table select,
1390
+ .remove_white_styling #post-body-content .form-table textarea {
1391
+ max-width: 630px !important;
1392
+ width: 100% !important;
1393
+ }
1394
+
1395
+ .pp-below-text-field-success {
1396
+ background: #46b450;
1397
+ color: #fff;
1398
+ padding: 2px 5px;
1399
+ width: 100%;
1400
+ box-sizing: border-box;
1401
+ }
1402
+
1403
+ .remove_white_styling #post-body-content textarea {
1404
+ min-height: 200px;
1405
+ }
1406
+
1407
+ .pp-custom-fields.remove_white_styling #post-body-content textarea {
1408
+ min-height: 50px;
1409
+ }
1410
+
1411
+ .pp-below-text-field-error {
1412
+ background: #ca4a1f;
1413
+ color: #fff;
1414
+ padding: 2px 5px;
1415
+ width: 100%;
1416
+ box-sizing: border-box;
1417
+ }
1418
+
1419
+ .pp-placeholder-tags {
1420
+ overflow: scroll;
1421
+ height: 300px;
1422
+ width: 100%;
1423
+ margin: 10px 0;
1424
+ }
1425
+
1426
+ .pp-placeholder-tags tbody tr:first-of-type {
1427
+ background-color: rgb(239, 239, 239);
1428
+ }
1429
+
1430
+ .pp-placeholder-tags tbody tr th {
1431
+ padding: 15px;
1432
+ }
1433
+
1434
+ .pp-settings-page-notice {
1435
+ background: #ddd9;
1436
+ padding: 15px;
1437
+ }
1438
+
1439
+ .pp-hint-tooltip {
1440
+ display: inline;
1441
+ font-weight: normal;
1442
+ }
1443
+
1444
+ #logs textarea.pp-error-log-textarea {
1445
+ width: 100% !important;
1446
+ max-width: 100% !important;
1447
+ min-height: 300px !important;
1448
+ color: rgba(51, 51, 51, 0.78) !important;
1449
+ }
1450
+
1451
+ .pp-custom-fields #post-body-content textarea {
1452
+ width: 100%;
1453
+ min-height: initial;
1454
+ }
1455
+
1456
+ /* content control CSS */
1457
+
1458
+ #ppContentProtectionContent .badge {
1459
+ -webkit-font-smoothing: antialiased;
1460
+ background: #a5b2bd;
1461
+ border-radius: 2px;
1462
+ color: #fff;
1463
+ display: inline-block;
1464
+ font-size: 11px;
1465
+ font-style: normal;
1466
+ font-weight: 700;
1467
+ line-height: 10px;
1468
+ padding: 4px 5px;
1469
+ text-transform: uppercase;
1470
+ vertical-align: text-top;
1471
+ -webkit-transition: background-color .25s ease-in-out;
1472
+ -o-transition: background-color .25s ease-in-out;
1473
+ transition: background-color .25s ease-in-out;
1474
+ }
1475
+
1476
+ #ppContentProtectionContent {
1477
+ margin: 1em 0 2em 0;
1478
+ }
1479
+
1480
+ #ppContentProtectionContent.actions .facet {
1481
+ padding-right: 35px
1482
+ }
1483
+
1484
+ #ppContentProtectionContent .condAction {
1485
+ background: #f9fafa;
1486
+ border: 1px solid #d6dde3;
1487
+ border-radius: 3px
1488
+ }
1489
+
1490
+ #ppContentProtectionContent .facet {
1491
+ zoom: 1;
1492
+ position: relative;
1493
+ padding: 15px 30px 10px 20px
1494
+ }
1495
+
1496
+ #ppContentProtectionContent .facet:after, #ppContentProtectionContent .facet:before {
1497
+ display: table;
1498
+ content: "";
1499
+ line-height: 0
1500
+ }
1501
+
1502
+ #ppContentProtectionContent .facet:after {
1503
+ clear: both
1504
+ }
1505
+
1506
+ #ppContentProtectionContent .col {
1507
+ width: 48%;
1508
+ float: none;
1509
+ box-sizing: border-box;
1510
+ display: inline-block;
1511
+ }
1512
+
1513
+ #ppContentProtectionContent .col select {
1514
+ width: 100% !important;
1515
+ max-width: 100% !important;
1516
+ }
1517
+
1518
+ #ppContentProtectionContent .col input {
1519
+ margin-right: 5px;
1520
+ width: 184px
1521
+ }
1522
+
1523
+ #ppContentProtectionContent .col:last-child {
1524
+ margin-right: 0
1525
+ }
1526
+
1527
+ #ppContentProtectionContent .col a {
1528
+ line-height: 28px
1529
+ }
1530
+
1531
+ #ppContentProtectionContent .col a:hover {
1532
+ text-decoration: none
1533
+ }
1534
+
1535
+ #ppContentProtectionContent .input-append > input {
1536
+ margin-right: 0
1537
+ }
1538
+
1539
+ #ppContentProtectionContent .regex input[type=text] {
1540
+ display: block
1541
+ }
1542
+
1543
+ #ppContentProtectionContent .timeframe input, #ppContentProtectionContent .timeframe select {
1544
+ display: inline-block;
1545
+ float: none
1546
+ }
1547
+
1548
+ #ppContentProtectionContent .timeframe input {
1549
+ width: 40px
1550
+ }
1551
+
1552
+ #ppContentProtectionContent .timeframe select {
1553
+ width: 80px
1554
+ }
1555
+
1556
+ #ppContentProtectionContent .icon-circle-minus {
1557
+ color: #a5b2bd
1558
+ }
1559
+
1560
+ #ppContentProtectionContent .actions {
1561
+ position: absolute;
1562
+ right: 10px;
1563
+ top: 17px;
1564
+ border: 1px solid #a5b2bd;
1565
+ border-radius: 50%;
1566
+ }
1567
+
1568
+ #ppContentProtectionContent .actions a {
1569
+ margin: 0;
1570
+ text-decoration: none;
1571
+ }
1572
+
1573
+ #ppContentProtectionContent .actions a:hover {
1574
+ text-decoration: none
1575
+ }
1576
+
1577
+ #ppContentProtectionContent .actions a:hover .icon-circle-minus {
1578
+ color: #4f5d6b
1579
+ }
1580
+
1581
+ #ppContentProtectionContent .and {
1582
+ border-bottom: 1px dashed #d6dde3;
1583
+ margin: .5em 0 1.7em 0;
1584
+ text-align: center
1585
+ }
1586
+
1587
+ #ppContentProtectionContent .and a, #ppContentProtectionContent .and em, #ppContentProtectionContent .and label {
1588
+ background: #fff;
1589
+ font-size: 1.2em;
1590
+ font-style: normal;
1591
+ margin: 0 10px;
1592
+ padding: 0 10px;
1593
+ position: relative;
1594
+ top: 9px
1595
+ }
1596
+
1597
+ #ppContentProtectionContent .and a {
1598
+ left: -6.5px
1599
+ }
1600
+
1601
+ #ppContentProtectionContent .and em {
1602
+ color: #4f5d6b
1603
+ }
1604
+
1605
+ #ppContentProtectionContent .and label {
1606
+ cursor: pointer;
1607
+ display: inline-block;
1608
+ top: 12px
1609
+ }
1610
+
1611
+ #ppContentProtectionContent .and input {
1612
+ margin: 0
1613
+ }
1614
+
1615
+ #ppContentProtectionContent .or {
1616
+ color: #93a1af;
1617
+ font-weight: 500;
1618
+ margin-left: -21px;
1619
+ left: 50%;
1620
+ position: absolute;
1621
+ top: -6px
1622
+ }
1623
+
1624
+ #ppContentProtectionContent .add-or > .add, #ppContentProtectionContent .or {
1625
+ background: #f9fafa;
1626
+ font-size: 1.2em;
1627
+ padding: 0 10px
1628
+ }
1629
+
1630
+ #ppContentProtectionContent .add-or {
1631
+ text-align: center
1632
+ }
1633
+
1634
+ #ppContentProtectionContent .add-or > .add {
1635
+ left: -6.5px;
1636
+ position: relative;
1637
+ top: -9px
1638
+ }
1639
+
1640
+ #ppContentProtectionContent .facetList > .facet:first-child > .badge {
1641
+ display: none !important;
1642
+ }
1643
+
1644
+ #ppContentProtectionContent #workflowConditions .facetList .facet select {
1645
+ min-height: 32px;
1646
+ }
1647
+
1648
+ #ppContentProtectionContent #workflowConditions .col input.select2-search__field {
1649
+ margin: 0;
1650
+ min-height: 0;
1651
+ }
1652
+
1653
+ #ppContentProtectionContent #workflowConditions .select2 li {
1654
+ margin-bottom: 0;
1655
+ }
1656
+
1657
+ #post-body-content .content_protection .column-title {
1658
+ width: 32%;
1659
+ }
1660
+
1661
+ #post-body-content .content_protection .column-content {
1662
+ width: 43%;
1663
+ }
1664
+
1665
+ #post-body-content .content_protection .access {
1666
+ width: 25%;
1667
+ }
1668
+
1669
+ /* Extension settings page */
1670
+ .ppress-extensions-items-wrap * {
1671
+ box-sizing: border-box;
1672
+ }
1673
+
1674
+ .ppress-extensions-items-wrap .ppress-extensions-header {
1675
+ padding: 20px 0 10px;
1676
+ border-bottom: 2px solid #e8e8eb;
1677
+ margin: 0 0 30px;
1678
+ display: flex;
1679
+ align-items: center;
1680
+ }
1681
+
1682
+ .ppress-extensions-items-wrap .ppress-extensions-header-buttons {
1683
+ flex: 1 0;
1684
+ }
1685
+
1686
+ .ppress-extensions-items-wrap .ppress-extensions-button {
1687
+ height: 35px;
1688
+ font-size: 14px;
1689
+ padding: 0 18px;
1690
+ margin-right: 10px;
1691
+ }
1692
+
1693
+ .ppress-extensions-items-wrap .ppress-extensions-items-row {
1694
+ box-sizing: border-box;
1695
+ display: flex;
1696
+ flex: 0 1 auto;
1697
+ flex-direction: row;
1698
+ flex-wrap: wrap;
1699
+ margin-right: -.5rem;
1700
+ margin-left: -.5rem;
1701
+ }
1702
+
1703
+ .ppress-extensions-items-wrap .ppress-extension-item-wrap {
1704
+ box-sizing: border-box;
1705
+ flex: 0 0 auto;
1706
+ padding: .5rem;
1707
+ }
1708
+
1709
+ .ppress-extensions-items-wrap .ppress-extension-item-wrap {
1710
+ flex-basis: 100%;
1711
+ max-width: 100%;
1712
+ }
1713
+
1714
+ @media only screen and (min-width: 782px) {
1715
+ .ppress-extensions-items-wrap .ppress-extension-item-wrap {
1716
+ flex-basis: 50%;
1717
+ max-width: 50%;
1718
+ }
1719
+ }
1720
+
1721
+ @media only screen and (min-width: 1042px) {
1722
+ .ppress-extensions-items-wrap .ppress-extension-item-wrap {
1723
+ flex-basis: 33.33333333%;
1724
+ max-width: 33.33333333%;
1725
+ }
1726
+ }
1727
+
1728
+ .ppress-extensions-items-wrap .ppress-extension-item-card {
1729
+ height: 100%;
1730
+ border: 1px solid #e8e8eb;
1731
+ background: #fff;
1732
+ box-shadow: 0 2px 5px rgba(0, 0, 0, .05);
1733
+ color: #141b38;
1734
+ display: flex;
1735
+ flex-direction: column;
1736
+ }
1737
+
1738
+ .ppress-extensions-items-wrap .ppress-extension-card-body {
1739
+ padding: 30px 30px 20px;
1740
+ flex: 1;
1741
+ }
1742
+
1743
+ .ppress-extensions-items-wrap .ppress-extension-card-body.ppress-unavailable {
1744
+ opacity: .5;
1745
+ }
1746
+
1747
+ .ppress-extensions-items-wrap .ppress-extension-card-header {
1748
+ display: flex;
1749
+ align-items: center;
1750
+ font-size: 18px;
1751
+ font-weight: 600;
1752
+ margin-bottom: 16px;
1753
+ }
1754
+
1755
+ .ppress-extensions-items-wrap .ppress-extension-card-header svg,
1756
+ .ppress-extensions-items-wrap .ppress-extension-card-header .dashicons {
1757
+ width: 35px;
1758
+ height: 35px;
1759
+ margin-right: 10px;
1760
+ font-size: 35px;
1761
+ }
1762
+
1763
+ .ppress-extensions-items-wrap .ppress-extension-card-description {
1764
+ color: #434960;
1765
+ font-size: 15px;
1766
+ line-height: 22px;
1767
+ }
1768
+
1769
+ .ppress-extensions-items-wrap .ppress-extension-card-learn-more {
1770
+ margin-top: 10px;
1771
+ }
1772
+
1773
+ .ppress-extensions-items-wrap .ppress-extension-card-footer {
1774
+ border: 2px solid #fff;
1775
+ background-color: #f9f9fa;
1776
+ padding: 12px;
1777
+ min-height: 43px;
1778
+ }
1779
+
1780
+ .ppress-extensions-items-wrap .ppress-extension-card-install-activate {
1781
+ display: flex;
1782
+ align-items: center;
1783
+ justify-content: flex-end;
1784
+ height: 30px;
1785
+ position: relative;
1786
+ }
1787
+
1788
+ .ppress-extensions-items-wrap .ppress-extension-card-install-activate .ppress-extension-card-status {
1789
+ font-weight: 600;
1790
+ font-size: 14px;
1791
+ }
1792
+
1793
+ .ppress-extensions-items-wrap .ppress-extension-use-switch {
1794
+ position: relative;
1795
+ cursor: pointer;
1796
+ background-color: #5a5a5a;
1797
+ border-radius: 15px;
1798
+ -webkit-transition: all .2s ease-in-out;
1799
+ -moz-transition: all .2s ease-in-out;
1800
+ -ms-transition: all .2s ease-in-out;
1801
+ transition: all .2s ease-in-out;
1802
+ vertical-align: middle;
1803
+ display: inline-block;
1804
+ margin: -2px 0 0 5px;
1805
+ width: 36px;
1806
+ height: 20px;
1807
+ }
1808
+
1809
+ .ppress-extensions-items-wrap .ppress-extension-card-install-activate input[type=checkbox]:checked + .ppress-extension-use-switch {
1810
+ background-color: #007cba;
1811
+ }
1812
+
1813
+ .ppress-extensions-items-wrap .ppress-extension-card-install-activate input[type=checkbox] {
1814
+ position: absolute;
1815
+ top: auto;
1816
+ overflow: hidden;
1817
+ clip: rect(1px, 1px, 1px, 1px);
1818
+ width: 1px;
1819
+ height: 1px;
1820
+ white-space: nowrap;
1821
+ }
1822
+
1823
+ .ppress-extensions-items-wrap .ppress-extension-card-install-activate input[type=checkbox]:checked + .ppress-extension-use-switch:before {
1824
+ -webkit-transform: translateX(16px);
1825
+ -ms-transform: translateX(16px);
1826
+ transform: translateX(16px);
1827
+ }
1828
+
1829
+ .ppress-extensions-items-wrap .ppress-extension-use-switch:before {
1830
+ position: absolute;
1831
+ content: "";
1832
+ height: 16px;
1833
+ width: 16px;
1834
+ left: 2px;
1835
+ top: 2px;
1836
+ background-color: #fff;
1837
+ border-radius: 50%;
1838
+ -webkit-transition: all .2s ease-in-out;
1839
+ -moz-transition: all .2s ease-in-out;
1840
+ -ms-transition: all .2s ease-in-out;
1841
+ transition: all .2s ease-in-out;
1842
+ }
1843
+
1844
+ .ppress-extensions-items-wrap .ppress-extension-card-learn-more .no-underline {
1845
+ text-decoration: none;
1846
+ }
1847
+
1848
+ .ppress-extensions-items-wrap .ppress-extensions-upgrade-cta {
1849
+ display: flex;
1850
+ align-items: center;
1851
+ justify-content: flex-end;
1852
+ }
1853
+
1854
+ .ppress-extensions-items-wrap .ppress-extension-status {
1855
+ font-weight: 700;
1856
+ color: #393f4c;
1857
+ }
1858
+
1859
+ .ppress-extensions-items-wrap .ppress-extension-status span {
1860
+ color: #777;
1861
+ font-weight: 600;
1862
+ }
1863
+
1864
+ .ppress-extensions-upsell-wrap {
1865
+ margin-top: 10px;
1866
+ padding: 20px;
1867
+ background: #fff;
1868
+ border-left: 3px solid #007cba;
1869
+ line-height: 1.5;
1870
+ font-size: 14px;
1871
+ }
1872
+
1873
+ .ppress-extensions-upsell-wrap .notice-content {
1874
+ display: -webkit-box;
1875
+ display: -ms-flexbox;
1876
+ display: flex;
1877
+ }
1878
+
1879
+ .ppress-extensions-upsell-wrap .ppress-extensions-upsell-button {
1880
+ flex-shrink: 0;
1881
+ -webkit-box-flex: 0;
1882
+ -ms-flex-positive: 0;
1883
+ flex-grow: 0;
1884
+ margin-left: auto;
1885
+ }
1886
+
1887
+ .ppress-extensions-upsell-wrap .ppress-extensions-upsell-button {
1888
+ border-width: 1px 1px 2px;
1889
+ border-radius: 3px;
1890
+ cursor: pointer;
1891
+ display: inline-block;
1892
+ font-size: 14px;
1893
+ text-decoration: none;
1894
+ margin-top: 0;
1895
+ line-height: 1;
1896
+ }
1897
+
1898
+ .ppress-extensions-upsell-wrap .ppress-extensions-upsell-button a {
1899
+ padding: 5px 15px;
1900
+ }
1901
+
1902
+ .ppress-extensions-upsell-wrap .ppress-extensions-upsell-highlight {
1903
+ font-weight: bold;
1904
+ color: #007cba;
1905
+ }
assets/css/form-builder.css ADDED
@@ -0,0 +1,1042 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'Material Icons';
3
+ font-style: normal;
4
+ font-weight: 400;
5
+ src: url(./material-icons/MaterialIcons-Regular.eot); /* For IE6-8 */
6
+ src: local('Material Icons'),
7
+ local('MaterialIcons-Regular'),
8
+ url(./material-icons/MaterialIcons-Regular.woff2) format('woff2'),
9
+ url(./material-icons/MaterialIcons-Regular.woff) format('woff'),
10
+ url(./material-icons/MaterialIcons-Regular.ttf) format('truetype');
11
+ }
12
+
13
+ /* from woo */
14
+ .pp-form-builder-help-tip {
15
+ color: #666;
16
+ display: inline-block;
17
+ font-size: 1.1em;
18
+ font-style: normal;
19
+ height: 16px;
20
+ line-height: 16px;
21
+ position: relative;
22
+ vertical-align: middle;
23
+ width: 16px
24
+ }
25
+
26
+ .pp-form-builder-help-tip::after {
27
+ font-family: Dashicons;
28
+ speak: none;
29
+ font-weight: 400;
30
+ font-variant: normal;
31
+ text-transform: none;
32
+ line-height: 1;
33
+ -webkit-font-smoothing: antialiased;
34
+ margin: 0;
35
+ text-indent: 0;
36
+ position: absolute;
37
+ top: 0;
38
+ left: 0;
39
+ width: 100%;
40
+ height: 100%;
41
+ text-align: center;
42
+ content: "";
43
+ cursor: help
44
+ }
45
+
46
+ h2 .pp-form-builder-help-tip {
47
+ margin-top: -5px;
48
+ margin-left: .25em
49
+ }
50
+
51
+ .postbox .pp-form-builder-help-tip {
52
+ margin: 0 0 0 9px
53
+ }
54
+
55
+ #pp-form-builder-metabox .hndle {
56
+ padding: 10px;
57
+ cursor: default;
58
+ }
59
+
60
+ #pp-form-builder-metabox .hndle span {
61
+ display: block;
62
+ vertical-align: middle;
63
+ line-height: 24px
64
+ }
65
+
66
+ #pp-form-builder-metabox .hndle span span {
67
+ display: inline;
68
+ line-height: inherit;
69
+ vertical-align: baseline
70
+ }
71
+
72
+ #pp-form-builder-metabox .hndle select {
73
+ margin: 0
74
+ }
75
+
76
+ #pp-form-builder-metabox .hndle label {
77
+ padding-right: 1em;
78
+ font-size: 12px;
79
+ vertical-align: baseline
80
+ }
81
+
82
+ #pp-form-builder-metabox .hndle label:first-child {
83
+ margin-right: 1em;
84
+ border-right: 1px solid #dfdfdf
85
+ }
86
+
87
+ #pp-form-builder-metabox .hndle input, #pp-form-builder-metabox .hndle select {
88
+ margin-top: 0;
89
+ vertical-align: middle
90
+ }
91
+
92
+ #pp-form-builder-metabox .hndle select {
93
+ margin-left: .5em
94
+ }
95
+
96
+ #pp-form-builder-metabox > .handlediv {
97
+ margin-top: 4px
98
+ }
99
+
100
+ #pp-form-builder-metabox .wrap {
101
+ margin: 0
102
+ }
103
+
104
+ #pp-form-builder-coupon-description::-webkit-input-placeholder {
105
+ line-height: 1.42em;
106
+ color: #bbb
107
+ }
108
+
109
+ #pp-form-builder-coupon-description::-moz-placeholder {
110
+ line-height: 1.42em;
111
+ color: #bbb
112
+ }
113
+
114
+ #pp-form-builder-coupon-description:-ms-input-placeholder {
115
+ line-height: 1.42em;
116
+ color: #bbb
117
+ }
118
+
119
+ #pp-form-builder-coupon-description:-moz-placeholder {
120
+ line-height: 1.42em;
121
+ color: #bbb
122
+ }
123
+
124
+ #pp-form-builder-metabox .panel-wrap {
125
+ background: #fff
126
+ }
127
+
128
+ #pp-form-builder-metabox .pp-form-builder_options_panel {
129
+ float: left;
130
+ width: 75%
131
+ }
132
+
133
+ #pp-form-builder-metabox .pp-form-builder_options_panel .pp-radios {
134
+ display: block;
135
+ float: left;
136
+ margin: 0
137
+ }
138
+
139
+ #pp-form-builder-metabox .pp-form-builder_options_panel .pp-radios li {
140
+ display: block;
141
+ padding: 0 0 10px
142
+ }
143
+
144
+ #pp-form-builder-metabox .pp-form-builder_options_panel .pp-radios li input {
145
+ width: auto
146
+ }
147
+
148
+ #pp-form-builder-metabox .panel-wrap, .pp-form-builder .panel-wrap {
149
+ overflow: hidden
150
+ }
151
+
152
+ #pp-form-builder-metabox ul.pp-tabs {
153
+ margin: 0;
154
+ width: 25%;
155
+ float: left;
156
+ line-height: 1em;
157
+ padding: 0 0 10px;
158
+ position: relative;
159
+ background-color: #fafafa;
160
+ border-right: 1px solid #eee;
161
+ box-sizing: border-box
162
+ }
163
+
164
+ #pp-form-builder-metabox ul.pp-tabs::after, .pp-form-builder ul.pp-tabs::after {
165
+ content: '';
166
+ display: block;
167
+ width: 100%;
168
+ height: 9999em;
169
+ position: absolute;
170
+ bottom: -9999em;
171
+ left: 0;
172
+ background-color: #fafafa;
173
+ border-right: 1px solid #eee
174
+ }
175
+
176
+ #pp-form-builder-metabox ul.pp-tabs li, .pp-form-builder ul.pp-tabs li {
177
+ margin: 0;
178
+ padding: 0;
179
+ display: block;
180
+ position: relative
181
+ }
182
+
183
+ #pp-form-builder-metabox ul.pp-tabs li a, .pp-form-builder ul.pp-tabs li a {
184
+ margin: 0;
185
+ padding: 10px;
186
+ display: block;
187
+ box-shadow: none;
188
+ text-decoration: none;
189
+ line-height: 20px !important;
190
+ border-bottom: 1px solid #eee
191
+ }
192
+
193
+ #pp-form-builder-metabox ul.pp-tabs li a span, .pp-form-builder ul.pp-tabs li a span {
194
+ margin-left: .618em;
195
+ margin-right: .618em
196
+ }
197
+
198
+ #pp-form-builder-metabox ul.pp-tabs li a::before, .pp-form-builder ul.pp-tabs li a::before {
199
+ font-family: Dashicons;
200
+ speak: none;
201
+ font-weight: 400;
202
+ font-variant: normal;
203
+ text-transform: none;
204
+ line-height: 1;
205
+ -webkit-font-smoothing: antialiased;
206
+ content: "";
207
+ text-decoration: none
208
+ }
209
+
210
+ #pp-form-builder-metabox ul.pp-tabs li.active a, .pp-form-builder ul.pp-tabs li.active a {
211
+ color: #555;
212
+ position: relative;
213
+ background-color: #eee
214
+ }
215
+
216
+ #pp-form-builder-metabox .inside {
217
+ margin: 0;
218
+ padding: 0;
219
+ }
220
+
221
+ .panel, .pp-form-builder_options_panel {
222
+ padding: 9px;
223
+ color: #555
224
+ }
225
+
226
+ .panel .form-field .pp-form-builder-help-tip, .pp-form-builder_options_panel .form-field .pp-form-builder-help-tip {
227
+ font-size: 1.4em
228
+ }
229
+
230
+ .pp-form-builder_options_panel fieldset.form-field, .pp-form-builder_options_panel .form-field {
231
+ margin: 0 0 9px;
232
+ font-size: 12px;
233
+ padding: 5px 9px;
234
+ line-height: 24px
235
+ }
236
+
237
+ .pp-form-builder_options_panel fieldset.form-field::after, .pp-form-builder_options_panel .form-field::after {
238
+ content: '.';
239
+ display: block;
240
+ height: 0;
241
+ clear: both;
242
+ visibility: hidden
243
+ }
244
+
245
+ .pp-form-builder_options_panel .checkbox {
246
+ margin: 4px 0 !important;
247
+ vertical-align: middle;
248
+ float: left
249
+ }
250
+
251
+ .pp-form-builder_options_panel .downloadable_files table td, .pp-form-builder_variations .downloadable_files table td {
252
+ vertical-align: middle !important;
253
+ padding: 4px 0 4px 7px !important;
254
+ position: relative
255
+ }
256
+
257
+ .pp-form-builder_options_panel .downloadable_files table td:last-child, .pp-form-builder_variations .downloadable_files table td:last-child {
258
+ padding-right: 7px !important
259
+ }
260
+
261
+ .pp-form-builder_options_panel .downloadable_files table td input.input_text, .pp-form-builder_variations .downloadable_files table td input.input_text {
262
+ width: 100%;
263
+ float: none;
264
+ min-width: 0;
265
+ margin: 1px 0
266
+ }
267
+
268
+ .pp-form-builder_options_panel .downloadable_files table td .upload_file_button, .pp-form-builder_variations .downloadable_files table td .upload_file_button {
269
+ width: auto;
270
+ float: right;
271
+ cursor: pointer
272
+ }
273
+
274
+ .pp-form-builder_options_panel .downloadable_files table td .delete, .pp-form-builder_variations .downloadable_files table td .delete {
275
+ display: block;
276
+ text-indent: -9999px;
277
+ position: relative;
278
+ height: 1em;
279
+ width: 1em;
280
+ font-size: 1.2em
281
+ }
282
+
283
+ .pp-form-builder_options_panel {
284
+ min-height: 175px;
285
+ box-sizing: border-box
286
+ }
287
+
288
+ .pp-form-builder_options_panel .form-field {
289
+ margin: 9px 0
290
+ }
291
+
292
+ .pp-form-builder_options_panel fieldset.form-field, .pp-form-builder_options_panel .form-field {
293
+ padding: 5px 20px 5px 162px !important;
294
+ }
295
+
296
+ .pp-form-builder_options_panel .sale_price_dates_fields .short:first-of-type {
297
+ margin-bottom: 1em
298
+ }
299
+
300
+ .pp-form-builder_options_panel .sale_price_dates_fields .short:nth-of-type(2) {
301
+ clear: left
302
+ }
303
+
304
+ .pp-form-builder_options_panel label {
305
+ float: left;
306
+ width: 160px;
307
+ padding: 0;
308
+ margin: 0 0 0 -150px;
309
+ font-size: 13px;
310
+ }
311
+
312
+ /* color picker shim */
313
+ .pp-form-builder_options_panel .wp-picker-input-wrap label {
314
+ margin-left: 0;
315
+ width: auto;
316
+ }
317
+
318
+ .pp-form-builder_options_panel label .req {
319
+ font-weight: 700;
320
+ font-style: normal;
321
+ color: #a00
322
+ }
323
+
324
+ .pp-form-builder_options_panel .description {
325
+ padding: 0;
326
+ margin: 0 0 0 7px;
327
+ clear: none;
328
+ display: inline
329
+ }
330
+
331
+ .pp-form-builder_options_panel .description-block {
332
+ margin-left: 0;
333
+ display: block
334
+ }
335
+
336
+ .pp-form-builder_options_panel input, .pp-form-builder_options_panel select, .pp-form-builder_options_panel textarea {
337
+ margin: 0
338
+ }
339
+
340
+ .pp-form-builder_options_panel textarea {
341
+ float: left;
342
+ height: 3.5em;
343
+ line-height: 1.5em;
344
+ vertical-align: top
345
+ }
346
+
347
+ .pp-form-builder_options_panel .pp-field-row-content {
348
+ width: 75%;
349
+ float: left
350
+ }
351
+
352
+ .pp-form-builder_options_panel input.button {
353
+ width: auto;
354
+ margin-left: 8px
355
+ }
356
+
357
+ .pp-form-builder_options_panel select {
358
+ float: left
359
+ }
360
+
361
+ .pp-form-builder_options_panel .short {
362
+ width: 95%
363
+ }
364
+
365
+ .pp-form-builder_options_panel .sized {
366
+ width: auto !important;
367
+ margin-right: 6px
368
+ }
369
+
370
+ .pp-form-builder_options_panel .options_group {
371
+ border-top: 1px solid #fff;
372
+ border-bottom: 1px solid #eee
373
+ }
374
+
375
+ .pp-form-builder_options_panel .options_group:first-child {
376
+ border-top: 0
377
+ }
378
+
379
+ .pp-form-builder_options_panel .options_group:last-child {
380
+ border-bottom: 0
381
+ }
382
+
383
+ .pp-form-builder_options_panel .options_group fieldset {
384
+ margin: 9px 0;
385
+ font-size: 12px;
386
+ padding: 5px 9px;
387
+ line-height: 24px
388
+ }
389
+
390
+ .pp-form-builder_options_panel .options_group fieldset label {
391
+ width: auto;
392
+ float: none
393
+ }
394
+
395
+ .pp-form-builder_options_panel .options_group fieldset ul {
396
+ float: left;
397
+ width: 50%;
398
+ margin: 0;
399
+ padding: 0
400
+ }
401
+
402
+ .pp-form-builder_options_panel .options_group fieldset ul li {
403
+ margin: 0;
404
+ width: auto
405
+ }
406
+
407
+ .pp-form-builder_options_panel .options_group fieldset ul li input {
408
+ width: auto;
409
+ float: none;
410
+ margin-right: 4px
411
+ }
412
+
413
+ .pp-form-builder_options_panel .options_group fieldset ul.pp-radios label {
414
+ margin-left: 0
415
+ }
416
+
417
+ .pp-form-builder_options_panel .dimensions_field .wrap {
418
+ display: block;
419
+ width: 50%
420
+ }
421
+
422
+ .pp-form-builder_options_panel .dimensions_field .wrap input {
423
+ width: 30.75%;
424
+ margin-right: 3.8%
425
+ }
426
+
427
+ .pp-form-builder_options_panel .dimensions_field .wrap .last {
428
+ margin-right: 0
429
+ }
430
+
431
+ .pp-form-builder_options_panel.padded {
432
+ padding: 1em
433
+ }
434
+
435
+ .pp-form-builder_options_panel .select2-container {
436
+ float: left
437
+ }
438
+
439
+ #pp-form-builder-metabox input.dp-applied {
440
+ float: left
441
+ }
442
+
443
+ .pp-builder-form-content {
444
+ border: 0;
445
+ }
446
+
447
+ .pp-builder-form-canvas-footer, .pp-builder-form-canvas-header + .pp-builder-form-content {
448
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
449
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
450
+ border-width: 0;
451
+ }
452
+
453
+ ol.pp-form-builder-field-type {
454
+ display: block;
455
+ visibility: visible !important;
456
+ overflow: hidden;
457
+ margin: 0;
458
+ padding: 0;
459
+ }
460
+
461
+ li {
462
+ list-style: none !important;
463
+ }
464
+
465
+ ol.pp-form-builder-field-type li {
466
+ float: left;
467
+ width: 50%;
468
+ padding-right: 5px;
469
+ list-style: none;
470
+ margin-bottom: 10px;
471
+ -webkit-box-sizing: border-box;
472
+ -moz-box-sizing: border-box;
473
+ box-sizing: border-box;
474
+ }
475
+
476
+ ol.pp-form-builder-field-type li .button {
477
+ border-color: #DFDFDF;
478
+ min-width: 120px;
479
+ font-size: 12px;
480
+ width: 100%;
481
+ padding-right: 5px;
482
+ text-align: center;
483
+ }
484
+
485
+ .pp-form-builder-body {
486
+ margin-top: 15px;
487
+ margin-bottom: 15px;
488
+ border-style: dashed;
489
+ border-width: 2px;
490
+ border-color: #CECED2;
491
+ padding: 20px;
492
+ }
493
+
494
+ .pp-builder-element-content-tabs .pp-builder-element-content-tab.btn-active {
495
+ font-weight: 600;
496
+ border-bottom-color: #00a0d2;
497
+ }
498
+
499
+ html #poststuff.pp_edit_form #post-body.columns-2 #side-sortables {
500
+ width: 380px;
501
+ }
502
+
503
+ html #poststuff.pp_edit_form #post-body.columns-2 {
504
+ margin-right: 400px;
505
+ }
506
+
507
+ html .pp-form-builder-sidebar-wrap .postbox .inside {
508
+ padding-right: 7px;
509
+ }
510
+
511
+ html .pp_edit_form #post-body.columns-2 #postbox-container-1 {
512
+ margin-right: -400px;
513
+ width: 380px;
514
+ position: relative;
515
+ }
516
+
517
+ .pp-dnd-form-builder-wrap {
518
+ opacity: 0;
519
+ }
520
+
521
+ .pp-builder-element-header a.pp-builder-element-expand-button,
522
+ .pp-builder-element-header a.pp-builder-element-expand-button:hover {
523
+ text-decoration: none;
524
+ color: #0073aa;
525
+ }
526
+
527
+ .pp-builder-element-header .pp-builder-element-expand-button {
528
+ display: block;
529
+ float: right
530
+ }
531
+
532
+ .pp-builder-element-header .pp-builder-element-expand-button {
533
+ margin: 0 2px;
534
+ }
535
+
536
+ .pp-builder-element-header .pp-builder-element-expand-button .dashicons {
537
+ margin-top: 5px;
538
+ }
539
+
540
+ .pp-builder-element-header .pp-builder-element-expand-button.expand-btn-hide {
541
+ visibility: hidden;
542
+ }
543
+
544
+ .pp-builder-element:hover .pp-builder-element-expand-button.expand-btn-hide {
545
+ visibility: visible;
546
+ }
547
+
548
+ @media only screen and (max-width: 850px) {
549
+ html #wpbody-content #post-body.columns-2 #postbox-container-1 {
550
+ margin-right: 0;
551
+ width: 100%;
552
+ }
553
+ }
554
+
555
+ .pp-builder-element {
556
+ margin: auto;
557
+ margin-bottom: 1em;
558
+ background-color: #fff;
559
+ border: 1px solid #e5e5e5;
560
+ width: 100%;
561
+ }
562
+
563
+ .pp-form-header-footer {
564
+ border-color: #ccc;
565
+ background: #f7f7f7;
566
+ box-shadow: 0 1px 0 #ccc;
567
+ }
568
+
569
+ .pp-builder-element-header-title {
570
+ display: block;
571
+ float: left;
572
+ margin: 0 5px;
573
+ overflow: hidden;
574
+ font-weight: 500;
575
+ line-height: 32px;
576
+ text-overflow: ellipsis;
577
+ white-space: nowrap;
578
+ -webkit-user-select: none;
579
+ -moz-user-select: none;
580
+ -ms-user-select: none;
581
+ user-select: none;
582
+ }
583
+
584
+ .pp-builder-element-content-footer, .pp-builder-element-header {
585
+ padding: 6px 12px;
586
+ }
587
+
588
+ .pp-builder-element-header {
589
+ overflow: hidden;
590
+ clear: both;
591
+ font-size: 13px
592
+ }
593
+
594
+ .pp-form-builder-field-settings-wrap {
595
+ position: absolute;
596
+ top: 0;
597
+ right: 0;
598
+ bottom: 0;
599
+ max-width: 350px;
600
+ width: 100%;
601
+ z-index: 2;
602
+ background: #fff;
603
+ display: none;
604
+ }
605
+
606
+ /* tab */
607
+
608
+ .pp-builder-sidebar-header {
609
+ background-color: #0085ba;
610
+ -webkit-box-sizing: border-box;
611
+ box-sizing: border-box;
612
+ padding: 12px;
613
+ }
614
+
615
+ #poststuff .pp-builder-sidebar-header h2 {
616
+ color: #FFFFFF;
617
+ font-size: 14px;
618
+ font-weight: normal;
619
+ line-height: 1;
620
+ margin: 0 22px 0 0;
621
+ padding: 0;
622
+ }
623
+
624
+ .pp-builder-sidebar-tabs {
625
+ background-color: #FFFFFF;
626
+ border: none;
627
+ border-bottom: 1px solid #CECED2;
628
+ border-radius: 0;
629
+ display: -webkit-box;
630
+ display: -ms-flexbox;
631
+ display: flex;
632
+ -webkit-box-orient: horizontal;
633
+ -webkit-box-direction: normal;
634
+ -ms-flex-direction: row;
635
+ flex-direction: row;
636
+ -ms-flex-wrap: nowrap;
637
+ flex-wrap: nowrap;
638
+ margin: 0;
639
+ padding: 0;
640
+ /*position: absolute;*/
641
+ right: 0;
642
+ /*top: 44px;*/
643
+ width: 100%;
644
+ z-index: 1;
645
+ line-height: 1.4em;
646
+ }
647
+
648
+ .pp-builder-sidebar-tabs > li {
649
+ background: none !important;
650
+ border: none;
651
+ border-radius: 0;
652
+ -webkit-box-flex: 1;
653
+ -ms-flex: 1 0 0px;
654
+ flex: 1 0 0px;
655
+ margin: 0;
656
+ padding: 0;
657
+ outline: none;
658
+ position: relative;
659
+ }
660
+
661
+ .pp-builder-sidebar-tabs > li > a {
662
+ border-bottom: 2px solid transparent;
663
+ -webkit-box-shadow: none;
664
+ box-shadow: none;
665
+ color: #444;
666
+ cursor: pointer;
667
+ display: block;
668
+ float: none;
669
+ font-size: 12px;
670
+ font-weight: bold;
671
+ opacity: .5;
672
+ overflow: hidden;
673
+ padding: 11px 10px;
674
+ text-align: center;
675
+ text-decoration: none;
676
+ text-overflow: ellipsis;
677
+ text-transform: uppercase;
678
+ -webkit-transition: border-color 200ms ease-in-out, color 200ms ease-in-out, opacity 200ms ease-in-out;
679
+ transition: border-color 200ms ease-in-out, color 200ms ease-in-out, opacity 200ms ease-in-out;
680
+ white-space: nowrap;
681
+ }
682
+
683
+ .pp-builder-sidebar-tabs > li:hover > a {
684
+ border-bottom-color: #000000;
685
+ }
686
+
687
+ .pp-builder-sidebar-tabs > li.pp-builder-sidebar-tab-active > a {
688
+ border-bottom-color: #0085ba;
689
+ color: #0085ba;
690
+ cursor: default;
691
+ opacity: 1;
692
+ }
693
+
694
+ label.pp-builder-label {
695
+ display: inline-block;
696
+ font-size: 14px;
697
+ color: #23282d;
698
+ line-height: 1.3;
699
+ font-weight: 400;
700
+ }
701
+
702
+ .pp-builder-inside input[type="checkbox"] {
703
+ border: 1px solid #b4b9be;
704
+ background: #fff;
705
+ color: #555;
706
+ display: inline-block;
707
+ line-height: 0;
708
+ height: 16px;
709
+ margin: 2px 4px 0 0;
710
+ outline: 0;
711
+ padding: 0 !important;
712
+ text-align: center;
713
+ vertical-align: middle;
714
+ width: 16px;
715
+ min-width: 16px;
716
+ -webkit-appearance: none;
717
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
718
+ transition: .05s border-color ease-in-out;
719
+ }
720
+
721
+ .pp-builder-inside {
722
+ padding: 10px;
723
+ line-height: 1;
724
+ background: #fff;
725
+ }
726
+
727
+ .pp-builder-sidebar-field {
728
+ margin-bottom: 10px;
729
+ }
730
+
731
+ .pp-builder-footer {
732
+ background: #fff;
733
+ padding-bottom: 10px;
734
+ }
735
+
736
+ .pp-form-builder-field-settings-wrap .pp-builder-sidebar-field input:not([type=checkbox]),
737
+ .pp-form-builder-field-settings-wrap .pp-builder-sidebar-field select,
738
+ .pp-form-builder-field-settings-wrap .pp-builder-sidebar-field textarea {
739
+ width: 100%;
740
+ }
741
+
742
+ .pp-builder-element-icon {
743
+ display: block;
744
+ float: left;
745
+ width: 24px;
746
+ height: 24px;
747
+ margin: 4px;
748
+ color: #23282d;
749
+ }
750
+
751
+ /* toolbar */
752
+ #pp_form_toolbar {
753
+ display: inline-block;
754
+ -webkit-box-sizing: border-box;
755
+ -moz-box-sizing: border-box;
756
+ box-sizing: border-box;
757
+ margin: 12px 0 0;
758
+ padding: 4px 10px 0;
759
+ width: 100%;
760
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
761
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
762
+ border: 1px solid #e5e5e5;
763
+ background: #fff;
764
+ color: #555;
765
+ font-size: 13px
766
+ }
767
+
768
+ #pp_form_toolbar a {
769
+ text-decoration: none
770
+ }
771
+
772
+ .pp_form_toolbar_preview a:focus {
773
+ border: 0;
774
+ box-shadow: none;
775
+ }
776
+
777
+ #pp_form_toolbar .pp_form_toolbar_right {
778
+ float: right;
779
+ }
780
+
781
+ ul#pp_form_toolbar_links {
782
+ position: relative;
783
+ display: inline-block;
784
+ margin: 0
785
+ }
786
+
787
+ ul#pp_form_toolbar_links li {
788
+ margin: 0;
789
+ padding: 0;
790
+ width: auto;
791
+ display: -moz-inline-stack;
792
+ display: inline-block
793
+ }
794
+
795
+ ul#pp_form_toolbar_links li.pp_form_toolbar_editor a,
796
+ ul#pp_form_toolbar_links li.pp_form_toolbar_entries a,
797
+ ul#pp_form_toolbar_links li.pp_form_toolbar_preview a {
798
+ text-decoration: none;
799
+ text-shadow: 0 1px 1px #FFF;
800
+ line-height: 16px;
801
+ white-space: nowrap
802
+ }
803
+
804
+ ul#pp_form_toolbar_links li a {
805
+ display: -moz-inline-stack;
806
+ display: inline-block;
807
+ margin: 0 10px;
808
+ padding: 15px 0;
809
+ font-size: 13px;
810
+ color: #23282d
811
+ }
812
+
813
+ ul#pp_form_toolbar_links li a.pp_form_toolbar_active:hover, ul#pp_form_toolbar_links li a:hover {
814
+ color: #0074A2;
815
+ }
816
+
817
+ ul#pp_form_toolbar_links li a span.dashicons {
818
+ font-size: 1.33333333em;
819
+ }
820
+
821
+ ul#pp_form_toolbar_links > li > a.pp_form_toolbar_active {
822
+ border-bottom: 4px solid #666;
823
+ box-shadow: none;
824
+ color: #23282d;
825
+ }
826
+
827
+ ul#pp_form_toolbar_links li a:hover i {
828
+ color: #0074A2
829
+ }
830
+
831
+ ul#pp_form_toolbar_links li a.pp_form_toolbar_active {
832
+ font-weight: 700
833
+ }
834
+
835
+ ul#pp_form_toolbar_links li a.pp_form_toolbar_disabled {
836
+ color: #333;
837
+ filter: alpha(opacity=50);
838
+ -moz-opacity: .5;
839
+ -khtml-opacity: .5;
840
+ opacity: .5;
841
+ -ms-filter: "alpha(opacity=50)";
842
+ cursor: default
843
+ }
844
+
845
+ ul#pp_form_toolbar_links li.pp_form_toolbar_settings a {
846
+ background-position: 0 0
847
+ }
848
+
849
+ ul#pp_form_toolbar_links li.pp_form_toolbar_settings a.pp_form_toolbar_active,
850
+ ul#pp_form_toolbar_links li.pp_form_toolbar_settings a:hover {
851
+ background-position: 0 -120px
852
+ }
853
+
854
+ ul#pp_form_toolbar_links li.pp_form_toolbar_settings a.pp_form_toolbar_disabled:hover {
855
+ background-position: 0 0
856
+ }
857
+
858
+ ul#pp_form_toolbar_links li.pp_form_toolbar_editor a {
859
+ background-position: 0 -20px
860
+ }
861
+
862
+ ul#pp_form_toolbar_links li.pp_form_toolbar_editor a.pp_form_toolbar_active,
863
+ ul#pp_form_toolbar_links li.pp_form_toolbar_editor a:hover {
864
+ background-position: 0 -140px
865
+ }
866
+
867
+ .pp-builder-form-content {
868
+ min-height: 100px;
869
+ }
870
+
871
+ .pp-builder-form-content .pp-builder-element:not(.pp-form-header-footer) {
872
+ cursor: move;
873
+ }
874
+
875
+ .pp-builder-form-content .pp-form-builder-drag-bg {
876
+ background-color: #fff;
877
+ padding: 30px;
878
+ margin: 10px;
879
+ width: 100%;
880
+ box-sizing: border-box;
881
+ border: 2px dashed #ddd;
882
+ }
883
+
884
+ .pp-form-builder-sortable-containment {
885
+ padding: 10px 20px;
886
+ }
887
+
888
+ .pp_upload_field_container {
889
+ position: relative;
890
+ }
891
+
892
+ .pp_upload_field {
893
+ padding-right: 6em;
894
+ }
895
+
896
+ .pp_upload_file {
897
+ display: block;
898
+ padding: 0px 10px 0px;
899
+ position: absolute;
900
+ top: 1px;
901
+ right: 10px;
902
+ margin-right: 8px;
903
+ background: #fff;
904
+ }
905
+
906
+ a.pp_upload_button {
907
+ text-decoration: none;
908
+ }
909
+
910
+ .pp-icon-picker-jbox-wrap .pp-form-material-icons,
911
+ .pp-form-control-icon-picker .pp-form-material-icons {
912
+ font-family: 'Material Icons';
913
+ font-weight: normal;
914
+ font-style: normal;
915
+ font-size: 24px; /* Preferred icon size */
916
+ display: inline-block;
917
+ line-height: 1;
918
+ text-transform: none;
919
+ letter-spacing: normal;
920
+ word-wrap: normal;
921
+ white-space: nowrap;
922
+ direction: ltr;
923
+ /* Support for all WebKit browsers. */
924
+ -webkit-font-smoothing: antialiased;
925
+ /* Support for Safari and Chrome. */
926
+ text-rendering: optimizeLegibility;
927
+ /* Support for Firefox. */
928
+ -moz-osx-font-smoothing: grayscale;
929
+ /* Support for IE. */
930
+ font-feature-settings: 'liga';
931
+
932
+
933
+ vertical-align: middle;
934
+ }
935
+
936
+ .pp-icon-picker-jbox-wrap .pp-form-material-icon-wrap {
937
+ padding: 8px;
938
+ display: inline-block;
939
+ border: 1px solid #eee;
940
+ margin: 2px;
941
+ cursor: pointer;
942
+ }
943
+
944
+ .pp-icon-picker-jbox-wrap .pp-form-material-icon-wrap.pp-active {
945
+ border: 2px solid #6495ed;
946
+ color: #6495ed;
947
+ }
948
+
949
+ .jBox-Modal.pp-icon-picker-jbox-wrap .jBox-title {
950
+ padding: 1px 20px;
951
+ }
952
+
953
+ .ppmb-tab-radios input[type=radio] {
954
+ display: none;
955
+ }
956
+
957
+ .ppmb-tab-radios label {
958
+ display: inline-block;
959
+ float: none;
960
+ padding: 2px 10px;
961
+ cursor: pointer;
962
+ width: auto;
963
+ margin: 0;
964
+ border: 1px solid #DFDFDF;
965
+ margin-right: 2px;
966
+ }
967
+
968
+ .ppmb-tab-radios input:checked + label {
969
+ background: #007cba;
970
+ border-color: #007cba;
971
+ color: #fff;
972
+ border-radius: 2px;
973
+ }
974
+
975
+ .ppmb-tab-radios .ppmb-tab {
976
+ display: none;
977
+ padding: 5px 0px;
978
+ clear: left;
979
+ }
980
+
981
+ #submit_button_data .ppmb-tab-radios .ppmb-tab {
982
+ border: 1px solid #eee;
983
+ padding: 5px;
984
+ margin: 10px 0 0;
985
+ }
986
+
987
+ .ppmb-tab-radios input:nth-of-type(1):checked ~ .ppmb-tab:nth-of-type(1),
988
+ .ppmb-tab-radios input:nth-of-type(2):checked ~ .ppmb-tab:nth-of-type(2),
989
+ .ppmb-tab-radios input:nth-of-type(3):checked ~ .ppmb-tab:nth-of-type(3),
990
+ .ppmb-tab-radios input:nth-of-type(4):checked ~ .ppmb-tab:nth-of-type(4),
991
+ .ppmb-tab-radios input:nth-of-type(5):checked ~ .ppmb-tab:nth-of-type(5) {
992
+ display: block;
993
+ }
994
+
995
+ .ppmb-tab input[type=text].ppfl {
996
+ padding: 10px 15px !important;
997
+ height: 40px !important;
998
+ cursor: not-allowed !important;
999
+ width: 290px !important;
1000
+ border-radius: 0 !important;
1001
+ background: #fff !important;
1002
+ border: 1px solid #dbdbdb !important;
1003
+ }
1004
+
1005
+ .ppmb-tab input[type=button].ppfl {
1006
+ padding: 10px 15px !important;
1007
+ cursor: not-allowed !important;
1008
+ color: #fff;
1009
+ border-radius: 0 !important;
1010
+ background: #007cba !important;
1011
+ border: 1px solid #007cba !important;
1012
+ }
1013
+
1014
+ .ppmb-tab input.ppfl:focus,
1015
+ .ppmb-tab input.ppfl:hover {
1016
+ border: 0;
1017
+ box-shadow: none;
1018
+ outline: none;
1019
+ }
1020
+
1021
+ .ppmb-tab input.ppfl.ppfl-pill {
1022
+ border-radius: 25px !important;
1023
+ }
1024
+
1025
+ .ppmb-tab input.ppfl.ppfl-round {
1026
+ border-radius: 6px !important;
1027
+ }
1028
+
1029
+ .ppmb-tab input.ppfl.ppfl-material {
1030
+ border: 0 !important;
1031
+ border-bottom: 1px solid #dbdbdb !important;
1032
+ }
1033
+
1034
+ .ppmb-tab input.ppfl.ppfl-flat {
1035
+ border: 0 !important;
1036
+ background: #f7f7f7 0 !important;
1037
+ }
1038
+
1039
+
1040
+ #pp-form-builder-metabox .pp-form-builder-mb-data .select2-container {
1041
+ width: 95% !important;
1042
+ }
assets/css/frontend.css ADDED
@@ -0,0 +1,2499 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url("hint.min.css");
2
+
3
+ @font-face {
4
+ font-family: 'Material Icons';
5
+ font-style: normal;
6
+ font-weight: 400;
7
+ src: url(./material-icons/MaterialIcons-Regular.eot); /* For IE6-8 */
8
+ src: local('Material Icons'),
9
+ local('MaterialIcons-Regular'),
10
+ url(./material-icons/MaterialIcons-Regular.woff2) format('woff2'),
11
+ url(./material-icons/MaterialIcons-Regular.woff) format('woff'),
12
+ url(./material-icons/MaterialIcons-Regular.ttf) format('truetype');
13
+ }
14
+
15
+ .ppress-material-icons,
16
+ .pp-form-field-wrap .pp-form-material-icons,
17
+ #profilepress-myaccount-wrapper .ppmyac-icons {
18
+ font-family: 'Material Icons' !important;
19
+ font-weight: normal;
20
+ font-style: normal;
21
+ font-size: 20px; /* Preferred icon size */
22
+ display: inline-block;
23
+ line-height: 1;
24
+ text-transform: none;
25
+ letter-spacing: normal;
26
+ word-wrap: normal;
27
+ white-space: nowrap;
28
+ direction: ltr;
29
+
30
+ /* Support for all WebKit browsers. */
31
+ -webkit-font-smoothing: antialiased;
32
+ /* Support for Safari and Chrome. */
33
+ text-rendering: optimizeLegibility;
34
+
35
+ /* Support for Firefox. */
36
+ -moz-osx-font-smoothing: grayscale;
37
+
38
+ /* Support for IE. */
39
+ font-feature-settings: 'liga';
40
+ }
41
+
42
+ /* Tabbed / User panel widget ------------------------------------ */
43
+ .pp-tab-widget-avatar img {
44
+ display: block;
45
+ border-radius: 50%;
46
+ height: 190px;
47
+ margin: 0 auto 10px !important;
48
+ padding: 2px;
49
+ text-align: center;
50
+ width: 190px;
51
+ float: none !important;
52
+ }
53
+
54
+ .pp-user-panel {
55
+ border-radius: 6px;
56
+ text-align: center;
57
+ }
58
+
59
+ .pp-user-panel-title {
60
+ font-size: 20px;
61
+ margin: 0;
62
+ }
63
+
64
+ .pp-user-panel p {
65
+ font-size: 15px;
66
+ margin-bottom: 23px;
67
+ }
68
+
69
+ .pp-tabbed-btn {
70
+ border: none;
71
+ font-size: 15px;
72
+ font-weight: 400;
73
+ line-height: 1.4;
74
+ border-radius: 4px;
75
+ padding: 10px 15px;
76
+ -webkit-font-smoothing: subpixel-antialiased;
77
+ -webkit-transition: border .25s linear, color .25s linear, background-color .25s linear;
78
+ transition: border .25s linear, color .25s linear, background-color .25s linear;
79
+ }
80
+
81
+ .pp-tabbed-btn-inverse {
82
+ color: #fff !important;
83
+ background-color: #34495e;
84
+ }
85
+
86
+ /* End Tabbed / User panel widget ------------------------------------ */
87
+
88
+ .pp-password-reset-handler-wrap .pp-reset-password-form {
89
+ padding: 40px;
90
+ max-width: 500px;
91
+ margin-top: 5px;
92
+ margin-bottom: 5px;
93
+ }
94
+
95
+ .pp-password-reset-handler-wrap .pp-reset-password-form h3 {
96
+ color: #444;
97
+ font-weight: 300;
98
+ margin: 0 auto 40px;
99
+ }
100
+
101
+ .pp-password-reset-handler-wrap .pp-reset-password-form label {
102
+ color: #444;
103
+ font-size: 15px;
104
+ }
105
+
106
+ .pp-password-reset-handler-wrap .pp-reset-password-form label .req {
107
+ margin: 2px;
108
+ color: #ff0000;
109
+ }
110
+
111
+ .pp-password-reset-handler-wrap .pp-reset-password-form label.active .req {
112
+ opacity: 0;
113
+ }
114
+
115
+ .pp-password-reset-handler-wrap .pp-reset-password-form input {
116
+ font-size: 22px;
117
+ display: block;
118
+ width: 100%;
119
+ box-sizing: border-box;
120
+ height: auto;
121
+ padding: 5px 10px;
122
+ background: none;
123
+ margin-bottom: 40px;
124
+ border: 1px solid #a0b3b0;
125
+ border-radius: 0;
126
+ -webkit-transition: border-color .25s ease, box-shadow .25s ease;
127
+ transition: border-color .25s ease, box-shadow .25s ease;
128
+ }
129
+
130
+ .pp-password-reset-handler-wrap .pp-reset-password-form input:focus {
131
+ outline: 0;
132
+ border-color: #1ab188;
133
+ }
134
+
135
+ .pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button {
136
+ border: 0;
137
+ outline: none;
138
+ border-radius: 0;
139
+ padding: 15px 0;
140
+ font-size: 20px;
141
+ font-weight: 600;
142
+ text-transform: uppercase;
143
+ letter-spacing: .1em;
144
+ background: #1ab188;
145
+ color: #ffffff;
146
+ -webkit-transition: all 0.5s ease;
147
+ transition: all 0.5s ease;
148
+ -webkit-appearance: none;
149
+ text-shadow: none;
150
+ box-shadow: none;
151
+ }
152
+
153
+ .pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button:hover,
154
+ .pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button:focus {
155
+ background: #179b77;
156
+ }
157
+
158
+ .pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button-block {
159
+ display: block;
160
+ width: 100%;
161
+ }
162
+
163
+ .pp-password-reset-handler-wrap .profilepress-reset-status {
164
+ margin-left: 40px;
165
+ max-width: 420px;
166
+ }
167
+
168
+ #pp-pass-strength-result {
169
+ background-color: #eee;
170
+ border: 1px solid #ddd;
171
+ color: #23282d;
172
+ padding: 3px 5px;
173
+ text-align: center;
174
+ width: 100%;
175
+ -webkit-box-sizing: border-box;
176
+ -moz-box-sizing: border-box;
177
+ box-sizing: border-box;
178
+ }
179
+
180
+ #pp-pass-strength-result.short {
181
+ background-color: #f1adad;
182
+ border-color: #e35b5b;
183
+ opacity: 1;
184
+ }
185
+
186
+ #pp-pass-strength-result.bad {
187
+ background-color: #fbc5a9;
188
+ border-color: #f78b53;
189
+ opacity: 1;
190
+ }
191
+
192
+ #pp-pass-strength-result.good {
193
+ background-color: #ffe399;
194
+ border-color: #ffc733;
195
+ opacity: 1;
196
+ }
197
+
198
+ #pp-pass-strength-result.strong {
199
+ background-color: #c1e1b9;
200
+ border-color: #83c373;
201
+ opacity: 1;
202
+ }
203
+
204
+ /* Global form styling ------------------------------------ */
205
+ .pp-form-wrapper .pp-form-label-wrap .pp-form-required-label {
206
+ color: #ff0000;
207
+ font-weight: 400;
208
+ }
209
+
210
+ .pp-form-wrapper input[type="checkbox"],
211
+ .pp-form-wrapper input[type="radio"] {
212
+ cursor: pointer
213
+ }
214
+
215
+ .pp-form-wrapper p {
216
+ margin: 0 0 5px 0 !important;
217
+ padding: 0 !important;
218
+ }
219
+
220
+ .pp-form-wrapper textarea,
221
+ .pp-form-wrapper select,
222
+ .pp-form-wrapper input[type="text"],
223
+ .pp-form-wrapper input[type="password"],
224
+ .pp-form-wrapper input[type="email"],
225
+ .pp-form-wrapper input[type="url"],
226
+ .pp-form-wrapper input[type="search"],
227
+ .pp-form-wrapper input[type="tel"],
228
+ .pp-form-wrapper input[type="number"],
229
+ .pp-form-wrapper input[type="datetime"] {
230
+ -webkit-appearance: none;
231
+ width: 100%;
232
+ background: #fff;
233
+ border: 1px solid #dedee5;
234
+ padding: 13px 15px;
235
+ outline: none;
236
+ line-height: 1;
237
+ }
238
+
239
+ .pp-form-wrapper select {
240
+ background-image: url(../images/frontend/arrow-down.png) !important;
241
+ background-position: right 20px center !important;
242
+ background-repeat: no-repeat !important;
243
+ background-size: 10px auto !important;
244
+ -webkit-appearance: none !important;
245
+ -moz-appearance: none !important;
246
+ appearance: none !important;
247
+ width: 100%;
248
+ border: 1px solid #dedee5;
249
+ padding: 13px 15px;
250
+ outline: none;
251
+ line-height: 1;
252
+ }
253
+
254
+ .pp-form-wrapper .pp-form-label-wrap {
255
+ margin: 0 0 4px 0;
256
+ padding: 0;
257
+ }
258
+
259
+ .pp-form-wrapper .pp-form-label {
260
+ font-size: 14px;
261
+ text-transform: none;
262
+ text-align: left;
263
+ font-weight: normal;
264
+ font-style: normal;
265
+ float: none;
266
+ line-height: 1.3;
267
+ margin: 0;
268
+ padding: 0;
269
+ width: auto;
270
+ display: inline;
271
+ cursor: pointer;
272
+ }
273
+
274
+ .pp-form-wrapper .pp-checkbox-wrap,
275
+ .pp-form-wrapper .pp-radio-wrap {
276
+ display: block;
277
+ text-align: left;
278
+ line-height: normal;
279
+ margin: 5px 0;
280
+ padding: 0;
281
+ }
282
+
283
+ .pp-form-wrapper .pp-checkbox-wrap label,
284
+ .pp-form-wrapper .pp-radio-wrap label {
285
+ margin-left: 5px;
286
+ }
287
+
288
+ .pp-form-wrapper input[type=checkbox], .pp-form-wrapper input[type=radio] {
289
+ border: 1px solid #ccc;
290
+ background-color: #fff;
291
+ width: 14px !important;
292
+ height: 14px !important;
293
+ display: inline-block;
294
+ vertical-align: baseline;
295
+ }
296
+
297
+ .pp-form-wrapper .ppress-pf-profile-connect {
298
+ padding: 5px 0 10px 0;
299
+ }
300
+
301
+ .pp-form-wrapper a.ppress-pf-social-icon {
302
+ width: 100%;
303
+ height: 100%;
304
+ display: inline;
305
+ }
306
+
307
+ .pp-form-wrapper .ppress-pf-social-icon svg {
308
+ vertical-align: middle;
309
+ width: 40px;
310
+ height: 40px;
311
+ }
312
+
313
+ .pp-form-wrapper .ppress-pf-social-icon.dpf-instagram svg,
314
+ .pp-form-wrapper .ppress-pf-social-icon.dpf-github svg {
315
+ padding: 3px;
316
+ }
317
+
318
+
319
+ /* Social login buttons ------------------------------------ */
320
+ a.pp-button-social-login:focus {
321
+ outline-color: transparent;
322
+ }
323
+
324
+ a.pp-button-social-login:focus .ppsc, a.pp-button-social-login:hover .ppsc {
325
+ background-color: hsla(0, 0%, 100%, .75);
326
+ }
327
+
328
+ a.pp-button-social-login:visited {
329
+ color: #fff;
330
+ }
331
+
332
+ a.pp-button-social-login {
333
+ position: relative;
334
+ display: inline-block;
335
+ vertical-align: middle;
336
+ line-height: 2.5em;
337
+ height: 2.5em;
338
+ font-size: 100%;
339
+ font-family: inherit;
340
+ font-weight: 700;
341
+ overflow: hidden;
342
+ white-space: nowrap;
343
+ border: 1px solid #333;
344
+ color: #fff !important;
345
+ background: #333;
346
+ padding: 0;
347
+ margin: 6px 0;
348
+ border-radius: 2px;
349
+ box-sizing: content-box;
350
+ cursor: pointer;
351
+ box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
352
+ text-decoration: none !important;
353
+ }
354
+
355
+ a.pp-button-social-login .ppsc {
356
+ font-style: normal;
357
+ font-weight: 400;
358
+ text-decoration: none;
359
+ text-transform: none;
360
+ display: inline-block;
361
+ vertical-align: top;
362
+ text-align: center;
363
+ font-size: 100%;
364
+ width: 2.5em;
365
+ height: 2.5em;
366
+ padding: 0;
367
+ background-color: #fff;
368
+ background-repeat: no-repeat;
369
+ background-position: 50%;
370
+ background-size: 1.8em 1.8em;
371
+ border-top-left-radius: 1px;
372
+ border-bottom-left-radius: 1px;
373
+ -moz-font-smoothing: antialiased;
374
+ -webkit-font-smoothing: antialiased;
375
+ font-smoothing: antialiased;
376
+ position: absolute;
377
+ left: 0;
378
+ margin: 0;
379
+ }
380
+
381
+ a.pp-button-social-login span.ppsc-text {
382
+ margin-left: 40px;
383
+ padding: .5em;
384
+ color: #fff !important;
385
+ }
386
+
387
+ a.pp-button-social-login {
388
+ min-width: 220px;
389
+ }
390
+
391
+ a.pp-button-social-login .ppsc-google {
392
+ background-image: url(../images/social-login/google.svg);
393
+ }
394
+
395
+ a.pp-button-social-login.pp-button-social-login-google {
396
+ background: #4285f4;
397
+ border-color: #4285f4;
398
+ }
399
+
400
+ a.pp-button-social-login.pp-button-social-login-facebook {
401
+ background: #3b5998;
402
+ border-color: #3b5998;
403
+ }
404
+
405
+ a.pp-button-social-login.pp-button-social-login-twitter {
406
+ background: #55acee;
407
+ border-color: #55acee;
408
+ }
409
+
410
+ a.pp-button-social-login.pp-button-social-login-linkedin {
411
+ background: #0077b5;
412
+ border-color: #0077b5;
413
+ }
414
+
415
+ a.pp-button-social-login.pp-button-social-login-vk {
416
+ background: #4a76a8;
417
+ border-color: #4a76a8;
418
+ }
419
+
420
+ a.pp-button-social-login.pp-button-social-login-github {
421
+ background: #24292e;
422
+ border-color: #24292e;
423
+ }
424
+
425
+ /** Amazon:#ff9900; disqus:#2e9fff; instagram: #e4405f; paypal:#00457c; yahoo:#400090 */
426
+ a.pp-button-social-login .ppsc-vk {
427
+ background-image: url(../images/social-login/vk-fa.svg)
428
+ }
429
+
430
+ a.pp-button-social-login .ppsc-facebook {
431
+ background-image: url(../images/social-login/facebook.svg);
432
+ }
433
+
434
+ a.pp-button-social-login .ppsc-twitter {
435
+ background-image: url(../images/social-login/twitter.svg)
436
+ }
437
+
438
+ a.pp-button-social-login .ppsc-linkedin {
439
+ background-image: url(../images/social-login/linkedin.svg)
440
+ }
441
+
442
+ a.pp-button-social-login .ppsc-github {
443
+ background-image: url(../images/social-login/github-fa.svg)
444
+ }
445
+
446
+ .pp-form-container *,
447
+ .pp-form-container .pp-form-wrapper,
448
+ .pp-form-container .pp-form-wrapper * {
449
+ -webkit-box-sizing: border-box;
450
+ -moz-box-sizing: border-box;
451
+ box-sizing: border-box;
452
+ }
453
+
454
+ html .pp-form-container .select2 input.select2-search__field {
455
+ border: 0 !important;
456
+ }
457
+
458
+ .pp-form-container form input[type=submit] {
459
+ -webkit-appearance: none !important;
460
+ }
461
+
462
+ .pp-form-container form {
463
+ margin: 0;
464
+ padding: 0;
465
+ background-color: transparent;
466
+ }
467
+
468
+ .woocommerce .woocommerce-MyAccount-content .pp-form-container {
469
+ margin-right: 0 !important;
470
+ margin-left: 0 !important;
471
+ }
472
+
473
+ .pp-form-container form input,
474
+ .pp-form-container form select,
475
+ .pp-form-container form textarea {
476
+ outline: none;
477
+ background-image: none;
478
+ height: auto;
479
+ float: none;
480
+ position: static;
481
+ box-shadow: none;
482
+ text-shadow: none;
483
+ text-transform: none;
484
+ text-decoration: none;
485
+ resize: vertical;
486
+ }
487
+
488
+ .pp-form-container form p {
489
+ margin: 0 0 0.5em;
490
+ }
491
+
492
+ .pp-form-container form input[type="submit"] {
493
+ cursor: pointer;
494
+ text-shadow: none;
495
+ }
496
+
497
+ .pp-form-container form input[type="submit"]:focus {
498
+ outline: 0;
499
+ }
500
+
501
+ .pp-form-container .pp-user-avatar {
502
+ border-radius: 50% !important;
503
+ display: block !important;
504
+ margin: 0 auto 10px !important;
505
+ text-align: center !important;
506
+ }
507
+
508
+ .pp-form-container img.pp-user-cover-image {
509
+ width: 100% !important;
510
+ height: auto !important;
511
+ }
512
+
513
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=checkbox],
514
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio],
515
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox],
516
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio] {
517
+ border: 1px solid #7e8993 !important;
518
+ border-radius: 4px !important;
519
+ background: #fff !important;
520
+ color: #555 !important;
521
+ clear: none !important;
522
+ cursor: pointer !important;
523
+ display: inline-block !important;
524
+ line-height: 0 !important;
525
+ margin: 0 !important;
526
+ outline: 0 !important;
527
+ padding: 0 !important;
528
+ text-align: center !important;
529
+ vertical-align: middle !important;
530
+ -webkit-appearance: none !important;
531
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1) !important;
532
+ transition: .05s border-color ease-in-out !important;
533
+ width: 16px !important;
534
+ height: 16px !important;
535
+ }
536
+
537
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio],
538
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio] {
539
+ border-radius: 50% !important;
540
+ }
541
+
542
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=checkbox]:checked::before,
543
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox]:checked::before {
544
+ content: url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23000000%27%2F%3E%3C%2Fsvg%3E) !important;
545
+ margin: -3px 0 0 -4px !important;
546
+ width: 20px !important;
547
+ height: 20px !important;
548
+ position: static;
549
+ }
550
+
551
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio]:checked::before,
552
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]:checked::before {
553
+ content: "";
554
+ border-radius: 50% !important;
555
+ margin: 3px !important;
556
+ background-color: #000000 !important;
557
+ line-height: 1.14285714 !important;
558
+ width: 8px !important;
559
+ height: 8px !important;
560
+ }
561
+
562
+
563
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=checkbox]:checked::before,
564
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio]:checked::before,
565
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox]:checked::before,
566
+ .pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]:checked::before {
567
+ float: left !important;
568
+ display: inline-block !important;
569
+ vertical-align: middle !important;
570
+ speak: none;
571
+ -webkit-font-smoothing: antialiased;
572
+ -moz-osx-font-smoothing: grayscale;
573
+ }
574
+
575
+ /* buildscratch form css BEGIN ------------------------------------ */
576
+
577
+ .pp-form-container .pp-form-wrapper.ppBuildScratch,
578
+ .pp-form-container .pp-form-wrapper.ppBuildScratch * {
579
+ font-family: 'Merriweather', sans-serif;
580
+ }
581
+
582
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .ppbs-headline,
583
+ .pp-form-container .pp-form-wrapper.ppBuildScratch h1,
584
+ .pp-form-container .pp-form-wrapper.ppBuildScratch h2,
585
+ .pp-form-container .pp-form-wrapper.ppBuildScratch h3,
586
+ .pp-form-container .pp-form-wrapper.ppBuildScratch h4 {
587
+ font-weight: bold;
588
+ font-size: 20px;
589
+ margin-bottom: 1em;
590
+ margin-top: 1em;
591
+ }
592
+
593
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .ppbs-headline {
594
+ margin-top: 0;
595
+ }
596
+
597
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .ppbs-headline {
598
+ text-align: center;
599
+ margin-right: 6.387%;
600
+ }
601
+
602
+ .pp-form-container .pp-form-wrapper.ppBuildScratch input:disabled {
603
+ opacity: 0.5;
604
+ }
605
+
606
+ .pp-form-container .pp-form-wrapper.ppBuildScratch {
607
+ max-width: 100%;
608
+ width: 100%;
609
+ padding: 6%;
610
+ padding-right: 0;
611
+ background: #ffffff;
612
+ color: #222222;
613
+ font-size: 14px;
614
+ position: relative;
615
+ box-shadow: 0 0 0 0.5px rgba(0, 20, 40, .1), 0 2px 8px 0 rgba(50, 55, 90, .2);
616
+ border-radius: 3px;
617
+ margin: 0 auto;
618
+ }
619
+
620
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppf-remove-frame {
621
+ box-shadow: none;
622
+ border-radius: 0;
623
+ }
624
+
625
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap,
626
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap {
627
+ padding: 4% 6.387%;
628
+ padding-top: 0;
629
+ padding-left: 0;
630
+ display: inline-block;
631
+ width: 100%;
632
+ vertical-align: top;
633
+ }
634
+
635
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap {
636
+ padding-bottom: 0;
637
+ }
638
+
639
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .pp-form-label-wrap {
640
+ margin: 0 0 5px 0;
641
+ padding: 0;
642
+ }
643
+
644
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-reveal .pp-form-field-description {
645
+ display: none;
646
+ }
647
+
648
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-reveal .pp-form-field-input-textarea-wrap .pp-form-field:focus ~ .pp-form-field-description {
649
+ display: block;
650
+ }
651
+
652
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-standard .pp-hint-tooltip,
653
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-reveal .pp-hint-tooltip {
654
+ display: none;
655
+ }
656
+
657
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-tooltip .pp-form-field-description {
658
+ display: none;
659
+ }
660
+
661
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-tooltip .pp-hint-tooltip {
662
+ display: inline;
663
+ font-weight: normal;
664
+ }
665
+
666
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-tooltip .pp-hint-tooltip .pp-form-material-icons {
667
+ position: relative;
668
+ margin: 0;
669
+ padding: 0;
670
+ font-size: 110%;
671
+ display: inline;
672
+ vertical-align: top;
673
+ }
674
+
675
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fld-inside {
676
+ position: relative;
677
+ }
678
+
679
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fld-inside .pp-form-label-wrap {
680
+ position: absolute;
681
+ top: 5px;
682
+ left: 15px;
683
+ z-index: 2;
684
+ }
685
+
686
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap.fld-inside .pp-form-label-wrap {
687
+ left: 0 !important;
688
+ }
689
+
690
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fld-inside .pp-form-field-input-textarea-wrap .pp-form-field {
691
+ padding-top: 18px;
692
+ padding-bottom: 2px;
693
+ }
694
+
695
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap.fld-inside .pp-form-field-input-textarea-wrap .pp-form-field {
696
+ padding-top: 23px;
697
+ padding-bottom: 7px;
698
+ }
699
+
700
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap.fld-inside .pp-form-field-input-textarea-wrap .pp-form-field {
701
+ padding-top: 30px;
702
+ padding-bottom: 10px;
703
+ }
704
+
705
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fw-half {
706
+ width: 50%;
707
+ }
708
+
709
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fw-third {
710
+ width: 33.3333333333%;
711
+ }
712
+
713
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),
714
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap select,
715
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap textarea {
716
+ border: 1px solid #dbdbdb;
717
+ font-size: 14px;
718
+ padding: 10px 15px;
719
+ -webkit-transition: all .35s;
720
+ transition: all .35s;
721
+ background: #ffffff;
722
+ color: #69717a;
723
+ width: 100%;
724
+ border-radius: 0;
725
+ line-height: 1.3;
726
+ min-height: 40px;
727
+ display: inline-block;
728
+ margin: 0;
729
+ }
730
+
731
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap textarea {
732
+ height: 100px;
733
+ overflow: auto;
734
+ }
735
+
736
+ .pp-form-field-wrap .pp-form-material-icons {
737
+ width: 24px;
738
+ height: 24px;
739
+ position: absolute;
740
+ right: 0;
741
+ top: 0;
742
+ cursor: text;
743
+ margin: 8px 12px 0 0;
744
+ }
745
+
746
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-right .pp-form-field-wrap.field-has-icon input,
747
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-right .pp-form-field-wrap.field-has-icon textarea {
748
+ padding-right: 40px;
749
+ }
750
+
751
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-left .pp-form-field-wrap.field-has-icon input,
752
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-left .pp-form-field-wrap.field-has-icon textarea {
753
+ padding-left: 40px;
754
+ }
755
+
756
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-left .pp-form-field-wrap.field-has-icon input,
757
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-left .pp-form-field-wrap.field-has-icon textarea {
758
+ padding-left: 30px !important;
759
+ }
760
+
761
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-right .pp-form-field-wrap.field-has-icon input,
762
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-right .pp-form-field-wrap.field-has-icon textarea {
763
+ padding-right: 30px !important;
764
+ }
765
+
766
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-left .pp-form-field-wrap .pp-form-material-icons {
767
+ left: 0;
768
+ margin-left: 12px;
769
+ }
770
+
771
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-left .pp-form-field-wrap .pp-form-material-icons {
772
+ left: 0 !important;
773
+ margin-left: 0 !important;
774
+ }
775
+
776
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-right .pp-form-field-wrap .pp-form-material-icons {
777
+ margin-right: 0 !important;
778
+ }
779
+
780
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap .pp-form-material-icons {
781
+ margin-top: 10px;
782
+ }
783
+
784
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap .pp-form-material-icons {
785
+ margin-top: 18px;
786
+ }
787
+
788
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap .pp-form-material-icons {
789
+ margin-top: 18px;
790
+ }
791
+
792
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .has-password-visibility-icon .pp-form-material-icons {
793
+ cursor: pointer;
794
+ }
795
+
796
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-pill .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),
797
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-pill .pp-form-field-wrap select,
798
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-pill .pp-form-field-wrap textarea {
799
+ border-radius: 25px !important;
800
+ }
801
+
802
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-round .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),
803
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-round .pp-form-field-wrap select,
804
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-round .pp-form-field-wrap textarea {
805
+ border-radius: 6px !important;
806
+ }
807
+
808
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),
809
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap select,
810
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap .select2.select2-container,
811
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap textarea {
812
+ border: 0 !important;
813
+ border-bottom: 1px solid #dbdbdb !important;
814
+ padding-left: 0 !important;
815
+ }
816
+
817
+
818
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap span.select2-selection.select2-selection--multiple {
819
+ border: 0 !important;
820
+ }
821
+
822
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap input[type=text]:focus,
823
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap select:focus,
824
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap textarea:focus {
825
+ border-top: 0 !important;
826
+ border-right: 0 !important;
827
+ border-left: 0 !important;
828
+ box-shadow: none !important;
829
+ }
830
+
831
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),
832
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap select,
833
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap .select2-selection,
834
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap textarea {
835
+ border: 0 !important;
836
+ background: #f7f7f7 !important;
837
+ }
838
+
839
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap input,
840
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap select {
841
+ padding-top: 15px;
842
+ padding-bottom: 15px;
843
+ }
844
+
845
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap textarea {
846
+ height: 150px;
847
+ }
848
+
849
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap input,
850
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap select {
851
+ padding-top: 20px;
852
+ padding-bottom: 20px;
853
+ }
854
+
855
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap textarea {
856
+ height: 200px;
857
+ }
858
+
859
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap input[type=text]:focus,
860
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap select:focus,
861
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap textarea:focus {
862
+ border: 1px solid #999;
863
+ }
864
+
865
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .pp-form-label-wrap .pp-form-label,
866
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .ppform-remember-label {
867
+ font-style: normal;
868
+ background-color: transparent;
869
+ display: block;
870
+ font-weight: 700; /* 700 == bold */
871
+ font-size: 14px;
872
+ float: none;
873
+ line-height: 1.3;
874
+ margin: 0;
875
+ padding: 0;
876
+ color: #444444;
877
+ }
878
+
879
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .ppform-remember-label {
880
+ display: inline-block;
881
+ }
882
+
883
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppf-hide-asterisk .pp-form-required-label {
884
+ display: none;
885
+ }
886
+
887
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap input[type="submit"] {
888
+ background: #000000;
889
+ border: none;
890
+ color: #ffffff;
891
+ font-weight: bold;
892
+ font-size: 16px;
893
+ line-height: 1;
894
+ padding: 15px 10px;
895
+ transition: .15s ease-in-out;
896
+ width: auto;
897
+ min-width: 110px;
898
+ text-align: center;
899
+ }
900
+
901
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-submit-button-wrap input[type="submit"],
902
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-submit-button-wrap input[type="submit"] {
903
+ padding-top: 20px;
904
+ padding-bottom: 20px;
905
+ }
906
+
907
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbl-pill .pp-form-submit-button-wrap input[type="submit"] {
908
+ border-radius: 25px !important;
909
+ }
910
+
911
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbl-round .pp-form-submit-button-wrap input[type="submit"] {
912
+ border-radius: 6px !important;
913
+ }
914
+
915
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap input[type="submit"]:hover,
916
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap input[type="submit"]:focus {
917
+ background-color: #ededed;
918
+ color: #000000;
919
+ text-decoration: none;
920
+ }
921
+
922
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-checkbox-wrap,
923
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-radio-wrap {
924
+ margin: 0 0 5px;
925
+ }
926
+
927
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-checkboxes-container {
928
+ margin: 0;
929
+ padding: 0;
930
+ }
931
+
932
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-checkbox-wrap:last-of-type,
933
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-radio-wrap:last-of-type {
934
+ margin-bottom: 0;
935
+ }
936
+
937
+ .pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-description {
938
+ font-size: 12px;
939
+ font-weight: normal;
940
+ color: #666666;
941
+ line-height: 1.3;
942
+ text-align: left;
943
+ margin: 4px 0 0 0;
944
+ }
945
+
946
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-wide .pp-form-submit-button-wrap input[type="submit"] {
947
+ width: 100%;
948
+ }
949
+
950
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width .pp-form-submit-button-wrap {
951
+ margin-top: 4%;
952
+ margin-bottom: 4%;
953
+ }
954
+
955
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width .pp-form-submit-button-wrap input[type="submit"] {
956
+ width: 100% !important;
957
+ position: absolute !important;
958
+ bottom: 0 !important;
959
+ right: 0 !important;
960
+ left: 0 !important;
961
+ }
962
+
963
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width .pp-form-submit-button-wrap input[type="submit"] {
964
+ border-top-right-radius: 0 !important;
965
+ border-top-left-radius: 0 !important;
966
+ }
967
+
968
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width.ppsbl-pill {
969
+ border-bottom-right-radius: 25px !important;
970
+ border-bottom-left-radius: 25px !important;
971
+ }
972
+
973
+ .pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width.ppsbl-round {
974
+ border-bottom-right-radius: 6px !important;
975
+ border-bottom-left-radius: 6px !important;
976
+ }
977
+
978
+ .pp-form-container .pp-form-wrapper.ppBuildScratch a.pp-button-social-login:last-of-type {
979
+ margin-bottom: 1.5em !important;
980
+ }
981
+
982
+ /* buildscratch form css END ------------------------------------ */
983
+
984
+ /* My account START ------------------------------------ */
985
+
986
+ #profilepress-myaccount-wrapper, #profilepress-myaccount-wrapper *,
987
+ #profilepress-myaccount-wrapper ::after,
988
+ #profilepress-myaccount-wrapper ::before {
989
+ -webkit-box-sizing: border-box;
990
+ -moz-box-sizing: border-box;
991
+ box-sizing: border-box;
992
+ }
993
+
994
+ #profilepress-myaccount-wrapper {
995
+ font-size: 16px;
996
+ }
997
+
998
+ #profilepress-myaccount-wrapper .profilepress-myaccount-row {
999
+ display: flex;
1000
+ flex-wrap: wrap;
1001
+ margin-right: -15px;
1002
+ margin-left: -15px;
1003
+ }
1004
+
1005
+
1006
+ #profilepress-myaccount-wrapper .profilepress-myaccount-nav {
1007
+ display: flex;
1008
+ flex-direction: column;
1009
+ padding-left: 0;
1010
+ margin-bottom: 0;
1011
+ }
1012
+
1013
+ #profilepress-myaccount-wrapper .ppmyac-dashboard-item {
1014
+ text-decoration: none !important;
1015
+ position: relative;
1016
+ display: block;
1017
+ padding: .75rem 1.25rem;
1018
+ margin-bottom: -1px;
1019
+ background-color: #fff;
1020
+ border: 1px solid rgba(0, 0, 0, .125);
1021
+ width: 100%;
1022
+ text-align: inherit;
1023
+ box-shadow: none;
1024
+ }
1025
+
1026
+ #profilepress-myaccount-wrapper .ppmyac-dashboard-item.isactive {
1027
+ z-index: 2;
1028
+ color: #fff;
1029
+ background-color: #007bff;
1030
+ border-color: #007bff;
1031
+ }
1032
+
1033
+ #profilepress-myaccount-wrapper .ppmyac-dashboard-item:first-child {
1034
+ border-top-left-radius: .25rem;
1035
+ border-top-right-radius: .25rem;
1036
+ }
1037
+
1038
+ #profilepress-myaccount-wrapper .ppmyac-dashboard-item:last-child {
1039
+ margin-bottom: 0;
1040
+ border-bottom-right-radius: .25rem;
1041
+ border-bottom-left-radius: .25rem;
1042
+ }
1043
+
1044
+ #profilepress-myaccount-wrapper .ppmyac-icons {
1045
+ margin-right: .5rem;
1046
+ vertical-align: text-bottom;
1047
+ }
1048
+
1049
+ #profilepress-myaccount-wrapper .profilepress-myaccount-col-sm-3 {
1050
+ position: relative;
1051
+ width: 100%;
1052
+ padding-right: 15px;
1053
+ padding-left: 15px;
1054
+ }
1055
+
1056
+ @media (min-width: 576px) {
1057
+ #profilepress-myaccount-wrapper .profilepress-myaccount-col-sm-3 {
1058
+ flex: 0 0 25%;
1059
+ max-width: 25%;
1060
+ }
1061
+ }
1062
+
1063
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content {
1064
+ position: relative;
1065
+ width: 100%;
1066
+ padding-top: 30px;
1067
+ padding-right: 15px;
1068
+ padding-left: 15px;
1069
+ }
1070
+
1071
+ @media (min-width: 576px) {
1072
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content {
1073
+ flex: 0 0 75%;
1074
+ max-width: 75%;
1075
+ }
1076
+ }
1077
+
1078
+ #profilepress-myaccount-wrapper .profilepress-myaccount-avatar-wrap {
1079
+ text-align: center;
1080
+ margin-bottom: 20px;
1081
+ }
1082
+
1083
+ #profilepress-myaccount-wrapper .profilepress-myaccount-avatar-wrap .profilepress-myaccount-avatar img.pp-user-avatar {
1084
+ margin: 0 !important;
1085
+ position: static !important;
1086
+ float: none !important;
1087
+ display: inline-block;
1088
+ -moz-border-radius: 999px;
1089
+ -webkit-border-radius: 999px;
1090
+ border-radius: 999px;
1091
+ }
1092
+
1093
+ #profilepress-myaccount-wrapper .profilepress-myaccount-nav a:focus {
1094
+ outline: none;
1095
+ text-shadow: none;
1096
+ box-shadow: none;
1097
+ }
1098
+
1099
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content h2,
1100
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content h3 {
1101
+ margin-top: 0 !important;
1102
+ margin-bottom: 1.8rem !important;
1103
+ font-weight: 700 !important;
1104
+ line-height: 1.2 !important;
1105
+ font-size: 2rem !important;
1106
+ }
1107
+
1108
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenus-wrap {
1109
+ margin-bottom: 2rem;
1110
+ }
1111
+
1112
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenu-wrap {
1113
+ display: inline;
1114
+ padding-right: 1rem;
1115
+ }
1116
+
1117
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenu-item {
1118
+ color: inherit;
1119
+ padding: 0 0 10px;
1120
+ }
1121
+
1122
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenu-item.ppsubmenu-active {
1123
+ border-bottom: 3px solid #6c757d;
1124
+ }
1125
+
1126
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content h3 {
1127
+ font-weight: 500 !important;
1128
+ font-size: 1.2rem !important;
1129
+ margin-bottom: 1rem !important;
1130
+ }
1131
+
1132
+ .profilepress-myaccount-alert,
1133
+ .profilepress-myaccount-edit-profile .profilepress-edit-profile-status {
1134
+ position: relative;
1135
+ padding: .75rem 1.25rem;
1136
+ margin-bottom: 1rem;
1137
+ border: 1px solid transparent;
1138
+ border-radius: .25rem;
1139
+ }
1140
+
1141
+ .profilepress-myaccount-alert.pp-alert-danger,
1142
+ .profilepress-myaccount-edit-profile .profilepress-edit-profile-status {
1143
+ color: #721c24;
1144
+ background-color: #f8d7da;
1145
+ border-color: #f5c6cb;
1146
+ }
1147
+
1148
+ .profilepress-myaccount-alert.pp-alert-success,
1149
+ .profilepress-myaccount-edit-profile .profilepress-edit-profile-status.success {
1150
+ color: #155724;
1151
+ background-color: #d4edda;
1152
+ border-color: #c3e6cb;
1153
+ }
1154
+
1155
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field {
1156
+ margin-top: .5rem;
1157
+ margin-bottom: 1rem;
1158
+ }
1159
+
1160
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-cover-image-empty {
1161
+ min-height: 250px;
1162
+ background-color: #eee;
1163
+ }
1164
+
1165
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-cover-image-wrap {
1166
+ padding: .75rem;
1167
+ background-color: #fff;
1168
+ border: 1px solid rgba(0, 0, 0, .125);
1169
+ margin-bottom: 0;
1170
+ border-radius: .25rem;
1171
+ }
1172
+
1173
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-cover-image-wrap img {
1174
+ width: 100%;
1175
+ height: auto;
1176
+ }
1177
+
1178
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-email-notifications-wrap .profilepress-myaccount-form-field {
1179
+ margin-top: .5rem;
1180
+ margin-bottom: .5rem;
1181
+ }
1182
+
1183
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-email-notifications-wrap {
1184
+ margin-bottom: 2rem;
1185
+ }
1186
+
1187
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field label {
1188
+ margin-bottom: .2rem;
1189
+ font-weight: 500;
1190
+ display: block;
1191
+ }
1192
+
1193
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field input[type=radio] + label,
1194
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field input[type=checkbox] + label {
1195
+ display: inline;
1196
+ }
1197
+
1198
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .profilepress-myaccount-form-control:not([type="radio"]):not([type="checkbox"]),
1199
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]),
1200
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap textarea,
1201
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap select {
1202
+ display: block;
1203
+ width: 100%;
1204
+ height: calc(1.5em + .75rem + 2px);
1205
+ padding: .375rem .75rem;
1206
+ font-size: 1rem;
1207
+ font-weight: 400;
1208
+ line-height: 1.5;
1209
+ background-color: #fff;
1210
+ background-clip: padding-box;
1211
+ border: 1px solid #ced4da;
1212
+ border-radius: .25rem;
1213
+ transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
1214
+ overflow: visible;
1215
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.125);
1216
+ }
1217
+
1218
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap textarea {
1219
+ height: auto !important;
1220
+ min-height: 100px !important;
1221
+ resize: vertical !important;
1222
+ }
1223
+
1224
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input.profilepress-myaccount-form-control:focus,
1225
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content textarea.profilepress-myaccount-form-control:focus,
1226
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content select.profilepress-myaccount-form-control:focus {
1227
+ background-color: #fff;
1228
+ border-color: #bbb;
1229
+ outline: 0;
1230
+ box-shadow: none;
1231
+ }
1232
+
1233
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .profilepress-myaccount-form-field input[type=submit] {
1234
+ display: inline-block;
1235
+ cursor: pointer;
1236
+ width: auto;
1237
+ }
1238
+
1239
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .profilepress-myaccount-form-field input[type=submit]:hover {
1240
+ color: #fff;
1241
+ background-color: #0069d9;
1242
+ border-color: #0062cc;
1243
+ text-decoration: none;
1244
+ }
1245
+
1246
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file {
1247
+ position: relative;
1248
+ display: inline-block;
1249
+ width: 100%;
1250
+ height: calc(1.5em + .75rem + 2px);
1251
+ margin-bottom: 0;
1252
+ }
1253
+
1254
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-input {
1255
+ position: relative;
1256
+ z-index: 2;
1257
+ width: 100%;
1258
+ height: calc(1.5em + .75rem + 2px);
1259
+ margin: 0;
1260
+ opacity: 0;
1261
+ }
1262
+
1263
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-label {
1264
+ position: absolute;
1265
+ top: 0;
1266
+ right: 0;
1267
+ left: 0;
1268
+ z-index: 1;
1269
+ height: calc(1.5em + .75rem + 2px);
1270
+ padding: .375rem .75rem;
1271
+ font-weight: 400;
1272
+ line-height: 1.5;
1273
+ color: #495057;
1274
+ background-color: #fff;
1275
+ border: 1px solid #ced4da;
1276
+ border-radius: .25rem;
1277
+ }
1278
+
1279
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-label::after {
1280
+ position: absolute;
1281
+ top: 0;
1282
+ right: 0;
1283
+ box-sizing: border-box;
1284
+ bottom: 0;
1285
+ z-index: 3;
1286
+ display: block;
1287
+ height: calc(1.5em + .75rem);
1288
+ padding: .375rem .75rem;
1289
+ line-height: 1.5;
1290
+ color: #495057;
1291
+ content: "Browse";
1292
+ background-color: #e9ecef;
1293
+ border-left: inherit;
1294
+ border-radius: 0 .25rem .25rem 0;
1295
+ }
1296
+
1297
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-input ~ .ppmyac-custom-file-label[data-browse]::after {
1298
+ content: attr(data-browse);
1299
+ }
1300
+
1301
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field .pp-checkbox-wrap label.pp-form-label,
1302
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field .pp-radio-wrap label.pp-form-label {
1303
+ display: inline-block;
1304
+ margin: 0 0 0 0.3819820591em;
1305
+ }
1306
+
1307
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-avatar-wrap {
1308
+ display: flex;
1309
+ flex-direction: column;
1310
+ margin: 1em 0 0 0;
1311
+ padding-left: 0;
1312
+ }
1313
+
1314
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-avatar {
1315
+ position: relative;
1316
+ padding: .75rem 1.25rem;
1317
+ background-color: #fff;
1318
+ border: 1px solid rgba(0, 0, 0, .125);
1319
+ margin-bottom: 0;
1320
+ border-radius: .25rem;
1321
+ justify-content: space-between !important;
1322
+ display: flex !important;
1323
+ }
1324
+
1325
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .pp-user-avatar {
1326
+ width: 70px;
1327
+ height: 70px;
1328
+ min-height: 100%;
1329
+ object-fit: cover;
1330
+ object-position: center;
1331
+ border-radius: 50%;
1332
+ }
1333
+
1334
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .ppmyac-remove-avatar {
1335
+ margin-bottom: .5rem !important;
1336
+ margin-top: .5rem !important;
1337
+ padding: .25rem .5rem;
1338
+ font-size: .875rem;
1339
+ line-height: 1.5;
1340
+ border-radius: .2rem;
1341
+ color: #fff;
1342
+ height: 35px;
1343
+ background-color: #6c757d;
1344
+ display: inline-block;
1345
+ font-weight: 400;
1346
+ text-align: center;
1347
+ vertical-align: middle;
1348
+ text-shadow: none;
1349
+ cursor: pointer;
1350
+ user-select: none;
1351
+ border: 1px solid #6c757d;
1352
+ transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
1353
+ }
1354
+
1355
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-cover-image-wrap .ppmyac-remove-avatar {
1356
+ margin-top: .75rem !important;
1357
+ margin-bottom: 0 !important;
1358
+ }
1359
+
1360
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content input.profilepress-myaccount-form-control::-webkit-file-upload-button {
1361
+ background: #fff;
1362
+ border-radius: 6px;
1363
+ font-size: 14px;
1364
+ border: 1px solid #ddd;
1365
+ }
1366
+
1367
+ #profilepress-myaccount-wrapper .profilepress-myaccount-content .select2-selection {
1368
+ border-radius: .25rem;
1369
+ transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
1370
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.125);
1371
+ }
1372
+
1373
+ /* My account END ------------------------------------ */
1374
+
1375
+
1376
+ /* Avatar and cover image hover to delete picture START ------------------------------------ */
1377
+ .pp-form-container .pp-field-user-avatar-picture-wrap {
1378
+ width: 250px;
1379
+ height: auto;
1380
+ margin: auto;
1381
+ position: relative;
1382
+ }
1383
+
1384
+ .pp-form-container .pp-field-user-cover-image-wrap {
1385
+ margin: auto;
1386
+ position: relative;
1387
+ }
1388
+
1389
+ .pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay-wrap,
1390
+ .pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay-wrap {
1391
+ position: absolute;
1392
+ top: 0;
1393
+ left: 0;
1394
+ background: rgba(0, 0, 0, .5);
1395
+ text-align: center;
1396
+ box-sizing: border-box;
1397
+ padding: 0;
1398
+ color: #fff;
1399
+ text-shadow: 0 1px #666;
1400
+ line-height: 21px;
1401
+ font-size: 16px;
1402
+ height: 100%;
1403
+ width: 100%;
1404
+ border-radius: 50%;
1405
+ }
1406
+
1407
+ .pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay-wrap {
1408
+ border-radius: 0;
1409
+ }
1410
+
1411
+ .pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay,
1412
+ .pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay {
1413
+ display: table;
1414
+ height: 100%;
1415
+ width: 100%;
1416
+ }
1417
+
1418
+ .pp-field-user-avatar-picture-wrap .pp-profile-avatar-overlay ins,
1419
+ .pp-field-user-cover-image-wrap .pp-cover-image-overlay ins {
1420
+ display: none;
1421
+ }
1422
+
1423
+ .pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay ins,
1424
+ .pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay ins {
1425
+ display: table-cell;
1426
+ vertical-align: middle;
1427
+ height: 100%;
1428
+ text-decoration: none !important;
1429
+ background: none !important;
1430
+ color: #fff !important;
1431
+ border-bottom: none !important;
1432
+ }
1433
+
1434
+ .pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay-wrap .pp-profile-avatar-overlay .pp-form-material-icons,
1435
+ .pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay-wrap .pp-cover-image-overlay .pp-form-material-icons {
1436
+ font-size: 35px !important;
1437
+ display: block !important;
1438
+ position: static !important;
1439
+ right: auto !important;
1440
+ top: auto !important;
1441
+ color: #fff !important;
1442
+ margin: 0 !important;
1443
+ width: auto !important;
1444
+ height: auto !important;
1445
+ cursor: pointer;
1446
+ }
1447
+
1448
+ /* Avatar and cover image hover to delete picture END ------------------------------------ */
1449
+
1450
+
1451
+ /******************** select2 shim *********************/
1452
+ html .select2.select2-container .select2-selection.select2-selection--multiple input.select2-search__field {
1453
+ border: 0 !important;
1454
+ height: auto !important;
1455
+ }
1456
+
1457
+ .select2.select2-container .select2-selection.select2-selection--multiple input.select2-search__field {
1458
+ border: 0 !important;
1459
+ box-shadow: none !important;
1460
+ }
1461
+
1462
+ .select2.select2-container .select2-selection.select2-selection--multiple li.select2-selection__choice {
1463
+ height: auto;
1464
+ line-height: normal;
1465
+ }
1466
+
1467
+ /******************** END select2 shim *********************/
1468
+
1469
+ /********************************************* MEMBER DIRECTORY GLOBAL CSS ------------------------------------ */
1470
+ .pp-form-wrapper.pp-member-directory {
1471
+ opacity: 0;
1472
+ }
1473
+
1474
+ /********************************************* DEFAULT profile template css BEGIN ------------------------------------ */
1475
+ .pp-form-wrapper.ppress-default-profile {
1476
+ max-width: 1000px;
1477
+ width: 100%;
1478
+ box-sizing: border-box;
1479
+ font-size: 15px;
1480
+ color: #666;
1481
+ margin-bottom: 30px;
1482
+ opacity: 0;
1483
+ }
1484
+
1485
+ .pp-form-wrapper.ppress-default-profile * {
1486
+ -webkit-font-smoothing: antialiased;
1487
+ -moz-osx-font-smoothing: grayscale;
1488
+ -webkit-box-sizing: border-box;
1489
+ -moz-box-sizing: border-box;
1490
+ box-sizing: border-box;
1491
+ }
1492
+
1493
+ .pp-form-wrapper.ppress-default-profile a, .pp-form-wrapper.ppress-default-profile a:hover {
1494
+ text-decoration: none !important;
1495
+ }
1496
+
1497
+ .pp-form-wrapper.ppress-default-profile .ppress-default-profile-cover {
1498
+ background-color: #eee;
1499
+ box-sizing: border-box;
1500
+ position: relative;
1501
+ }
1502
+
1503
+ .pp-form-wrapper.ppress-default-profile .ppress-default-profile-cover-e {
1504
+ text-align: center;
1505
+ overflow: hidden;
1506
+ }
1507
+
1508
+ .pp-form-wrapper.ppress-default-profile .ppress-default-profile-cover-e img {
1509
+ width: 100%;
1510
+ display: block;
1511
+ overflow: hidden;
1512
+ border-radius: 0;
1513
+ margin: 0;
1514
+ }
1515
+
1516
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-header {
1517
+ position: relative;
1518
+ padding: 0 0 25px 0;
1519
+ border-bottom: solid 2px #eee;
1520
+ min-height: 85px;
1521
+ box-sizing: content-box;
1522
+ }
1523
+
1524
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-headericon {
1525
+ position: absolute;
1526
+ top: 15px;
1527
+ right: 0;
1528
+ vertical-align: middle;
1529
+ font-size: 30px;
1530
+ height: 30px;
1531
+ line-height: 30px;
1532
+ z-index: 66;
1533
+ margin-right: 10px;
1534
+ }
1535
+
1536
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-headericon .ppress-dpf-edit-a .ppress-material-icons {
1537
+ font-size: 30px;
1538
+ }
1539
+
1540
+ .pp-form-wrapper.ppress-default-profile a.ppress-dpf-edit-a {
1541
+ color: #aaaaaa;
1542
+ text-decoration: none;
1543
+ border-bottom: 0;
1544
+ }
1545
+
1546
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-headericon a:hover,
1547
+ .pp-form-wrapper.ppress-default-profile a.ppress-dpf-edit-a.active {
1548
+ color: #007bff;
1549
+ }
1550
+
1551
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-photo {
1552
+ float: left;
1553
+ position: absolute;
1554
+ margin: 0 0 0 30px;
1555
+ box-sizing: border-box;
1556
+ width: 200px;
1557
+ height: 200px;
1558
+ }
1559
+
1560
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-photo img {
1561
+ width: 100%;
1562
+ height: auto;
1563
+ -moz-border-radius: 100%;
1564
+ -webkit-border-radius: 100%;
1565
+ border-radius: 100%;
1566
+ display: block;
1567
+ overflow: hidden;
1568
+ margin: 0;
1569
+ box-shadow: none;
1570
+ background: #fff;
1571
+ border: 5px solid #fff;
1572
+ }
1573
+
1574
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-meta {
1575
+ padding-right: 30px;
1576
+ -ms-word-break: break-all;
1577
+ word-break: break-word;
1578
+ word-wrap: break-word;
1579
+ }
1580
+
1581
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-main-meta {
1582
+ padding: 10px 0 0 0;
1583
+ color: #999999;
1584
+ }
1585
+
1586
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-name {
1587
+ font-size: 24px;
1588
+ font-weight: bold;
1589
+ margin-right: 30px;
1590
+ color: #555555;
1591
+ line-height: 1.7em;
1592
+ }
1593
+
1594
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-clear {
1595
+ clear: both;
1596
+ }
1597
+
1598
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-meta span {
1599
+ margin: 0 5px;
1600
+ font-size: 14px;
1601
+ display: inline-block;
1602
+ line-height: .1;
1603
+ }
1604
+
1605
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-meta span:first-child {
1606
+ margin: 0 5px 0 0;
1607
+ }
1608
+
1609
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-meta-text {
1610
+ margin: 5px 0 0 0;
1611
+ line-height: 1.4em;
1612
+ font-size: 13px;
1613
+ }
1614
+
1615
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav {
1616
+ padding: 10px;
1617
+ background: #444;
1618
+ text-align: center;
1619
+ }
1620
+
1621
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item a {
1622
+ color: #fff;
1623
+ font-size: 14px;
1624
+ font-weight: 600;
1625
+ padding: 6px 10px 6px 28px;
1626
+ display: block;
1627
+ float: left;
1628
+ border-radius: 4px;
1629
+ margin-left: 5px;
1630
+ position: relative;
1631
+ border-bottom: 0;
1632
+ text-decoration: none !important;
1633
+ }
1634
+
1635
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item a:hover {
1636
+ background: #555;
1637
+ }
1638
+
1639
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item .ppress-material-icons {
1640
+ font-size: 18px;
1641
+ height: 18px;
1642
+ line-height: 1.5;
1643
+ position: absolute;
1644
+ display: block;
1645
+ left: 10px;
1646
+ }
1647
+
1648
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item span.ppress-dpf-nav-title {
1649
+ padding-left: 5px;
1650
+ }
1651
+
1652
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item.ppress-dpf-active a {
1653
+ background: #007bff;
1654
+ }
1655
+
1656
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-body {
1657
+ max-width: 600px;
1658
+ padding-top: 15px;
1659
+ padding-bottom: 15px;
1660
+ margin: auto;
1661
+ }
1662
+
1663
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note,
1664
+ .pp-form-wrapper.ppress-default-profile .pp-user-comment-no-item {
1665
+ text-align: center;
1666
+ padding-top: 20px;
1667
+ color: #666;
1668
+ }
1669
+
1670
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note .ppress-material-icons {
1671
+ display: inline-block;
1672
+ font-size: 70px;
1673
+ height: 70px;
1674
+ line-height: 70px;
1675
+ }
1676
+
1677
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note span,
1678
+ .pp-form-wrapper.ppress-default-profile .pp-user-comment-no-item span {
1679
+ margin-top: 10px;
1680
+ display: block;
1681
+ font-size: 16px;
1682
+ color: #888;
1683
+ }
1684
+
1685
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note a {
1686
+ border: none !important;
1687
+ }
1688
+
1689
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-body-items {
1690
+ margin: 0 0 30px 0;
1691
+ }
1692
+
1693
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-body-item {
1694
+ position: relative;
1695
+ padding: 15px 0 0 0;
1696
+ }
1697
+
1698
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-item-label {
1699
+ display: block;
1700
+ margin: 0 0 8px 0;
1701
+ border-bottom: solid 2px #eee;
1702
+ padding-bottom: 4px;
1703
+ font-size: 15px;
1704
+ line-height: 22px;
1705
+ font-weight: bold;
1706
+ }
1707
+
1708
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-field-label-icon {
1709
+ float: left;
1710
+ margin: 0 8px 0 0;
1711
+ height: 22px;
1712
+ line-height: 18px;
1713
+ display: inline-block;
1714
+ width: 24px;
1715
+ text-align: center;
1716
+ }
1717
+
1718
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-field-label-icon i {
1719
+ font-size: 22px;
1720
+ position: relative;
1721
+ top: 1px;
1722
+ }
1723
+
1724
+ /* Cover image disabled START*/
1725
+ .pp-form-wrapper.ppress-default-profile .ppdf-nocover .ppress-dpf-profile-photo {
1726
+ float: none;
1727
+ margin: 0 auto;
1728
+ text-align: center;
1729
+ position: relative;
1730
+ }
1731
+
1732
+ .pp-form-wrapper.ppress-default-profile .ppdf-nocover .ppress-dpf-profile-meta {
1733
+ padding-left: 0 !important;
1734
+ padding-right: 0 !important;
1735
+ text-align: center !important;
1736
+ }
1737
+
1738
+ /* Cover image disabled END*/
1739
+ /********************************************/
1740
+ /** 340px and below */
1741
+ .ppress-default-profile.ppressui340 .ppress-dpf-profile-nav {
1742
+ padding: 0;
1743
+ }
1744
+
1745
+ .ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item a {
1746
+ padding: 10px 16px;
1747
+ margin-left: 0;
1748
+ border-radius: 0;
1749
+ }
1750
+
1751
+ .ppress-dpf-profile-nav-item.ppressui340 .ppress-dpf-profile-body {
1752
+ padding-left: 0;
1753
+ padding-right: 0;
1754
+ }
1755
+
1756
+ .ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo {
1757
+ position: static;
1758
+ top: auto;
1759
+ left: auto;
1760
+ }
1761
+
1762
+ .ppress-default-profile.ppressui340 .ppress-dpf-header .ppress-dpf-profile-meta {
1763
+ text-align: center;
1764
+ padding: 0;
1765
+ margin-top: -30px;
1766
+ }
1767
+
1768
+ .ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-meta {
1769
+ padding-top: 0;
1770
+ }
1771
+
1772
+ .ppress-default-profile.ppressui340 .ppress-dpf-header .ppress-dpf-name {
1773
+ float: none;
1774
+ margin-right: 0;
1775
+ font-size: 18px;
1776
+ }
1777
+
1778
+ .ppress-default-profile.ppressui340 .ppress-dpf-header .ppress-dpf-meta-text {
1779
+ padding: 0 20px;
1780
+ }
1781
+
1782
+ .ppress-default-profile.ppressui340 .ppress-dpf-profile-photo {
1783
+ position: relative;
1784
+ width: 100px;
1785
+ height: 100px;
1786
+ margin: 0 auto;
1787
+ float: none;
1788
+ left: auto;
1789
+ text-align: center;
1790
+ top: -40px;
1791
+ }
1792
+
1793
+ .ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo {
1794
+ width: 120px;
1795
+ height: 120px;
1796
+ }
1797
+
1798
+ .ppress-default-profile.ppressui340 .ppress-dpf-nav-title {
1799
+ font-size: 12px;
1800
+ }
1801
+
1802
+ .ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item .ppress-material-icons {
1803
+ display: block;
1804
+ position: static;
1805
+ top: auto;
1806
+ left: auto;
1807
+ font-size: 20px;
1808
+ height: 20px;
1809
+ line-height: 20px;
1810
+ }
1811
+
1812
+ .ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-meta {
1813
+ margin-top: 0;
1814
+ }
1815
+
1816
+ /** 500px and below **/
1817
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-nav {
1818
+ padding: 0;
1819
+ }
1820
+
1821
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item a {
1822
+ padding: 10px 16px;
1823
+ margin-left: 0;
1824
+ border-radius: 0;
1825
+ }
1826
+
1827
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item i {
1828
+ display: block;
1829
+ position: static;
1830
+ top: auto;
1831
+ left: auto;
1832
+ font-size: 22px;
1833
+ height: 22px;
1834
+ line-height: 22px;
1835
+ }
1836
+
1837
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-body {
1838
+ padding-left: 0;
1839
+ padding-right: 0;
1840
+ }
1841
+
1842
+ .ppress-default-profile.ppressui500.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo {
1843
+ position: static;
1844
+ top: auto;
1845
+ left: auto;
1846
+ }
1847
+
1848
+ .ppress-default-profile.ppressui500.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo {
1849
+ width: 120px;
1850
+ height: 120px;
1851
+ }
1852
+
1853
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-photo {
1854
+ position: relative;
1855
+ width: 100px;
1856
+ height: 100px;
1857
+ margin: 0 auto;
1858
+ float: none;
1859
+ display: block;
1860
+ top: -40px;
1861
+ left: 0;
1862
+ }
1863
+
1864
+ .ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-profile-meta {
1865
+ text-align: center;
1866
+ padding: 0;
1867
+ margin-top: -30px;
1868
+ }
1869
+
1870
+ .ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-name {
1871
+ float: none;
1872
+ margin-right: 0;
1873
+ font-size: 21px;
1874
+ }
1875
+
1876
+ .ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-meta-text {
1877
+ padding-top: 10px;
1878
+ }
1879
+
1880
+ .ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-meta {
1881
+ padding: 0 20px;
1882
+ display: block;
1883
+ }
1884
+
1885
+ .ppress-default-profile.ppressui500 .ppress-dpf-nav-title {
1886
+ font-size: 12px;
1887
+ }
1888
+
1889
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item .ppress-material-icons {
1890
+ display: block;
1891
+ position: static;
1892
+ top: auto;
1893
+ left: auto;
1894
+ font-size: 20px;
1895
+ height: 20px;
1896
+ line-height: 20px;
1897
+ }
1898
+
1899
+ .ppress-default-profile.ppressui500.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-meta {
1900
+ margin-top: 0;
1901
+ }
1902
+
1903
+ /** 800px and below **/
1904
+ .ppress-default-profile.ppressui800 .ppress-dpf-profile-nav {
1905
+ padding: 0;
1906
+ }
1907
+
1908
+ .ppress-default-profile.ppressui800 .ppress-dpf-profile-nav-item a {
1909
+ padding: 10px 20px;
1910
+ margin-left: 0;
1911
+ border-radius: 0;
1912
+ }
1913
+
1914
+ .ppress-default-profile.ppressui800 .ppress-dpf-profile-photo {
1915
+ width: 150px;
1916
+ }
1917
+
1918
+ .ppress-default-profile.ppressui800 .ppress-dpf-profile-photo {
1919
+ width: 140px;
1920
+ height: 140px;
1921
+ top: -70px;
1922
+ }
1923
+
1924
+ .ppress-default-profile.ppressui800.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo {
1925
+ top: auto;
1926
+ }
1927
+
1928
+ .ppress-default-profile.ppressui800 .ppress-dpf-header .ppress-dpf-profile-meta {
1929
+ padding-left: 200px;
1930
+ }
1931
+
1932
+ .ppress-default-profile.ppressui800 .ppress-dpf-header .ppress-dpf-meta-text {
1933
+ padding-top: 10px;
1934
+ }
1935
+
1936
+ .ppress-default-profile.ppressui800 .ppress-dpf-nav-title {
1937
+ font-size: 12px;
1938
+ }
1939
+
1940
+ .ppress-default-profile.ppressui800 .ppress-dpf-profile-nav-item .ppress-material-icons {
1941
+ display: block;
1942
+ position: static;
1943
+ top: auto;
1944
+ left: auto;
1945
+ font-size: 20px;
1946
+ height: 20px;
1947
+ line-height: 20px;
1948
+ }
1949
+
1950
+ /** 960px and below **/
1951
+ .ppress-default-profile.ppressui960 .ppress-dpf-profile-photo {
1952
+ width: 200px;
1953
+ }
1954
+
1955
+ .ppress-default-profile.ppressui960 .ppress-dpf-profile-photo {
1956
+ width: 140px;
1957
+ height: 140px;
1958
+ top: -70px;
1959
+ }
1960
+
1961
+ .ppress-default-profile.ppressui960.ppdf-nocover .ppress-dpf-profile-meta {
1962
+ margin-top: -50px;
1963
+ }
1964
+
1965
+ /*****************************************/
1966
+
1967
+ .ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item a,
1968
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item a {
1969
+ padding: 5px 11px;
1970
+ font-size: 12px;
1971
+ }
1972
+
1973
+ .ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item .ppress-material-icons,
1974
+ .ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item .ppress-material-icons {
1975
+ font-size: 14px;
1976
+ }
1977
+
1978
+ .ppress-default-profile.ppressui340 span.ppress-dpf-nav-title,
1979
+ .ppress-default-profile.ppressui500 span.ppress-dpf-nav-title {
1980
+ font-size: 10px;
1981
+ }
1982
+
1983
+ /***************** Post list CSS **************/
1984
+ .pp-form-wrapper.ppress-default-profile ul.pp-user-post-list {
1985
+ list-style: none;
1986
+ margin: 0;
1987
+ padding: 0;
1988
+ }
1989
+
1990
+ .pp-form-wrapper.ppress-default-profile li.pp-user-post-item {
1991
+ padding: 20px 0;
1992
+ border-bottom: 1px solid #eee;
1993
+ }
1994
+
1995
+ .pp-form-wrapper.ppress-default-profile .pp-user-post-item a,
1996
+ .pp-form-wrapper.ppress-default-profile .pp-user-post-item h3 {
1997
+ font-size: 16px;
1998
+ font-weight: normal;
1999
+ margin: 0;
2000
+ text-decoration: none;
2001
+ }
2002
+
2003
+ .pp-form-wrapper.ppress-default-profile .pp-user-post-item h3.pp-post-item-head {
2004
+ line-height: 20px;
2005
+ }
2006
+
2007
+ .pp-form-wrapper.ppress-default-profile .ppress-dpf-more-post-wrap {
2008
+ text-align: center;
2009
+ padding-top: 30px;
2010
+ }
2011
+
2012
+ .pp-form-wrapper.ppress-default-profile a.ppress-dpf-more-post-btn {
2013
+ font-size: 15px;
2014
+ border: none;
2015
+ display: block;
2016
+ width: 100%;
2017
+ line-height: 1em;
2018
+ padding: 15px;
2019
+ text-decoration: none;
2020
+ text-align: center;
2021
+ text-transform: none;
2022
+ font-weight: normal;
2023
+ transition: 0.25s;
2024
+ border-radius: 4px;
2025
+ -webkit-box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
2026
+ box-shadow: 0 4px 6px rgba(50, 50, 93, .11), 0 1px 3px rgba(0, 0, 0, .08);
2027
+ max-width: 250px;
2028
+ margin: 0 auto;
2029
+ color: #ffffff;
2030
+ background: #007bff;
2031
+ }
2032
+
2033
+ /************* Comment list CSS **************/
2034
+ .pp-form-wrapper.ppress-default-profile .pp-user-comment-item {
2035
+ padding: 20px 0;
2036
+ border-bottom: 1px solid #eee;
2037
+ }
2038
+
2039
+ .pp-form-wrapper.ppress-default-profile .pp-user-comment-item-link a {
2040
+ color: inherit;
2041
+ }
2042
+
2043
+ .pp-form-wrapper.ppress-default-profile .pp-user-comment-no-item + .ppress-dpf-more-post-wrap {
2044
+ display: none;
2045
+ }
2046
+
2047
+ /********************************************* END default profile template css ------------------------------------ */
2048
+
2049
+ /*********************************** BEGIN member directory search and filter CSS ------------------------------------ */
2050
+
2051
+
2052
+ .pp-member-directory .ppressmd-member-directory-header.ppressmd-form {
2053
+ display: flex;
2054
+ flex-direction: column;
2055
+ justify-content: flex-start;
2056
+ align-items: stretch;
2057
+ flex-wrap: nowrap;
2058
+ width: 100%;
2059
+ }
2060
+
2061
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row:not(.ppressmd-member-directory-filters-bar) {
2062
+ display: flex;
2063
+ flex-direction: row;
2064
+ justify-content: flex-start;
2065
+ align-items: baseline;
2066
+ flex-wrap: nowrap;
2067
+ margin: 0 0 10px 0;
2068
+ }
2069
+
2070
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row.ppressmd-member-directory-search-row {
2071
+ justify-content: flex-end;
2072
+ }
2073
+
2074
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line {
2075
+ display: flex;
2076
+ flex-direction: row;
2077
+ justify-content: flex-start;
2078
+ align-items: center;
2079
+ flex-wrap: nowrap;
2080
+ width: 60%;
2081
+ }
2082
+
2083
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label {
2084
+ flex: 1;
2085
+ margin: 0 10px 0 0;
2086
+ min-width: 90px;
2087
+ max-width: 85%;
2088
+ }
2089
+
2090
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label .ppressmd-search-line {
2091
+ -webkit-appearance: textfield;
2092
+ width: 100%;
2093
+ padding: 0 12px !important;
2094
+ display: block !important;
2095
+ -moz-border-radius: 2px;
2096
+ -webkit-border-radius: 2px;
2097
+ border-radius: 2px;
2098
+ outline: none !important;
2099
+ cursor: text !important;
2100
+ font-size: 15px !important;
2101
+ height: 40px !important;
2102
+ box-sizing: border-box !important;
2103
+ box-shadow: none !important;
2104
+ margin: 0 !important;
2105
+ position: static;
2106
+ background-color: #ffffff;
2107
+ }
2108
+
2109
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line .ppressmd-do-search {
2110
+ min-width: 15%;
2111
+ width: auto;
2112
+ }
2113
+
2114
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line {
2115
+ display: flex;
2116
+ flex-direction: row;
2117
+ justify-content: space-between;
2118
+ align-items: center;
2119
+ flex-wrap: nowrap;
2120
+ width: 100%;
2121
+ }
2122
+
2123
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-sorting {
2124
+ display: flex;
2125
+ flex-direction: row;
2126
+ justify-content: flex-start;
2127
+ align-items: baseline;
2128
+ flex-wrap: nowrap;
2129
+ flex: 5;
2130
+ }
2131
+
2132
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-sorting .ppressmd-member-directory-sorting-a {
2133
+ display: flex;
2134
+ flex-direction: row;
2135
+ justify-content: flex-start;
2136
+ align-items: baseline;
2137
+ flex-wrap: nowrap;
2138
+ position: relative;
2139
+ cursor: pointer;
2140
+ }
2141
+
2142
+ .pp-member-directory .ppressmd-member-directory-header a {
2143
+ text-decoration: none;
2144
+ border-bottom: none;
2145
+ box-shadow: none;
2146
+ }
2147
+
2148
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppress-material-icons {
2149
+ display: inline;
2150
+ vertical-align: middle;
2151
+ }
2152
+
2153
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters {
2154
+ display: flex;
2155
+ flex-direction: row;
2156
+ justify-content: flex-end;
2157
+ align-items: baseline;
2158
+ flex-wrap: nowrap;
2159
+ flex: 2;
2160
+ text-align: right;
2161
+ }
2162
+
2163
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a {
2164
+ display: flex;
2165
+ flex-direction: row;
2166
+ justify-content: flex-start;
2167
+ align-items: baseline;
2168
+ flex-wrap: nowrap;
2169
+ cursor: pointer;
2170
+ }
2171
+
2172
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a a {
2173
+ margin: 0 5px 0 0;
2174
+ }
2175
+
2176
+ .ppressmd-member-directory-header:not(.ppmd-filters-expand) .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a .ppress-up {
2177
+ display: none;
2178
+ }
2179
+
2180
+ .ppressmd-member-directory-header.ppmd-filters-expand .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a .ppress-down {
2181
+ display: none;
2182
+ }
2183
+
2184
+ .ppressmd-new-dropdown {
2185
+ font-size: 16px;
2186
+ margin: 0;
2187
+ position: absolute;
2188
+ height: auto;
2189
+ background: #fff;
2190
+ z-index: 10;
2191
+ display: none;
2192
+ border: 1px solid #ddd;
2193
+ box-shadow: 0 7px 14px 0 rgba(50, 50, 93, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
2194
+ -webkit-box-shadow: 0 7px 14px 0 rgba(50, 50, 93, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
2195
+ box-sizing: border-box;
2196
+ -moz-box-sizing: border-box;
2197
+ -webkit-box-sizing: border-box;
2198
+ border-radius: 5px 5px 5px 5px;
2199
+ -moz-border-radius: 5px 5px 5px 5px;
2200
+ -webkit-border-radius: 5px 5px 5px 5px;
2201
+ }
2202
+
2203
+ .ppressmd-new-dropdown ul {
2204
+ margin: 0;
2205
+ padding: 0;
2206
+ }
2207
+
2208
+ .ppressmd-new-dropdown ul li {
2209
+ list-style-type: none;
2210
+ padding: 0;
2211
+ margin: 0;
2212
+ }
2213
+
2214
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-sorting .ppressmd-member-directory-sorting-a .ppressmd-new-dropdown {
2215
+ top: 24px;
2216
+ width: 200px;
2217
+ left: -12px;
2218
+ }
2219
+
2220
+ .ppressmd-new-dropdown ul li a {
2221
+ display: block;
2222
+ padding: 8px 12px;
2223
+ line-height: 1;
2224
+ }
2225
+
2226
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row.ppressmd-member-directory-filters-bar {
2227
+ padding: 0 0 10px 0;
2228
+ }
2229
+
2230
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row.ppressmd-header-row-invisible {
2231
+ margin: 0;
2232
+ }
2233
+
2234
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search.ppressmd-search-invisible {
2235
+ display: none;
2236
+ }
2237
+
2238
+ .ppressmd-member-directory-header.ppmd-filters-expand .ppressmd-member-directory-header-row .ppressmd-search.ppressmd-search-invisible {
2239
+ display: grid;
2240
+ }
2241
+
2242
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search {
2243
+ margin: 0;
2244
+ width: 100%;
2245
+ display: grid;
2246
+ grid-template-rows: auto 1fr;
2247
+ grid-template-columns: repeat(3, 1fr);
2248
+ grid-gap: 10px;
2249
+ grid-auto-rows: minmax(max-content, auto);
2250
+ -ms-grid-template-rows: auto 1fr;
2251
+ -ms-grid-template-columns: repeat(3, 1fr);
2252
+ -ms-grid-gap: 10px;
2253
+ -ms-grid-auto-rows: minmax(max-content, auto);
2254
+ align-items: center;
2255
+ }
2256
+
2257
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter {
2258
+ display: flex;
2259
+ flex-direction: row;
2260
+ justify-content: flex-start;
2261
+ align-items: baseline;
2262
+ flex-wrap: nowrap;
2263
+ width: 100%;
2264
+ }
2265
+
2266
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter {
2267
+ display: flex;
2268
+ flex-direction: row;
2269
+ justify-content: flex-start;
2270
+ align-items: baseline;
2271
+ flex-wrap: nowrap;
2272
+ width: 100%;
2273
+ }
2274
+
2275
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter.ppressmd-text-filter-type input {
2276
+ width: 100%;
2277
+ padding: 10px 30px;
2278
+ }
2279
+
2280
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label .ppressmd-search-line,
2281
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter.ppressmd-text-filter-type input:not(.select2-search__field),
2282
+ .pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection {
2283
+ background-color: transparent;
2284
+ border: 1px solid #dddddd !important;
2285
+ }
2286
+
2287
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter.ppressmd-text-filter-type input,
2288
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label .ppressmd-search-line,
2289
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppress-material-icons,
2290
+ .pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection__rendered {
2291
+ color: #666666;
2292
+ background-color: transparent;
2293
+ }
2294
+
2295
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row input[type=search]:focus {
2296
+ border: 1px solid #bbb !important;
2297
+ }
2298
+
2299
+ .pp-member-directory .ppressmd-member-directory-header .ppressmd-button {
2300
+ border: none !important;
2301
+ display: block;
2302
+ width: 100%;
2303
+ line-height: 1em !important;
2304
+ padding: 16px 20px !important;
2305
+ text-decoration: none !important;
2306
+ text-align: center;
2307
+ text-transform: none !important;
2308
+ font-weight: normal !important;
2309
+ overflow: hidden;
2310
+ position: relative;
2311
+ transition: 0.25s;
2312
+ box-sizing: border-box;
2313
+ -moz-border-radius: 4px !important;
2314
+ -webkit-border-radius: 4px !important;
2315
+ border-radius: 4px !important;
2316
+ box-shadow: none;
2317
+
2318
+ vertical-align: middle !important;
2319
+ height: auto !important;
2320
+ cursor: pointer !important;
2321
+ text-shadow: none;
2322
+ font-family: inherit;
2323
+ outline: none !important;
2324
+ margin: 0;
2325
+ -webkit-appearance: none;
2326
+ }
2327
+
2328
+ .pp-member-directory .ppressmd-members-total-wrap {
2329
+ text-align: center;
2330
+ margin: 0 0 10px 0;
2331
+ }
2332
+
2333
+ .pp-member-directory .ppressmd-members-total {
2334
+ font-size: 20px;
2335
+ font-weight: 300;
2336
+ }
2337
+
2338
+ /* Customize Select2 CSS */
2339
+
2340
+ .pp-member-directory .ppressmd-member-directory-header .select2.select2-container {
2341
+ width: 100% !important;
2342
+ }
2343
+
2344
+ .pp-member-directory .ppressmd-member-directory-header .select2-search.select2-search--inline .select2-search__field {
2345
+ width: auto !important;
2346
+ }
2347
+
2348
+ .pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection {
2349
+ display: block !important;
2350
+ height: 40px;
2351
+ padding: 0 0 0 12px !important;
2352
+ overflow: hidden !important;
2353
+ position: relative !important;
2354
+ white-space: nowrap !important;
2355
+ line-height: 35px !important;
2356
+ font-size: 15px !important;
2357
+ text-align: left !important;
2358
+ text-decoration: none !important;
2359
+ -moz-border-radius: 2px !important;
2360
+ -webkit-border-radius: 2px !important;
2361
+ border-radius: 2px !important;
2362
+ background-clip: padding-box !important;
2363
+ -webkit-touch-callout: none;
2364
+ -webkit-user-select: none;
2365
+ -moz-user-select: none;
2366
+ -ms-user-select: none;
2367
+ user-select: none;
2368
+ background: none !important;
2369
+ }
2370
+
2371
+ .pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection .select2-selection__arrow {
2372
+ display: inline-block !important;
2373
+ width: 34px !important;
2374
+ height: 100% !important;
2375
+ position: absolute !important;
2376
+ right: 0 !important;
2377
+ top: 0 !important;
2378
+ -moz-border-radius: 0 2px 2px 0 !important;
2379
+ -webkit-border-radius: 0 2px 2px 0 !important;
2380
+ border-radius: 0 2px 2px 0 !important;
2381
+ background-clip: padding-box !important;
2382
+ text-align: center !important;
2383
+ background: transparent !important;
2384
+ border-left: 0 !important;
2385
+ }
2386
+
2387
+ .pp-member-directory .ppressmd-member-directory-header .select2-container.select2-container--open .select2-dropdown {
2388
+ border: 1px solid #ddd;
2389
+ border-top: 0;
2390
+ border-radius: 0;
2391
+ }
2392
+
2393
+ .pp-member-directory .ppressmd-member-directory-header .select2-container.select2-container--open .select2-dropdown .select2-results li {
2394
+ list-style: none;
2395
+ display: list-item;
2396
+ background-image: none;
2397
+ font-size: 15px;
2398
+ margin: 5px !important;
2399
+ color: #666 !important;
2400
+ padding: 3px 7px 4px !important;
2401
+ cursor: pointer;
2402
+ min-height: 1em !important;
2403
+ }
2404
+
2405
+ .pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection.select2-selection--multiple {
2406
+ height: auto !important;
2407
+ line-height: 0.8 !important;
2408
+ }
2409
+
2410
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__rendered {
2411
+ padding-left: 0 !important;
2412
+ line-height: 37px;
2413
+ }
2414
+
2415
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__rendered {
2416
+ line-height: 37px;
2417
+ box-sizing: border-box;
2418
+ list-style: none;
2419
+ margin: 0;
2420
+ padding-left: 0 !important;
2421
+ padding-right: 30px;
2422
+ width: 100%;
2423
+ font-size: 13px;
2424
+ }
2425
+
2426
+ .pp-member-directory .ppressmd-member-directory-header .select2-results li.select2-results__option.select2-results__option--highlighted {
2427
+ background: none !important;
2428
+ background: #f4f4f4 !important;
2429
+ color: #666 !important;
2430
+ }
2431
+
2432
+
2433
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__clear,
2434
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__clear {
2435
+ right: 10px;
2436
+ font-size: 30px;
2437
+ margin: 0 !important;
2438
+ }
2439
+
2440
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__clear,
2441
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__clear,
2442
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__arrow b {
2443
+ color: #888 !important;
2444
+ }
2445
+
2446
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__clear {
2447
+ position: absolute;
2448
+ }
2449
+
2450
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__choice {
2451
+ padding: 3px 3px 3px 5px;
2452
+ }
2453
+
2454
+ .pp-member-directory .ppressmd-member-directory-header .select2-container .select2-search.select2-search--inline > input {
2455
+ border: none !important;
2456
+ padding: 0 !important;
2457
+ border-radius: 0 !important;
2458
+ }
2459
+
2460
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
2461
+ overflow-x: hidden;
2462
+ text-overflow: ellipsis;
2463
+ max-width: 100%;
2464
+ box-sizing: border-box;
2465
+ }
2466
+
2467
+ .pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__clear {
2468
+ font-size: 20px !important;
2469
+ }
2470
+
2471
+ .pp-member-directory .ppmd-pagination-wrap {
2472
+ font-size: 16px;
2473
+ width: 100%;
2474
+ margin: 0 auto 10px;
2475
+ padding: 0;
2476
+ text-align: center;
2477
+ }
2478
+
2479
+ .pp-member-directory .ppmd-pagination-wrap .page-numbers {
2480
+ display: inline-block;
2481
+ width: auto;
2482
+ height: 34px;
2483
+ line-height: 34px;
2484
+ transition: all .2s linear;
2485
+ padding: 0 14px;
2486
+ color: #666666;
2487
+ font-weight: normal;
2488
+ }
2489
+
2490
+ .pp-member-directory .ppmd-pagination-wrap .page-numbers.current {
2491
+ background: #007bff;
2492
+ color: #ffffff;
2493
+ }
2494
+
2495
+ .pp-member-directory .ppmd-pagination-wrap .page-numbers .ppress-material-icons {
2496
+ vertical-align: middle;
2497
+ }
2498
+
2499
+ /*********************************** END member directory search and filter CSS ------------------------------------ */
assets/css/frontend.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;transition:.3s ease;transition-delay:0s}[class*=hint--]:before{content:'';background:0 0;border:6px solid transparent;z-index:1000001}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;transition-delay:.1s}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:12px;white-space:nowrap;text-shadow:0 -1px 0 #000;box-shadow:4px 4px 8px rgba(0,0,0,.3)}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label='']:after,[aria-label='']:before,[data-hint='']:after,[data-hint='']:before{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#383838}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#383838}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top:after{-webkit-transform:translateX(-50%);transform:translateX(-50%)}.hint--top:hover:before{-webkit-transform:translateY(-8px);transform:translateY(-8px)}.hint--top:hover:after{-webkit-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom:after{-webkit-transform:translateX(-50%);transform:translateX(-50%)}.hint--bottom:hover:before{-webkit-transform:translateY(8px);transform:translateY(8px)}.hint--bottom:hover:after{-webkit-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--right:before{border-right-color:#383838;margin-left:-11px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:after,.hint--right:hover:before{-webkit-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{border-left-color:#383838;margin-right:-11px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:after,.hint--left:hover:before{-webkit-transform:translateX(-8px);transform:translateX(-8px)}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-left:after{-webkit-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{-webkit-transform:translateY(-8px);transform:translateY(-8px)}.hint--top-left:hover:after{-webkit-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-right:after{-webkit-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--top-right:hover:after,.hint--top-right:hover:before{-webkit-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-left:after{-webkit-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{-webkit-transform:translateY(8px);transform:translateY(8px)}.hint--bottom-left:hover:after{-webkit-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-right:after{-webkit-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:after,.hint--bottom-right:hover:before{-webkit-transform:translateY(8px);transform:translateY(8px)}.hint--large:after,.hint--medium:after,.hint--small:after{white-space:normal;line-height:1.4em;word-wrap:break-word}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--error:after{background-color:#b34e4d;text-shadow:0 -1px 0 #592726}.hint--error.hint--top-left:before,.hint--error.hint--top-right:before,.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom-left:before,.hint--error.hint--bottom-right:before,.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{background-color:#c09854;text-shadow:0 -1px 0 #6c5328}.hint--warning.hint--top-left:before,.hint--warning.hint--top-right:before,.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom-left:before,.hint--warning.hint--bottom-right:before,.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{background-color:#3986ac;text-shadow:0 -1px 0 #1a3c4d}.hint--info.hint--top-left:before,.hint--info.hint--top-right:before,.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom-left:before,.hint--info.hint--bottom-right:before,.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{background-color:#458746;text-shadow:0 -1px 0 #1a321a}.hint--success.hint--top-left:before,.hint--success.hint--top-right:before,.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom-left:before,.hint--success.hint--bottom-right:before,.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{-webkit-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top:after{-webkit-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{-webkit-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top-left:after{-webkit-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:after,.hint--always.hint--top-right:before{-webkit-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom:after{-webkit-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{-webkit-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom-left:after{-webkit-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:after,.hint--always.hint--bottom-right:before{-webkit-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);transform:translateX(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:after,.hint--no-animate:before{transition-duration:0s}.hint--bounce:after,.hint--bounce:before{transition:opacity .3s ease,visibility .3s ease,-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24),-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24)}.hint--no-shadow:after,.hint--no-shadow:before{text-shadow:initial;box-shadow:initial}@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:url(./material-icons/MaterialIcons-Regular.eot);src:local('Material Icons'),local('MaterialIcons-Regular'),url(./material-icons/MaterialIcons-Regular.woff2) format('woff2'),url(./material-icons/MaterialIcons-Regular.woff) format('woff'),url(./material-icons/MaterialIcons-Regular.ttf) format('truetype')}#profilepress-myaccount-wrapper .ppmyac-icons,.pp-form-field-wrap .pp-form-material-icons,.ppress-material-icons{font-family:'Material Icons'!important;font-weight:400;font-style:normal;font-size:20px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga'}.pp-tab-widget-avatar img{display:block;border-radius:50%;height:190px;margin:0 auto 10px!important;padding:2px;text-align:center;width:190px;float:none!important}.pp-user-panel{border-radius:6px;text-align:center}.pp-user-panel-title{font-size:20px;margin:0}.pp-user-panel p{font-size:15px;margin-bottom:23px}.pp-tabbed-btn{border:0;font-size:15px;font-weight:400;line-height:1.4;border-radius:4px;padding:10px 15px;-webkit-font-smoothing:subpixel-antialiased;transition:border .25s linear,color .25s linear,background-color .25s linear}.pp-tabbed-btn-inverse{color:#fff!important;background-color:#34495e}.pp-password-reset-handler-wrap .pp-reset-password-form{padding:40px;max-width:500px;margin-top:5px;margin-bottom:5px}.pp-password-reset-handler-wrap .pp-reset-password-form h3{color:#444;font-weight:300;margin:0 auto 40px}.pp-password-reset-handler-wrap .pp-reset-password-form label{color:#444;font-size:15px}.pp-password-reset-handler-wrap .pp-reset-password-form label .req{margin:2px;color:red}.pp-password-reset-handler-wrap .pp-reset-password-form label.active .req{opacity:0}.pp-password-reset-handler-wrap .pp-reset-password-form input{font-size:22px;display:block;width:100%;box-sizing:border-box;height:auto;padding:5px 10px;background:0 0;margin-bottom:40px;border:1px solid #a0b3b0;border-radius:0;transition:border-color .25s ease,box-shadow .25s ease}.pp-password-reset-handler-wrap .pp-reset-password-form input:focus{outline:0;border-color:#1ab188}.pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button{border:0;outline:0;border-radius:0;padding:15px 0;font-size:20px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;background:#1ab188;color:#fff;transition:all .5s ease;-webkit-appearance:none;text-shadow:none;box-shadow:none}.pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button:focus,.pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button:hover{background:#179b77}.pp-password-reset-handler-wrap .pp-reset-password-form .pp-reset-button-block{display:block;width:100%}.pp-password-reset-handler-wrap .profilepress-reset-status{margin-left:40px;max-width:420px}#pp-pass-strength-result{background-color:#eee;border:1px solid #ddd;color:#23282d;padding:3px 5px;text-align:center;width:100%;box-sizing:border-box}#pp-pass-strength-result.short{background-color:#f1adad;border-color:#e35b5b;opacity:1}#pp-pass-strength-result.bad{background-color:#fbc5a9;border-color:#f78b53;opacity:1}#pp-pass-strength-result.good{background-color:#ffe399;border-color:#ffc733;opacity:1}#pp-pass-strength-result.strong{background-color:#c1e1b9;border-color:#83c373;opacity:1}.pp-form-wrapper .pp-form-label-wrap .pp-form-required-label{color:red;font-weight:400}.pp-form-wrapper input[type=checkbox],.pp-form-wrapper input[type=radio]{cursor:pointer}.pp-form-wrapper p{margin:0 0 5px!important;padding:0!important}.pp-form-wrapper input[type=datetime],.pp-form-wrapper input[type=email],.pp-form-wrapper input[type=number],.pp-form-wrapper input[type=password],.pp-form-wrapper input[type=search],.pp-form-wrapper input[type=tel],.pp-form-wrapper input[type=text],.pp-form-wrapper input[type=url],.pp-form-wrapper select,.pp-form-wrapper textarea{-webkit-appearance:none;width:100%;background:#fff;border:1px solid #dedee5;padding:13px 15px;outline:0;line-height:1}.pp-form-wrapper select{background-image:url(../images/frontend/arrow-down.png)!important;background-position:right 20px center!important;background-repeat:no-repeat!important;background-size:10px auto!important;-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.pp-form-wrapper .pp-form-label-wrap{margin:0 0 4px;padding:0}.pp-form-wrapper .pp-form-label{font-size:14px;text-transform:none;text-align:left;font-weight:400;font-style:normal;float:none;line-height:1.3;margin:0;padding:0;width:auto;display:inline;cursor:pointer}.pp-form-wrapper .pp-checkbox-wrap,.pp-form-wrapper .pp-radio-wrap{display:block;text-align:left;line-height:normal;margin:5px 0;padding:0}.pp-form-wrapper .pp-checkbox-wrap label,.pp-form-wrapper .pp-radio-wrap label{margin-left:5px}.pp-form-wrapper input[type=checkbox],.pp-form-wrapper input[type=radio]{border:1px solid #ccc;background-color:#fff;width:14px!important;height:14px!important;display:inline-block;vertical-align:baseline}.pp-form-wrapper .ppress-pf-profile-connect{padding:5px 0 10px}.pp-form-wrapper a.ppress-pf-social-icon{width:100%;height:100%;display:inline}.pp-form-wrapper .ppress-pf-social-icon svg{vertical-align:middle;width:40px;height:40px}.pp-form-wrapper .ppress-pf-social-icon.dpf-github svg,.pp-form-wrapper .ppress-pf-social-icon.dpf-instagram svg{padding:3px}a.pp-button-social-login:focus{outline-color:transparent}a.pp-button-social-login:focus .ppsc,a.pp-button-social-login:hover .ppsc{background-color:rgba(255,255,255,.75)}a.pp-button-social-login:visited{color:#fff}a.pp-button-social-login,a.pp-button-social-login .ppsc{display:inline-block;font-size:100%;height:2.5em;padding:0}a.pp-button-social-login{position:relative;vertical-align:middle;line-height:2.5em;font-family:inherit;font-weight:700;overflow:hidden;white-space:nowrap;border:1px solid #333;color:#fff!important;background:#333;margin:6px 0;border-radius:2px;box-sizing:content-box;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.1);text-decoration:none!important;min-width:220px}a.pp-button-social-login .ppsc{font-style:normal;font-weight:400;text-decoration:none;text-transform:none;vertical-align:top;text-align:center;width:2.5em;background-color:#fff;background-repeat:no-repeat;background-position:50%;background-size:1.8em 1.8em;border-top-left-radius:1px;border-bottom-left-radius:1px;-moz-font-smoothing:antialiased;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;position:absolute;left:0;margin:0}a.pp-button-social-login span.ppsc-text{margin-left:40px;padding:.5em;color:#fff!important}a.pp-button-social-login .ppsc-google{background-image:url(../images/social-login/google.svg)}a.pp-button-social-login.pp-button-social-login-google{background:#4285f4;border-color:#4285f4}a.pp-button-social-login.pp-button-social-login-facebook{background:#3b5998;border-color:#3b5998}a.pp-button-social-login.pp-button-social-login-twitter{background:#55acee;border-color:#55acee}a.pp-button-social-login.pp-button-social-login-linkedin{background:#0077b5;border-color:#0077b5}a.pp-button-social-login.pp-button-social-login-vk{background:#4a76a8;border-color:#4a76a8}a.pp-button-social-login.pp-button-social-login-github{background:#24292e;border-color:#24292e}a.pp-button-social-login .ppsc-vk{background-image:url(../images/social-login/vk-fa.svg)}a.pp-button-social-login .ppsc-facebook{background-image:url(../images/social-login/facebook.svg)}a.pp-button-social-login .ppsc-twitter{background-image:url(../images/social-login/twitter.svg)}a.pp-button-social-login .ppsc-linkedin{background-image:url(../images/social-login/linkedin.svg)}a.pp-button-social-login .ppsc-github{background-image:url(../images/social-login/github-fa.svg)}#profilepress-myaccount-wrapper,#profilepress-myaccount-wrapper *,#profilepress-myaccount-wrapper ::after,#profilepress-myaccount-wrapper ::before,.pp-form-container *,.pp-form-container .pp-form-wrapper,.pp-form-container .pp-form-wrapper *{box-sizing:border-box}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap span.select2-selection.select2-selection--multiple,html .pp-form-container .select2 input.select2-search__field{border:0!important}.pp-form-container form input[type=submit]{-webkit-appearance:none!important;cursor:pointer;text-shadow:none}.pp-form-container form{margin:0;padding:0;background-color:transparent}.woocommerce .woocommerce-MyAccount-content .pp-form-container{margin-right:0!important;margin-left:0!important}.pp-form-container form input,.pp-form-container form select,.pp-form-container form textarea{outline:0;background-image:none;height:auto;float:none;position:static;box-shadow:none;text-shadow:none;text-transform:none;text-decoration:none;resize:vertical}.pp-form-container form p{margin:0 0 .5em}.pp-form-container form input[type=submit]:focus{outline:0}.pp-form-container .pp-user-avatar{border-radius:50%!important;display:block!important;margin:0 auto 10px!important;text-align:center!important}.pp-form-container img.pp-user-cover-image{width:100%!important;height:auto!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=checkbox],#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio],.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox],.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]{border:1px solid #7e8993!important;border-radius:4px!important;background:#fff!important;color:#555!important;clear:none!important;cursor:pointer!important;display:inline-block!important;line-height:0!important;margin:0!important;outline:0!important;padding:0!important;text-align:center!important;vertical-align:middle!important;-webkit-appearance:none!important;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)!important;transition:.05s border-color ease-in-out!important;width:16px!important;height:16px!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio],.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox],.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]{border-radius:50%!important}.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox],.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]{border-radius:4px!important}.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]{border-radius:50%!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=checkbox]:checked::before,.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox]:checked::before{content:url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23000000%27%2F%3E%3C%2Fsvg%3E)!important;margin:-3px 0 0 -4px!important;width:20px!important;height:20px!important;position:static}#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio]:checked::before,.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]:checked::before{content:"";border-radius:50%!important;margin:3px!important;background-color:#000!important;line-height:1.14285714!important;width:8px!important;height:8px!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=checkbox]:checked::before,#profilepress-myaccount-wrapper .profilepress-myaccount-content input[type=radio]:checked::before,.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=checkbox]:checked::before,.pp-form-container .pp-form-wrapper .pp-form-field-wrap input[type=radio]:checked::before{float:left!important;display:inline-block!important;vertical-align:middle!important;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.pp-form-container .pp-form-wrapper.ppBuildScratch,.pp-form-container .pp-form-wrapper.ppBuildScratch *{font-family:'Merriweather',sans-serif}.pp-form-container .pp-form-wrapper.ppBuildScratch .ppbs-headline{font-weight:700;font-size:20px;margin-bottom:1em;margin-top:0;text-align:center;margin-right:6.387%}.pp-form-container .pp-form-wrapper.ppBuildScratch h1,.pp-form-container .pp-form-wrapper.ppBuildScratch h2,.pp-form-container .pp-form-wrapper.ppBuildScratch h3,.pp-form-container .pp-form-wrapper.ppBuildScratch h4{font-weight:700;font-size:20px;margin-bottom:1em;margin-top:1em}.pp-form-container .pp-form-wrapper.ppBuildScratch input:disabled{opacity:.5}.pp-form-container .pp-form-wrapper.ppBuildScratch{max-width:100%;width:100%;padding:6% 0 6% 6%;background:#fff;color:#222;font-size:14px;position:relative;box-shadow:0 0 0 .5px rgba(0,20,40,.1),0 2px 8px 0 rgba(50,55,90,.2);border-radius:3px;margin:0 auto}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppf-remove-frame{box-shadow:none;border-radius:0}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap{padding:0 6.387% 4% 0;display:inline-block;width:100%;vertical-align:top}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap{display:inline-block;width:100%;vertical-align:top;padding:0 6.387% 0 0}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .pp-form-label-wrap{margin:0 0 5px;padding:0}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-reveal .pp-form-field-description,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-reveal .pp-hint-tooltip,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-standard .pp-hint-tooltip,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-tooltip .pp-form-field-description{display:none}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-reveal .pp-form-field-input-textarea-wrap .pp-form-field:focus~.pp-form-field-description{display:block}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-tooltip .pp-hint-tooltip{display:inline;font-weight:400}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fda-tooltip .pp-hint-tooltip .pp-form-material-icons{position:relative;margin:0;padding:0;font-size:110%;display:inline;vertical-align:top}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fld-inside{position:relative}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fld-inside .pp-form-label-wrap{position:absolute;top:5px;left:15px;z-index:2}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap.fld-inside .pp-form-label-wrap{left:0!important}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fld-inside .pp-form-field-input-textarea-wrap .pp-form-field{padding-top:18px;padding-bottom:2px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap.fld-inside .pp-form-field-input-textarea-wrap .pp-form-field{padding-top:23px;padding-bottom:7px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap.fld-inside .pp-form-field-input-textarea-wrap .pp-form-field{padding-top:30px;padding-bottom:10px}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fw-half{width:50%}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap.fw-third{width:33.3333333333%}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap select,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap textarea{border:1px solid #dbdbdb;font-size:14px;padding:10px 15px;transition:all .35s;background:#fff;color:#69717a;width:100%;border-radius:0;line-height:1.3;min-height:40px;display:inline-block;margin:0}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap textarea{height:100px;overflow:auto}.pp-form-field-wrap .pp-form-material-icons{width:24px;height:24px;position:absolute;right:0;top:0;cursor:text;margin:8px 12px 0 0}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-right .pp-form-field-wrap.field-has-icon input,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-right .pp-form-field-wrap.field-has-icon textarea{padding-right:40px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-left .pp-form-field-wrap.field-has-icon input,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-left .pp-form-field-wrap.field-has-icon textarea{padding-left:40px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-left .pp-form-field-wrap.field-has-icon input,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-left .pp-form-field-wrap.field-has-icon textarea{padding-left:30px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-right .pp-form-field-wrap.field-has-icon input,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-right .pp-form-field-wrap.field-has-icon textarea{padding-right:30px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfia-left .pp-form-field-wrap .pp-form-material-icons{left:0;margin-left:12px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-left .pp-form-field-wrap .pp-form-material-icons{left:0!important;margin-left:0!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material.ppfia-right .pp-form-field-wrap .pp-form-material-icons{margin-right:0!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap .pp-form-material-icons{margin-top:10px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap .pp-form-material-icons{margin-top:18px}.pp-form-container .pp-form-wrapper.ppBuildScratch .has-password-visibility-icon .pp-form-material-icons{cursor:pointer}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-pill .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-pill .pp-form-field-wrap select,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-pill .pp-form-field-wrap textarea{border-radius:25px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-round .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-round .pp-form-field-wrap select,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-round .pp-form-field-wrap textarea{border-radius:6px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap .select2.select2-container,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap select,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap textarea{border:0!important;border-bottom:1px solid #dbdbdb!important;padding-left:0!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap input[type=text]:focus,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap select:focus,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-material .pp-form-field-wrap textarea:focus{border-top:0!important;border-right:0!important;border-left:0!important;box-shadow:none!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap .select2-selection,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap input:not([type=radio]):not([type=checkbox]),.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap select,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfl-flat .pp-form-field-wrap textarea{border:0!important;background:#f7f7f7!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap input,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap select{padding-top:15px;padding-bottom:15px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-field-wrap textarea{height:150px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap input,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap select{padding-top:20px;padding-bottom:20px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-field-wrap textarea{height:200px}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap input[type=text]:focus,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap select:focus,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap textarea:focus{border:1px solid #999}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .pp-form-label-wrap .pp-form-label,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .ppform-remember-label{font-style:normal;background-color:transparent;display:block;font-weight:700;font-size:14px;float:none;line-height:1.3;margin:0;padding:0;color:#444}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-wrap .ppform-remember-label{display:inline-block}.pp-field-user-avatar-picture-wrap .pp-profile-avatar-overlay ins,.pp-field-user-cover-image-wrap .pp-cover-image-overlay ins,.pp-form-container .pp-form-wrapper.ppBuildScratch.ppf-hide-asterisk .pp-form-required-label{display:none}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap input[type=submit]{background:#000;border:0;color:#fff;font-weight:700;font-size:16px;line-height:1;padding:15px 10px;transition:.15s ease-in-out;width:auto;min-width:110px;text-align:center}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-large .pp-form-submit-button-wrap input[type=submit],.pp-form-container .pp-form-wrapper.ppBuildScratch.ppfs-medium .pp-form-submit-button-wrap input[type=submit]{padding-top:20px;padding-bottom:20px}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbl-pill .pp-form-submit-button-wrap input[type=submit]{border-radius:25px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbl-round .pp-form-submit-button-wrap input[type=submit]{border-radius:6px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap input[type=submit]:focus,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-submit-button-wrap input[type=submit]:hover{background-color:#ededed;color:#000;text-decoration:none}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-checkbox-wrap,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-radio-wrap{margin:0 0 5px}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-checkboxes-container,.ppressmd-new-dropdown ul{margin:0;padding:0}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-checkbox-wrap:last-of-type,.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-radio-wrap:last-of-type{margin-bottom:0}.pp-form-container .pp-form-wrapper.ppBuildScratch .pp-form-field-description{font-size:12px;font-weight:400;color:#666;line-height:1.3;text-align:left;margin:4px 0 0}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-wide .pp-form-submit-button-wrap input[type=submit]{width:100%}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width .pp-form-submit-button-wrap{margin-top:4%;margin-bottom:4%}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width .pp-form-submit-button-wrap input[type=submit]{width:100%!important;position:absolute!important;bottom:0!important;right:0!important;left:0!important;border-top-right-radius:0!important;border-top-left-radius:0!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width.ppsbl-pill{border-bottom-right-radius:25px!important;border-bottom-left-radius:25px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch.ppsbw-full-width.ppsbl-round{border-bottom-right-radius:6px!important;border-bottom-left-radius:6px!important}.pp-form-container .pp-form-wrapper.ppBuildScratch a.pp-button-social-login:last-of-type{margin-bottom:1.5em!important}#profilepress-myaccount-wrapper{font-size:16px}#profilepress-myaccount-wrapper .profilepress-myaccount-row{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}#profilepress-myaccount-wrapper .profilepress-myaccount-nav{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}#profilepress-myaccount-wrapper .ppmyac-dashboard-item{text-decoration:none!important;position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125);width:100%;text-align:inherit;box-shadow:none}#profilepress-myaccount-wrapper .ppmyac-dashboard-item.isactive{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}#profilepress-myaccount-wrapper .ppmyac-dashboard-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}#profilepress-myaccount-wrapper .ppmyac-dashboard-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}#profilepress-myaccount-wrapper .ppmyac-icons{margin-right:.5rem;vertical-align:text-bottom}#profilepress-myaccount-wrapper .profilepress-myaccount-col-sm-3{position:relative;width:100%;padding-right:15px;padding-left:15px}@media (min-width:576px){#profilepress-myaccount-wrapper .profilepress-myaccount-col-sm-3{-webkit-flex:0 0 25%;flex:0 0 25%;max-width:25%}}#profilepress-myaccount-wrapper .profilepress-myaccount-content{position:relative;width:100%;padding-top:30px;padding-right:15px;padding-left:15px}@media (min-width:576px){#profilepress-myaccount-wrapper .profilepress-myaccount-content{-webkit-flex:0 0 75%;flex:0 0 75%;max-width:75%}}#profilepress-myaccount-wrapper .profilepress-myaccount-avatar-wrap{text-align:center;margin-bottom:20px}#profilepress-myaccount-wrapper .profilepress-myaccount-avatar-wrap .profilepress-myaccount-avatar img.pp-user-avatar{margin:0!important;position:static!important;float:none!important;display:inline-block;border-radius:999px}#profilepress-myaccount-wrapper .profilepress-myaccount-nav a:focus{outline:0;text-shadow:none;box-shadow:none}#profilepress-myaccount-wrapper .profilepress-myaccount-content h2{margin-top:0!important;margin-bottom:1.8rem!important;font-weight:700!important;line-height:1.2!important;font-size:2rem!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content h3{margin-top:0!important;line-height:1.2!important;font-weight:500!important;font-size:1.2rem!important;margin-bottom:1rem!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenus-wrap{margin-bottom:2rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenu-wrap{display:inline;padding-right:1rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenu-item{color:inherit;padding:0 0 10px}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-submenu-item.ppsubmenu-active{border-bottom:3px solid #6c757d}.profilepress-myaccount-alert,.profilepress-myaccount-edit-profile .profilepress-edit-profile-status{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.profilepress-myaccount-alert.pp-alert-danger,.profilepress-myaccount-edit-profile .profilepress-edit-profile-status{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.profilepress-myaccount-alert.pp-alert-success,.profilepress-myaccount-edit-profile .profilepress-edit-profile-status.success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field{margin-top:.5rem;margin-bottom:1rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-cover-image-empty{min-height:250px;background-color:#eee}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-cover-image-wrap{padding:.75rem;background-color:#fff;border:1px solid rgba(0,0,0,.125);margin-bottom:0;border-radius:.25rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-cover-image-wrap img{width:100%;height:auto}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-email-notifications-wrap .profilepress-myaccount-form-field{margin-top:.5rem;margin-bottom:.5rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-email-notifications-wrap{margin-bottom:2rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field label{margin-bottom:.2rem;font-weight:500;display:block}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field input[type=checkbox]+label,#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field input[type=radio]+label{display:inline}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .profilepress-myaccount-form-control:not([type=radio]):not([type=checkbox]),#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap input:not([type=radio]):not([type=checkbox]):not([type=submit]),#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap select,#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap textarea{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;overflow:visible;box-shadow:inset 0 1px 1px rgba(0,0,0,.125)}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap textarea{height:auto!important;min-height:100px!important;resize:vertical!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content input.profilepress-myaccount-form-control:focus,#profilepress-myaccount-wrapper .profilepress-myaccount-content select.profilepress-myaccount-form-control:focus,#profilepress-myaccount-wrapper .profilepress-myaccount-content textarea.profilepress-myaccount-form-control:focus{background-color:#fff;border-color:#bbb;outline:0;box-shadow:none}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .profilepress-myaccount-form-field input[type=submit]{display:inline-block;cursor:pointer;width:auto}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .profilepress-myaccount-form-field input[type=submit]:hover{color:#fff;background-color:#0069d9;border-color:#0062cc;text-decoration:none}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-label::after{position:absolute;top:0;right:0;box-sizing:border-box;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-wrap .ppmyac-custom-file-input~.ppmyac-custom-file-label[data-browse]::after{content:attr(data-browse)}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field .pp-checkbox-wrap label.pp-form-label,#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-form-field .pp-radio-wrap label.pp-form-label{display:inline-block;margin:0 0 0 .3819820591em}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-avatar-wrap{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;margin:1em 0 0;padding-left:0}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-avatar{position:relative;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125);margin-bottom:0;border-radius:.25rem;-webkit-justify-content:space-between!important;justify-content:space-between!important;display:-webkit-flex!important;display:flex!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content .pp-user-avatar{width:70px;height:70px;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;border-radius:50%}#profilepress-myaccount-wrapper .profilepress-myaccount-content .ppmyac-remove-avatar{margin-bottom:.5rem!important;margin-top:.5rem!important;padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem;color:#fff;height:35px;background-color:#6c757d;display:inline-block;font-weight:400;text-align:center;vertical-align:middle;text-shadow:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #6c757d;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}#profilepress-myaccount-wrapper .profilepress-myaccount-content .profilepress-myaccount-delete-cover-image-wrap .ppmyac-remove-avatar{margin-top:.75rem!important;margin-bottom:0!important}#profilepress-myaccount-wrapper .profilepress-myaccount-content input.profilepress-myaccount-form-control::-webkit-file-upload-button{background:#fff;border-radius:6px;font-size:14px;border:1px solid #ddd}#profilepress-myaccount-wrapper .profilepress-myaccount-content .select2-selection{border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;box-shadow:inset 0 1px 1px rgba(0,0,0,.125)}.pp-form-container .pp-field-user-avatar-picture-wrap{width:250px;height:auto;margin:auto;position:relative}.pp-form-container .pp-field-user-cover-image-wrap{margin:auto;position:relative}.pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay-wrap,.pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay-wrap{position:absolute;top:0;left:0;background:rgba(0,0,0,.5);text-align:center;box-sizing:border-box;padding:0;color:#fff;text-shadow:0 1px #666;line-height:21px;font-size:16px;height:100%;width:100%;border-radius:50%}.pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay-wrap{border-radius:0}.pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay,.pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay{display:table;height:100%;width:100%}.pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay ins,.pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay ins{display:table-cell;vertical-align:middle;height:100%;text-decoration:none!important;background:0 0!important;color:#fff!important;border-bottom:none!important}.pp-field-user-avatar-picture-wrap:hover .pp-profile-avatar-overlay-wrap .pp-profile-avatar-overlay .pp-form-material-icons,.pp-field-user-cover-image-wrap:hover .pp-cover-image-overlay-wrap .pp-cover-image-overlay .pp-form-material-icons{font-size:35px!important;display:block!important;position:static!important;right:auto!important;top:auto!important;color:#fff!important;margin:0!important;width:auto!important;height:auto!important;cursor:pointer}html .select2.select2-container .select2-selection.select2-selection--multiple input.select2-search__field{border:0!important;height:auto!important}.select2.select2-container .select2-selection.select2-selection--multiple input.select2-search__field{border:0!important;box-shadow:none!important}.select2.select2-container .select2-selection.select2-selection--multiple li.select2-selection__choice{height:auto;line-height:normal}.pp-form-wrapper.pp-member-directory{opacity:0}.pp-form-wrapper.ppress-default-profile{max-width:1000px;width:100%;box-sizing:border-box;font-size:15px;color:#666;margin-bottom:30px;opacity:0}.pp-form-wrapper.ppress-default-profile *{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;box-sizing:border-box}.pp-form-wrapper.ppress-default-profile a,.pp-form-wrapper.ppress-default-profile a:hover{text-decoration:none!important}.pp-form-wrapper.ppress-default-profile .ppress-default-profile-cover{background-color:#eee;box-sizing:border-box;position:relative}.pp-form-wrapper.ppress-default-profile .ppress-default-profile-cover-e{text-align:center;overflow:hidden}.pp-form-wrapper.ppress-default-profile .ppress-default-profile-cover-e img{width:100%;display:block;overflow:hidden;border-radius:0;margin:0}.pp-form-wrapper.ppress-default-profile .ppress-dpf-header{position:relative;padding:0 0 25px;border-bottom:solid 2px #eee;min-height:85px;box-sizing:content-box}.pp-form-wrapper.ppress-default-profile .ppress-dpf-headericon{position:absolute;top:15px;right:0;vertical-align:middle;font-size:30px;height:30px;line-height:30px;z-index:66;margin-right:10px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-headericon .ppress-dpf-edit-a .ppress-material-icons{font-size:30px}.pp-form-wrapper.ppress-default-profile a.ppress-dpf-edit-a{color:#aaa;text-decoration:none;border-bottom:0}.pp-form-wrapper.ppress-default-profile .ppress-dpf-headericon a:hover,.pp-form-wrapper.ppress-default-profile a.ppress-dpf-edit-a.active{color:#007bff}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-photo{float:left;position:absolute;margin:0 0 0 30px;box-sizing:border-box;width:200px;height:200px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-photo img{width:100%;height:auto;border-radius:100%;display:block;overflow:hidden;margin:0;box-shadow:none;background:#fff;border:5px solid #fff}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-meta{padding-right:30px;-ms-word-break:break-all;word-break:break-word;word-wrap:break-word}.pp-form-wrapper.ppress-default-profile .ppress-dpf-main-meta{padding:10px 0 0;color:#999}.pp-form-wrapper.ppress-default-profile .ppress-dpf-name{font-size:24px;font-weight:700;margin-right:30px;color:#555;line-height:1.7em}.pp-form-wrapper.ppress-default-profile .ppress-dpf-clear{clear:both}.pp-form-wrapper.ppress-default-profile .ppress-dpf-meta span{margin:0 5px;font-size:14px;display:inline-block;line-height:.1}.pp-form-wrapper.ppress-default-profile .ppress-dpf-meta span:first-child{margin:0 5px 0 0}.pp-form-wrapper.ppress-default-profile .ppress-dpf-meta-text{margin:5px 0 0;line-height:1.4em;font-size:13px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav{padding:10px;background:#444;text-align:center}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item a{color:#fff;font-size:14px;font-weight:600;padding:6px 10px 6px 28px;display:block;float:left;border-radius:4px;margin-left:5px;position:relative;border-bottom:0;text-decoration:none!important}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item a:hover{background:#555}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item .ppress-material-icons{font-size:18px;height:18px;line-height:1.5;position:absolute;display:block;left:10px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item span.ppress-dpf-nav-title{padding-left:5px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-nav-item.ppress-dpf-active a{background:#007bff}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-body{max-width:600px;padding-top:15px;padding-bottom:15px;margin:auto}.pp-form-wrapper.ppress-default-profile .pp-user-comment-no-item,.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note{text-align:center;padding-top:20px;color:#666}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note .ppress-material-icons{display:inline-block;font-size:70px;height:70px;line-height:70px}.pp-form-wrapper.ppress-default-profile .pp-user-comment-no-item span,.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note span{margin-top:10px;display:block;font-size:16px;color:#888}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-note a{border:0!important}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-body-items{margin:0 0 30px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-profile-body-item{position:relative;padding:15px 0 0}.pp-form-wrapper.ppress-default-profile .ppress-dpf-item-label{display:block;margin:0 0 8px;border-bottom:solid 2px #eee;padding-bottom:4px;font-size:15px;line-height:22px;font-weight:700}.pp-form-wrapper.ppress-default-profile .ppress-dpf-field-label-icon{float:left;margin:0 8px 0 0;height:22px;line-height:18px;display:inline-block;width:24px;text-align:center}.pp-form-wrapper.ppress-default-profile .ppress-dpf-field-label-icon i{font-size:22px;position:relative;top:1px}.pp-form-wrapper.ppress-default-profile .ppdf-nocover .ppress-dpf-profile-photo{float:none;margin:0 auto;text-align:center;position:relative}.pp-form-wrapper.ppress-default-profile .ppdf-nocover .ppress-dpf-profile-meta{padding-left:0!important;padding-right:0!important;text-align:center!important}.ppress-default-profile.ppressui340 .ppress-dpf-profile-nav{padding:0}.ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item a,.ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item a{margin-left:0;border-radius:0}.ppress-dpf-profile-nav-item.ppressui340 .ppress-dpf-profile-body{padding-left:0;padding-right:0}.ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo{position:static;top:auto;left:auto}.ppress-default-profile.ppressui340 .ppress-dpf-header .ppress-dpf-profile-meta{text-align:center;padding:0;margin-top:-30px}.ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-meta{padding-top:0}.ppress-default-profile.ppressui340 .ppress-dpf-header .ppress-dpf-name{float:none;margin-right:0;font-size:18px}.ppress-default-profile.ppressui340 .ppress-dpf-header .ppress-dpf-meta-text{padding:0 20px}.ppress-default-profile.ppressui340 .ppress-dpf-profile-photo{position:relative;width:100px;height:100px;margin:0 auto;float:none;left:auto;text-align:center;top:-40px}.ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo{width:120px;height:120px}.ppress-default-profile.ppressui340 .ppress-dpf-nav-title{font-size:12px}.ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item .ppress-material-icons{display:block;position:static;top:auto;left:auto;height:20px;line-height:20px}.ppress-default-profile.ppressui340.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-meta{margin-top:0}.ppress-default-profile.ppressui500 .ppress-dpf-profile-nav{padding:0}.ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item i{display:block;position:static;top:auto;left:auto;font-size:22px;height:22px;line-height:22px}.ppress-default-profile.ppressui500 .ppress-dpf-profile-body{padding-left:0;padding-right:0}.ppress-default-profile.ppressui500.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo{position:static;top:auto;left:auto;width:120px;height:120px}.ppress-default-profile.ppressui500 .ppress-dpf-profile-photo{position:relative;width:100px;height:100px;margin:0 auto;float:none;display:block;top:-40px;left:0}.ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-profile-meta{text-align:center;padding:0;margin-top:-30px}.ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-name{float:none;margin-right:0;font-size:21px}.ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-meta-text{padding-top:10px}.ppress-default-profile.ppressui500 .ppress-dpf-header .ppress-dpf-meta{padding:0 20px;display:block}.ppress-default-profile.ppressui500 .ppress-dpf-nav-title{font-size:12px}.ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item .ppress-material-icons{display:block;position:static;top:auto;left:auto;height:20px;line-height:20px}.ppress-default-profile.ppressui500.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-meta{margin-top:0}.ppress-default-profile.ppressui800 .ppress-dpf-profile-nav{padding:0}.ppress-default-profile.ppressui800 .ppress-dpf-profile-nav-item a{padding:10px 20px;margin-left:0;border-radius:0}.ppress-default-profile.ppressui800 .ppress-dpf-profile-photo{width:140px;height:140px;top:-70px}.ppress-default-profile.ppressui800.ppdf-nocover .ppress-dpf-header .ppress-dpf-profile-photo{top:auto}.ppress-default-profile.ppressui800 .ppress-dpf-header .ppress-dpf-profile-meta{padding-left:200px}.ppress-default-profile.ppressui800 .ppress-dpf-header .ppress-dpf-meta-text{padding-top:10px}.ppress-default-profile.ppressui800 .ppress-dpf-nav-title{font-size:12px}.ppress-default-profile.ppressui800 .ppress-dpf-profile-nav-item .ppress-material-icons{display:block;position:static;top:auto;left:auto;font-size:20px;height:20px;line-height:20px}.ppress-default-profile.ppressui960 .ppress-dpf-profile-photo{width:140px;height:140px;top:-70px}.ppress-default-profile.ppressui960.ppdf-nocover .ppress-dpf-profile-meta{margin-top:-50px}.ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item a,.ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item a{padding:5px 11px;font-size:12px}.ppress-default-profile.ppressui340 .ppress-dpf-profile-nav-item .ppress-material-icons,.ppress-default-profile.ppressui500 .ppress-dpf-profile-nav-item .ppress-material-icons{font-size:14px}.ppress-default-profile.ppressui340 span.ppress-dpf-nav-title,.ppress-default-profile.ppressui500 span.ppress-dpf-nav-title{font-size:10px}.pp-form-wrapper.ppress-default-profile ul.pp-user-post-list{list-style:none;margin:0;padding:0}.pp-form-wrapper.ppress-default-profile li.pp-user-post-item{padding:20px 0;border-bottom:1px solid #eee}.pp-form-wrapper.ppress-default-profile .pp-user-post-item a,.pp-form-wrapper.ppress-default-profile .pp-user-post-item h3{font-size:16px;font-weight:400;margin:0;text-decoration:none}.pp-form-wrapper.ppress-default-profile .pp-user-post-item h3.pp-post-item-head{line-height:20px}.pp-form-wrapper.ppress-default-profile .ppress-dpf-more-post-wrap{text-align:center;padding-top:30px}.pp-form-wrapper.ppress-default-profile a.ppress-dpf-more-post-btn{font-size:15px;border:0;display:block;width:100%;line-height:1em;padding:15px;text-decoration:none;text-align:center;text-transform:none;font-weight:400;transition:.25s;border-radius:4px;box-shadow:0 4px 6px rgba(50,50,93,.11),0 1px 3px rgba(0,0,0,.08);max-width:250px;margin:0 auto;color:#fff;background:#007bff}.pp-form-wrapper.ppress-default-profile .pp-user-comment-item{padding:20px 0;border-bottom:1px solid #eee}.pp-form-wrapper.ppress-default-profile .pp-user-comment-item-link a{color:inherit}.pp-form-wrapper.ppress-default-profile .pp-user-comment-no-item+.ppress-dpf-more-post-wrap{display:none}.pp-member-directory .ppressmd-member-directory-header.ppressmd-form{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-items:stretch;align-items:stretch;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;width:100%}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row:not(.ppressmd-member-directory-filters-bar){display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;margin:0 0 10px}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row.ppressmd-member-directory-search-row{-webkit-justify-content:flex-end;justify-content:flex-end}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;width:60%}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label{-webkit-flex:1;flex:1;margin:0 10px 0 0;min-width:90px;max-width:85%}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label .ppressmd-search-line{-webkit-appearance:textfield;width:100%;padding:0 12px!important;display:block!important;border-radius:2px;outline:0!important;cursor:text!important;font-size:15px!important;height:40px!important;box-sizing:border-box!important;box-shadow:none!important;margin:0!important;position:static}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line .ppressmd-do-search{min-width:15%;width:auto}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;width:100%}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-sorting{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex:5;flex:5}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-sorting .ppressmd-member-directory-sorting-a{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;position:relative;cursor:pointer}.pp-member-directory .ppressmd-member-directory-header a{text-decoration:none;border-bottom:none;box-shadow:none}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppress-material-icons{display:inline;vertical-align:middle}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-flex:2;flex:2;text-align:right}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a{display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-align-items:baseline;align-items:baseline;-webkit-flex-wrap:nowrap;flex-wrap:nowrap;cursor:pointer}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a a{margin:0 5px 0 0}.ppressmd-member-directory-header:not(.ppmd-filters-expand) .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a .ppress-up{display:none}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search.ppressmd-search-invisible,.ppressmd-member-directory-header.ppmd-filters-expand .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-filters .ppressmd-member-directory-filters-a .ppress-down{display:none}.ppressmd-new-dropdown{font-size:16px;margin:0;position:absolute;height:auto;background:#fff;z-index:10;display:none;border:1px solid #ddd;box-shadow:0 7px 14px 0 rgba(50,50,93,.1),0 3px 6px 0 rgba(0,0,0,.07);-webkit-box-shadow:0 7px 14px 0 rgba(50,50,93,.1),0 3px 6px 0 rgba(0,0,0,.07);box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;-webkit-border-radius:5px 5px 5px 5px}.ppressmd-new-dropdown ul li{list-style-type:none;padding:0;margin:0}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppressmd-member-directory-sorting .ppressmd-member-directory-sorting-a .ppressmd-new-dropdown{top:24px;width:200px;left:-12px}.ppressmd-new-dropdown ul li a{display:block;padding:8px 12px;line-height:1}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row.ppressmd-member-directory-filters-bar{padding:0 0 10px}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row.ppressmd-header-row-invisible{margin:0}.ppressmd-member-directory-header.ppmd-filters-expand .ppressmd-member-directory-header-row .ppressmd-search.ppressmd-search-invisible{display:grid}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search{margin:0;width:100%;display:grid;grid-template-rows:auto 1fr;grid-template-columns:repeat(3,1fr);grid-gap:10px;grid-auto-rows:minmax(-webkit-max-content,auto);grid-auto-rows:minmax(max-content,auto);-ms-grid-template-rows:auto 1fr;-ms-grid-template-columns:repeat(3,1fr);-ms-grid-gap:10px;-ms-grid-auto-rows:minmax(max-content,auto);-webkit-align-items:center;align-items:center}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter{display:flex;flex-direction:row;justify-content:flex-start;align-items:baseline;flex-wrap:nowrap;width:100%}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter.ppressmd-text-filter-type input{width:100%;padding:10px 30px}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label .ppressmd-search-line,.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter.ppressmd-text-filter-type input:not(.select2-search__field),.pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection{background-color:transparent;border:1px solid #ddd!important}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-nav-line .ppress-material-icons,.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-member-directory-search-line label .ppressmd-search-line,.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row .ppressmd-search .ppressmd-search-filter.ppressmd-text-filter-type input,.pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection__rendered{color:#666;background-color:transparent}.pp-member-directory .ppressmd-member-directory-header .ppressmd-member-directory-header-row input[type=search]:focus{border:1px solid #bbb!important}.pp-member-directory .ppressmd-member-directory-header .ppressmd-button{border:0!important;display:block;width:100%;line-height:1em!important;padding:16px 20px!important;text-decoration:none!important;text-align:center;text-transform:none!important;font-weight:400!important;overflow:hidden;position:relative;transition:.25s;box-sizing:border-box;border-radius:4px!important;box-shadow:none;vertical-align:middle!important;height:auto!important;cursor:pointer!important;text-shadow:none;font-family:inherit;outline:0!important;margin:0;-webkit-appearance:none}.pp-member-directory .ppressmd-members-total-wrap{text-align:center;margin:0 0 10px}.pp-member-directory .ppressmd-members-total{font-size:20px;font-weight:300}.pp-member-directory .ppressmd-member-directory-header .select2.select2-container{width:100%!important}.pp-member-directory .ppressmd-member-directory-header .select2-search.select2-search--inline .select2-search__field{width:auto!important}.pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection{display:block!important;height:40px;padding:0 0 0 12px!important;overflow:hidden!important;position:relative!important;white-space:nowrap!important;line-height:35px!important;font-size:15px!important;text-align:left!important;text-decoration:none!important;border-radius:2px!important;background-clip:padding-box!important;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:0 0!important}.pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection .select2-selection__arrow{display:inline-block!important;width:34px!important;height:100%!important;position:absolute!important;right:0!important;top:0!important;border-radius:0 2px 2px 0!important;background-clip:padding-box!important;text-align:center!important;background:0 0!important;border-left:0!important}.pp-member-directory .ppressmd-member-directory-header .select2-container.select2-container--open .select2-dropdown{border:1px solid #ddd;border-top:0;border-radius:0}.pp-member-directory .ppressmd-member-directory-header .select2-container.select2-container--open .select2-dropdown .select2-results li{list-style:none;display:list-item;background-image:none;font-size:15px;margin:5px!important;color:#666!important;padding:3px 7px 4px!important;cursor:pointer;min-height:1em!important}.pp-member-directory .ppressmd-member-directory-header .select2.select2-container .select2-selection.select2-selection--multiple{height:auto!important;line-height:.8!important}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__rendered{padding-left:0!important;line-height:37px}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__rendered{line-height:37px;box-sizing:border-box;list-style:none;margin:0;padding-left:0!important;padding-right:30px;width:100%;font-size:13px}.pp-member-directory .ppressmd-member-directory-header .select2-results li.select2-results__option.select2-results__option--highlighted{background:0 0!important;background:#f4f4f4!important;color:#666!important}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__clear{right:10px;margin:0!important}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__clear{right:10px;font-size:30px;margin:0!important}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__clear,.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__arrow b,.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__clear{color:#888!important}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__clear{position:absolute}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__choice{padding:3px 3px 3px 5px}.pp-member-directory .ppressmd-member-directory-header .select2-container .select2-search.select2-search--inline>input{border:0!important;padding:0!important;border-radius:0!important}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--multiple .select2-selection__rendered li{overflow-x:hidden;text-overflow:ellipsis;max-width:100%;box-sizing:border-box}.pp-member-directory .ppressmd-member-directory-header .select2-container--default .select2-selection--single .select2-selection__clear{font-size:20px!important}.pp-member-directory .ppmd-pagination-wrap{font-size:16px;width:100%;margin:0 auto 10px;padding:0;text-align:center}.pp-member-directory .ppmd-pagination-wrap .page-numbers{display:inline-block;width:auto;height:34px;line-height:34px;transition:all .2s linear;padding:0 14px;color:#666;font-weight:400}.pp-member-directory .ppmd-pagination-wrap .page-numbers.current{background:#007bff;color:#fff}.pp-member-directory .ppmd-pagination-wrap .page-numbers .ppress-material-icons{vertical-align:middle}
assets/css/hint.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /* Hint.css - v2.6.0 - 2019-04-27
2
+ * http://kushagragour.in/lab/hint/
3
+ * Copyright (c) 2019 Kushagra Gour */
4
+
5
+ [class*=hint--]{position:relative;display:inline-block}[class*=hint--]:after,[class*=hint--]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:1000000;pointer-events:none;-webkit-transition:.3s ease;-moz-transition:.3s ease;transition:.3s ease;-webkit-transition-delay:0s;-moz-transition-delay:0s;transition-delay:0s}[class*=hint--]:hover:after,[class*=hint--]:hover:before{visibility:visible;opacity:1;-webkit-transition-delay:.1s;-moz-transition-delay:.1s;transition-delay:.1s}[class*=hint--]:before{content:'';position:absolute;background:0 0;border:6px solid transparent;z-index:1000001}[class*=hint--]:after{background:#383838;color:#fff;padding:8px 10px;font-size:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:12px;white-space:nowrap;text-shadow:0 -1px 0 #000;box-shadow:4px 4px 8px rgba(0,0,0,.3)}[class*=hint--][aria-label]:after{content:attr(aria-label)}[class*=hint--][data-hint]:after{content:attr(data-hint)}[aria-label='']:after,[aria-label='']:before,[data-hint='']:after,[data-hint='']:before{display:none!important}.hint--top-left:before,.hint--top-right:before,.hint--top:before{border-top-color:#383838}.hint--bottom-left:before,.hint--bottom-right:before,.hint--bottom:before{border-bottom-color:#383838}.hint--top:after,.hint--top:before{bottom:100%;left:50%}.hint--top:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--top:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top:hover:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--bottom:after,.hint--bottom:before{top:100%;left:50%}.hint--bottom:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom:after{-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);transform:translateX(-50%)}.hint--bottom:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom:hover:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--right:before{border-right-color:#383838;margin-left:-11px;margin-bottom:-6px}.hint--right:after{margin-bottom:-14px}.hint--right:after,.hint--right:before{left:100%;bottom:50%}.hint--right:hover:after,.hint--right:hover:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--left:before{border-left-color:#383838;margin-right:-11px;margin-bottom:-6px}.hint--left:after{margin-bottom:-14px}.hint--left:after,.hint--left:before{right:100%;bottom:50%}.hint--left:hover:after,.hint--left:hover:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--top-left:after,.hint--top-left:before{bottom:100%;left:50%}.hint--top-left:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--top-left:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--top-left:hover:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--top-right:after,.hint--top-right:before{bottom:100%;left:50%}.hint--top-right:before{margin-bottom:-11px;left:calc(50% - 6px)}.hint--top-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--top-right:hover:after,.hint--top-right:hover:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--bottom-left:after,.hint--bottom-left:before{top:100%;left:50%}.hint--bottom-left:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-left:after{-webkit-transform:translateX(-100%);-moz-transform:translateX(-100%);transform:translateX(-100%);margin-left:12px}.hint--bottom-left:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--bottom-left:hover:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--bottom-right:after,.hint--bottom-right:before{top:100%;left:50%}.hint--bottom-right:before{margin-top:-11px;left:calc(50% - 6px)}.hint--bottom-right:after{-webkit-transform:translateX(0);-moz-transform:translateX(0);transform:translateX(0);margin-left:-12px}.hint--bottom-right:hover:after,.hint--bottom-right:hover:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--large:after,.hint--medium:after,.hint--small:after{white-space:normal;line-height:1.4em;word-wrap:break-word}.hint--small:after{width:80px}.hint--medium:after{width:150px}.hint--large:after{width:300px}.hint--error:after{background-color:#b34e4d;text-shadow:0 -1px 0 #592726}.hint--error.hint--top-left:before,.hint--error.hint--top-right:before,.hint--error.hint--top:before{border-top-color:#b34e4d}.hint--error.hint--bottom-left:before,.hint--error.hint--bottom-right:before,.hint--error.hint--bottom:before{border-bottom-color:#b34e4d}.hint--error.hint--left:before{border-left-color:#b34e4d}.hint--error.hint--right:before{border-right-color:#b34e4d}.hint--warning:after{background-color:#c09854;text-shadow:0 -1px 0 #6c5328}.hint--warning.hint--top-left:before,.hint--warning.hint--top-right:before,.hint--warning.hint--top:before{border-top-color:#c09854}.hint--warning.hint--bottom-left:before,.hint--warning.hint--bottom-right:before,.hint--warning.hint--bottom:before{border-bottom-color:#c09854}.hint--warning.hint--left:before{border-left-color:#c09854}.hint--warning.hint--right:before{border-right-color:#c09854}.hint--info:after{background-color:#3986ac;text-shadow:0 -1px 0 #1a3c4d}.hint--info.hint--top-left:before,.hint--info.hint--top-right:before,.hint--info.hint--top:before{border-top-color:#3986ac}.hint--info.hint--bottom-left:before,.hint--info.hint--bottom-right:before,.hint--info.hint--bottom:before{border-bottom-color:#3986ac}.hint--info.hint--left:before{border-left-color:#3986ac}.hint--info.hint--right:before{border-right-color:#3986ac}.hint--success:after{background-color:#458746;text-shadow:0 -1px 0 #1a321a}.hint--success.hint--top-left:before,.hint--success.hint--top-right:before,.hint--success.hint--top:before{border-top-color:#458746}.hint--success.hint--bottom-left:before,.hint--success.hint--bottom-right:before,.hint--success.hint--bottom:before{border-bottom-color:#458746}.hint--success.hint--left:before{border-left-color:#458746}.hint--success.hint--right:before{border-right-color:#458746}.hint--always:after,.hint--always:before{opacity:1;visibility:visible}.hint--always.hint--top:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top:after{-webkit-transform:translateX(-50%) translateY(-8px);-moz-transform:translateX(-50%) translateY(-8px);transform:translateX(-50%) translateY(-8px)}.hint--always.hint--top-left:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--top-left:after{-webkit-transform:translateX(-100%) translateY(-8px);-moz-transform:translateX(-100%) translateY(-8px);transform:translateX(-100%) translateY(-8px)}.hint--always.hint--top-right:after,.hint--always.hint--top-right:before{-webkit-transform:translateY(-8px);-moz-transform:translateY(-8px);transform:translateY(-8px)}.hint--always.hint--bottom:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom:after{-webkit-transform:translateX(-50%) translateY(8px);-moz-transform:translateX(-50%) translateY(8px);transform:translateX(-50%) translateY(8px)}.hint--always.hint--bottom-left:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--bottom-left:after{-webkit-transform:translateX(-100%) translateY(8px);-moz-transform:translateX(-100%) translateY(8px);transform:translateX(-100%) translateY(8px)}.hint--always.hint--bottom-right:after,.hint--always.hint--bottom-right:before{-webkit-transform:translateY(8px);-moz-transform:translateY(8px);transform:translateY(8px)}.hint--always.hint--left:after,.hint--always.hint--left:before{-webkit-transform:translateX(-8px);-moz-transform:translateX(-8px);transform:translateX(-8px)}.hint--always.hint--right:after,.hint--always.hint--right:before{-webkit-transform:translateX(8px);-moz-transform:translateX(8px);transform:translateX(8px)}.hint--rounded:after{border-radius:4px}.hint--no-animate:after,.hint--no-animate:before{-webkit-transition-duration:0s;-moz-transition-duration:0s;transition-duration:0s}.hint--bounce:after,.hint--bounce:before{-webkit-transition:opacity .3s ease,visibility .3s ease,-webkit-transform .3s cubic-bezier(.71,1.7,.77,1.24);-moz-transition:opacity .3s ease,visibility .3s ease,-moz-transform .3s cubic-bezier(.71,1.7,.77,1.24);transition:opacity .3s ease,visibility .3s ease,transform .3s cubic-bezier(.71,1.7,.77,1.24)}.hint--no-shadow:after,.hint--no-shadow:before{text-shadow:initial;box-shadow:initial}
assets/css/images/bg_fallback.png ADDED
Binary file
assets/css/images/icon_sprite.png ADDED
Binary file
assets/css/images/ui-icons_222222_256x240.png ADDED
Binary file
assets/css/images/ui-icons_454545_256x240.png ADDED
Binary file
assets/css/material-icons/MaterialIcons-Regular.eot ADDED
Binary file
assets/css/material-icons/MaterialIcons-Regular.ttf ADDED
Binary file
assets/css/material-icons/MaterialIcons-Regular.woff ADDED
Binary file
assets/css/material-icons/MaterialIcons-Regular.woff2 ADDED
Binary file
assets/flatpickr/flatpickr.min.css ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,0.08);}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1);animation:fpFadeInDown 300ms cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px);}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none !important;box-shadow:none !important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.rightMost:after{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flatpickr-months .flatpickr-month{background:transparent;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,0.9);fill:rgba(0,0,0,0.9);}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{/*
2
+ /*rtl:begin:ignore*/left:0;/*
3
+ /*rtl:end:ignore*/}/*
4
+ /*rtl:begin:ignore*/
5
+ /*
6
+ /*rtl:end:ignore*/
7
+ .flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{/*
8
+ /*rtl:begin:ignore*/right:0;/*
9
+ /*rtl:end:ignore*/}/*
10
+ /*rtl:begin:ignore*/
11
+ /*
12
+ /*rtl:end:ignore*/
13
+ .flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9;}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px;}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto;}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%;}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,0.15);-webkit-box-sizing:border-box;box-sizing:border-box;}.numInputWrapper span:hover{background:rgba(0,0,0,0.1)}.numInputWrapper span:active{background:rgba(0,0,0,0.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0;}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,0.6);top:26%}.numInputWrapper span.arrowDown{top:50%;}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,0.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto;}.numInputWrapper span svg path{fill:rgba(0,0,0,0.5)}.numInputWrapper:hover{background:rgba(0,0,0,0.05);}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0;}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch\0;display:inline-block;}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,0.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,0.9)}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,0.5);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto;}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,0.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px;}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:rgba(0,0,0,0.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px;}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;}.dayContainer + .dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9;}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 0 #569ff7}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:rgba(57,57,57,0.3);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,0.1)}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left;}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,0.3);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left;}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;}.flatpickr-time input.flatpickr-hour{font-weight:bold}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:bold;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}
assets/flatpickr/flatpickr.min.js ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /* flatpickr v4.6.3,, @license MIT */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).flatpickr=t()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},a={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},i=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0};function r(e,t,n){var a;return void 0===n&&(n=!1),function(){var i=this,o=arguments;null!==a&&clearTimeout(a),a=window.setTimeout(function(){a=null,n||e.apply(i,o)},t),n&&!a&&e.apply(i,o)}}var l=function(e){return e instanceof Array?e:[e]};function c(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function d(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function u(e,t){var n=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}var f=function(){},m=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},g={D:f,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*o(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var a=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:f,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:f,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},p={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},h={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[h.w(e,t,n)]},F:function(e,t,n){return m(h.n(e,t,n)-1,!1,t)},G:function(e,t,n){return i(h.h(e,t,n))},H:function(e){return i(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return m(e.getMonth(),!0,t)},S:function(e){return i(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return i(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return i(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return i(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},v=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,n){var a=n||r;return void 0!==i.formatDate?i.formatDate(e,t,a):t.split("").map(function(t,n,o){return h[t]&&"\\"!==o[n-1]?h[t](e,a,i):"\\"!==t?t:""}).join("")}},D=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,d=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var s=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else if(i&&i.parseDate)l=i.parseDate(e,s);else{l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var f=void 0,m=[],h=0,v=0,D="";h<s.length;h++){var w=s[h],b="\\"===w,C="\\"===s[h-1]||b;if(p[w]&&!C){D+=p[w];var M=new RegExp(D).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:g[w],val:M[++v]})}else b||(D+=".");m.forEach(function(e){var t=e.fn,n=e.val;return l=t(l,n,c)||l})}l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===a&&l.setHours(0,0,0,0),l;i.errorHandler(new Error("Invalid date provided: "+d))}}};function w(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var b=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},C={DAY:864e5};"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(t){t&&Object.keys(t).forEach(function(n){return e[n]=t[n]})},i=0,o=t;i<o.length;i++){a(o[i])}return e});var M=300;function y(f,g){var h={config:e({},n,E.defaultConfig),l10n:a};function y(e){return e.bind(h)}function x(){var e=h.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==h.calendarContainer&&(h.calendarContainer.style.visibility="hidden",h.calendarContainer.style.display="block"),void 0!==h.daysContainer){var t=(h.days.offsetWidth+1)*e.showMonths;h.daysContainer.style.width=t+"px",h.calendarContainer.style.width=t+(void 0!==h.weekWrapper?h.weekWrapper.offsetWidth:0)+"px",h.calendarContainer.style.removeProperty("visibility"),h.calendarContainer.style.removeProperty("display")}})}function T(e){0===h.selectedDates.length&&ie(),void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==h.amPM&&e.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[o(h.amPM.textContent===h.l10n.amPM[0])]);var a=parseFloat(n.getAttribute("min")),r=parseFloat(n.getAttribute("max")),l=parseFloat(n.getAttribute("step")),c=parseInt(n.value,10),d=e.delta||(t?38===e.which?1:-1:0),s=c+l*d;if(void 0!==n.value&&2===n.value.length){var u=n===h.hourElement,f=n===h.minuteElement;s<a?(s=r+s+o(!u)+(o(u)&&o(!h.amPM)),f&&j(void 0,-1,h.hourElement)):s>r&&(s=n===h.hourElement?s-r-o(!h.amPM):a,f&&j(void 0,1,h.hourElement)),h.amPM&&u&&(1===l?s+c===23:Math.abs(s-c)>l)&&(h.amPM.textContent=h.l10n.amPM[o(h.amPM.textContent===h.l10n.amPM[0])]),n.value=i(s)}}(e);var t=h._input.value;k(),we(),h._input.value!==t&&h._debouncedChange()}function k(){if(void 0!==h.hourElement&&void 0!==h.minuteElement){var e,t,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(h.minuteElement.value,10)||0)%60,i=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(e=n,t=h.amPM.textContent,n=e%12+12*o(t===h.l10n.amPM[1]));var r=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.minDate,!0);if(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.maxDate,!0)){var l=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate;(n=Math.min(n,l.getHours()))===l.getHours()&&(a=Math.min(a,l.getMinutes())),a===l.getMinutes()&&(i=Math.min(i,l.getSeconds()))}if(r){var c=void 0!==h.config.minTime?h.config.minTime:h.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(i=Math.max(i,c.getSeconds()))}O(n,a,i)}}function I(e){var t=e||h.latestSelectedDateObj;t&&O(t.getHours(),t.getMinutes(),t.getSeconds())}function S(){var e=h.config.defaultHour,t=h.config.defaultMinute,n=h.config.defaultSeconds;if(void 0!==h.config.minDate){var a=h.config.minDate.getHours(),i=h.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=h.config.minDate.getSeconds())}if(void 0!==h.config.maxDate){var o=h.config.maxDate.getHours(),r=h.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=h.config.maxDate.getSeconds())}O(e,t,n)}function O(e,t,n){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(e%24,t,n||0,0),h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=i(h.config.time_24hr?e:(12+e)%12+12*o(e%12==0)),h.minuteElement.value=i(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[o(e>=12)]),void 0!==h.secondElement&&(h.secondElement.value=i(n)))}function _(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&Q(t)}function F(e,t,n,a){return t instanceof Array?t.forEach(function(t){return F(e,t,n,a)}):e instanceof Array?e.forEach(function(e){return F(e,t,n,a)}):(e.addEventListener(t,n,a),void h._handlers.push({element:e,event:t,handler:n,options:a}))}function N(e){return function(t){1===t.which&&e(t)}}function Y(){ge("onChange")}function A(e,t){var n=void 0!==e?h.parseDate(e):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate<h.now?h.config.maxDate:h.now),a=h.currentYear,i=h.currentMonth;try{void 0!==n&&(h.currentYear=n.getFullYear(),h.currentMonth=n.getMonth())}catch(e){e.message="Invalid date supplied: "+n,h.config.errorHandler(e)}t&&h.currentYear!==a&&(ge("onYearChange"),K()),!t||h.currentYear===a&&h.currentMonth===i||ge("onMonthChange"),h.redraw()}function P(e){~e.target.className.indexOf("arrow")&&j(e,e.target.classList.contains("arrowUp")?1:-1)}function j(e,t,n){var a=e&&e.target,i=n||a&&a.parentNode&&a.parentNode.firstChild,o=pe("increment");o.delta=t,i&&i.dispatchEvent(o)}function H(e,t,n,a){var i=X(t,!0),o=d("span","flatpickr-day "+e,t.getDate().toString());return o.dateObj=t,o.$i=a,o.setAttribute("aria-label",h.formatDate(t,h.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===w(t,h.now)&&(h.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,he(t)&&(o.classList.add("selected"),h.selectedDateElem=o,"range"===h.config.mode&&(c(o,"startRange",h.selectedDates[0]&&0===w(t,h.selectedDates[0],!0)),c(o,"endRange",h.selectedDates[1]&&0===w(t,h.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===h.config.mode&&function(e){return!("range"!==h.config.mode||h.selectedDates.length<2)&&w(e,h.selectedDates[0])>=0&&w(e,h.selectedDates[1])<=0}(t)&&!he(t)&&o.classList.add("inRange"),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+h.config.getWeek(t)+"</span>"),ge("onDayCreate",o),o}function L(e){e.focus(),"range"===h.config.mode&&ne(e)}function W(e){for(var t=e>0?0:h.config.showMonths-1,n=e>0?h.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=h.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&X(c.dateObj))return c}}function R(e,t){var n=ee(document.activeElement||document.body),a=void 0!==e?e:n?document.activeElement:void 0!==h.selectedDateElem&&ee(h.selectedDateElem)?h.selectedDateElem:void 0!==h.todayDateElem&&ee(h.todayDateElem)?h.todayDateElem:W(t>0?1:-1);return void 0===a?h._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():h.currentMonth,a=t>0?h.config.showMonths:-1,i=t>0?1:-1,o=n-h.currentMonth;o!=a;o+=i)for(var r=h.daysContainer.children[o],l=n-h.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,c=r.children.length,d=l;d>=0&&d<c&&d!=(t>0?c:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&X(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return L(s)}h.changeMonth(i),R(W(i),0)}(a,t):L(a)}function B(e,t){for(var n=(new Date(e,t,1).getDay()-h.l10n.firstDayOfWeek+7)%7,a=h.utils.getDaysInMonth((t-1+12)%12),i=h.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=h.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-n,u=0;s<=a;s++,u++)o.appendChild(H(l,new Date(e,t-1,s),s,u));for(s=1;s<=i;s++,u++)o.appendChild(H("",new Date(e,t,s),s,u));for(var f=i+1;f<=42-n&&(1===h.config.showMonths||u%7!=0);f++,u++)o.appendChild(H(c,new Date(e,t+1,f%i),f,u));var m=d("div","dayContainer");return m.appendChild(o),m}function J(){if(void 0!==h.daysContainer){s(h.daysContainer),h.weekNumbers&&s(h.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<h.config.showMonths;t++){var n=new Date(h.currentYear,h.currentMonth,1);n.setMonth(h.currentMonth+t),e.appendChild(B(n.getFullYear(),n.getMonth()))}h.daysContainer.appendChild(e),h.days=h.daysContainer.firstChild,"range"===h.config.mode&&1===h.selectedDates.length&&ne()}}function K(){if(!(h.config.showMonths>1||"dropdown"!==h.config.monthSelectorType)){var e=function(e){return!(void 0!==h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&e<h.config.minDate.getMonth())&&!(void 0!==h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()&&e>h.config.maxDate.getMonth())};h.monthsDropdownContainer.tabIndex=-1,h.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=d("option","flatpickr-monthDropdown-month");n.value=new Date(h.currentYear,t).getMonth().toString(),n.textContent=m(t,h.config.shorthandCurrentMonth,h.l10n),n.tabIndex=-1,h.currentMonth===t&&(n.selected=!0),h.monthsDropdownContainer.appendChild(n)}}}function U(){var e,t=d("div","flatpickr-month"),n=window.document.createDocumentFragment();h.config.showMonths>1||"static"===h.config.monthSelectorType?e=d("span","cur-month"):(h.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),F(h.monthsDropdownContainer,"change",function(e){var t=e.target,n=parseInt(t.value,10);h.changeMonth(n-h.currentMonth),ge("onMonthChange")}),K(),e=h.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&i.setAttribute("min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(i.setAttribute("max",h.config.maxDate.getFullYear().toString()),i.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),n.appendChild(o),t.appendChild(n),{container:t,yearElement:i,monthElement:e}}function q(){s(h.monthNav),h.monthNav.appendChild(h.prevMonthNav),h.config.showMonths&&(h.yearElements=[],h.monthElements=[]);for(var e=h.config.showMonths;e--;){var t=U();h.yearElements.push(t.yearElement),h.monthElements.push(t.monthElement),h.monthNav.appendChild(t.container)}h.monthNav.appendChild(h.nextMonthNav)}function $(){h.weekdayContainer?s(h.weekdayContainer):h.weekdayContainer=d("div","flatpickr-weekdays");for(var e=h.config.showMonths;e--;){var t=d("div","flatpickr-weekdaycontainer");h.weekdayContainer.appendChild(t)}return z(),h.weekdayContainer}function z(){if(h.weekdayContainer){var e=h.l10n.firstDayOfWeek,t=h.l10n.weekdays.shorthand.slice();e>0&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e)));for(var n=h.config.showMonths;n--;)h.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function G(e,t){void 0===t&&(t=!0);var n=t?e:e-h.currentMonth;n<0&&!0===h._hidePrevMonthArrow||n>0&&!0===h._hideNextMonthArrow||(h.currentMonth+=n,(h.currentMonth<0||h.currentMonth>11)&&(h.currentYear+=h.currentMonth>11?1:-1,h.currentMonth=(h.currentMonth+12)%12,ge("onYearChange"),K()),J(),ge("onMonthChange"),ve())}function V(e){return!(!h.config.appendTo||!h.config.appendTo.contains(e))||h.calendarContainer.contains(e)}function Z(e){if(h.isOpen&&!h.config.inline){var t="function"==typeof(r=e).composedPath?r.composedPath()[0]:r.target,n=V(t),a=t===h.input||t===h.altInput||h.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(h.input)||~e.path.indexOf(h.altInput)),i="blur"===e.type?a&&e.relatedTarget&&!V(e.relatedTarget):!a&&!n&&!V(e.relatedTarget),o=!h.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&o&&(void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&T(),h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}var r}function Q(e){if(!(!e||h.config.minDate&&e<h.config.minDate.getFullYear()||h.config.maxDate&&e>h.config.maxDate.getFullYear())){var t=e,n=h.currentYear!==t;h.currentYear=t||h.currentYear,h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth)),n&&(h.redraw(),ge("onYearChange"),K())}}function X(e,t){void 0===t&&(t=!0);var n=h.parseDate(e,void 0,t);if(h.config.minDate&&n&&w(n,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&n&&w(n,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime)>0)return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===n)return!1;for(var a=h.config.enable.length>0,i=a?h.config.enable:h.config.disable,o=0,r=void 0;o<i.length;o++){if("function"==typeof(r=i[o])&&r(n))return a;if(r instanceof Date&&void 0!==n&&r.getTime()===n.getTime())return a;if("string"==typeof r&&void 0!==n){var l=h.parseDate(r,void 0,!0);return l&&l.getTime()===n.getTime()?a:!a}if("object"==typeof r&&void 0!==n&&r.from&&r.to&&n.getTime()>=r.from.getTime()&&n.getTime()<=r.to.getTime())return a}return!a}function ee(e){return void 0!==h.daysContainer&&(-1===e.className.indexOf("hidden")&&h.daysContainer.contains(e))}function te(e){var t=e.target===h._input,n=h.config.allowInput,a=h.isOpen&&(!n||!t),i=h.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return h.setDate(h._input.value,!0,e.target===h.altInput?h.config.altFormat:h.config.dateFormat),e.target.blur();h.open()}else if(V(e.target)||a||i){var o=!!h.timeContainer&&h.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?(e.preventDefault(),T(),de()):se(e);break;case 27:e.preventDefault(),de();break;case 8:case 46:t&&!h.config.allowInput&&(e.preventDefault(),h.clear());break;case 37:case 39:if(o||t)h.hourElement&&h.hourElement.focus();else if(e.preventDefault(),void 0!==h.daysContainer&&(!1===n||document.activeElement&&ee(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),G(r),R(W(1),0)):R(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;h.daysContainer&&void 0!==e.target.$i||e.target===h.input||e.target===h.altInput?e.ctrlKey?(e.stopPropagation(),Q(h.currentYear-l),R(W(1),0)):o||R(void 0,7*l):e.target===h.currentYearElement?Q(h.currentYear-l):h.config.enableTime&&(!o&&h.hourElement&&h.hourElement.focus(),T(e),h._debouncedChange());break;case 9:if(o){var c=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].concat(h.pluginElements).filter(function(e){return e}),d=c.indexOf(e.target);if(-1!==d){var s=c[d+(e.shiftKey?-1:1)];e.preventDefault(),(s||h._input).focus()}}else!h.config.noCalendar&&h.daysContainer&&h.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),h._input.focus())}}if(void 0!==h.amPM&&e.target===h.amPM)switch(e.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0],k(),we();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1],k(),we()}(t||V(e.target))&&ge("onKeyDown",e)}function ne(e){if(1===h.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),n=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),a=Math.min(t,h.selectedDates[0].getTime()),i=Math.max(t,h.selectedDates[0].getTime()),o=!1,r=0,l=0,c=a;c<i;c+=C.DAY)X(new Date(c),!0)||(o=o||c>a&&c<i,c<n&&(!r||c>r)?r=c:c>n&&(!l||c<l)&&(l=c));for(var d=0;d<h.config.showMonths;d++)for(var s=h.daysContainer.children[d],u=function(a,i){var c=s.children[a],d=c.dateObj.getTime(),u=r>0&&d<r||l>0&&d>l;return u?(c.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){c.classList.remove(e)}),"continue"):o&&!u?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){c.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t<=h.selectedDates[0].getTime()?"startRange":"endRange"),n<t&&d===n?c.classList.add("startRange"):n>t&&d===n&&c.classList.add("endRange"),d>=r&&(0===l||d<=l)&&b(d,n,t)&&c.classList.add("inRange"))))},f=0,m=s.children.length;f<m;f++)u(f)}}function ae(){!h.isOpen||h.config.static||h.config.inline||le()}function ie(){h.setDate(void 0!==h.config.minDate?new Date(h.config.minDate.getTime()):new Date,!0),S(),we()}function oe(e){return function(t){var n=h.config["_"+e+"Date"]=h.parseDate(t,h.config.dateFormat),a=h.config["_"+("min"===e?"max":"min")+"Date"];void 0!==n&&(h["min"===e?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(e){return X(e)}),h.selectedDates.length||"min"!==e||I(n),we()),h.daysContainer&&(ce(),void 0!==n?h.currentYearElement[e]=n.getFullYear().toString():h.currentYearElement.removeAttribute(e),h.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function re(){"object"!=typeof h.config.locale&&void 0===E.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale)),h.l10n=e({},E.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?E.l10ns[h.config.locale]:void 0),p.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")",void 0===e({},g,JSON.parse(JSON.stringify(f.dataset||{}))).time_24hr&&void 0===E.defaultConfig.time_24hr&&(h.config.time_24hr=h.l10n.time_24hr),h.formatDate=v(h),h.parseDate=D({config:h.config,l10n:h.l10n})}function le(e){if(void 0!==h.calendarContainer){ge("onPreCalendarPosition");var t=e||h._positionElement,n=Array.prototype.reduce.call(h.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=h.calendarContainer.offsetWidth,i=h.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=t.getBoundingClientRect(),d=window.innerHeight-l.bottom,s="above"===o||"below"!==o&&d<n&&l.top>n,u=window.pageYOffset+l.top+(s?-n-2:t.offsetHeight+2);if(c(h.calendarContainer,"arrowTop",!s),c(h.calendarContainer,"arrowBottom",s),!h.config.inline){var f=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),m=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+a>window.document.body.offsetWidth,p=m+a>window.document.body.offsetWidth;if(c(h.calendarContainer,"rightMost",g),!h.config.static)if(h.calendarContainer.style.top=u+"px",g)if(p){var v=document.styleSheets[0];if(void 0===v)return;var D=window.document.body.offsetWidth,w=Math.max(0,D/2-a/2),b=v.cssRules.length,C="{left:"+l.left+"px;right:auto;}";c(h.calendarContainer,"rightMost",!1),c(h.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+C,b),h.calendarContainer.style.left=w+"px",h.calendarContainer.style.right="auto"}else h.calendarContainer.style.left="auto",h.calendarContainer.style.right=m+"px";else h.calendarContainer.style.left=f+"px",h.calendarContainer.style.right="auto"}}}function ce(){h.config.noCalendar||h.isMobile||(ve(),J())}function de(){h._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function se(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=h.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()<h.currentMonth||a.getMonth()>h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;if(h.selectedDateElem=n,"single"===h.config.mode)h.selectedDates=[a];else if("multiple"===h.config.mode){var o=he(a);o?h.selectedDates.splice(parseInt(o),1):h.selectedDates.push(a)}else"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1,!1),h.latestSelectedDateObj=a,h.selectedDates.push(a),0!==w(a,h.selectedDates[0],!0)&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(k(),i){var r=h.currentYear!==a.getFullYear();h.currentYear=a.getFullYear(),h.currentMonth=a.getMonth(),r&&(ge("onYearChange"),K()),ge("onMonthChange")}if(ve(),J(),we(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),i||"range"===h.config.mode||1!==h.config.showMonths?void 0!==h.selectedDateElem&&void 0===h.hourElement&&h.selectedDateElem&&h.selectedDateElem.focus():L(n),void 0!==h.hourElement&&void 0!==h.hourElement&&h.hourElement.focus(),h.config.closeOnSelect){var l="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime;(l||c)&&de()}Y()}}h.parseDate=D({config:h.config,l10n:h.l10n}),h._handlers=[],h.pluginElements=[],h.loadedPlugins=[],h._bind=F,h._setHoursFromDate=I,h._positionCalendar=le,h.changeMonth=G,h.changeYear=Q,h.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);h.input.value="",void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[],h.latestSelectedDateObj=void 0,!0===t&&(h.currentYear=h._initialDate.getFullYear(),h.currentMonth=h._initialDate.getMonth());h.showTimeInput=!1,!0===h.config.enableTime&&S();h.redraw(),e&&ge("onChange")},h.close=function(){h.isOpen=!1,h.isMobile||(void 0!==h.calendarContainer&&h.calendarContainer.classList.remove("open"),void 0!==h._input&&h._input.classList.remove("active"));ge("onClose")},h._createElement=d,h.destroy=function(){void 0!==h.config&&ge("onDestroy");for(var e=h._handlers.length;e--;){var t=h._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config.static&&h.calendarContainer.parentNode){var n=h.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete h[e]}catch(e){}})},h.isEnabled=X,h.jumpToDate=A,h.open=function(e,t){void 0===t&&(t=h._positionElement);if(!0===h.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==h.mobileInput&&(h.mobileInput.focus(),h.mobileInput.click()),void ge("onOpen");if(h._input.disabled||h.config.inline)return;var n=h.isOpen;h.isOpen=!0,n||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),ge("onOpen"),le(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&ie(),!1!==h.config.allowInput||void 0!==e&&h.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))},h.redraw=ce,h.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(h.config,e),e)void 0!==ue[a]&&ue[a].forEach(function(e){return e()});else h.config[e]=n,void 0!==ue[e]?ue[e].forEach(function(e){return e()}):t.indexOf(e)>-1&&(h.config[e]=l(n));h.redraw(),we(!1)},h.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=h.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return h.clear(t);fe(e,n),h.showTimeInput=h.selectedDates.length>0,h.latestSelectedDateObj=h.selectedDates[h.selectedDates.length-1],h.redraw(),A(),I(),0===h.selectedDates.length&&h.clear(!1);we(t),t&&ge("onChange")},h.toggle=function(e){if(!0===h.isOpen)return h.close();h.open(e)};var ue={locale:[re,z],showMonths:[q,x,$],minDate:[A],maxDate:[A]};function fe(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return h.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[h.parseDate(e,t)];else if("string"==typeof e)switch(h.config.mode){case"single":case"time":n=[h.parseDate(e,t)];break;case"multiple":n=e.split(h.config.conjunction).map(function(e){return h.parseDate(e,t)});break;case"range":n=e.split(h.l10n.rangeSeparator).map(function(e){return h.parseDate(e,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));h.selectedDates=n.filter(function(e){return e instanceof Date&&X(e,!1)}),"range"===h.config.mode&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function me(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?h.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:h.parseDate(e.from,void 0),to:h.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(e,t){if(void 0!==h.config){var n=h.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&a<n.length;a++)n[a](h.selectedDates,h.input.value,h,t);"onChange"===e&&(h.input.dispatchEvent(pe("change")),h.input.dispatchEvent(pe("input")))}}function pe(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function he(e){for(var t=0;t<h.selectedDates.length;t++)if(0===w(h.selectedDates[t],e))return""+t;return!1}function ve(){h.config.noCalendar||h.isMobile||!h.monthNav||(h.yearElements.forEach(function(e,t){var n=new Date(h.currentYear,h.currentMonth,1);n.setMonth(h.currentMonth+t),h.config.showMonths>1||"static"===h.config.monthSelectorType?h.monthElements[t].textContent=m(n.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ":h.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYear<h.config.minDate.getFullYear()),h._hideNextMonthArrow=void 0!==h.config.maxDate&&(h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth+1>h.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function De(e){return h.selectedDates.map(function(t){return h.formatDate(t,e)}).filter(function(e,t,n){return"range"!==h.config.mode||h.config.enableTime||n.indexOf(e)===t}).join("range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator)}function we(e){void 0===e&&(e=!0),void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):""),h.input.value=De(h.config.dateFormat),void 0!==h.altInput&&(h.altInput.value=De(h.config.altFormat)),!1!==e&&ge("onValueUpdate")}function be(e){var t=h.prevMonthNav.contains(e.target),n=h.nextMonthNav.contains(e.target);t||n?G(t?-1:1):h.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):e.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}return function(){h.element=h.input=f,h.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e({},g,JSON.parse(JSON.stringify(f.dataset||{}))),o={};h.config.parseDate=i.parseDate,h.config.formatDate=i.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(e){h.config._enable=me(e)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(e){h.config._disable=me(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var c=E.defaultConfig.dateFormat||n.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):c+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var d=E.defaultConfig.altFormat||n.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):d+" h:i"+(i.enableSeconds?":S":"")+" K"}i.altInputClass||(h.config.altInputClass=h.input.className+" "+h.config.altInputClass),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:oe("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:oe("max")});var s=function(e){return function(t){h.config["min"===e?"_minTime":"_maxTime"]=h.parseDate(t,"H:i:S")}};Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:s("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:s("max")}),"time"===i.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),Object.assign(h.config,o,i);for(var u=0;u<a.length;u++)h.config[a[u]]=!0===h.config[a[u]]||"true"===h.config[a[u]];t.filter(function(e){return void 0!==h.config[e]}).forEach(function(e){h.config[e]=l(h.config[e]||[]).map(y)}),h.isMobile=!h.config.disableMobile&&!h.config.inline&&"single"===h.config.mode&&!h.config.disable.length&&!h.config.enable.length&&!h.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var u=0;u<h.config.plugins.length;u++){var m=h.config.plugins[u](h)||{};for(var p in m)t.indexOf(p)>-1?h.config[p]=l(m[p]).map(y).concat(h.config[p]):void 0===i[p]&&(h.config[p]=m[p])}ge("onParseConfig")}(),re(),h.input=h.config.wrap?f.querySelector("[data-input]"):f,h.input?(h.input._type=h.input.type,h.input.type="text",h.input.classList.add("flatpickr-input"),h._input=h.input,h.config.altInput&&(h.altInput=d(h.input.nodeName,h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling)),h.config.allowInput||h._input.setAttribute("readonly","readonly"),h._positionElement=h.config.positionElement||h._input):h.config.errorHandler(new Error("Invalid input element specified")),function(){h.selectedDates=[],h.now=h.parseDate(h.config.now)||new Date;var e=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);e&&fe(e,h.config.dateFormat),h._initialDate=h.selectedDates.length>0?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()<h.now.getTime()?h.config.maxDate:h.now,h.currentYear=h._initialDate.getFullYear(),h.currentMonth=h._initialDate.getMonth(),h.selectedDates.length>0&&(h.latestSelectedDateObj=h.selectedDates[0]),void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i")),void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i")),h.minDateHasTime=!!h.config.minDate&&(h.config.minDate.getHours()>0||h.config.minDate.getMinutes()>0||h.config.minDate.getSeconds()>0),h.maxDateHasTime=!!h.config.maxDate&&(h.config.maxDate.getHours()>0||h.config.maxDate.getMinutes()>0||h.config.maxDate.getSeconds()>0),Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(e){h._showTimeInput=e,h.calendarContainer&&c(h.calendarContainer,"showTimeInput",e),h.isOpen&&le()}})}(),h.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=h.currentMonth),void 0===t&&(t=h.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[e]}},h.isMobile||function(){var e=window.document.createDocumentFragment();if(h.calendarContainer=d("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(e.appendChild((h.monthNav=d("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=d("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=d("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,q(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(e){h.__hidePrevMonthArrow!==e&&(c(h.prevMonthNav,"flatpickr-disabled",e),h.__hidePrevMonthArrow=e)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(e){h.__hideNextMonthArrow!==e&&(c(h.nextMonthNav,"flatpickr-disabled",e),h.__hideNextMonthArrow=e)}}),h.currentYearElement=h.yearElements[0],ve(),h.monthNav)),h.innerContainer=d("div","flatpickr-innerContainer"),h.config.weekNumbers){var t=function(){h.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",h.l10n.weekAbbreviation));var t=d("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;h.innerContainer.appendChild(n),h.weekNumbers=a,h.weekWrapper=n}h.rContainer=d("div","flatpickr-rContainer"),h.rContainer.appendChild($()),h.daysContainer||(h.daysContainer=d("div","flatpickr-days"),h.daysContainer.tabIndex=-1),J(),h.rContainer.appendChild(h.daysContainer),h.innerContainer.appendChild(h.rContainer),e.appendChild(h.innerContainer)}h.config.enableTime&&e.appendChild(function(){h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=d("div","flatpickr-time"),h.timeContainer.tabIndex=-1;var e=d("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":h.l10n.hourAriaLabel});h.hourElement=t.getElementsByTagName("input")[0];var n=u("flatpickr-minute",{"aria-label":h.l10n.minuteAriaLabel});if(h.minuteElement=n.getElementsByTagName("input")[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(h.config.defaultHour)),h.minuteElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("min","0"),h.minuteElement.setAttribute("max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(n),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds){h.timeContainer.classList.add("hasSeconds");var a=u("flatpickr-second");h.secondElement=a.getElementsByTagName("input")[0],h.secondElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("step",h.minuteElement.getAttribute("step")),h.secondElement.setAttribute("min","0"),h.secondElement.setAttribute("max","59"),h.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(a)}return h.config.time_24hr||(h.amPM=d("span","flatpickr-am-pm",h.l10n.amPM[o((h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour)>11)]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}()),c(h.calendarContainer,"rangeMode","range"===h.config.mode),c(h.calendarContainer,"animate",!0===h.config.animate),c(h.calendarContainer,"multiMonth",h.config.showMonths>1),h.calendarContainer.appendChild(e);var r=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;if((h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!r&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)){var l=d("div","flatpickr-wrapper");h.element.parentNode&&h.element.parentNode.insertBefore(l,h.element),l.appendChild(h.element),h.altInput&&l.appendChild(h.altInput),l.appendChild(h.calendarContainer)}h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+e+"]"),function(t){return F(t,"click",h[e])})}),h.isMobile)!function(){var e=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=d("input",h.input.className+" flatpickr-mobile"),h.mobileInput.step=h.input.getAttribute("step")||"any",h.mobileInput.tabIndex=1,h.mobileInput.type=e,h.mobileInput.disabled=h.input.disabled,h.mobileInput.required=h.input.required,h.mobileInput.placeholder=h.input.placeholder,h.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",h.selectedDates.length>0&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr)),h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d")),h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d")),h.input.type="hidden",void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(e){}F(h.mobileInput,"change",function(e){h.setDate(e.target.value,!1,h.mobileFormatStr),ge("onChange"),ge("onClose")})}();else{var e=r(ae,50);h._debouncedChange=r(Y,M),h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(h.daysContainer,"mouseover",function(e){"range"===h.config.mode&&ne(e.target)}),F(window.document.body,"keydown",te),h.config.inline||h.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"touchstart",Z):F(window.document,"mousedown",N(Z)),F(window.document,"focus",Z,{capture:!0}),!0===h.config.clickOpens&&(F(h._input,"focus",h.open),F(h._input,"mousedown",N(h.open))),void 0!==h.daysContainer&&(F(h.monthNav,"mousedown",N(be)),F(h.monthNav,["keyup","increment"],_),F(h.daysContainer,"mousedown",N(se))),void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(F(h.timeContainer,["increment"],T),F(h.timeContainer,"blur",T,{capture:!0}),F(h.timeContainer,"mousedown",N(P)),F([h.hourElement,h.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==h.secondElement&&F(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&F(h.amPM,"mousedown",N(function(e){T(e),Y()})))}}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&I(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),we(!1)),x(),h.showTimeInput=h.selectedDates.length>0||h.config.noCalendar;var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&a&&le(),ge("onReady")}(),h}function x(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],i=0;i<n.length;i++){var o=n[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=y(o,t||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return x(this,e)},HTMLElement.prototype.flatpickr=function(e){return x([this],e)});var E=function(e,t){return"string"==typeof e?x(window.document.querySelectorAll(e),t):e instanceof Node?x([e],t):x(e,t)};return E.defaultConfig={},E.l10ns={en:e({},a),default:e({},a)},E.localize=function(t){E.l10ns.default=e({},E.l10ns.default,t)},E.setDefaults=function(t){E.defaultConfig=e({},E.defaultConfig,t)},E.parseDate=D({}),E.formatDate=v({}),E.compareDates=w,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return x(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=E),E});
assets/images/admin/car.svg ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 612 612" style="enable-background:new 0 0 612 612;" xml:space="preserve">
5
+ <g>
6
+ <g>
7
+ <path d="M175.205,239.62c0.127-1.965-0.533-3.902-1.833-5.381l-58.84-66.941c-1.3-1.479-3.135-2.381-5.102-2.508
8
+ c-1.975-0.126-3.902,0.533-5.381,1.833c-27.037,23.766-49.479,51.794-66.706,83.305c-0.944,1.729-1.165,3.762-0.611,5.651
9
+ c0.554,1.89,1.836,3.483,3.565,4.427l78.205,42.748c1.131,0.619,2.352,0.912,3.557,0.912c2.627,0,5.174-1.398,6.523-3.866
10
+ c11.386-20.828,26.229-39.359,44.114-55.08C174.178,243.422,175.08,241.587,175.205,239.62z"/>
11
+ <path d="M201.462,214.829c1.334,2.515,3.907,3.948,6.568,3.948c1.174,0,2.365-0.279,3.473-0.867
12
+ c20.962-11.117,43.512-18.371,67.025-21.561c4.064-0.551,6.913-4.293,6.362-8.358l-11.979-88.316
13
+ c-0.551-4.064-4.304-6.909-8.358-6.362c-35.708,4.843-69.949,15.857-101.772,32.736c-3.623,1.922-5.002,6.416-3.082,10.041
14
+ L201.462,214.829z"/>
15
+ <path d="M105.785,334.345l-86.017-23.338c-1.901-0.514-3.929-0.255-5.638,0.725s-2.958,2.598-3.475,4.499
16
+ C3.586,342.295,0,369.309,0,396.523c0,4.657,0.111,9.329,0.342,14.284c0.185,3.981,3.468,7.083,7.414,7.083
17
+ c0.116,0,0.234-0.002,0.35-0.008l89.031-4.113c1.967-0.09,3.82-0.96,5.145-2.415c1.327-1.455,2.022-3.38,1.93-5.347
18
+ c-0.155-3.341-0.23-6.444-0.23-9.484c0-18.02,2.365-35.873,7.029-53.066C112.082,339.499,109.743,335.42,105.785,334.345z"/>
19
+ <path d="M438.731,120.745c-32.411-15.625-67.04-25.308-102.925-28.786c-1.972-0.198-3.918,0.408-5.439,1.659
20
+ c-1.521,1.252-2.481,3.056-2.671,5.018l-8.593,88.712c-0.396,4.082,2.594,7.713,6.677,8.108
21
+ c23.652,2.291,46.463,8.669,67.8,18.954c1.015,0.49,2.118,0.738,3.225,0.738c0.826,0,1.654-0.139,2.45-0.416
22
+ c1.859-0.649,3.385-2.012,4.24-3.786l38.7-80.287C443.978,126.965,442.427,122.525,438.731,120.745z"/>
23
+ <path d="M569.642,245.337c0.48-1.911,0.184-3.932-0.828-5.624c-18.432-30.835-41.933-57.983-69.848-80.686
24
+ c-1.529-1.242-3.48-1.824-5.447-1.627c-1.959,0.203-3.758,1.174-5,2.702l-56.237,69.144c-1.242,1.529-1.828,3.488-1.625,5.447
25
+ c0.201,1.959,1.173,3.758,2.702,5.002c18.47,15.019,34.015,32.975,46.205,53.369c1.392,2.326,3.855,3.618,6.383,3.618
26
+ c1.297,0,2.61-0.34,3.803-1.054l76.501-45.728C567.94,248.889,569.16,247.248,569.642,245.337z"/>
27
+ <path d="M598.044,304.939c-1.228-3.915-5.397-6.096-9.308-4.867l-85.048,26.648c-3.915,1.226-6.093,5.393-4.867,9.306
28
+ c6.104,19.486,9.199,39.839,9.199,60.494c0,3.041-0.076,6.144-0.23,9.484c-0.092,1.967,0.602,3.892,1.93,5.347
29
+ c1.327,1.456,3.178,2.325,5.145,2.415l89.031,4.113c0.118,0.005,0.234,0.008,0.35,0.008c3.944,0,7.228-3.103,7.414-7.083
30
+ c0.229-4.955,0.342-9.627,0.342-14.284C612,365.306,607.306,334.494,598.044,304.939z"/>
31
+ <path d="M305.737,380.755c-1.281,0-2.555,0.042-3.824,0.11l-120.65-71.185c-2.953-1.745-6.702-1.308-9.176,1.065
32
+ c-2.476,2.371-3.07,6.099-1.456,9.121l65.815,123.355c-0.242,2.376-0.371,4.775-0.371,7.195c0,18.608,7.246,36.101,20.403,49.258
33
+ c13.158,13.158,30.652,20.404,49.26,20.404c18.608,0,36.101-7.248,49.258-20.404c13.158-13.157,20.403-30.65,20.403-49.258
34
+ c0-18.608-7.246-36.101-20.403-49.258C341.839,388.001,324.344,380.755,305.737,380.755z"/>
35
+ </g>
36
+ </g>
37
+ <g>
38
+ </g>
39
+ <g>
40
+ </g>
41
+ <g>
42
+ </g>
43
+ <g>
44
+ </g>
45
+ <g>
46
+ </g>
47
+ <g>
48
+ </g>
49
+ <g>
50
+ </g>
51
+ <g>
52
+ </g>
53
+ <g>
54
+ </g>
55
+ <g>
56
+ </g>
57
+ <g>
58
+ </g>
59
+ <g>
60
+ </g>
61
+ <g>
62
+ </g>
63
+ <g>
64
+ </g>
65
+ <g>
66
+ </g>
67
+ </svg>
assets/images/admin/dragdrop-builder-icon.png ADDED
Binary file
assets/images/admin/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
assets/images/admin/mo-pro-upgrade.jpg ADDED
Binary file
assets/images/admin/shortcode-builder-icon.png ADDED
Binary file
assets/images/bash/bash-facebook.png ADDED
Binary file
assets/images/bash/bash-google.png ADDED
Binary file
assets/images/bash/bash-twitter.png ADDED
Binary file
assets/images/dixon-fe-profile/bg.jpg ADDED
Binary file
assets/images/dixon-fe-profile/facebook.png ADDED
Binary file
assets/images/dixon-fe-profile/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
assets/images/dixon-fe-profile/inn.png ADDED
Binary file
assets/images/dixon-fe-profile/linkedin.png ADDED
Binary file
assets/images/dixon-fe-profile/twitter.png ADDED
Binary file
assets/images/frontend/arrow-down.png ADDED
Binary file
assets/images/frontend/jc_dft_img.jpg ADDED
Binary file
assets/images/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
assets/images/monochrome/dribbble.png ADDED
Binary file
assets/images/monochrome/facebook.png ADDED
Binary file
assets/images/monochrome/flickr.png ADDED
Binary file
assets/images/monochrome/github.png ADDED
Binary file
assets/images/monochrome/instagram.png ADDED
Binary file
assets/images/monochrome/pinterest.png ADDED
Binary file
assets/images/monochrome/soundcloud.png ADDED
Binary file
assets/images/monochrome/spotify.png ADDED
Binary file
assets/images/monochrome/twitter.png ADDED
Binary file
assets/images/monochrome/youtube.png ADDED
Binary file
assets/images/parallel/dots.png ADDED
Binary file
assets/images/parallel/facebook.png ADDED
Binary file
assets/images/parallel/github.png ADDED
Binary file
assets/images/parallel/google.png ADDED
Binary file
assets/images/parallel/linkedin.png ADDED
Binary file
assets/images/parallel/twitter.png ADDED
Binary file
assets/images/smiley/avatar.gif ADDED
Binary file
assets/images/smiley/bg1.png ADDED
Binary file
assets/images/smiley/bg2.png ADDED
Binary file
assets/images/smiley/facebook.png ADDED
Binary file
assets/images/smiley/linkedin.png ADDED
Binary file
assets/images/smiley/twitter.png ADDED
Binary file
assets/images/social-login/amazon.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m15238 12129c-409-559-847-1014-847-2055v-3454c0-1464 106-2808-985-3815-858-817-2284-1105-3374-1105-2134 0-4513 787-5012 3396-53 277 151 422 335 462l2172 233c203-11 350-208 389-407 186-899 948-1331 1802-1331 461 0 984 167 1257 576 315 455 273 1081 273 1607v289c-1300 144-2999 240-4216 767-1403 601-2388 1825-2388 3623 0 2306 1466 3458 3354 3458 1593 0 2465-373 3694-1612 408 585 542 866 1285 1478 167 88 382 80 529-52l1-1 5 5c448-393 1260-1092 1719-1472 182-148 150-389 7-590zm-4410-996c-355 625-922 1008-1552 1008-858 0-1362-649-1362-1608 0-1889 1713-2231 3333-2231v478h1c0 864 20 1583-420 2353z" fill="#221f1f"/><g fill="#ff9201"><path d="m17917 15897c-2146 1584-5257 2426-7937 2426-3753 0-7135-1388-9693-3698-201-182-22-430 219-289 2761 1607 6174 2574 9700 2574 2379 0 4993-493 7399-1514 362-153 666 240 312 501z"/><path d="m18809 14878c-274-350-1815-165-2505-82-211 24-243-158-54-292 1228-863 3241-613 3475-325 236 293-62 2310-1213 3273-177 149-345 70-267-126 259-648 839-2096 564-2448z"/></g></g></svg>
assets/images/social-login/disqus.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m10358 19522c-2330 0-4460-847-6106-2256l-4052 555 1566-3862c-547-1202-851-2540-851-3946 0-5256 4228-9513 9443-9513 5214 0 9442 4257 9442 9513 0 5252-4228 9509-9442 9509zm5154-9537v-28c0-2744-1938-4701-5274-4701h-3609v9513h3553c3364 0 5330-2040 5330-4784zm-5234 2448h-1055v-4840h1055c1546 0 2577 882 2577 2408v24c0 1538-1031 2408-2577 2408z" fill="#2e9fff"/></g></svg>
assets/images/social-login/facebook.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m17159 200h-14318c-1459 0-2641 1182-2641 2641v14318c0 1459 1182 2641 2641 2641h7061l13-7004h-1820c-236 0-429-192-430-428l-8-2257c-1-238 191-432 429-432h1816v-2181c0-2532 1547-3910 3805-3910h1853c237 0 429 192 429 429v1904c0 237-192 429-429 429l-1137 1c-1228 0-1466 584-1466 1440v1888h2699c257 0 457 225 426 480l-267 2259c-26 215-209 378-427 378h-2419l-12 7004h4202c1459 0 2641-1182 2641-2641v-14318c0-1459-1182-2641-2641-2641z" fill="#3b5998"/></g></svg>
assets/images/social-login/github-fa.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>
assets/images/social-login/google.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m340 199c-24 0-42 21-42 45v6c-41-8-62-20-84-44-13 27 1 49 17 62-10 0-20-2-27-8 0-1-1 0-1 0 6 23 27 39 42 44-14 0-23 2-34-5 0 0-1 0-1 1 8 22 24 29 46 29-11 9-26 17-55 18-1 0-2 1 0 2 10 9 36 16 73 16 60 0 108-55 108-123v-3c10-4 15-13 18-21 0-1 0-1-1-1l-20 7s0 0 0-1c8-7 15-15 17-24-10 4-19 8-26 10-1 0-2 0-3 0-5-3-19-10-27-10z" fill="#65bbf2"/><path d="m19608 10217c0-806-64-1394-206-2004h-9202v3638h5402c-109 902-698 2264-2004 3179l-20 121 2911 2255 202 20c1851-1709 2917-4226 2917-7209z" fill="#4285f4"/><path d="m10200 19800c2644 0 4868-872 6489-2374l-3091-2396c-828 576-1939 979-3398 979-2592 0-4792-1709-5577-4073l-115 11-3023 2340-40 111c1610 3202 4921 5402 8755 5402z" fill="#34a853"/><path d="m4625 11938c-206-608-325-1261-325-1938 0-674 119-1328 315-1938l-4-130-3064-2379-102 47c-664 1330-1045 2821-1045 4400s381 3072 1045 4400z" fill="#fbbc05"/><path d="m10200 3989c1840 0 3081 796 3789 1460l2766-2700c-1700-1579-3911-2549-6555-2549-3834 0-7145 2200-8755 5402l3168 2462c795-2364 2995-4075 5587-4075z" fill="#eb4335"/></g></svg>
assets/images/social-login/instagram.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)" fill="#e4405f" transform="matrix(1 0 0 1.0005615 0 -1.113052)"><path d="m10000 1966c2616 0 2926 9 3960 57 955 43 1474 203 1820 337 170 63 309 128 466 219 256 147 455 303 661 514 211 206 366 404 514 660 90 157 155 295 219 466 133 345 293 864 336 1819 48 1032 58 1342 58 3958 0 2615-10 2925-58 3958-43 954-203 1473-336 1819-65 165-129 300-219 454-298 517-670 889-1187 1188-154 88-289 152-454 217-346 133-865 294-1820 337-1034 47-1343 57-3960 57s-2927-10-3960-57c-956-43-1475-204-1820-337-171-64-310-128-466-219-257-148-455-303-661-514-211-206-367-405-514-660-91-157-156-296-219-466-134-345-294-865-337-1819-48-1033-57-1343-57-3958 0-2616 9-2926 57-3958 43-955 203-1474 337-1819 63-171 128-309 219-466 147-256 303-454 514-660 206-211 404-367 661-514 156-91 295-156 466-219 345-134 864-294 1820-337 1033-48 1343-57 3960-57zm0-1765c-2662 0-2995 11-4041 59-1043 47-1755 213-2378 455-259 97-471 198-710 336-397 229-705 468-1027 794-326 321-565 629-794 1025-138 240-238 451-336 710-242 623-408 1335-455 2378-48 1044-59 1378-59 4038s11 2994 59 4038c48 1042 213 1755 456 2378 97 259 197 470 336 709 228 396 467 705 794 1025 321 326 629 566 1026 795 240 138 451 238 710 335 623 242 1335 408 2378 455 1046 48 1379 59 4041 59s2995-11 4041-59c1043-47 1755-213 2378-455 254-98 462-198 698-333 799-462 1373-1036 1834-1834 136-236 235-443 334-697 242-624 408-1336 455-2378 49-1045 60-1379 60-4038 0-2660-11-2994-60-4038-47-1043-213-1755-455-2378-98-259-197-471-336-710-228-396-468-705-794-1025-321-326-630-565-1027-795-239-137-450-238-709-335-623-242-1336-408-2378-455-1046-48-1379-59-4041-59z"/><path d="m9999 4966c-926 0-1714 210-2516 674-802 463-1379 1039-1842 1841s-674 1589-674 2514c0 927 211 1714 674 2516s1040 1378 1842 1841 1590 674 2516 674c927 0 1715-211 2517-674s1379-1039 1842-1841 674-1589 674-2516c0-925-211-1712-674-2514s-1040-1378-1842-1841c-802-464-1590-674-2517-674zm0 8295c-601 0-1112-137-1633-437-521-301-894-675-1196-1195-301-521-437-1032-437-1634 0-600 136-1111 437-1632 302-520 675-895 1196-1195 521-301 1032-437 1634-437 601 0 1112 136 1633 437 521 300 895 675 1196 1195 301 521 437 1032 437 1632 0 602-136 1113-437 1634-301 520-675 894-1196 1195-521 300-1032 437-1634 437z"/><path d="m16408 4767c0 217-49 401-158 589-109 187-243 321-430 430-188 108-372 158-589 158-216 0-400-50-588-158-188-109-322-243-431-430-108-188-157-372-157-589 0-216 49-400 157-587 109-188 243-323 431-431s372-157 588-157c217 0 401 49 589 157 187 108 321 243 430 431 109 187 158 371 158 587z"/></g></svg>
assets/images/social-login/linkedin.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m200 1607c0-777 645-1407 1451-1407h16698c799 0 1451 630 1451 1407v16847c0 784-652 1407-1451 1407h-16698c-806 0-1451-623-1451-1407z" fill="#0077b5"/><g fill="#fff"><path d="m6152 16659v-8881h-2976v8881zm-1495-10091c1040 0 1685-681 1685-1538-14-865-645-1532-1656-1532-1026 0-1686 667-1686 1532 0 857 645 1538 1642 1538z"/><path d="m7772 16659h2961v-4968c0-264 22-528 96-711 219-535 703-1085 1531-1085 1071 0 1496 814 1496 2008v4756h2961v-5100c0-2726-1459-3994-3408-3994-1606 0-2302 894-2698 1495h22v-1282h-2961c37 835 0 8881 0 8881z"/></g></g></svg>
assets/images/social-login/paypal.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m15543 1679c-908-1036-2550-1479-4648-1479h-6090c-430 0-794 312-862 737l-2537 16085c-49 317 196 603 517 603h3761l945-5990-30 188c67-423 430-737 858-737h1787c3509 0 6258-1425 7061-5549 24-122 46-242 63-358-102-54-102-54 0 0 240-1523-2-2561-825-3500z" fill="#27346a"/><path d="m8067 4631c101-48 212-74 330-74h4774c566 0 1092 37 1574 114 139 22 273 48 403 76 131 29 256 63 380 98 61 18 120 37 179 55 238 80 458 172 661 279 240-1525-2-2561-825-3500-908-1036-2550-1479-4648-1479h-6090c-430 0-794 312-862 737l-2537 16085c-49 317 196 603 517 603h3761l1960-12426c39-255 203-463 423-568z" fill="#27346a"/><path d="m16304 5535c-803 4124-3551 5551-7062 5551h-1787c-428 0-792 312-858 737l-1174 7447c-45 279 169 530 450 530h3171c375 0 694-273 754-644l29-161 598-3786 39-211c59-369 378-642 753-642h474c3070 0 5476-1248 6179-4857 291-1507 140-2766-635-3650-236-268-528-489-868-670-18 116-39 234-63 356z" fill="#2790c3"/><path d="m15525 4843c-122-35-249-68-378-96-131-30-266-55-403-78-483-77-1009-114-1576-114h-4774c-118 0-230 26-330 76-220 105-384 313-423 568l-1015 6436-30 188c67-425 429-737 859-737h1787c3511 0 6259-1425 7062-5551 24-122 44-240 63-356-205-107-425-201-661-279-59-20-120-39-181-57z" fill="#1f264f"/></g></svg>
assets/images/social-login/twitter.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m340 199c-24 0-42 21-42 45v6c-41-8-62-20-84-44-13 27 1 49 17 62-10 0-20-2-27-8 0-1-1 0-1 0 6 23 27 39 42 44-14 0-23 2-34-5 0 0-1 0-1 1 8 22 24 29 46 29-11 9-26 17-55 18-1 0-2 1 0 2 10 9 36 16 73 16 60 0 108-55 108-123v-3c10-4 15-13 18-21 0-1 0-1-1-1l-20 7v-1c8-7 15-15 17-24-10 4-19 8-26 10-1 0-2 0-3 0-5-3-19-10-27-10z" fill="#65bbf2"/><path d="m13880 2100c-2272 35-4061 1995-4061 4266v550c-4061-723-6058-1824-8260-4128-1308 2545 138 4678 1721 5848-1067 0-1962-138-2651-757-68-34-137 0-102 69 585 2133 2581 3681 4129 4128-1411 0-2340 206-3338-413-69-34-138 0-104 69 758 2098 2272 2752 4475 2752-1102 825-2581 1651-5370 1720-102 0-171 137-68 206 1033 860 3579 1514 7159 1514 5885 0 10669-5229 10669-11696v-344c930-344 1446-1169 1721-1995 0-34-35-69-69-69l-1962 688c-34 0-69-69-34-103 826-654 1445-1479 1721-2270 0 0-35-35-69-35-929 379-1824 756-2513 964-103 33-241 33-343-35-448-241-1790-929-2651-929z" fill="#55acee"/></g></svg>
assets/images/social-login/vk-fa.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg viewBox="0 0 576 512" xmlns="http://www.w3.org/2000/svg"><path d="m545 117.7c3.7-12.5 0-21.7-17.8-21.7h-58.9c-15 0-21.9 7.9-25.6 16.7 0 0-30 73.1-72.4 120.5-13.7 13.7-20 18.1-27.5 18.1-3.7 0-9.4-4.4-9.4-16.9v-116.7c0-15-4.2-21.7-16.6-21.7h-92.6c-9.4 0-15 7-15 13.5 0 14.2 21.2 17.5 23.4 57.5v86.8c0 19-3.4 22.5-10.9 22.5-20 0-68.6-73.4-97.4-157.4-5.8-16.3-11.5-22.9-26.6-22.9h-58.9c-16.8 0-20.2 7.9-20.2 16.7 0 15.6 20 93.1 93.1 195.5 48.7 69.9 117.3 107.8 179.7 107.8 37.5 0 42.1-8.4 42.1-22.9 0-66.8-3.4-73.1 15.4-73.1 8.7 0 23.7 4.4 58.7 38.1 40 40 46.6 57.9 69 57.9h58.9c16.8 0 25.3-8.4 20.4-25-11.2-34.9-86.9-106.7-90.3-111.5-8.7-11.2-6.2-16.2 0-26.2.1-.1 72-101.3 79.4-135.6z" fill="#45688e"/></svg>
assets/images/social-login/vkontakte.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg fill-rule="evenodd" height="200mm" preserveAspectRatio="xMidYMid" stroke-linejoin="round" stroke-width="28.222" viewBox="0 0 20000 20000" width="200mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h20000v20000h-20000z"/></clipPath><g clip-path="url(#a)"><path d="m340 199c-24 0-42 21-42 45v6c-41-8-62-20-84-44-13 27 1 49 17 62-10 0-20-2-27-8 0-1-1 0-1 0 6 23 27 39 42 44-14 0-23 2-34-5 0 0-1 0-1 1 8 22 24 29 46 29-11 9-26 17-55 18-1 0-2 1 0 2 10 9 36 16 73 16 60 0 108-55 108-123v-3c10-4 15-13 18-21 0-1 0-1-1-1l-20 7v-1c8-7 15-15 17-24-10 4-19 8-26 10-1 0-2 0-3 0-5-3-19-10-27-10z" fill="#65bbf2"/><path d="m19696 14498c-24-50-46-93-66-127-341-612-990-1364-1949-2255l-21-21-10-10-10-10h-10c-436-415-711-694-827-837-212-272-258-548-143-826 81-211 387-657 918-1337 280-361 501-650 664-868 1177-1564 1687-2565 1531-2999l-61-103c-42-60-147-117-316-168-170-50-388-59-654-25l-2939 20c-47-17-115-15-204 5-89 21-133 31-133 31l-51 25-40 31c-35 21-72 56-113 107-40 51-75 111-101 179-320 823-684 1589-1092 2296-253 422-484 787-694 1097-212 309-388 538-531 684-143 145-273 263-388 351-116 89-204 127-266 113-60-14-118-28-173-41-95-62-172-145-230-250-58-106-96-238-116-398-21-160-33-298-37-414-3-115-1-278 5-489 7-212 11-355 11-428 0-260 4-540 15-843 11-302 19-542 26-720 7-176 10-363 10-561 0-196-12-351-36-464-24-112-59-221-107-326-47-105-117-187-210-245-91-58-205-103-341-138-361-82-820-126-1378-133-1265-13-2078 68-2438 246-143 75-273 176-388 305-123 150-140 231-51 246 408 60 697 206 867 438l61 123c48 88 95 245 143 469 47 225 79 473 92 744 33 498 33 922 0 1276-34 354-66 630-97 827s-76 357-138 480c-61 122-102 196-123 224-20 27-37 44-50 51-88 34-181 51-276 51s-211-48-346-143c-137-95-278-226-424-393-147-166-312-399-495-699-184-299-374-652-572-1061l-163-296c-102-191-241-467-418-831-178-365-334-716-469-1057-55-143-137-252-245-326l-52-31c-34-28-88-56-163-86-75-32-153-53-234-67l-2797 20c-285 0-480 65-581 194l-42 61c-20 35-30 88-30 163s20 167 61 276c408 959 852 1884 1332 2776 479 891 897 1608 1250 2152 354 545 715 1059 1081 1541 368 483 611 793 731 929 118 137 211 238 280 306l255 245c164 163 403 359 720 587 316 228 667 453 1051 673 385 221 831 402 1342 541 510 140 1006 196 1489 169h1175c238-21 418-96 541-224l40-52c27-40 53-103 76-188 24-85 36-179 36-281-8-293 15-556 66-791 51-234 109-411 174-530 64-120 137-220 219-301 82-82 139-132 174-149 34-16 60-28 81-35 164-54 355-1 577 158 221 160 429 357 622 592 195 235 428 499 699 791 273 292 511 510 715 653l204 123c136 82 313 156 531 224 217 68 407 85 571 51l2612-40c259 0 459-44 602-128 143-85 228-179 256-281 27-102 28-217 5-347-25-129-48-219-72-271z" fill="#4c75a3"/></g></svg>
assets/images/social-login/yahoo.svg ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg
3
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
4
+ xmlns:cc="http://creativecommons.org/ns#"
5
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
+ xmlns:svg="http://www.w3.org/2000/svg"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ xmlns:xlink="http://www.w3.org/1999/xlink"
9
+ version="1.1"
10
+ id="svg3522"
11
+ height="200mm"
12
+ width="200mm">
13
+ <defs
14
+ id="defs3524">
15
+ <linearGradient
16
+ gradientUnits="userSpaceOnUse"
17
+ gradientTransform="scale(0.37684406,2.6536175)"
18
+ xlink:href="#linearGradient3225"
19
+ id="linearGradient3231"
20
+ x1="249.93822"
21
+ y1="40.551739"
22
+ x2="249.93822"
23
+ y2="72.466637" />
24
+ <linearGradient
25
+ id="linearGradient3225">
26
+ <stop
27
+ offset="0"
28
+ id="stop3227"
29
+ stop-color="#210045" />
30
+ <stop
31
+ id="stop3237"
32
+ offset="0.25"
33
+ stop-color="#25004d" />
34
+ <stop
35
+ id="stop3235"
36
+ offset="0.5"
37
+ stop-color="#2b005c" />
38
+ <stop
39
+ id="stop3233"
40
+ offset="0.748544"
41
+ stop-color="#340071" />
42
+ <stop
43
+ offset="1"
44
+ id="stop3229"
45
+ stop-color="#3e0088" />
46
+ </linearGradient>
47
+ <linearGradient
48
+ gradientUnits="userSpaceOnUse"
49
+ gradientTransform="scale(0.44853439,2.2294834)"
50
+ xlink:href="#linearGradient3247"
51
+ id="linearGradient3253"
52
+ x1="215.35764"
53
+ y1="47.912979"
54
+ x2="239.58209"
55
+ y2="86.302849" />
56
+ <linearGradient
57
+ id="linearGradient3247">
58
+ <stop
59
+ offset="0"
60
+ id="stop3249"
61
+ stop-color="#5500bd" />
62
+ <stop
63
+ offset="1"
64
+ id="stop3251"
65
+ stop-color="#5300b5" />
66
+ </linearGradient>
67
+ <linearGradient
68
+ gradientUnits="userSpaceOnUse"
69
+ gradientTransform="scale(0.82014979,1.2192895)"
70
+ xlink:href="#linearGradient3269"
71
+ id="linearGradient3267"
72
+ x1="91.833229"
73
+ y1="76.647705"
74
+ x2="102.88281"
75
+ y2="71.7015" />
76
+ <linearGradient
77
+ id="linearGradient3269">
78
+ <stop
79
+ id="stop3271"
80
+ offset="0"
81
+ stop-opacity="0.980392"
82
+ stop-color="#27005d" />
83
+ <stop
84
+ offset="0.317674"
85
+ id="stop3279"
86
+ stop-color="#2b005d" />
87
+ <stop
88
+ offset="0.597562"
89
+ id="stop3277"
90
+ stop-color="#280055" />
91
+ <stop
92
+ offset="0.808776"
93
+ id="stop3275"
94
+ stop-color="#24004d" />
95
+ <stop
96
+ id="stop3273"
97
+ offset="1"
98
+ stop-color="#230049" />
99
+ </linearGradient>
100
+ <linearGradient
101
+ gradientUnits="userSpaceOnUse"
102
+ gradientTransform="scale(0.75722813,1.320606)"
103
+ xlink:href="#linearGradient3281"
104
+ id="linearGradient3287"
105
+ x1="60.350403"
106
+ y1="1.7870075"
107
+ x2="126.55737"
108
+ y2="81.032318" />
109
+ <linearGradient
110
+ id="linearGradient3281">
111
+ <stop
112
+ offset="0"
113
+ id="stop3283"
114
+ stop-color="#5100b2" />
115
+ <stop
116
+ offset="1"
117
+ id="stop3285"
118
+ stop-color="#5500bd" />
119
+ </linearGradient>
120
+ <linearGradient
121
+ gradientUnits="userSpaceOnUse"
122
+ gradientTransform="scale(0.78865004,1.2679895)"
123
+ xlink:href="#linearGradient3289"
124
+ id="linearGradient3295"
125
+ x1="185.74336"
126
+ y1="1.0991673"
127
+ x2="121.82187"
128
+ y2="84.227867" />
129
+ <linearGradient
130
+ id="linearGradient3289">
131
+ <stop
132
+ offset="0"
133
+ id="stop3291"
134
+ stop-color="#5500bd" />
135
+ <stop
136
+ offset="1"
137
+ id="stop3293"
138
+ stop-color="#47008d" />
139
+ </linearGradient>
140
+ <linearGradient
141
+ gradientUnits="userSpaceOnUse"
142
+ gradientTransform="scale(0.84433244,1.1843676)"
143
+ xlink:href="#linearGradient3301"
144
+ id="linearGradient3299"
145
+ x1="137.88416"
146
+ y1="61.06081"
147
+ x2="149.05969"
148
+ y2="65.808876" />
149
+ <linearGradient
150
+ id="linearGradient3301">
151
+ <stop
152
+ id="stop3303"
153
+ offset="0"
154
+ stop-color="#1b0041" />
155
+ <stop
156
+ id="stop3305"
157
+ offset="1"
158
+ stop-color="#21004f" />
159
+ </linearGradient>
160
+ </defs>
161
+ <metadata
162
+ id="metadata3748">image/svg+xml<rdf:RDF>
163
+ <cc:Work
164
+ rdf:about="">
165
+ <dc:format>image/svg+xml</dc:format>
166
+ <dc:type
167
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
168
+ <dc:title></dc:title>
169
+ </cc:Work>
170
+ </rdf:RDF>
171
+ </metadata>
172
+ <g
173
+ transform="matrix(3.5075161,0,0,3.5075161,2.5083035,3.5074653)"
174
+ id="g3557">
175
+ <title
176
+ id="title3559">background</title>
177
+ <rect
178
+ style="fill:none"
179
+ x="-1"
180
+ y="-1"
181
+ width="198"
182
+ height="198"
183
+ id="canvas_background" />
184
+ </g>
185
+ <g
186
+ transform="matrix(3.5075161,0,0,3.5075161,16.67858,20.117816)"
187
+ id="g3562">
188
+ <title
189
+ id="title3564">Layer 1</title>
190
+ <g
191
+ id="svg_1"
192
+ stroke="null">
193
+ <path
194
+ style="fill:#6700e8"
195
+ id="path3167"
196
+ d="M 146.3341,1.500001 151.87075,14.083402 165.96417,7.540033 171.69552,1.5 c -9.06618,2.056575 -17.2433,2.124929 -25.36142,0 z"
197
+ stroke="null" />
198
+ <path
199
+ style="fill:url(#linearGradient3299)"
200
+ id="path3165"
201
+ d="m 106.5705,111.22727 -9.563431,3.52335 -6.040016,-10.57005 59.897037,-95.633864 4.28231,-1.466769 c 5.91085,-1.335756 12.35768,-2.7682 16.55671,-5.579936 -9.51226,12.849917 -44.14924,72.912609 -65.13261,109.727269 z"
202
+ stroke="null" />
203
+ <path
204
+ style="fill:url(#linearGradient3295)"
205
+ id="path3163"
206
+ d="m 93.483733,109.71726 2.51668,-2.51668 L 155.25477,7.058388 146.3341,1.500002 c -7.15413,13.325415 -33.53995,56.445871 -50.333687,84.05713 l -8.05341,15.100078 5.53673,9.06005 z"
207
+ stroke="null" />
208
+ <path
209
+ style="fill:url(#linearGradient3287)"
210
+ id="path3161"
211
+ d="m 45.666808,1.500001 c 13.136043,23.279949 33.301178,55.847556 50.333606,84.05713 l 0,21.643449 -4.026705,4.02669 L 33.083407,6.533361 45.666808,1.5 Z"
212
+ stroke="null" />
213
+ <path
214
+ style="fill:#6700e8"
215
+ id="path3159"
216
+ d="m 35.960426,7.831714 9.706382,-6.331713 c -10.415588,2.221319 -14.772591,2.362707 -25.166803,0 l 4.026705,4.530025 11.433716,1.801688 z"
217
+ stroke="null" />
218
+ <path
219
+ style="fill:url(#linearGradient3267)"
220
+ id="path3157"
221
+ d="m 96.000414,107.20058 -4.529991,6.54337 -6.040099,-2.51668 C 74.185031,91.791149 41.128646,32.584127 20.500006,1.500001 24.681543,4.530086 30.330848,6.192805 36.85558,7.25248 l 59.144834,99.9481 z"
222
+ stroke="null" />
223
+ <path
224
+ style="fill:url(#linearGradient3253)"
225
+ id="path3155"
226
+ d="m 108.08045,192.26437 -17.113397,-8.05337 1.510025,-71.47372 3.523336,-5.5367 10.570086,4.02669 1.50995,81.0371 z"
227
+ stroke="null" />
228
+ <path
229
+ style="fill:url(#linearGradient3231)"
230
+ id="path3153"
231
+ d="m 96.000414,186.72768 -12.080032,5.53669 1.509942,-81.0371 10.57009,-4.02669 0,79.5271 z"
232
+ stroke="null" />
233
+ <path
234
+ style="fill:#200045"
235
+ id="path3151"
236
+ d="m 83.920381,192.26437 12.102564,-8.86676 12.057505,8.86676 c 0,0 -6.68411,-1.2163 -12.057752,-1.2163 -4.848652,0 -12.102316,1.2163 -12.102316,1.2163 z"
237
+ stroke="null" />
238
+ </g>
239
+ </g>
240
+ </svg>
assets/images/themes/bash-account-form.gif ADDED
Binary file
assets/images/themes/bash-login.png ADDED
Binary file
assets/images/themes/bash-password-reset.png ADDED
Binary file
assets/images/themes/bash-registration.png ADDED
Binary file
assets/images/themes/boson-edit-profile.png ADDED
Binary file
assets/images/themes/boson-registration.png ADDED
Binary file
assets/images/themes/daffodil-edit-profile.png ADDED
Binary file
assets/images/themes/daffodil-login.png ADDED
Binary file
assets/images/themes/daffodil-password-reset.png ADDED
Binary file
assets/images/themes/daffodil-registration.png ADDED
Binary file
assets/images/themes/daisy-profile.png ADDED
Binary file
assets/images/themes/default-member-directory.png ADDED
Binary file
assets/images/themes/default-user-profile.png ADDED
Binary file
assets/images/themes/dixon-profile.png ADDED
Binary file
assets/images/themes/fzbuk-login.png ADDED
Binary file
assets/images/themes/fzbuk-password-reset.png ADDED
Binary file
assets/images/themes/fzbuk-registration.png ADDED
Binary file
assets/images/themes/gerbera-member-directory.png ADDED
Binary file
assets/images/themes/jakhu-login.png ADDED
Binary file
assets/images/themes/jakhu-password-reset.png ADDED
Binary file
assets/images/themes/jakhu-registration.png ADDED
Binary file
assets/images/themes/lavender-registration.png ADDED
Binary file
assets/images/themes/lucid-tab-widget.png ADDED
Binary file
assets/images/themes/monochrome-profile.png ADDED
Binary file
assets/images/themes/montserrat-form.gif ADDED
Binary file
assets/images/themes/parallel-login.gif ADDED
Binary file
assets/images/themes/parallel-password-reset.gif ADDED
Binary file
assets/images/themes/parallel-registration.gif ADDED
Binary file
assets/images/themes/perfectolite-edit-profile.png ADDED
Binary file
assets/images/themes/perfectolite-login.png ADDED
Binary file
assets/images/themes/perfectolite-password-reset.png ADDED
Binary file
assets/images/themes/perfectolite-registration.png ADDED
Binary file
assets/images/themes/perfectopro-login.png ADDED
Binary file
assets/images/themes/perfectopro-registration.png ADDED
Binary file
assets/images/themes/pinnacle-edit-profile.png ADDED
Binary file
assets/images/themes/pinnacle-login-registration.png ADDED
Binary file
assets/images/themes/pinnacle-password-reset.png ADDED
Binary file
assets/images/themes/premium-theme.png ADDED
Binary file
assets/images/themes/smiley-edit-profile.png ADDED
Binary file
assets/images/themes/smiley-edit-profile2.png ADDED
Binary file
assets/images/themes/smiley-login.png ADDED
Binary file
assets/images/themes/smiley-password-reset.png ADDED
Binary file
assets/images/themes/smiley-profile.png ADDED
Binary file
assets/images/themes/smiley-registration.png ADDED
Binary file
assets/images/themes/smiley2-profile.png ADDED
Binary file
assets/images/themes/stride.gif ADDED
Binary file
assets/images/themes/sukan-login.png ADDED
Binary file
assets/images/themes/tulip-edit-profile.png ADDED
Binary file
assets/images/themes/tulip-login.png ADDED
Binary file
assets/images/themes/tulip-password-reset.png ADDED
Binary file
assets/images/themes/tulip-registration.png ADDED
Binary file
assets/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
assets/jbox/init.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ jQuery(function () {
2
+ new jBox('Tooltip', {
3
+ attach: '.pp-melange-jbox',
4
+ maxWidth: 200,
5
+ theme: 'TooltipDark'
6
+ });
7
+ });
assets/jbox/jBox.all.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .jBox-wrapper{text-align:left;box-sizing:border-box}.jBox-container,.jBox-content,.jBox-title{position:relative;word-break:break-word;box-sizing:border-box}.jBox-container{background:#fff}.jBox-content{padding:8px 12px;overflow-x:hidden;overflow-y:auto;transition:opacity .2s}.jBox-footer{box-sizing:border-box}.jBox-Mouse .jBox-container,.jBox-Tooltip .jBox-container{border-radius:4px;box-shadow:0 0 3px rgba(0,0,0,.25)}.jBox-Mouse .jBox-title,.jBox-Tooltip .jBox-title{padding:8px 10px 0;font-weight:700}.jBox-Mouse.jBox-hasTitle .jBox-content,.jBox-Tooltip.jBox-hasTitle .jBox-content{padding-top:5px}.jBox-Mouse{pointer-events:none}.jBox-pointer{position:absolute;overflow:hidden;box-sizing:border-box}.jBox-pointer:after{content:'';width:20px;height:20px;position:absolute;background:#fff;transform:rotate(45deg);box-sizing:border-box}.jBox-pointer-top{top:0}.jBox-pointer-top:after{left:5px;top:6px;box-shadow:-1px -1px 2px rgba(0,0,0,.15)}.jBox-pointer-right{right:0}.jBox-pointer-right:after{top:5px;right:6px;box-shadow:1px -1px 2px rgba(0,0,0,.15)}.jBox-pointer-left{left:0}.jBox-pointer-left:after{top:5px;left:6px;box-shadow:-1px 1px 2px rgba(0,0,0,.15)}.jBox-pointer-bottom{bottom:0}.jBox-pointer-bottom:after{left:5px;bottom:6px;box-shadow:1px 1px 2px rgba(0,0,0,.15)}.jBox-pointer-bottom,.jBox-pointer-top{width:30px;height:12px}.jBox-pointer-left,.jBox-pointer-right{width:12px;height:30px}.jBox-Modal .jBox-container{border-radius:4px}.jBox-Modal .jBox-container,.jBox-Modal.jBox-closeButton-box:before{box-shadow:0 3px 15px rgba(0,0,0,.4),0 0 5px rgba(0,0,0,.4)}.jBox-Modal .jBox-content{padding:15px 20px}.jBox-Modal .jBox-title{border-radius:4px 4px 0 0;padding:15px 20px;background:#fafafa;border-bottom:1px solid #eee}.jBox-Modal.jBox-closeButton-title .jBox-title{padding-right:65px}.jBox-Modal .jBox-footer{border-radius:0 0 4px 4px}.jBox-closeButton{z-index:1;cursor:pointer;position:absolute;box-sizing:border-box}.jBox-closeButton svg{position:absolute;top:50%;right:50%}.jBox-closeButton path{fill:#aaa;transition:fill .2s}.jBox-closeButton:hover path{fill:#888}.jBox-overlay .jBox-closeButton{top:0;right:0;width:40px;height:40px}.jBox-overlay .jBox-closeButton svg{width:20px;height:20px;margin-top:-10px;margin-right:-10px}.jBox-overlay .jBox-closeButton path{fill:#ddd}.jBox-overlay .jBox-closeButton:hover path{fill:#fff}.jBox-closeButton-title .jBox-closeButton{top:0;right:0;bottom:0;width:50px}.jBox-closeButton-title svg{width:12px;height:12px;margin-top:-6px;margin-right:-6px}.jBox-closeButton-box{box-sizing:border-box}.jBox-closeButton-box .jBox-closeButton{top:-8px;right:-10px;width:24px;height:24px;background:#fff;border-radius:50%}.jBox-closeButton-box .jBox-closeButton svg{width:10px;height:10px;margin-top:-5px;margin-right:-5px}.jBox-closeButton-box:before{content:'';position:absolute;top:-8px;right:-10px;width:24px;height:24px;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.3)}.jBox-closeButton-box.jBox-pointerPosition-top:before{top:5px}.jBox-closeButton-box.jBox-pointerPosition-right:before{right:2px}.jBox-Modal.jBox-hasTitle.jBox-closeButton-box .jBox-closeButton{background:#fafafa}.jBox-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.82)}.jBox-footer{background:#fafafa;border-top:1px solid #eee;padding:8px 10px;border-radius:0 0 3px 3px}body[class*=" jBox-blockScroll-"],body[class^=jBox-blockScroll-]{overflow:hidden}.jBox-draggable{cursor:move}@keyframes jBoxLoading{to{transform:rotate(360deg)}}.jBox-loading .jBox-content{opacity:.2}.jBox-loading-spinner .jBox-content{min-height:38px!important;min-width:38px!important;opacity:0}.jBox-spinner{box-sizing:border-box;position:absolute;top:50%;left:50%;width:24px;height:24px;margin-top:-12px;margin-left:-12px}.jBox-spinner:before{display:block;box-sizing:border-box;content:'';width:24px;height:24px;border-radius:50%;border:2px solid rgba(0,0,0,.2);border-top-color:rgba(0,0,0,.8);animation:jBoxLoading .6s linear infinite}.jBox-countdown{border-radius:4px 4px 0 0;z-index:0;background:#000;opacity:.2;position:absolute;top:0;left:0;right:0;height:3px;overflow:hidden}.jBox-countdown-inner{top:0;right:0;width:100%;height:3px;position:absolute;background:#fff}[class*=" jBox-animated-"],[class^=jBox-animated-]{animation-fill-mode:both}@keyframes jBox-tada{0%{transform:scale(1)}10%,20%{transform:scale(.8) rotate(-4deg)}30%,50%,70%,90%{transform:scale(1.2) rotate(4deg)}40%,60%,80%{transform:scale(1.2) rotate(-4deg)}100%{transform:scale(1) rotate(0)}}.jBox-animated-tada{animation:jBox-tada 1s}@keyframes jBox-tadaSmall{0%{transform:scale(1)}10%,20%{transform:scale(.9) rotate(-2deg)}30%,50%,70%,90%{transform:scale(1.1) rotate(2deg)}40%,60%,80%{transform:scale(1.1) rotate(-2deg)}100%{transform:scale(1) rotate(0)}}.jBox-animated-tadaSmall{animation:jBox-tadaSmall 1s}@keyframes jBox-flash{0%,100%,50%{opacity:1}25%,75%{opacity:0}}.jBox-animated-flash{animation:jBox-flash .5s}@keyframes jBox-shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}.jBox-animated-shake{animation:jBox-shake .4s}@keyframes jBox-pulseUp{0%{transform:scale(1)}50%{transform:scale(1.15)}100%{transform:scale(1)}}.jBox-animated-pulseUp{animation:jBox-pulseUp .25s}@keyframes jBox-pulseDown{0%{transform:scale(1)}50%{transform:scale(.85)}100%{transform:scale(1)}}.jBox-animated-pulseDown{animation:jBox-pulseDown .25s}@keyframes jBox-popIn{0%{transform:scale(0)}50%{transform:scale(1.1)}100%{transform:scale(1)}}.jBox-animated-popIn{animation:jBox-popIn .25s}@keyframes jBox-popOut{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(0)}}.jBox-animated-popOut{animation:jBox-popOut .25s}@keyframes jBox-fadeIn{0%{opacity:0}100%{opacity:1}}.jBox-animated-fadeIn{animation:jBox-fadeIn .2s}@keyframes jBox-fadeOut{0%{opacity:1}100%{opacity:0}}.jBox-animated-fadeOut{animation:jBox-fadeOut .2s}@keyframes jBox-slideUp{0%{transform:translateY(0)}100%{transform:translateY(-300px);opacity:0}}.jBox-animated-slideUp{animation:jBox-slideUp .4s}@keyframes jBox-slideRight{0%{transform:translateX(0)}100%{transform:translateX(300px);opacity:0}}.jBox-animated-slideRight{animation:jBox-slideRight .4s}@keyframes jBox-slideDown{0%{transform:translateY(0)}100%{transform:translateY(300px);opacity:0}}.jBox-animated-slideDown{animation:jBox-slideDown .4s}@keyframes jBox-slideLeft{0%{transform:translateX(0)}100%{transform:translateX(-300px);opacity:0}}.jBox-animated-slideLeft{animation:jBox-slideLeft .4s}.jBox-Confirm .jBox-content{text-align:center;padding:46px 35px}@media (max-width:500px){.jBox-Confirm .jBox-content{padding:32px 20px}}.jBox-Confirm-footer{height:46px}.jBox-Confirm-button{display:block;float:left;cursor:pointer;text-align:center;width:50%;line-height:46px;height:46px;overflow:hidden;padding:0 10px;transition:color .2s,background-color .2s;box-sizing:border-box}.jBox-Confirm-button-cancel{border-bottom-left-radius:4px;background:#ddd;color:#666}.jBox-Confirm-button-cancel:active,.jBox-Confirm-button-cancel:hover{background:#ccc}.jBox-Confirm-button-cancel:active{box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.jBox-Confirm-button-submit{border-bottom-right-radius:4px;background:#7d0;color:#fff}.jBox-Confirm-button-submit:active,.jBox-Confirm-button-submit:hover{background:#6c0}.jBox-Confirm-button-submit:active{box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.jBox-Image .jBox-container{background-color:transparent}.jBox-Image .jBox-content{padding:0;width:100%;height:100%}.jBox-image-container{background:center center no-repeat;position:absolute;width:100%;height:100%;opacity:0}.jBox-image-label-container{position:absolute;top:100%;left:0;right:0;height:40px;z-index:100}.jBox-image-label{box-sizing:border-box;position:absolute;bottom:0;width:100%;text-align:center;left:0;color:#fff;padding:8px 40px;line-height:24px;transition:opacity .36s;opacity:0;z-index:0;pointer-events:none}.jBox-image-label.expanded{background:#000}.jBox-image-label:not(.expanded){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.jBox-image-label.active{opacity:1;pointer-events:all}.jBox-image-pointer-next,.jBox-image-pointer-prev{position:absolute;bottom:0;width:40px;height:40px;cursor:pointer;opacity:.8;transition:opacity .2s;background:no-repeat center center url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijc0LjcgMjI0IDE4LjcgMzIiPg0KPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTkzLDIyNy40TDgwLjQsMjQwTDkzLDI1Mi42YzAuNCwwLjQsMC40LDEuMSwwLDEuNWwtMS42LDEuNmMtMC40LDAuNC0xLDAuNS0xLjUsMEw3NSwyNDAuN2MtMC40LTAuNC0wLjUtMSwwLTEuNWwxNC45LTE0LjljMC40LTAuNCwxLTAuNCwxLjUsMGwxLjYsMS42QzkzLjUsMjI2LjQsOTMuNCwyMjcsOTMsMjI3LjR6Ii8+DQo8L3N2Zz4=);background-size:11px auto;user-select:none;z-index:1}.jBox-image-pointer-next:hover,.jBox-image-pointer-prev:hover{opacity:1}.jBox-image-pointer-next{right:0;transform:scaleX(-1)}.jBox-image-pointer-prev{left:0}.jBox-image-counter-container{position:absolute;right:40px;height:40px;line-height:40px;font-size:13px;color:#fff;text-align:right;display:none}.jBox-image-has-counter .jBox-image-counter-container{display:block}.jBox-image-has-counter .jBox-image-label:not(.expanded){padding-right:80px;text-indent:40px}.jBox-overlay.jBox-overlay-Image{background:#000}.jBox-image-not-found{background:#000}.jBox-image-not-found:before{content:'';box-sizing:border-box;display:block;width:80px;height:80px;margin-top:-40px;margin-left:-40px;position:absolute;top:50%;left:50%;border:5px solid #222;border-radius:50%}.jBox-image-not-found:after{content:'';display:block;box-sizing:content-box;z-index:auto;width:6px;height:74px;margin-top:-37px;margin-left:-3px;position:absolute;top:50%;left:50%;background:#222;transform:rotateZ(45deg);transform-origin:50% 50% 0}.jBox-image-download-button-wrapper{position:absolute;top:-40px;right:35px;height:40px;display:flex;cursor:pointer;opacity:.8;transition:opacity .2s}.jBox-image-download-button-wrapper:hover{opacity:1}.jBox-image-download-button-icon{width:40px;height:40px;background:center center no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNjQwIj48cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNNDE2IDI1NnYtMTkyaC0xOTJ2MTkyaC0xNjBsMjU2IDI1NiAyNTYtMjU2aC0xNjB6TTAgNTc2aDY0MHY2NGgtNjQwdi02NHoiPjwvcGF0aD48L3N2Zz4=);background-size:60%}.jBox-image-download-button-text{white-space:nowrap;line-height:40px;padding:0 10px 0 0;color:#fff;font-size:14px}@keyframes jBoxImageLoading{to{transform:rotate(360deg)}}.jBox-image-loading:before{content:'';position:absolute;top:50%;left:50%;width:32px;height:32px;margin-top:-16px;margin-left:-16px;border:4px solid #333;border-bottom-color:#666;animation:jBoxImageLoading 1.2s linear infinite;border-radius:50%}.jBox-Notice{transition:margin .2s}.jBox-Notice .jBox-container{border-radius:4px;box-shadow:inset 1px 1px 0 0 rgba(255,255,255,.25),inset -1px -1px 0 0 rgba(0,0,0,.1)}.jBox-Notice .jBox-content{border-radius:4px;padding:12px 20px}@media (max-width:768px){.jBox-Notice .jBox-content{padding:10px 15px}}@media (max-width:500px){.jBox-Notice .jBox-content{padding:8px 10px}}.jBox-Notice.jBox-hasTitle .jBox-content{padding-top:5px}@media (max-width:500px){.jBox-Notice.jBox-hasTitle .jBox-content{padding-top:0}}.jBox-Notice.jBox-hasTitle .jBox-title{padding:12px 20px 0;font-weight:700}@media (max-width:768px){.jBox-Notice.jBox-hasTitle .jBox-title{padding:10px 15px 0}}@media (max-width:500px){.jBox-Notice.jBox-hasTitle .jBox-title{padding:8px 10px 0}}.jBox-Notice.jBox-closeButton-title .jBox-title{padding-right:55px}.jBox-Notice.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton{width:40px}.jBox-Notice.jBox-Notice-black .jBox-container{color:#fff;background:#000}.jBox-Notice.jBox-Notice-black.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-black.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-gray .jBox-container{color:#222;background:#f6f6f6}.jBox-Notice.jBox-Notice-gray.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-gray.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#222}.jBox-Notice.jBox-Notice-red .jBox-container{color:#fff;background:#d00}.jBox-Notice.jBox-Notice-red.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-red.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-green .jBox-container{color:#fff;background:#5d0}.jBox-Notice.jBox-Notice-green.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-green.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-blue .jBox-container{color:#fff;background:#49d}.jBox-Notice.jBox-Notice-blue.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-blue.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-yellow .jBox-container{color:#000;background:#fd0}.jBox-Notice.jBox-Notice-yellow.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-yellow.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-NoticeFancy .jBox-content,.jBox-NoticeFancy .jBox-title{padding-left:25px}.jBox-NoticeFancy.jBox-Notice-color .jBox-container{color:#fff;background:#000}.jBox-NoticeFancy.jBox-Notice-color .jBox-container:after{content:'';position:absolute;top:0;left:0;bottom:0;width:8px;border-radius:4px 0 0 4px;background-image:linear-gradient(45deg,rgba(255,255,255,.4) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.4) 50%,rgba(255,255,255,.4) 75%,transparent 75%,transparent);background-size:14px 14px}.jBox-NoticeFancy.jBox-Notice-black .jBox-container:after,.jBox-NoticeFancy.jBox-Notice-gray .jBox-container:after{background-color:#888}.jBox-NoticeFancy.jBox-Notice-red .jBox-container:after{background-color:#e00}.jBox-NoticeFancy.jBox-Notice-green .jBox-container:after{background-color:#6c0}.jBox-NoticeFancy.jBox-Notice-blue .jBox-container:after{background-color:#49d}.jBox-NoticeFancy.jBox-Notice-yellow .jBox-container:after{background-color:#fb0}.jBox-NoticeFancy .jBox-countdown{left:8px;border-radius:0 4px 0 0}.jBox-TooltipBorder .jBox-container,.jBox-TooltipBorder .jBox-pointer:after{border:2px solid #49d}.jBox-TooltipBorder .jBox-pointer:after{width:22px;height:22px}.jBox-TooltipBorder .jBox-pointer-bottom,.jBox-TooltipBorder .jBox-pointer-top{width:34px;height:13px}.jBox-TooltipBorder .jBox-pointer-bottom:after,.jBox-TooltipBorder .jBox-pointer-top:after{left:6px}.jBox-TooltipBorder .jBox-pointer-left,.jBox-TooltipBorder .jBox-pointer-right{width:13px;height:34px}.jBox-TooltipBorder .jBox-pointer-left:after,.jBox-TooltipBorder .jBox-pointer-right:after{top:6px}.jBox-TooltipBorder.jBox-closeButton-box:before{width:28px;height:28px;background:#49d}.jBox-TooltipBorderThick .jBox-container{box-shadow:none;border-radius:8px;border:4px solid #ccc}.jBox-TooltipBorderThick .jBox-pointer:after{box-shadow:none;border:4px solid #ccc;width:24px;height:24px}.jBox-TooltipBorderThick .jBox-pointer-bottom,.jBox-TooltipBorderThick .jBox-pointer-top{width:38px;height:13px}.jBox-TooltipBorderThick .jBox-pointer-left,.jBox-TooltipBorderThick .jBox-pointer-right{width:13px;height:38px}.jBox-TooltipBorderThick.jBox-closeButton-box:before{width:32px;height:32px;background:#ccc}.jBox-TooltipDark .jBox-container{border-radius:4px;background:#000;color:#fff;box-shadow:0 0 6px rgba(0,0,0,.4)}.jBox-TooltipDark .jBox-pointer:after{background:#000}.jBox-TooltipDark .jBox-closeButton{background:#000}.jBox-TooltipDark.jBox-closeButton-box:before{box-shadow:0 0 6px rgba(0,0,0,.4)}.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton path{fill:#ddd}.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton:hover path{fill:#fff}.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton:active path{fill:#bbb}.jBox-TooltipError{pointer-events:none}.jBox-TooltipError .jBox-container{border-radius:2px;background:#d00;color:#fff;font-weight:700;font-size:13px}.jBox-TooltipError .jBox-content{padding:0 10px;line-height:28px}.jBox-TooltipError .jBox-pointer:after{background:#d00;width:20px;height:20px}.jBox-TooltipError .jBox-pointer-bottom,.jBox-TooltipError .jBox-pointer-top{width:22px;height:8px}.jBox-TooltipError .jBox-pointer-left,.jBox-TooltipError .jBox-pointer-right{width:8px;height:22px}.jBox-TooltipError .jBox-pointer-top:after{left:1px;top:6px}.jBox-TooltipError .jBox-pointer-right:after{top:1px;right:6px}.jBox-TooltipError .jBox-pointer-bottom:after{left:1px;bottom:6px}.jBox-TooltipError .jBox-pointer-left:after{top:1px;left:6px}.jBox-TooltipSmall{pointer-events:none}.jBox-TooltipSmall .jBox-container{border-radius:2px}.jBox-TooltipSmall .jBox-content{padding:0 10px;line-height:28px}.jBox-TooltipSmall .jBox-pointer:after{width:20px;height:20px}.jBox-TooltipSmall .jBox-pointer-bottom,.jBox-TooltipSmall .jBox-pointer-top{width:22px;height:8px}.jBox-TooltipSmall .jBox-pointer-left,.jBox-TooltipSmall .jBox-pointer-right{width:8px;height:22px}.jBox-TooltipSmall .jBox-pointer-top:after{left:1px;top:6px}.jBox-TooltipSmall .jBox-pointer-right:after{top:1px;right:6px}.jBox-TooltipSmall .jBox-pointer-bottom:after{left:1px;bottom:6px}.jBox-TooltipSmall .jBox-pointer-left:after{top:1px;left:6px}.jBox-TooltipSmallGray{pointer-events:none}.jBox-TooltipSmallGray .jBox-container{font-size:13px;line-height:24px;border-radius:12px;background-image:linear-gradient(to bottom,#fafafa,#f2f2f2)}.jBox-TooltipSmallGray .jBox-content{padding:0 10px}.jBox-TooltipSmallGray .jBox-pointer:after{width:20px;height:20px}.jBox-TooltipSmallGray .jBox-pointer-bottom,.jBox-TooltipSmallGray .jBox-pointer-top{width:22px;height:8px}.jBox-TooltipSmallGray .jBox-pointer-left,.jBox-TooltipSmallGray .jBox-pointer-right{width:8px;height:22px}.jBox-TooltipSmallGray .jBox-pointer-top:after{background:#fafafa;left:1px;top:6px}.jBox-TooltipSmallGray .jBox-pointer-right:after{top:1px;right:6px}.jBox-TooltipSmallGray .jBox-pointer-bottom:after{background:#f2f2f2;left:1px;bottom:6px}.jBox-TooltipSmallGray .jBox-pointer-left:after{top:1px;left:6px}
assets/jbox/jBox.all.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function jBoxWrapper(O){function a(t,i){return this.options={id:null,width:"auto",height:"auto",minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,responsiveWidth:!0,responsiveHeight:!0,responsiveMinWidth:100,responsiveMinHeight:100,attach:null,trigger:"click",preventDefault:!1,content:null,getContent:null,title:null,getTitle:null,footer:null,isolateScroll:!0,ajax:{url:null,data:"",reload:!1,getURL:"data-url",getData:"data-ajax",setContent:!0,loadingClass:!0,spinner:!0,spinnerDelay:300,spinnerReposition:!0},cancelAjaxOnClose:!0,target:null,position:{x:"center",y:"center"},outside:null,offset:0,attributes:{x:"left",y:"top"},fixed:!1,adjustPosition:!0,adjustTracker:!1,adjustDistance:5,reposition:!0,repositionOnOpen:!0,repositionOnContent:!0,holdPosition:!0,pointer:!1,pointTo:"target",fade:180,animation:null,theme:"Default",addClass:null,overlay:!1,overlayClass:null,zIndex:1e4,delayOpen:0,delayClose:0,closeOnEsc:!1,closeOnClick:!1,closeOnMouseleave:!1,closeButton:!1,appendTo:O("body"),createOnInit:!1,blockScroll:!1,blockScrollAdjust:!0,draggable:!1,dragOver:!0,autoClose:!1,delayOnHover:!1,showCountdown:!1,preloadAudio:!0,audio:null,volume:100,onInit:null,onAttach:null,onPosition:null,onCreated:null,onOpen:null,onClose:null,onCloseComplete:null,onDragStart:null,onDragEnd:null},this._pluginOptions={Tooltip:{getContent:"title",trigger:"mouseenter",position:{x:"center",y:"top"},outside:"y",pointer:!0},Mouse:{responsiveWidth:!1,responsiveHeight:!1,adjustPosition:"flip",target:"mouse",trigger:"mouseenter",position:{x:"right",y:"bottom"},outside:"xy",offset:5},Modal:{target:O(window),fixed:!0,blockScroll:!0,closeOnEsc:!0,closeOnClick:"overlay",closeButton:!0,overlay:!0,animation:"zoomIn"}},this.options=O.extend(!0,this.options,this._pluginOptions[t]?this._pluginOptions[t]:a._pluginOptions[t],i),"string"==O.type(t)&&(this.type=t),this.isTouchDevice=function(){var t=" -webkit- -moz- -o- -ms- ".split(" ");if("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)return!0;var i,o=["(",t.join("touch-enabled),("),"heartz",")"].join("");return i=o,window.matchMedia(i).matches}(),this.isTouchDevice&&"mouseenter"===this.options.trigger&&!1===this.options.closeOnClick&&(this.options.closeOnClick="body"),this._fireEvent=function(t,i){this.options["_"+t]&&this.options["_"+t].bind(this)(i),this.options[t]&&this.options[t].bind(this)(i)},null===this.options.id&&(this.options.id="jBox"+a._getUniqueID()),this.id=this.options.id,("center"==this.options.position.x&&"x"==this.options.outside||"center"==this.options.position.y&&"y"==this.options.outside)&&(this.options.outside=null),"target"==this.options.pointTo&&(!this.options.outside||"xy"==this.options.outside)&&(this.options.pointer=!1),"object"!=O.type(this.options.offset)?this.options.offset={x:this.options.offset,y:this.options.offset}:this.options.offset=O.extend({x:0,y:0},this.options.offset),"object"!=O.type(this.options.adjustDistance)?this.options.adjustDistance={top:this.options.adjustDistance,right:this.options.adjustDistance,bottom:this.options.adjustDistance,left:this.options.adjustDistance}:this.options.adjustDistance=O.extend({top:5,left:5,right:5,bottom:5},this.options.adjustDistance),this.outside=!(!this.options.outside||"xy"==this.options.outside)&&this.options.position[this.options.outside],this.align=this.outside?this.outside:"center"!=this.options.position.y&&"number"!=O.type(this.options.position.y)?this.options.position.x:"center"!=this.options.position.x&&"number"!=O.type(this.options.position.x)?this.options.position.y:this.options.attributes.x,a.zIndexMax=Math.max(a.zIndexMax||0,"auto"===this.options.zIndex?1e4:this.options.zIndex),"auto"===this.options.zIndex&&(this.adjustZIndexOnOpen=!0,a.zIndexMax+=2,this.options.zIndex=a.zIndexMax,this.trueModal=this.options.overlay),this._getOpp=function(t){return{left:"right",right:"left",top:"bottom",bottom:"top",x:"y",y:"x"}[t]},this._getXY=function(t){return{left:"x",right:"x",top:"y",bottom:"y",center:"x"}[t]},this._getTL=function(t){return{left:"left",right:"left",top:"top",bottom:"top",center:"left",x:"left",y:"top"}[t]},this._getInt=function(t,i){return"auto"==t?"auto":t&&"string"==O.type(t)&&"%"==t.slice(-1)?O(window)["height"==i?"innerHeight":"innerWidth"]()*parseInt(t.replace("%",""))/100:t},this._createSVG=function(t,i){var o=document.createElementNS("http://www.w3.org/2000/svg",t);return O.each(i,function(t,i){o.setAttribute(i[0],i[1]||"")}),o},this._isolateScroll=function(e){e&&e.length&&e.on("DOMMouseScroll.jBoxIsolateScroll mousewheel.jBoxIsolateScroll",function(t){var i=t.wheelDelta||t.originalEvent&&t.originalEvent.wheelDelta||-t.detail,o=0<=this.scrollTop+e.outerHeight()-this.scrollHeight,s=this.scrollTop<=0;(i<0&&o||0<i&&s)&&t.preventDefault()})},this._setTitleWidth=function(){if(!this.titleContainer||"auto"==this.content[0].style.width&&!this.content[0].style.maxWidth)return null;if("none"==this.wrapper.css("display")){this.wrapper.css("display","block");var t=this.content.outerWidth();this.wrapper.css("display","none")}else t=this.content.outerWidth();this.titleContainer.css({maxWidth:Math.max(t,parseInt(this.content[0].style.maxWidth))||null})},this._draggable=function(){if(!this.options.draggable)return!1;var t="title"==this.options.draggable?this.titleContainer:this.options.draggable instanceof O?this.options.draggable:"string"==O.type(this.options.draggable)?O(this.options.draggable):this.wrapper;return!(!(t&&t instanceof O&&t.length)||t.data("jBox-draggable"))&&(t.addClass("jBox-draggable").data("jBox-draggable",!0).on("touchstart mousedown",function(t){if(2!=t.button&&!O(t.target).hasClass("jBox-noDrag")&&!O(t.target).parents(".jBox-noDrag").length){this.draggingStartX=t.pageX,this.draggingStartY=t.pageY,this.options.dragOver&&!this.trueModal&&parseInt(this.wrapper.css("zIndex"),10)<=a.zIndexMaxDragover&&(a.zIndexMaxDragover+=1,this.wrapper.css("zIndex",a.zIndexMaxDragover));var i=this.wrapper.outerHeight(),o=this.wrapper.outerWidth(),s=this.wrapper.offset().top+i-t.pageY,e=this.wrapper.offset().left+o-t.pageX;O(document).on("touchmove.jBox-draggable-"+this.id+" mousemove.jBox-draggable-"+this.id,function(t){this.dragging||this.draggingStartX==t.pageX||this.draggingStartY==t.pageY||(this._fireEvent("onDragStart"),this.dragging=!0),this.wrapper.offset({top:t.pageY+s-i,left:t.pageX+e-o})}.bind(this)),t.preventDefault()}}.bind(this)).on("touchend mouseup",function(){if(O(document).off("touchmove.jBox-draggable-"+this.id+" mousemove.jBox-draggable-"+this.id),this.dragging&&this._fireEvent("onDragEnd"),this.dragging=!1,("Modal"==this.type||"Confirm"==this.type)&&this.options.holdPosition){var t=O("#"+this.id).offset(),i={x:t.left-O(document).scrollLeft(),y:t.top-O(document).scrollTop()};this.position({position:i,offset:{x:0,y:0}})}}.bind(this)),this.trueModal||(a.zIndexMaxDragover=a.zIndexMaxDragover?Math.max(a.zIndexMaxDragover,this.options.zIndex):this.options.zIndex),this)},this._create=function(){if(!this.wrapper){if(this.wrapper=O("<div/>",{id:this.id,class:"jBox-wrapper"+(this.type?" jBox-"+this.type:"")+(this.options.theme?" jBox-"+this.options.theme:"")+(this.options.addClass?" "+this.options.addClass:"")}).css({position:this.options.fixed?"fixed":"absolute",display:"none",opacity:0,zIndex:this.options.zIndex}).data("jBox",this),this.options.closeOnMouseleave&&this.wrapper.on("mouseleave",function(t){!this.source||t.relatedTarget!=this.source[0]&&-1===O.inArray(this.source[0],O(t.relatedTarget).parents("*"))&&this.close()}.bind(this)),"box"==this.options.closeOnClick&&this.wrapper.on("click",function(){this.close({ignoreDelay:!0})}.bind(this)),this.container=O('<div class="jBox-container"/>').appendTo(this.wrapper),this.content=O('<div class="jBox-content"/>').appendTo(this.container),this.options.footer&&(this.footer=O('<div class="jBox-footer"/>').append(this.options.footer).appendTo(this.container)),this.options.isolateScroll&&this._isolateScroll(this.content),this.options.closeButton){var t=this._createSVG("svg",[["viewBox","0 0 24 24"]]);t.appendChild(this._createSVG("path",[["d","M22.2,4c0,0,0.5,0.6,0,1.1l-6.8,6.8l6.9,6.9c0.5,0.5,0,1.1,0,1.1L20,22.3c0,0-0.6,0.5-1.1,0L12,15.4l-6.9,6.9c-0.5,0.5-1.1,0-1.1,0L1.7,20c0,0-0.5-0.6,0-1.1L8.6,12L1.7,5.1C1.2,4.6,1.7,4,1.7,4L4,1.7c0,0,0.6-0.5,1.1,0L12,8.5l6.8-6.8c0.5-0.5,1.1,0,1.1,0L22.2,4z"]])),this.closeButton=O('<div class="jBox-closeButton jBox-noDrag"/>').on("click",function(t){this.close({ignoreDelay:!0})}.bind(this)).append(t),"box"!=this.options.closeButton&&(!0!==this.options.closeButton||this.options.overlay||this.options.title||this.options.getTitle)||(this.wrapper.addClass("jBox-closeButton-box"),this.closeButton.appendTo(this.container))}if(this.wrapper.appendTo(this.options.appendTo),this.wrapper.find(".jBox-closeButton").length&&O.each(["top","right","bottom","left"],function(t,i){this.wrapper.find(".jBox-closeButton").css(i)&&"auto"!=this.wrapper.find(".jBox-closeButton").css(i)&&(this.options.adjustDistance[i]=Math.max(this.options.adjustDistance[i],this.options.adjustDistance[i]+-1*((parseInt(this.wrapper.find(".jBox-closeButton").css(i))||0)+(parseInt(this.container.css("border-"+i+"-width"))||0))))}.bind(this)),this.options.pointer){if(this.pointer={position:"target"!=this.options.pointTo?this.options.pointTo:this._getOpp(this.outside),xy:"target"!=this.options.pointTo?this._getXY(this.options.pointTo):this._getXY(this.outside),align:"center",offset:0},this.pointer.element=O('<div class="jBox-pointer jBox-pointer-'+this.pointer.position+'"/>').appendTo(this.wrapper),this.pointer.dimensions={x:this.pointer.element.outerWidth(),y:this.pointer.element.outerHeight()},"string"==O.type(this.options.pointer)){var i=this.options.pointer.split(":");i[0]&&(this.pointer.align=i[0]),i[1]&&(this.pointer.offset=parseInt(i[1]))}this.pointer.alignAttribute="x"==this.pointer.xy?"bottom"==this.pointer.align?"bottom":"top":"right"==this.pointer.align?"right":"left",this.wrapper.css("padding-"+this.pointer.position,this.pointer.dimensions[this.pointer.xy]),this.pointer.element.css(this.pointer.alignAttribute,"center"==this.pointer.align?"50%":0).css("margin-"+this.pointer.alignAttribute,this.pointer.offset),this.pointer.margin={},this.pointer.margin["margin-"+this.pointer.alignAttribute]=this.pointer.offset,"center"==this.pointer.align&&this.pointer.element.css("transform","translate("+("y"==this.pointer.xy?-.5*this.pointer.dimensions.x+"px":0)+", "+("x"==this.pointer.xy?-.5*this.pointer.dimensions.y+"px":0)+")"),this.pointer.element.css("x"==this.pointer.xy?"width":"height",parseInt(this.pointer.dimensions[this.pointer.xy])+parseInt(this.container.css("border-"+this.pointer.alignAttribute+"-width"))),this.wrapper.addClass("jBox-pointerPosition-"+this.pointer.position)}this.setContent(this.options.content,!0),this.setTitle(this.options.title,!0),this.options.draggable&&this._draggable(),this._fireEvent("onCreated")}},this.options.createOnInit&&this._create(),this.options.attach&&this.attach(),this._attachEvents=function(){this.options.delayOnHover&&O("#"+this.id).on("mouseenter",function(t){this.isHovered=!0}.bind(this)),this.options.delayOnHover&&O("#"+this.id).on("mouseleave",function(t){this.isHovered=!1}.bind(this)),(this.options.adjustPosition||this.options.reposition)&&!this.fixed&&this.outside&&(this.options.adjustTracker&&O(window).on("scroll.jBox-"+this.id,function(t){this.position()}.bind(this)),(this.options.adjustPosition||this.options.reposition)&&O(window).on("resize.jBox-"+this.id,function(t){this.position()}.bind(this))),"mouse"==this.options.target&&O("body").on("mousemove.jBox-"+this.id,function(t){this.position({mouseTarget:{top:t.pageY,left:t.pageX}})}.bind(this))},this._detachEvents=function(){this.options.closeOnEsc&&O(document).off("keyup.jBox-"+this.id),(!0===this.options.closeOnClick||"body"==this.options.closeOnClick)&&O(document).off("click.jBox-"+this.id),this.options.adjustTracker&&O(window).off("scroll.jBox-"+this.id),(this.options.adjustPosition||this.options.reposition)&&O(window).off("resize.jBox-"+this.id),"mouse"==this.options.target&&O("body").off("mousemove.jBox-"+this.id)},this._showOverlay=function(){this.overlay||(this.overlay=O('<div id="'+this.id+'-overlay"/>').addClass("jBox-overlay"+(this.type?" jBox-overlay-"+this.type:"")).css({display:"none",opacity:0,zIndex:this.options.zIndex-1}).appendTo(this.options.appendTo),this.options.overlayClass&&this.overlay.addClass(this.options.overlayClass),("overlay"==this.options.closeButton||!0===this.options.closeButton)&&this.overlay.append(this.closeButton),"overlay"==this.options.closeOnClick&&this.overlay.on("click",function(){this.close({ignoreDelay:!0})}.bind(this)),O("#"+this.id+"-overlay .jBox-closeButton").length&&(this.options.adjustDistance.top=Math.max(O("#"+this.id+"-overlay .jBox-closeButton").outerHeight(),this.options.adjustDistance.top))),!0===this.adjustZIndexOnOpen&&this.overlay.css("zIndex",parseInt(this.wrapper.css("zIndex"),10)-1),"block"!=this.overlay.css("display")&&(this.options.fade?this.overlay.stop()&&this.overlay.animate({opacity:1},{queue:!1,duration:this.options.fade,start:function(){this.overlay.css({display:"block"})}.bind(this)}):this.overlay.css({display:"block",opacity:1}))},this._hideOverlay=function(){this.overlay&&(this.options.fade?this.overlay.stop()&&this.overlay.animate({opacity:0},{queue:!1,duration:this.options.fade,complete:function(){this.overlay.css({display:"none"})}.bind(this)}):this.overlay.css({display:"none",opacity:0}))},this._exposeDimensions=function(){this.wrapper.css({top:-1e4,left:-1e4,right:"auto",bottom:"auto"});var t={x:this.wrapper.outerWidth(),y:this.wrapper.outerHeight()};return this.wrapper.css({top:"auto",left:"auto"}),t},this._generateAnimationCSS=function(){if("object"!=O.type(this.options.animation)&&(this.options.animation={pulse:{open:"pulse",close:"zoomOut"},zoomIn:{open:"zoomIn",close:"zoomIn"},zoomOut:{open:"zoomOut",close:"zoomOut"},move:{open:"move",close:"move"},slide:{open:"slide",close:"slide"},flip:{open:"flip",close:"flip"},tada:{open:"tada",close:"zoomOut"}}[this.options.animation]),!this.options.animation)return null;this.options.animation.open&&(this.options.animation.open=this.options.animation.open.split(":")),this.options.animation.close&&(this.options.animation.close=this.options.animation.close.split(":")),this.options.animation.openDirection=this.options.animation.open[1]?this.options.animation.open[1]:null,this.options.animation.closeDirection=this.options.animation.close[1]?this.options.animation.close[1]:null,this.options.animation.open&&(this.options.animation.open=this.options.animation.open[0]),this.options.animation.close&&(this.options.animation.close=this.options.animation.close[0]),this.options.animation.open&&(this.options.animation.open+="Open"),this.options.animation.close&&(this.options.animation.close+="Close");var n={pulse:{duration:350,css:[["0%","scale(1)"],["50%","scale(1.1)"],["100%","scale(1)"]]},zoomInOpen:{duration:this.options.fade||180,css:[["0%","scale(0.9)"],["100%","scale(1)"]]},zoomInClose:{duration:this.options.fade||180,css:[["0%","scale(1)"],["100%","scale(0.9)"]]},zoomOutOpen:{duration:this.options.fade||180,css:[["0%","scale(1.1)"],["100%","scale(1)"]]},zoomOutClose:{duration:this.options.fade||180,css:[["0%","scale(1)"],["100%","scale(1.1)"]]},moveOpen:{duration:this.options.fade||180,positions:{top:{"0%":-12},right:{"0%":12},bottom:{"0%":12},left:{"0%":-12}},css:[["0%","translate%XY(%Vpx)"],["100%","translate%XY(0px)"]]},moveClose:{duration:this.options.fade||180,timing:"ease-in",positions:{top:{"100%":-12},right:{"100%":12},bottom:{"100%":12},left:{"100%":-12}},css:[["0%","translate%XY(0px)"],["100%","translate%XY(%Vpx)"]]},slideOpen:{duration:400,positions:{top:{"0%":-400},right:{"0%":400},bottom:{"0%":400},left:{"0%":-400}},css:[["0%","translate%XY(%Vpx)"],["100%","translate%XY(0px)"]]},slideClose:{duration:400,timing:"ease-in",positions:{top:{"100%":-400},right:{"100%":400},bottom:{"100%":400},left:{"100%":-400}},css:[["0%","translate%XY(0px)"],["100%","translate%XY(%Vpx)"]]},flipOpen:{duration:600,css:[["0%","perspective(400px) rotateX(90deg)"],["40%","perspective(400px) rotateX(-15deg)"],["70%","perspective(400px) rotateX(15deg)"],["100%","perspective(400px) rotateX(0deg)"]]},flipClose:{duration:this.options.fade||300,css:[["0%","perspective(400px) rotateX(0deg)"],["100%","perspective(400px) rotateX(90deg)"]]},tada:{duration:800,css:[["0%","scale(1)"],["10%, 20%","scale(0.9) rotate(-3deg)"],["30%, 50%, 70%, 90%","scale(1.1) rotate(3deg)"],["40%, 60%, 80%","scale(1.1) rotate(-3deg)"],["100%","scale(1) rotate(0)"]]}};O.each(["pulse","tada"],function(t,i){n[i+"Open"]=n[i+"Close"]=n[i]});var s=function(s,e){return keyframe_css="@keyframes jBox-"+this.id+"-animation-"+this.options.animation[s]+"-"+s+(e?"-"+e:"")+" {",O.each(n[this.options.animation[s]].css,function(t,i){var o=e?i[1].replace("%XY",this._getXY(e).toUpperCase()):i[1];n[this.options.animation[s]].positions&&(o=o.replace("%V",n[this.options.animation[s]].positions[e][i[0]])),keyframe_css+=i[0]+" {transform:"+o+";}"}.bind(this)),keyframe_css+="}",keyframe_css+=".jBox-"+this.id+"-animation-"+this.options.animation[s]+"-"+s+(e?"-"+e:"")+" {",keyframe_css+="animation-duration: "+n[this.options.animation[s]].duration+"ms;",keyframe_css+="animation-name: jBox-"+this.id+"-animation-"+this.options.animation[s]+"-"+s+(e?"-"+e:"")+";",keyframe_css+=n[this.options.animation[s]].timing?"animation-timing-function: "+n[this.options.animation[s]].timing+";":"",keyframe_css+="}",keyframe_css}.bind(this);this._animationCSS="",O.each(["open","close"],function(t,o){if(!this.options.animation[o]||!n[this.options.animation[o]]||"close"==o&&!this.options.fade)return"";n[this.options.animation[o]].positions?O.each(["top","right","bottom","left"],function(t,i){this._animationCSS+=s(o,i)}.bind(this)):this._animationCSS+=s(o)}.bind(this))},this.options.animation&&this._generateAnimationCSS(),this._blockBodyClick=function(){this.blockBodyClick=!0,setTimeout(function(){this.blockBodyClick=!1}.bind(this),10)},this._animate=function(t){if(!t&&(t=this.isOpen?"open":"close"),!this.options.fade&&"close"==t)return null;var i=this.options.animation[t+"Direction"]||("center"!=this.align?this.align:this.options.attributes.x);this.flipped&&this._getXY(i)==this._getXY(this.align)&&(i=this._getOpp(i));var o="jBox-"+this.id+"-animation-"+this.options.animation[t]+"-"+t+" jBox-"+this.id+"-animation-"+this.options.animation[t]+"-"+t+"-"+i;this.wrapper.addClass(o);var s=1e3*parseFloat(this.wrapper.css("animation-duration"));"close"==t&&(s=Math.min(s,this.options.fade)),setTimeout(function(){this.wrapper.removeClass(o)}.bind(this),s)},this._abortAnimation=function(){var t=this.wrapper.attr("class").split(" ").filter(function(t){return 0!==t.lastIndexOf("jBox-"+this.id+"-animation",0)}.bind(this));this.wrapper.attr("class",t.join(" "))},(this.options.responsiveWidth||this.options.responsiveHeight)&&O(window).on("resize.responsivejBox-"+this.id,function(t){this.isOpen&&this.position()}.bind(this)),"string"===O.type(this.options.preloadAudio)&&(this.options.preloadAudio=[this.options.preloadAudio]),"string"===O.type(this.options.audio)&&(this.options.audio={open:this.options.audio}),"number"===O.type(this.options.volume)&&(this.options.volume={open:this.options.volume,close:this.options.volume}),!0===this.options.preloadAudio&&this.options.audio&&(this.options.preloadAudio=[],O.each(this.options.audio,function(t,i){this.options.preloadAudio.push(i+".mp3"),this.options.preloadAudio.push(i+".ogg")}.bind(this))),this.options.preloadAudio.length&&O.each(this.options.preloadAudio,function(t,i){var o=new Audio;o.src=i,o.preload="auto"}),this._fireEvent("onInit"),this}var t,i;return a.prototype.attach=function(t,s){return!t&&(t=this.options.attach),"string"==O.type(t)&&(t=O(t)),!s&&(s=this.options.trigger),t&&t.length&&O.each(t,function(t,o){(o=O(o)).data("jBox-attached-"+this.id)||("title"==this.options.getContent&&null!=o.attr("title")&&o.data("jBox-getContent",o.attr("title")).removeAttr("title"),this.attachedElements||(this.attachedElements=[]),this.attachedElements.push(o[0]),o.on(s+".jBox-attach-"+this.id,function(t){if(this.timer&&clearTimeout(this.timer),"mouseenter"!=s||!this.isOpen||this.source[0]!=o[0]){if(this.isOpen&&this.source&&this.source[0]!=o[0])var i=!0;this.source=o,!this.options.target&&(this.target=o),"click"==s&&this.options.preventDefault&&t.preventDefault(),this["click"!=s||i?"open":"toggle"]()}}.bind(this)),"mouseenter"==this.options.trigger&&o.on("mouseleave",function(t){if(!this.wrapper)return null;this.options.closeOnMouseleave&&(t.relatedTarget==this.wrapper[0]||O(t.relatedTarget).parents("#"+this.id).length)||this.close()}.bind(this)),o.data("jBox-attached-"+this.id,s),this._fireEvent("onAttach",o))}.bind(this)),this},a.prototype.detach=function(t){return!t&&(t=this.attachedElements||[]),t&&t.length&&O.each(t,function(t,i){(i=O(i)).data("jBox-attached-"+this.id)&&(i.off(i.data("jBox-attached-"+this.id)+".jBox-attach-"+this.id),i.data("jBox-attached-"+this.id,null)),this.attachedElements=O.grep(this.attachedElements,function(t){return t!=i[0]})}.bind(this)),this},a.prototype.setTitle=function(t,i){if(null==t||null==t)return this;!this.wrapper&&this._create();var o=this.wrapper.outerHeight(),s=this.wrapper.outerWidth();return this.title||(this.titleContainer=O('<div class="jBox-title"/>'),this.title=O("<div/>").appendTo(this.titleContainer),("title"==this.options.closeButton||!0===this.options.closeButton&&!this.options.overlay)&&(this.wrapper.addClass("jBox-closeButton-title"),this.closeButton.appendTo(this.titleContainer)),this.titleContainer.insertBefore(this.content),this._setTitleWidth()),this.wrapper[t?"addClass":"removeClass"]("jBox-hasTitle"),this.title.html(t),s!=this.wrapper.outerWidth()&&this._setTitleWidth(),this.options.draggable&&this._draggable(),!i&&this.options.repositionOnContent&&(o!=this.wrapper.outerHeight()||s!=this.wrapper.outerWidth())&&this.position(),this},a.prototype.setContent=function(t,i){if(null==t||null==t)return this;!this.wrapper&&this._create();var o=this.wrapper.outerHeight(),s=this.wrapper.outerWidth();switch(this.content.children("[data-jbox-content-appended]").appendTo("body").css({display:"none"}),O.type(t)){case"string":this.content.html(t);break;case"object":t instanceof O?(this.content.html(""),t.attr("data-jbox-content-appended",1).appendTo(this.content).css({display:"block"})):this.content.html(JSON.stringify(t))}return s!=this.wrapper.outerWidth()&&this._setTitleWidth(),this.options.draggable&&this._draggable(),!i&&this.options.repositionOnContent&&(o!=this.wrapper.outerHeight()||s!=this.wrapper.outerWidth())&&this.position(),this},a.prototype.setDimensions=function(t,i,o){!this.wrapper&&this._create(),null==i&&(i="auto"),this.content.css(t,this._getInt(i)),"width"==t&&this._setTitleWidth(),(null==o||o)&&this.position()},a.prototype.setWidth=function(t,i){this.setDimensions("width",t,i)},a.prototype.setHeight=function(t,i){this.setDimensions("height",t,i)},a.prototype.position=function(o){if(!o&&(o={}),o=O.extend(!0,this.options,o),this.target=o.target||this.target||O(window),!(this.target instanceof O||"mouse"==this.target)&&(this.target=O(this.target)),!this.target.length)return this;this.content.css({width:this._getInt(o.width,"width"),height:this._getInt(o.height,"height"),minWidth:this._getInt(o.minWidth,"width"),minHeight:this._getInt(o.minHeight,"height"),maxWidth:this._getInt(o.maxWidth,"width"),maxHeight:this._getInt(o.maxHeight,"height")}),this._setTitleWidth();var s=this._exposeDimensions();"mouse"!=this.target&&!this.target.data("jBox-"+this.id+"-fixed")&&this.target.data("jBox-"+this.id+"-fixed",this.target[0]!=O(window)[0]&&("fixed"==this.target.css("position")||0<this.target.parents().filter(function(){return"fixed"==O(this).css("position")}).length)?"fixed":"static");var t={x:O(window).outerWidth(),y:O(window).outerHeight(),top:o.fixed&&this.target.data("jBox-"+this.id+"-fixed")?0:O(window).scrollTop(),left:o.fixed&&this.target.data("jBox-"+this.id+"-fixed")?0:O(window).scrollLeft()};t.bottom=t.top+t.y,t.right=t.left+t.x;try{var i=this.target.offset()}catch(t){i={top:0,left:0}}"mouse"!=this.target&&"fixed"==this.target.data("jBox-"+this.id+"-fixed")&&o.fixed&&(i.top=i.top-O(window).scrollTop(),i.left=i.left-O(window).scrollLeft());var e={x:"mouse"==this.target?12:this.target.outerWidth(),y:"mouse"==this.target?20:this.target.outerHeight(),top:"mouse"==this.target&&o.mouseTarget?o.mouseTarget.top:i?i.top:0,left:"mouse"==this.target&&o.mouseTarget?o.mouseTarget.left:i?i.left:0},n=o.outside&&!("center"==o.position.x&&"center"==o.position.y),a={x:t.x-o.adjustDistance.left-o.adjustDistance.right,y:t.y-o.adjustDistance.top-o.adjustDistance.bottom,left:n?e.left-O(window).scrollLeft()-o.adjustDistance.left:0,right:n?t.x-e.left+O(window).scrollLeft()-e.x-o.adjustDistance.right:0,top:n?e.top-O(window).scrollTop()-this.options.adjustDistance.top:0,bottom:n?t.y-e.top+O(window).scrollTop()-e.y-o.adjustDistance.bottom:0},r={x:"x"!=o.outside&&"xy"!=o.outside||"number"==O.type(o.position.x)?null:o.position.x,y:"y"!=o.outside&&"xy"!=o.outside||"number"==O.type(o.position.y)?null:o.position.y},h={x:!1,y:!1};if(r.x&&s.x>a[r.x]&&a[this._getOpp(r.x)]>a[r.x]&&(r.x=this._getOpp(r.x))&&(h.x=!0),r.y&&s.y>a[r.y]&&a[this._getOpp(r.y)]>a[r.y]&&(r.y=this._getOpp(r.y))&&(h.y=!0),o.responsiveWidth||o.responsiveHeight){var p=function(){if(o.responsiveWidth&&s.x>a[r.x||"x"]){var t=a[r.x||"x"]-(this.pointer&&n&&"x"==o.outside?this.pointer.dimensions.x:0)-parseInt(this.container.css("border-left-width"))-parseInt(this.container.css("border-right-width"));this.content.css({width:t>this.options.responsiveMinWidth?t:null,minWidth:t<parseInt(this.content.css("minWidth"))?0:null}),this._setTitleWidth()}s=this._exposeDimensions()}.bind(this);o.responsiveWidth&&p(),o.responsiveWidth&&!h.y&&r.y&&s.y>a[r.y]&&a[this._getOpp(r.y)]>a[r.y]&&(r.y=this._getOpp(r.y))&&(h.y=!0);var l=function(){if(o.responsiveHeight&&s.y>a[r.y||"y"]){var t=function(){if(!this.titleContainer&&!this.footer)return 0;if("none"==this.wrapper.css("display")){this.wrapper.css("display","block");var t=(this.titleContainer?this.titleContainer.outerHeight():0)+(this.footer?this.footer.outerHeight():0);this.wrapper.css("display","none")}else t=(this.titleContainer?this.titleContainer.outerHeight():0)+(this.footer?this.footer.outerHeight():0);return t||0}.bind(this),i=a[r.y||"y"]-(this.pointer&&n&&"y"==o.outside?this.pointer.dimensions.y:0)-t()-parseInt(this.container.css("border-top-width"))-parseInt(this.container.css("border-bottom-width"));this.content.css({height:i>this.options.responsiveMinHeight?i:null}),this._setTitleWidth()}s=this._exposeDimensions()}.bind(this);o.responsiveHeight&&l(),o.responsiveHeight&&!h.x&&r.x&&s.x>a[r.x]&&a[this._getOpp(r.x)]>a[r.x]&&(r.x=this._getOpp(r.x))&&(h.x=!0),o.adjustPosition&&"move"!=o.adjustPosition&&(h.x&&p(),h.y&&l())}var d={},c=function(t){if("number"!=O.type(o.position[t])){var i=o.attributes[t]="x"==t?"left":"top";if(d[i]=e[i],"center"==o.position[t])return d[i]+=Math.ceil((e[t]-s[t])/2),void("mouse"!=this.target&&this.target[0]&&this.target[0]==O(window)[0]&&(d[i]+=.5*(o.adjustDistance[i]-o.adjustDistance[this._getOpp(i)])));i!=o.position[t]&&(d[i]+=e[t]-s[t]),(o.outside==t||"xy"==o.outside)&&(d[i]+=s[t]*(i!=o.position[t]?1:-1))}else d[o.attributes[t]]=o.position[t]}.bind(this);if(c("x"),c("y"),this.pointer&&"target"==o.pointTo&&"number"!=O.type(o.position.x)&&"number"!=O.type(o.position.y)){var u=0;switch(this.pointer.align){case"center":"center"!=o.position[this._getOpp(o.outside)]&&(u+=s[this._getOpp(o.outside)]/2);break;default:switch(o.position[this._getOpp(o.outside)]){case"center":u+=(s[this._getOpp(o.outside)]/2-this.pointer.dimensions[this._getOpp(o.outside)]/2)*(this.pointer.align==this._getTL(this.pointer.align)?1:-1);break;default:u+=this.pointer.align!=o.position[this._getOpp(o.outside)]?this.dimensions[this._getOpp(o.outside)]*(-1!==O.inArray(this.pointer.align,["top","left"])?1:-1)+this.pointer.dimensions[this._getOpp(o.outside)]/2*(-1!==O.inArray(this.pointer.align,["top","left"])?-1:1):this.pointer.dimensions[this._getOpp(o.outside)]/2*(-1!==O.inArray(this.pointer.align,["top","left"])?1:-1)}}u*=o.position[this._getOpp(o.outside)]==this.pointer.alignAttribute?-1:1,u+=this.pointer.offset*(this.pointer.align==this._getOpp(this._getTL(this.pointer.align))?1:-1),d[this._getTL(this._getOpp(this.pointer.xy))]+=u}if(d[o.attributes.x]+=o.offset.x,d[o.attributes.y]+=o.offset.y,this.wrapper.css(d),o.adjustPosition){this.positionAdjusted&&(this.pointer&&this.wrapper.css("padding",0).css("padding-"+this._getOpp(this.outside),this.pointer.dimensions[this._getXY(this.outside)]).removeClass("jBox-pointerPosition-"+this._getOpp(this.pointer.position)).addClass("jBox-pointerPosition-"+this.pointer.position),this.pointer&&this.pointer.element.attr("class","jBox-pointer jBox-pointer-"+this._getOpp(this.outside)).css(this.pointer.margin),this.positionAdjusted=!1,this.flipped=!1);var g=t.top>d.top-(o.adjustDistance.top||0),m=t.right<d.left+s.x+(o.adjustDistance.right||0),f=t.bottom<d.top+s.y+(o.adjustDistance.bottom||0),x=t.left>d.left-(o.adjustDistance.left||0),y=x?"left":m?"right":null,b=g?"top":f?"bottom":null;if(y||b){if(("Modal"==this.type||"Confirm"==this.type)&&"number"==O.type(this.options.position.x)&&"number"==O.type(this.options.position.y)){var j=0,v=0;return this.options.holdPosition&&(x?j=t.left-(d.left-(o.adjustDistance.left||0)):m&&(j=t.right-(d.left+s.x+(o.adjustDistance.right||0))),g?v=t.top-(d.top-(o.adjustDistance.top||0)):f&&(v=t.bottom-(d.top+s.y+(o.adjustDistance.bottom||0))),this.options.position.x=Math.max(t.top,this.options.position.x+j),this.options.position.y=Math.max(t.left,this.options.position.y+v),c("x"),c("y"),this.wrapper.css(d)),this._fireEvent("onPosition"),this}if(!0===o.adjustPosition||"flip"===o.adjustPosition){var w=function(t){this.wrapper.css(this._getTL(t),d[this._getTL(t)]+(s[this._getXY(t)]+o.offset[this._getXY(t)]*("top"==t||"left"==t?-2:2)+e[this._getXY(t)])*("top"==t||"left"==t?1:-1)),this.pointer&&this.wrapper.removeClass("jBox-pointerPosition-"+this.pointer.position).addClass("jBox-pointerPosition-"+this._getOpp(this.pointer.position)).css("padding",0).css("padding-"+t,this.pointer.dimensions[this._getXY(t)]),this.pointer&&this.pointer.element.attr("class","jBox-pointer jBox-pointer-"+t),this.positionAdjusted=!0,this.flipped=!0}.bind(this);h.x&&w(this.options.position.x),h.y&&w(this.options.position.y)}var B="x"==this._getXY(this.outside)?b:y;if(this.pointer&&"target"==o.pointTo&&"flip"!=o.adjustPosition&&this._getXY(B)==this._getOpp(this._getXY(this.outside))){if("center"==this.pointer.align)var C=s[this._getXY(B)]/2-this.pointer.dimensions[this._getOpp(this.pointer.xy)]/2-parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))*(B!=this._getTL(B)?-1:1);else C=B==this.pointer.alignAttribute?parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute)):s[this._getXY(B)]-parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))-this.pointer.dimensions[this._getXY(B)];var _=B==this._getTL(B)?t[this._getTL(B)]-d[this._getTL(B)]+o.adjustDistance[B]:-1*(t[this._getOpp(this._getTL(B))]-d[this._getTL(B)]-o.adjustDistance[B]-s[this._getXY(B)]);B==this._getOpp(this._getTL(B))&&d[this._getTL(B)]-_<t[this._getTL(B)]+o.adjustDistance[this._getTL(B)]&&(_-=t[this._getTL(B)]+o.adjustDistance[this._getTL(B)]-(d[this._getTL(B)]-_)),(_=Math.min(_,C))<=C&&0<_&&(this.pointer.element.css("margin-"+this.pointer.alignAttribute,parseInt(this.pointer.element.css("margin-"+this.pointer.alignAttribute))-_*(B!=this.pointer.alignAttribute?-1:1)),this.wrapper.css(this._getTL(B),d[this._getTL(B)]+_*(B!=this._getTL(B)?-1:1)),this.positionAdjusted=!0)}}}return this._fireEvent("onPosition"),this},(a.prototype.unscroll=function(t){if(this.set=function(t,i){window.unscrollStore||(window.unscrollStore={}),window.unscrollStore[t]=i},this.get=function(t){return window.unscrollStore?window.unscrollStore[t]:null},this.getScrollbarWidth=function(){if(this.get("scrollbarWidth"))return this.get("scrollbarWidth")+"px";var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-10000",document.body.appendChild(t);var i=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),this.set("scrollbarWidth",i),i+"px"},this.getElementsToAdjust=function(o){!o&&(o=[]),"string"==typeof o&&(o=[[o,"padding-right"]]),o.forEach(function(t,i){"string"==typeof t&&(o[i]=[t,"padding-right"])});for(var t=!1,i=0;i<o.length;i++)-1!==o[i][0].indexOf("body")&&(t=!0);return!1===t&&o.push(["body","padding-right"]),o},this.pageHasScrollbar=function(){return this.getScrollbarWidth()&&document.body.offsetHeight>window.innerHeight},this.pageHasScrollbar()){t=this.getElementsToAdjust(t);for(var i=0;i<t.length;i++)for(var o=document.querySelectorAll(t[i][0]),s=0;s<o.length;s++){if(o[s].getAttribute("data-unscroll"))return;var e=t[i][1],n=window.getComputedStyle(o[s]).getPropertyValue(e);o[s].setAttribute("data-unscroll",e),n||(n="0px");var a="padding-right"==e||"right"==e?"+":"-";o[s].style[e]="calc("+n+" "+a+" "+this.getScrollbarWidth()+")"}}!function(){if(!document.getElementById("unscroll-class-name")){var t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",i.setAttribute("id","unscroll-class-name"),i.appendChild(document.createTextNode(".unscrollable { overflow: hidden !important; }")),t.appendChild(i)}}(),document.body.classList.add("unscrollable")}).reset=function(){for(var t=document.querySelectorAll("[data-unscroll]"),i=0;i<t.length;i++){var o=t[i].getAttribute("data-unscroll");t[i].style[o]=null,t[i].removeAttribute("data-unscroll")}document.body.classList.remove("unscrollable")},a.prototype.open=function(t){if(!t&&(t={}),this.isDestroyed)return this;if(!this.wrapper&&this._create(),!this._styles&&(this._styles=O("<style/>").append(this._animationCSS).appendTo(O("head"))),this.timer&&clearTimeout(this.timer),this._blockBodyClick(),this.isDisabled)return this;this.options.closeOnEsc&&O(document).on("keyup.jBox-"+this.id,function(t){27==t.keyCode&&this.close({ignoreDelay:!0})}.bind(this)),!0!==this.options.closeOnClick&&"body"!==this.options.closeOnClick||(O("body").on("click.jBox-"+this.id,function(t){this.blockBodyClick||"body"==this.options.closeOnClick&&(t.target==this.wrapper[0]||this.wrapper.has(t.target).length)||this.close({ignoreDelay:!0})}.bind(this)),this.isTouchDevice&&O("body > *").on("click.jBox-"+this.id,function(){return!0}));var i=function(){!0===this.adjustZIndexOnOpen&&(a.zIndexMax=Math.max(parseInt(this.wrapper.css("zIndex"),10),this.options.zIndex,a.zIndexMax||0,a.zIndexMaxDragover||0)+2,this.wrapper.css("zIndex",a.zIndexMax),this.options.zIndex=a.zIndexMax),this.source&&this.options.getTitle&&this.source.attr(this.options.getTitle)&&this.setTitle(this.source.attr(this.options.getTitle),!0),this.source&&this.options.getContent&&(this.source.data("jBox-getContent")?this.setContent(this.source.data("jBox-getContent"),!0):this.source.attr(this.options.getContent)?this.setContent(this.source.attr(this.options.getContent),!0):"html"==this.options.getContent&&this.setContent(this.source.html(),!0)),this._fireEvent("onOpen"),(this.options.ajax&&(this.options.ajax.url||this.source&&this.source.attr(this.options.ajax.getURL))&&(!this.ajaxLoaded||this.options.ajax.reload)||t.ajax&&(t.ajax.url||t.ajax.data))&&("strict"==this.options.ajax.reload||!this.source||!this.source.data("jBox-ajax-data")||t.ajax&&(t.ajax.url||t.ajax.data)?this.ajax(t.ajax||null,!0):this.setContent(this.source.data("jBox-ajax-data"))),(!this.positionedOnOpen||this.options.repositionOnOpen)&&this.position(t)&&(this.positionedOnOpen=!0),this.isClosing&&this._abortAnimation(),this.isOpen||(this.isOpen=!0,this.options.autoClose&&(this.options.delayClose=this.options.autoClose)&&this.close(),this._attachEvents(),this.options.blockScroll&&(this.options.blockScrollAdjust?a.blockScrollScopes?a.blockScrollScopes++:(a.blockScrollScopes=1,this.unscroll(Array.isArray(this.options.blockScrollAdjust)||"string"==typeof this.options.blockScrollAdjust?this.options.blockScrollAdjust:null)):O("body").addClass("jBox-blockScroll-"+this.id)),this.options.overlay&&(this._showOverlay(),this.position()),this.options.animation&&!this.isClosing&&this._animate("open"),this.options.audio&&this.options.audio.open&&this.audio(this.options.audio.open,this.options.volume.open),this.options.fade?this.wrapper.stop().animate({opacity:1},{queue:!1,duration:this.options.fade,start:function(){this.isOpening=!0,this.wrapper.css({display:"block"})}.bind(this),always:function(){this.isOpening=!1,setTimeout(function(){this.positionOnFadeComplete&&this.position()&&(this.positionOnFadeComplete=!1)}.bind(this),10)}.bind(this)}):(this.wrapper.css({display:"block",opacity:1}),this.positionOnFadeComplete&&this.position()&&(this.positionOnFadeComplete=!1)))}.bind(this);return!this.options.delayOpen||this.isOpen||this.isClosing||t.ignoreDelay?i():this.timer=setTimeout(i,this.options.delayOpen),this},a.prototype.close=function(t){if(t||(t={}),O("body").off("click.jBox-"+this.id),this.isTouchDevice&&O("body > *").off("click.jBox-"+this.id),this.isDestroyed||this.isClosing)return this;if(this.timer&&clearTimeout(this.timer),this._blockBodyClick(),this.isDisabled)return this;var i=function(){if(this._fireEvent("onClose"),this.options.cancelAjaxOnClose&&this.cancelAjax(),this.isOpen){this.isOpen=!1,this._detachEvents(),this.options.blockScroll&&(this.options.blockScrollAdjust?!(a.blockScrollScopes=a.blockScrollScopes?--a.blockScrollScopes:0)&&this.unscroll.reset():O("body").removeClass("jBox-blockScroll-"+this.id)),this.options.overlay&&this._hideOverlay(),this.options.animation&&!this.isOpening&&this._animate("close"),this.options.audio&&this.options.audio.close&&this.audio(this.options.audio.close,this.options.volume.close);var t=this.isTouchDevice&&"mouse"==this.options.target?0:this.options.fade;t?this.wrapper.stop().animate({opacity:0},{queue:!1,duration:t,start:function(){this.isClosing=!0}.bind(this),complete:function(){this.wrapper.css({display:"none"}),this._fireEvent("onCloseComplete")}.bind(this),always:function(){this.isClosing=!1}.bind(this)}):(this.wrapper.css({display:"none",opacity:0}),this._fireEvent("onCloseComplete"))}}.bind(this);if(t.ignoreDelay||this.isTouchDevice&&"mouse"==this.options.target)i();else if((this.options.delayOnHover||this.options.showCountdown)&&10<this.options.delayClose){var o=this,s=this.options.delayClose,e=Date.now();if(this.options.showCountdown&&!this.inner){var n=O('<div class="jBox-countdown" />');this.inner=O('<div class="jBox-countdown-inner" />'),n.prepend(this.inner),O("#"+this.id).append(n)}this.countdown=function(){var t=Date.now();o.isHovered||(s-=t-e),e=t,0<s?(o.options.showCountdown&&o.inner.css("width",100*s/o.options.delayClose+"%"),window.requestAnimationFrame(o.countdown)):i()},window.requestAnimationFrame(this.countdown)}else this.timer=setTimeout(i,Math.max(this.options.delayClose,10));return this},a.prototype.toggle=function(t){return this[this.isOpen?"close":"open"](t),this},a.prototype.disable=function(){return this.isDisabled=!0,this},a.prototype.enable=function(){return this.isDisabled=!1,this},a.prototype.hide=function(){return this.disable(),this.wrapper&&this.wrapper.css({display:"none"}),this},a.prototype.show=function(){return this.enable(),this.wrapper&&this.wrapper.css({display:"block"}),this},a.prototype.ajax=function(o,i){o||(o={}),O.each([["getData","data"],["getURL","url"]],function(t,i){this.options.ajax[i[0]]&&!o[i[1]]&&this.source&&null!=this.source.attr(this.options.ajax[i[0]])&&(o[i[1]]=this.source.attr(this.options.ajax[i[0]])||"")}.bind(this));var t=O.extend(!0,{},this.options.ajax);this.cancelAjax();var s=o.beforeSend||t.beforeSend||function(){},e=o.complete||t.complete||function(){},n=o.success||t.success||function(){},a=o.error||t.error||function(){},r=O.extend(!0,t,o);return r.beforeSend=function(t){r.loadingClass&&this.wrapper.addClass(!0===r.loadingClass?"jBox-loading":r.loadingClass),r.spinner&&(this.spinnerDelay=setTimeout(function(){this.wrapper.addClass("jBox-loading-spinner"),r.spinnerReposition&&(i?this.positionOnFadeComplete=!0:this.position()),this.spinner=O(!0!==r.spinner?r.spinner:'<div class="jBox-spinner"></div>').appendTo(this.container),this.titleContainer&&"absolute"==this.spinner.css("position")&&this.spinner.css({transform:"translateY("+.5*this.titleContainer.outerHeight()+"px)"})}.bind(this),""==this.content.html()?0:r.spinnerDelay||0)),s.bind(this)(t)}.bind(this),r.complete=function(t){this.spinnerDelay&&clearTimeout(this.spinnerDelay),this.wrapper.removeClass("jBox-loading jBox-loading-spinner jBox-loading-spinner-delay"),this.spinner&&this.spinner.length&&this.spinner.remove()&&r.spinnerReposition&&(i?this.positionOnFadeComplete=!0:this.position()),this.ajaxLoaded=!0,e.bind(this)(t)}.bind(this),r.success=function(t){r.setContent&&this.setContent(t,!0)&&(i?this.positionOnFadeComplete=!0:this.position()),r.setContent&&this.source&&this.source.data("jBox-ajax-data",t),n.bind(this)(t)}.bind(this),r.error=function(t){a.bind(this)(t)}.bind(this),this.ajaxRequest=O.ajax(r),this},a.prototype.cancelAjax=function(){this.ajaxRequest&&(this.ajaxRequest.abort(),this.ajaxLoaded=!1)},a.prototype.audio=function(t,i){if(!t)return this;if(!a._audio&&(a._audio={}),!a._audio[t]){var o=O("<audio/>");O("<source/>",{src:t+".mp3"}).appendTo(o),O("<source/>",{src:t+".ogg"}).appendTo(o),a._audio[t]=o[0]}a._audio[t].volume=Math.min((null!=i?i:100)/100,1);try{a._audio[t].pause(),a._audio[t].currentTime=0}catch(t){}return a._audio[t].play(),this},a._animationSpeeds={tada:1e3,tadaSmall:1e3,flash:500,shake:400,pulseUp:250,pulseDown:250,popIn:250,popOut:250,fadeIn:200,fadeOut:200,slideUp:400,slideRight:400,slideLeft:400,slideDown:400},a.prototype.animate=function(t,i){!i&&(i={}),!this.animationTimeout&&(this.animationTimeout={}),!i.element&&(i.element=this.wrapper),!i.element.data("jBox-animating-id")&&i.element.data("jBox-animating-id",a._getUniqueElementID()),i.element.data("jBox-animating")&&(i.element.removeClass(i.element.data("jBox-animating")).data("jBox-animating",null),this.animationTimeout[i.element.data("jBox-animating-id")]&&clearTimeout(this.animationTimeout[i.element.data("jBox-animating-id")])),i.element.addClass("jBox-animated-"+t).data("jBox-animating","jBox-animated-"+t),this.animationTimeout[i.element.data("jBox-animating-id")]=setTimeout(function(){i.element.removeClass(i.element.data("jBox-animating")).data("jBox-animating",null),i.complete&&i.complete()},a._animationSpeeds[t])},a.prototype.destroy=function(){return this.detach(),this.isOpen&&this.close({ignoreDelay:!0}),this.wrapper&&this.wrapper.remove(),this.overlay&&this.overlay.remove(),this._styles&&this._styles.remove(),this.isDestroyed=!0,this},a._getUniqueID=(t=1,function(){return t++}),a._getUniqueElementID=(i=1,function(){return i++}),a._pluginOptions={},a.plugin=function(t,i){a._pluginOptions[t]=i},O.fn.jBox=function(t,i){return!t&&(t={}),!i&&(i={}),new a(t,O.extend(i,{attach:this}))},a}function jBoxConfirmWrapper(jBox,jQuery){new jBox.plugin("Confirm",{confirmButton:"Submit",cancelButton:"Cancel",confirm:null,cancel:null,closeOnConfirm:!0,target:window,fixed:!0,attach:"[data-confirm]",getContent:"data-confirm",content:"Do you really want to do this?",minWidth:360,maxWidth:500,blockScroll:!0,closeOnEsc:!0,closeOnClick:!1,closeButton:!1,overlay:!0,animation:"zoomIn",preventDefault:!0,_onAttach:function(t){if(!this.options.confirm){var i=t.attr("onclick")?t.attr("onclick"):t.attr("href")?t.attr("target")?'window.open("'+t.attr("href")+'", "'+t.attr("target")+'");':'window.location.href = "'+t.attr("href")+'";':"";t.prop("onclick",null).data("jBox-Confirm-submit",i)}},_onCreated:function(){this.wrapper.addClass("jBox-Modal"),this.footer=jQuery('<div class="jBox-Confirm-footer"/>'),jQuery('<div class="jBox-Confirm-button jBox-Confirm-button-cancel"/>').html(this.options.cancelButton).click(function(){this.options.cancel&&this.options.cancel(this.source),this.close()}.bind(this)).appendTo(this.footer),this.submitButton=jQuery('<div class="jBox-Confirm-button jBox-Confirm-button-submit"/>').html(this.options.confirmButton).appendTo(this.footer),this.footer.appendTo(this.container)},_onOpen:function(){this.submitButton.off("click.jBox-Confirm"+this.id).on("click.jBox-Confirm"+this.id,function(){this.options.confirm?this.options.confirm(this.source):eval(this.source.data("jBox-Confirm-submit")),this.options.closeOnConfirm&&this.close()}.bind(this))}})}function jBoxImageWrapper(t,a){new t.plugin("Image",{src:"href",gallery:"data-jbox-image",imageLabel:"title",imageFade:360,imageSize:"contain",imageCounter:!1,imageCounterSeparator:"/",downloadButton:!1,downloadButtonText:null,downloadButtonUrl:null,mobileImageAttr:null,mobileImageBreakpoint:null,preloadFirstImage:!1,target:window,attach:"[data-jbox-image]",fixed:!0,blockScroll:!0,closeOnEsc:!0,closeOnClick:"button",closeButton:!0,overlay:!0,animation:"zoomIn",preventDefault:!0,width:"100%",height:"100%",adjustDistance:{top:40,right:5,bottom:40,left:5},_onInit:function(){this.images=this.currentImage={},this.imageZIndex=1,this.initImage=function(t){if(!(t=a(t)).data("jBox-image-gallery")){var i=t.attr(this.options.src);this.options.mobileImageAttr&&this.options.mobileImageBreakpoint&&t.attr(this.options.mobileImageAttr)&&a(window).width()<=this.options.mobileImageBreakpoint&&(i=t.attr(this.options.mobileImageAttr));var o=t.attr(this.options.gallery)||"default";!this.images[o]&&(this.images[o]=[]),this.images[o].push({src:i,label:t.attr(this.options.imageLabel)||"",downloadUrl:this.options.downloadButtonUrl&&t.attr(this.options.downloadButtonUrl)?t.attr(this.options.downloadButtonUrl):null}),"title"==this.options.imageLabel&&t.removeAttr("title"),t.data("jBox-image-gallery",o),t.data("jBox-image-id",this.images[o].length-1)}}.bind(this),this.attachedElements&&this.attachedElements.length&&a.each(this.attachedElements,function(t,i){this.initImage(i)}.bind(this));var n=function(t,i,o,s){if(!a("#jBox-image-"+t+"-"+i).length){var e=a("<div/>",{id:"jBox-image-"+t+"-"+i,class:"jBox-image-container"+(o?" jBox-image-"+t+"-current":"")}).css({backgroundSize:this.options.imageSize,opacity:s?1:0,zIndex:o?this.imageZIndex++:0}).appendTo(this.content);return a("<div/>",{id:"jBox-image-label-"+t+"-"+i,class:"jBox-image-label"+(o?" active":"")}).html(this.images[t][i].label).click(function(){a(this).toggleClass("expanded")}).appendTo(this.imageLabel),o&&e.animate({opacity:1},s?0:this.options.imageFade),e}}.bind(this);this.downloadImage=function(t){var i=document.createElement("a");i.href=t,i.setAttribute("download",t.substring(t.lastIndexOf("/")+1)),document.body.appendChild(i),i.click()};var e=function(i,o,t,s){var e=n(i,o,t,s);e.addClass("jBox-image-loading"),a('<img src="'+this.images[i][o].src+'" />').each(function(){var t=new Image;t.onload=function(){e.removeClass("jBox-image-loading"),e.css({backgroundImage:'url("'+this.images[i][o].src+'")'})}.bind(this),t.onerror=function(){e.removeClass("jBox-image-loading"),e.addClass("jBox-image-not-found")}.bind(this),t.src=this.images[i][o].src}.bind(this))}.bind(this);this.showImage=function(t){if("open"!=t){var i=this.currentImage.gallery;o=(o=this.currentImage.id+(1*("prev"==t)?-1:1))>this.images[i].length-1?0:o<0?this.images[i].length-1:o}else{if(this.source){i=this.source.data("jBox-image-gallery");var o=this.source.data("jBox-image-id")}else{if(!this.attachedElements||!this.attachedElements.length)return;i=a(this.attachedElements[0]).data("jBox-image-gallery"),o=a(this.attachedElements[0]).data("jBox-image-id")}a(".jBox-image-pointer-prev, .jBox-image-pointer-next").css({display:1<this.images[i].length?"block":"none"})}if(a(".jBox-image-"+i+"-current").length&&a(".jBox-image-"+i+"-current").removeClass("jBox-image-"+i+"-current").animate({opacity:0},"open"==t?0:this.options.imageFade),this.currentImage={gallery:i,id:o},a("#jBox-image-"+i+"-"+o).length?a("#jBox-image-"+i+"-"+o).addClass("jBox-image-"+i+"-current").css({zIndex:this.imageZIndex++,opacity:0}).animate({opacity:1},"open"==t?0:this.options.imageFade):e(i,o,!0,"open"===t),function(t,i){a(".jBox-image-label.active").removeClass("active expanded"),a("#jBox-image-label-"+t+"-"+i).addClass("active")}(i,o),this.imageCounter&&(1<this.images[i].length?(this.wrapper.addClass("jBox-image-has-counter"),this.imageCounter.find(".jBox-image-counter-all").html(this.images[i].length),this.imageCounter.find(".jBox-image-counter-current").html(o+1)):this.wrapper.removeClass("jBox-image-has-counter")),this.images[i].length-1){var s=o+1;s=s>this.images[i].length-1?0:s<0?this.images[i].length-1:s,a("#jBox-image-"+i+"-"+s).length||e(i,s,!1,!1)}},this.options.preloadFirstImage&&a(window).on("load",function(){this.showImage("open")}.bind(this))},_onAttach:function(t){this.initImage&&this.initImage(t)},_onCreated:function(){this.imageLabel=a("<div/>",{class:"jBox-image-label-container"}).appendTo(this.wrapper),this.imageLabel.append(a("<div/>",{class:"jBox-image-pointer-prev",click:function(){this.showImage("prev")}.bind(this)})).append(a("<div/>",{class:"jBox-image-pointer-next",click:function(){this.showImage("next")}.bind(this)})),this.options.downloadButton&&(this.downloadButton=a("<div/>",{class:"jBox-image-download-button-wrapper"}).appendTo(this.wrapper).append(this.options.downloadButtonText?a("<div/>",{class:"jBox-image-download-button-text"}).html(this.options.downloadButtonText):null).append(a("<div/>",{class:"jBox-image-download-button-icon"})).on("click touchdown",function(){if(this.images[this.currentImage.gallery][this.currentImage.id].downloadUrl)var t=this.images[this.currentImage.gallery][this.currentImage.id].downloadUrl;else t=this.wrapper.find(".jBox-image-"+this.currentImage.gallery+"-current")[0].style.backgroundImage.slice(4,-1).replace(/["']/g,"");this.downloadImage(t)}.bind(this))),this.options.imageCounter&&(this.imageCounter=a("<div/>",{class:"jBox-image-counter-container"}).appendTo(this.wrapper),this.imageCounter.append(a("<span/>",{class:"jBox-image-counter-current"})).append(a("<span/>").html(this.options.imageCounterSeparator)).append(a("<span/>",{class:"jBox-image-counter-all"})))},_onOpen:function(){a(document).on("keyup.jBox-Image-"+this.id,function(t){37==t.keyCode&&this.showImage("prev"),39==t.keyCode&&this.showImage("next")}.bind(this)),this.showImage("open")},_onClose:function(){a(document).off("keyup.jBox-Image-"+this.id)},_onCloseComplete:function(){this.wrapper.find(".jBox-image-container").css("opacity",0)}})}function jBoxNoticeWrapper(t,n){new t.plugin("Notice",{color:null,stack:!0,stackSpacing:10,autoClose:6e3,attributes:{x:"right",y:"top"},position:{x:15,y:15},responsivePositions:{500:{x:5,y:5},768:{x:10,y:10}},target:window,fixed:!0,animation:"zoomIn",closeOnClick:"box",zIndex:12e3,_onInit:function(){this.defaultNoticePosition=n.extend({},this.options.position),this._adjustNoticePositon=function(){var t=n(window),o=t.width();t.height();this.options.position=n.extend({},this.defaultNoticePosition),n.each(this.options.responsivePositions,function(t,i){if(o<=t)return this.options.position=i,!1}.bind(this)),this.options.adjustDistance={top:this.options.position.y,right:this.options.position.x,bottom:this.options.position.y,left:this.options.position.x}},this.options.content instanceof n&&(this.options.content=this.options.content.clone().attr("id","")),n(window).on("resize.responsivejBoxNotice-"+this.id,function(t){this.isOpen&&this._adjustNoticePositon()}.bind(this)),this.open()},_onCreated:function(){this.wrapper.addClass("jBox-Notice-color jBox-Notice-"+(this.options.color||"gray")),this.wrapper.data("jBox-Notice-position",this.options.attributes.x+"-"+this.options.attributes.y)},_onOpen:function(){this.options.stack||(this._adjustNoticePositon(),n.each(n(".jBox-Notice"),function(t,i){(i=n(i)).attr("id")!=this.id&&i.data("jBox-Notice-position")==this.options.attributes.x+"-"+this.options.attributes.y&&(this.options.stack||i.data("jBox").close({ignoreDelay:!0}))}.bind(this)))},_onPosition:function(){var s={};for(var t in n.each(n(".jBox-Notice"),function(t,i){var o=(i=n(i)).data("jBox-Notice-position");s[o]||(s[o]=[]),s[o].push(i)}),s){var i=t.split("-")[1];s[t].reverse();var o=0;for(var e in s[t])el=s[t][e],el.css("margin-"+i,o),o+=el.outerHeight()+this.options.stackSpacing}},_onCloseComplete:function(){this.destroy(),this.options._onPosition.bind(this).call()}})}!function(i,o){"function"==typeof define&&define.amd?define(["jquery"],function(t){return i.jBox=o(t)}):"object"==typeof module&&module.exports?module.exports=i.jBox=o(require("jquery")):i.jBox=o(i.jQuery)}(this,function(t){var i=jBoxWrapper(t);try{void 0!==jBoxConfirmWrapper&&jBoxConfirmWrapper&&jBoxConfirmWrapper(i,t)}catch(t){console.error(t)}try{void 0!==jBoxImageWrapper&&jBoxImageWrapper&&jBoxImageWrapper(i,t)}catch(t){console.error(t)}try{void 0!==jBoxNoticeWrapper&&jBoxNoticeWrapper&&jBoxNoticeWrapper(i,t)}catch(t){console.error(t)}return i});
assets/js/admin.js ADDED
@@ -0,0 +1,458 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ /** @todo add nonce to all ajax requests */
4
+
5
+ var sb = {
6
+ ajax_flag: false,
7
+ ajax_queue: []
8
+ };
9
+
10
+ sb.process_ajax_queue = function () {
11
+ if (sb.ajax_queue.length === 0) return;
12
+ var req = sb.ajax_queue.pop();
13
+ sb.send_ajax(req.iframe_id, req.structure_codemirror_editor, req.css_codemirror_editor);
14
+ };
15
+
16
+ var currentRequest = null;
17
+
18
+ sb.send_ajax = function (iframe_id, structure_codemirror_editor, css_codemirror_editor) {
19
+ if (sb.ajax_flag === true) {
20
+ sb.ajax_queue.push({
21
+ iframe_id: iframe_id,
22
+ structure_codemirror_editor: structure_codemirror_editor,
23
+ css_codemirror_editor: css_codemirror_editor
24
+ });
25
+
26
+ return;
27
+ }
28
+
29
+ sb.ajax_flag = true;
30
+
31
+ var builder_structure = '<div class="pp-password-reset-handler-wrap">' + structure_codemirror_editor.getValue() + '</div>';
32
+
33
+ currentRequest = $.ajax({
34
+ type: "POST",
35
+ url: ajaxurl,
36
+ data: {
37
+ builder_structure: builder_structure,
38
+ builder_css: css_codemirror_editor.getValue(),
39
+ action: 'pp-builder-preview'
40
+ },
41
+ beforeSend: function () {
42
+ if (currentRequest != null) {
43
+ currentRequest.abort();
44
+ }
45
+ },
46
+ })
47
+ .done(function (response) {
48
+ sb.ajax_flag = false;
49
+ var doc = document.getElementById(iframe_id).contentWindow.document;
50
+ doc.open();
51
+ doc.write(response);
52
+ doc.close();
53
+
54
+ }).always(function () {
55
+ sb.process_ajax_queue();
56
+ });
57
+ };
58
+
59
+ sb.codeMirrorInit = function (id, mode, lineNumbers) {
60
+ lineNumbers = typeof lineNumbers !== 'undefined' ? lineNumbers : true;
61
+ return CodeMirror.fromTextArea(id, {
62
+ lineNumbers: lineNumbers,
63
+ mode: mode
64
+ });
65
+ };
66
+
67
+ sb.preview_request = function (builder_structure_id, builder_css_id, iframe_id) {
68
+
69
+ iframe_id = iframe_id || 'indexIframe';
70
+
71
+ if (document.getElementById(builder_css_id) === null) return;
72
+
73
+ var structure_codemirror_editor = window.cmSettingsInstances[builder_structure_id] = sb.codeMirrorInit(document.getElementById(builder_structure_id), 'htmlmixed');
74
+ var css_codemirror_editor = window.cmSettingsInstances[builder_css_id] = sb.codeMirrorInit(document.getElementById(builder_css_id), 'css');
75
+
76
+ // detect if a change event is fired in codemirror editor.
77
+ structure_codemirror_editor.on('change', _.debounce(function () {
78
+ sb.send_ajax(iframe_id, structure_codemirror_editor, css_codemirror_editor);
79
+ window.onbeforeunload = function () {
80
+ return 'The changes you made will be lost if you navigate away from this page.';
81
+ };
82
+ }, 1500));
83
+
84
+ // detect if a change event is fired in codemirror editor.
85
+ css_codemirror_editor.on('change', function () {
86
+ sb.send_ajax(iframe_id, structure_codemirror_editor, css_codemirror_editor);
87
+ window.onbeforeunload = function () {
88
+ return 'The changes you made will be lost if you navigate away from this page.';
89
+ };
90
+ });
91
+
92
+ $('input[type="submit"]').click(function () {
93
+ window.onbeforeunload = function (e) {
94
+ e = null;
95
+ };
96
+ });
97
+
98
+ $(window).load(function () {
99
+ sb.send_ajax(iframe_id, structure_codemirror_editor, css_codemirror_editor);
100
+ });
101
+
102
+
103
+ if ($('#pp_password_handler_structure').length === 0) return;
104
+ var password_handler_structure_codemirror_editor = window.cmSettingsInstances['pp_password_handler_structure'] = sb.codeMirrorInit(document.getElementById('pp_password_handler_structure'), 'htmlmixed');
105
+ password_handler_structure_codemirror_editor.on('change', function () {
106
+ sb.send_ajax('handlerIframe', password_handler_structure_codemirror_editor, css_codemirror_editor);
107
+ });
108
+
109
+ $(window).load(function () {
110
+ sb.send_ajax('handlerIframe', password_handler_structure_codemirror_editor, css_codemirror_editor);
111
+ });
112
+ };
113
+
114
+ sb.login = function () {
115
+ sb.preview_request('pp_login_structure', 'pp_login_css');
116
+ };
117
+
118
+ sb.melange = function () {
119
+ sb.preview_request('pp_melange_structure', 'pp_melange_css');
120
+ };
121
+
122
+ sb.password_reset = function () {
123
+ sb.preview_request('pp_password_structure', 'pp_password_css');
124
+ };
125
+
126
+ sb.registration = function () {
127
+ sb.preview_request('pp_registration_structure', 'pp_registration_css');
128
+ };
129
+
130
+ sb.frontend_profile = function () {
131
+ sb.preview_request('pp_fe_profile_structure', 'pp_fe_profile_css');
132
+ };
133
+
134
+ sb.edit_profile = function () {
135
+ sb.preview_request('pp_edit_profile_structure', 'pp_edit_profile_css');
136
+ };
137
+
138
+ var admin_sidebar_tab_settings = function () {
139
+
140
+ var open_tab = function (tab_selector, control_view) {
141
+ if ($(tab_selector).length === 0) return;
142
+
143
+ $('.pp-settings-wrap .nav-tab-wrapper a').removeClass('nav-tab-active');
144
+ $(tab_selector).addClass('nav-tab-active').blur();
145
+ var clicked_group = $(tab_selector).attr('href');
146
+ if (typeof (localStorage) !== 'undefined') {
147
+ localStorage.setItem(option_name + "_active-tab", $(tab_selector).attr('href'));
148
+ }
149
+ $('.pp-group-wrapper').hide();
150
+ $(clicked_group).fadeIn();
151
+
152
+ if (typeof control_view !== 'undefined') {
153
+ $('html, body').animate({
154
+ // we are removing 20 to accomodate admin bar which cut into view.
155
+ scrollTop: $("#" + control_view).offset().top - 20
156
+ }, 2000);
157
+ }
158
+
159
+ // reset/remove hash from url
160
+ window.location.hash = '';
161
+
162
+ $.each(window.cmSettingsInstances, function (index, value) {
163
+ value.refresh();
164
+ });
165
+ };
166
+
167
+ var open_active_or_first_tab = function () {
168
+ var active_tab = '';
169
+ if (typeof (localStorage) !== 'undefined') {
170
+ active_tab = localStorage.getItem(option_name + "_active-tab");
171
+ }
172
+
173
+ if (active_tab !== '' && $(active_tab).length) {
174
+ active_tab += '-tab';
175
+ } else {
176
+ active_tab = $('.pp-settings-wrap .nav-tab-wrapper a:first')
177
+ }
178
+
179
+ open_tab(active_tab);
180
+ };
181
+
182
+ $('.pp-group-wrapper').hide();
183
+ var option_name = $('div.pp-settings-wrap').data('option-name');
184
+
185
+ $('.pp-settings-wrap .nav-tab-wrapper a').click(function (e) {
186
+ e.preventDefault();
187
+ open_tab(this);
188
+ });
189
+
190
+ var hash_event_triggered = false;
191
+
192
+ $(window).on('hashchange', function () {
193
+ if (hash_event_triggered === true) return;
194
+
195
+ // in #registration_page?login_page, registration_page is the tab id and \
196
+ // login_page the control/settings tr id.
197
+ var hash = this.location.hash, tab_id_len, tab_id, cache;
198
+ if (hash.length === 0) open_active_or_first_tab();
199
+
200
+ if ((tab_id_len = hash.indexOf('?')) !== -1) {
201
+ tab_id = hash.slice(0, tab_id_len);
202
+ control_tr_id = hash.slice(tab_id_len + 1);
203
+
204
+ if ((cache = $('a' + tab_id + '-tab')).length !== 0) {
205
+ open_tab(cache, control_tr_id);
206
+ }
207
+ } else {
208
+ open_tab(hash + '-tab')
209
+ }
210
+
211
+ hash_event_triggered = true;
212
+
213
+ });
214
+
215
+ $(window).trigger('hashchange');
216
+ };
217
+
218
+ var custom_fields_sortable = function () {
219
+ // profile fields sortable
220
+ $("table.custom_profile_fields tbody").sortable({
221
+ cursor: "move",
222
+ containment: "table",
223
+ handle: ".custom-field-anchor",
224
+ start: function (event, ui) {
225
+ ui.item.toggleClass("alternate");
226
+ },
227
+ stop: function (event, ui) {
228
+ ui.item.toggleClass("alternate");
229
+ },
230
+ update: function (event, ui) {
231
+ var data = $(this).sortable('toArray');
232
+ $.post(
233
+ ajaxurl, {
234
+ action: "pp_profile_fields_sortable",
235
+ data: data
236
+ }
237
+ );
238
+
239
+ // regenerate the table tr ids after each DOM update
240
+ $('table.custom_profile_fields tbody tr').each(function (index) {
241
+ $(this).attr('id', ++index);
242
+ });
243
+ }
244
+ });
245
+ // profile fields sortable
246
+ $("table#pp_contact_info tbody").sortable({
247
+ cursor: "move",
248
+ containment: "table",
249
+ handle: ".custom-field-anchor",
250
+ start: function (event, ui) {
251
+ ui.item.toggleClass("alternate");
252
+ },
253
+ stop: function (event, ui) {
254
+ ui.item.toggleClass("alternate");
255
+ },
256
+ update: function (event, ui) {
257
+ var data = $(this).sortable('toArray');
258
+ $.post(
259
+ ajaxurl, {
260
+ action: "pp_contact_info_sortable",
261
+ data: data
262
+ }
263
+ );
264
+ }
265
+ });
266
+
267
+ // add IDs to table "tr" tags in profile fields wp-list-table
268
+ // to be used by jQuery sortable.
269
+ $('table.custom_profile_fields tbody tr').each(function (index) {
270
+ $(this).attr('id', ++index);
271
+ });
272
+ };
273
+
274
+ var custom_field_toggling = function () {
275
+ jQuery(function ($) {
276
+ var cpf_type = $('#cpf_type');
277
+
278
+ var flag = true;
279
+
280
+ if (cpf_type.length > 0) {
281
+
282
+ cpf_type.change(function () {
283
+ var cache = $('#cpf-multi-select'),
284
+ cache2 = $('#pp-custom-field-date-format-row'),
285
+ cache3 = $('#pp-custom-field-options-row'),
286
+ selected_value = this.value;
287
+
288
+ cache.hide();
289
+ if (selected_value === 'select') {
290
+ cache.show();
291
+ }
292
+
293
+ cache2.hide();
294
+ if (selected_value === 'date') {
295
+ cache2.show();
296
+ }
297
+
298
+ cache3.hide();
299
+ // contextual display of options field
300
+ if ($.inArray(selected_value, ['select', 'radio', 'checkbox', 'file']) !== -1) {
301
+ if (flag === false) {
302
+ cache3.find('input').val('');
303
+ }
304
+ cache3.show();
305
+ }
306
+ });
307
+
308
+ cpf_type.change();
309
+
310
+ flag = false;
311
+ }
312
+
313
+ });
314
+ };
315
+
316
+ var email_settings_field_init = function () {
317
+ // initialize codemirror on email field in settings
318
+ $(window).load(function () {
319
+ $('.pp-email-editor-textarea').each(function () {
320
+ window.cmSettingsInstances[this.id] = sb.codeMirrorInit(this, 'htmlmixed', false);
321
+ });
322
+
323
+ $('.pp-codemirror-editor-textarea').each(function () {
324
+ window.cmSettingsInstances[this.id] = sb.codeMirrorInit(this, 'html', true);
325
+ });
326
+ });
327
+
328
+ $('.pp-email-editor-tablinks').click(function (e) {
329
+ e.preventDefault();
330
+ $(this).blur();
331
+ var parent = $(this).parents('.pp-email-editor-wrap');
332
+ $('.pp-email-editor-tablinks', parent).removeClass('eactive');
333
+ var key = parent.find('.pp-email-editor-textarea').attr('id');
334
+
335
+ $('.pp-email-editor-tabcontent', parent).hide();
336
+
337
+ $(this).addClass('eactive');
338
+
339
+ if ($(this).hasClass('ecode')) {
340
+ parent.find('.pp-email-editor-tabcontent.ecode').show();
341
+ } else {
342
+ $('#' + key + '_preview_tabcontent').html(window.cmSettingsInstances[key].getValue());
343
+ parent.find('.pp-email-editor-tabcontent.epreview').show();
344
+ }
345
+ });
346
+
347
+ $('.pp-email-editor-tablinks.ecode').click();
348
+
349
+ $('#email_content_type').on('change', function () {
350
+ if (this.value === 'text/plain') {
351
+ $('.pp-email-editor-tablinks').hide();
352
+
353
+ $('.pp-email-editor-tabcontent').hide();
354
+ $('.pp-email-editor-tabcontent.ecode').show();
355
+ } else {
356
+ $('.pp-email-editor-tablinks').show();
357
+ $('.pp-email-editor-tablinks.ecode').click();
358
+ }
359
+ });
360
+ };
361
+
362
+ var titleshit = function () {
363
+ $('#title').each(function () {
364
+ var input = $(this), prompt = $('#' + this.id + '-prompt-text');
365
+
366
+ if ('' === this.value) {
367
+ prompt.removeClass('screen-reader-text');
368
+ }
369
+
370
+ prompt.click(function () {
371
+ $(this).addClass('screen-reader-text');
372
+ input.focus();
373
+ });
374
+
375
+ input.blur(function () {
376
+ if ('' === this.value) {
377
+ prompt.removeClass('screen-reader-text');
378
+ }
379
+ });
380
+
381
+ input.focus(function () {
382
+ prompt.addClass('screen-reader-text');
383
+ });
384
+ });
385
+ };
386
+
387
+ var shortcodeBuilderUI = function () {
388
+ $('.ppSCB-tab-box .nav-tab').click(function (e) {
389
+ e.preventDefault();
390
+ $('.ppSCB-tab-box .nav-tab').removeClass('nav-tab-active');
391
+ var href = $(this).attr('href');
392
+ $('.ppSCB-tab-content').hide();
393
+ $(this).addClass('nav-tab-active');
394
+ $(href).show();
395
+
396
+ // if tab is switched in settings, refresh codemirror to redraw the layout
397
+ // see https://github.com/codemirror/CodeMirror/issues/61
398
+ $.each(window.cmSettingsInstances, function (index, value) {
399
+ value.refresh();
400
+ });
401
+
402
+ }).eq(0).click();
403
+
404
+ $('.ppSCB-preview-h-left').click(function (e) {
405
+ e.preventDefault();
406
+ $('.ppSCB-preview-h-left, .ppSCB-preview-h-right').removeClass('ppSCB-preview-active');
407
+ $('.ppSCB-sidebar.password-reset iframe').hide();
408
+ $(this).addClass('ppSCB-preview-active');
409
+ $('#indexIframe').show();
410
+ }).click();
411
+
412
+ $('.ppSCB-preview-h-right').click(function (e) {
413
+ e.preventDefault();
414
+ $('.ppSCB-preview-h-left, .ppSCB-preview-h-right').removeClass('ppSCB-preview-active');
415
+ $('.ppSCB-sidebar.password-reset iframe').hide();
416
+ $(this).addClass('ppSCB-preview-active');
417
+ $('#handlerIframe').show();
418
+ });
419
+ };
420
+
421
+ $(function () {
422
+
423
+ if (typeof window.cmSettingsInstances === 'undefined') {
424
+ window.cmSettingsInstances = {};
425
+ }
426
+ admin_sidebar_tab_settings();
427
+ custom_fields_sortable();
428
+ custom_field_toggling();
429
+ email_settings_field_init();
430
+ titleshit();
431
+ shortcodeBuilderUI();
432
+
433
+ sb.login();
434
+ sb.melange();
435
+ sb.password_reset();
436
+ sb.registration();
437
+ sb.frontend_profile();
438
+ sb.edit_profile();
439
+
440
+ // confirm before deleting form
441
+ $('.pp-form-listing.pp-forms .pp-form-delete, .pp-builder-action-btn-block .pp-form-delete, .pp-confirm-delete').click(function (e) {
442
+ e.preventDefault();
443
+ if (confirm(pp_form_builder.confirm_delete)) {
444
+ window.location.href = $(this).attr('href');
445
+ }
446
+ });
447
+
448
+ // Access settings tab contextual display
449
+ $('#global_site_access').change(function () {
450
+ var val = this.value;
451
+
452
+ $('#global_site_access_redirect_page_row, #global_site_access_exclude_pages_row, #global_site_access_allow_homepage_row')
453
+ .toggle('login' === val);
454
+ }).change();
455
+
456
+ $('.wp-csa-select2').select2();
457
+ });
458
+ })(jQuery);
assets/js/builder/app.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e,t,i,l){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=a(e),n=a(t),o=a(i),r=a(l),p=n.default.View.extend({className:"pp-form-buider-settings-popup-container",iconPickerTemplate:o.default.template("pp-form-builder-material-icon"),events:{"click .pp-form-cancel-btn":"cancel_settings","click .pp-form-buider-settings-popup-tab-menu":"switch_tab","click .pp-form-save-btn":"save_changes","click .pp-form-control-icon-picker":"icon_picker","keyup input[name=label].pp-form-control":"make_label_placeholder"},initialize:function(e){if(void 0===e.fieldType)throw new Error("Field Type required");this.options=e,_.bindAll(this,"switch_tab"),_.bindAll(this,"save_changes"),_.bindAll(this,"icon_picker")},icon_picker:function(e){e.preventDefault();var t=this,i=d.default(e.target);(t.jboxInstance=new jBox("Modal",{title:d.default("#pp-form-material-icon-picker-tmpl-title").html(),maxWidth:600,zIndex:999999999,addClass:"pp-icon-picker-jbox-wrap",overlayClass:"pp-icon-picker-jbox-overlay",animation:"zoomIn",content:d.default("#pp-form-material-icon-picker-tmpl"),onOpen:function(){var e=d.default("input.pp-form-control",i.parent()),l=e.val(),a=d.default("#pp-form-material-icon-picker-tmpl");a.find(".pp-form-material-icon-wrap").removeClass("pp-active"),""!==l&&a.find('.pp-form-material-icon-wrap[data-material-icon="'+l+'"]').addClass("pp-active"),d.default(".pp-form-material-icon-wrap").click((function(){var l=d.default(this).data("material-icon");i.html(t.iconPickerTemplate({icon:l})),e.val(l),t.jboxInstance.close()}))}})).open()},save_changes:function(e){e.preventDefault();var t=this;d.default(".pp-form-control").each((function(){var e=d.default(this).attr("name"),i=d.default(this).val();"checkbox"===d.default(this).attr("type")&&(i=this.checked),void 0!==e&&t.options.model.set(e,i)})),d.default("#label",this.$el).length>0?t.options.model.set("fieldBarTitle",d.default("#label",this.$el).val()):t.options.model.set("fieldBarTitle",d.default("#placeholder",this.$el).val()),t.remove()},switch_tab:function(e){e.preventDefault(),d.default(".pp-form-buider-settings-popup-tab-menu",this.$el).removeClass("active"),d.default(e.target).addClass("active"),d.default(".pp-form-buider-settings-popup-tab-content",this.$el).hide(),d.default(d.default(e.target).attr("href")).show()},make_label_placeholder:function(e){e.preventDefault();var t=d.default("input[name=placeholder]",this.$el);!0!==this.$el.data("make_label_placeholder_flag")&&this.$el.data("make_label_placeholder_flag",""===t.val()),!0===this.$el.data("make_label_placeholder_flag")&&t.val(d.default(e.target).val())},cancel_settings_outside:function(e){e.target==this.el&&this.remove()},cancel_settings:function(e){e.preventDefault(),this.remove()},render:function(){var e=-1!==this.options.fieldType.indexOf("reg-cpf")?"reg-cpf":this.options.fieldType;e=-1!==e.indexOf("edit-profile-cpf")?"edit-profile-cpf":e;var t=this.options.model.get("definedFieldType");void 0!==t&&(e=e+"-"+t);var i=o.default.template("pp-form-builder-popup-settings-"+e);this.$el.html(i(this.options.model.toJSON())),d.default(".pp-form-buider-settings-popup-tab-menu",this.$el).eq(0).addClass("active"),d.default(".pp-form-buider-settings-popup-tab-content",this.$el).hide().eq(0).show()}}),s=n.default.View.extend({className:"pp-builder-element",template:o.default.template("pp-form-builder-field-bar"),events:{"click .pp-builder-element-expand-button.pp-settings":"reveal_settings","click .pp-builder-element-expand-button.pp-delete":"delete_field","click .pp-builder-element-expand-button.pp-clone":"clone_field"},reveal_settings:function(e){e.preventDefault(),d.default(e.target).parent("a").blur();var t=this.model.get("fieldType"),i=new p({fieldType:t,model:this.model});i.render(),d.default("body").append(i.$el);var l=d.default(".pp-form-control-wpeditor");l.length>0&&l.each((function(){var e=d.default(this).attr("id");d.default("#"+e).pp_wp_editor({mode:"tmce"}),tinymce.get(e).on("keyup change undo redo SetContent",(function(){this.save()}))}))},delete_field:function(e){e.preventDefault(),confirm(pp_form_builder.confirm_delete)&&(d.default(e.target).parent("a").blur(),this.remove(),this.collection.remove(this.model))},clone_field:function(e){e.preventDefault(),d.default(e.target).parent("a").blur(),this.collection.add(this.model.clone(),{at:this.collection.indexOf(this.model)})},render:function(){var e=this.model.get("fieldType"),t=void 0!==pp_form_builder_combined_fields[e]&&"undefined"!==pp_form_builder_combined_fields[e].fieldTitle?pp_form_builder_combined_fields[e].fieldTitle:this.model.get("fieldTitle");this.$el.html(this.template({fieldType:e,fieldTitle:t,fieldIcon:this.model.get("fieldIcon"),fieldBarTitle:this.model.get("fieldBarTitle")})).data("modelCID",this.model.cid)}}),f=function(e,t,i,l){var a=i.findWhere({fieldType:"footer"}),d="pp_form_builder_"+t+"_fields";l=void 0!==l?l:i.indexOf(a);var n=_.extend(window[d][e],{fieldType:e});i.add(n,{at:l,sort:!1})},c=function(e){d.default("#pp-form-builder-fields-settings").val(JSON.stringify(e.toJSON())),d.default(".pp_edit_form form").submit()},u=n.default.View.extend({el:"#pp-form-builder",initialize:function(){_.bindAll(this,"update_sort_index"),_.bindAll(this,"addFieldOnDrop"),this.listenTo(this.collection,"add",this.render),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"pp_fieldBarTitle_changed",this.render)},initSortable:function(){this.$el.sortable({items:".pp-builder-element",cursor:"move",placeholder:"pp-form-builder-drag-bg",update:this.update_sort_index,receive:this.addFieldOnDrop})},addFieldOnDrop:function(e,t){var i,l;0===t.helper.prev().length||void 0===t.helper.prev().data("modelCID")?i=0:(l=t.helper.prev().data("modelCID"),i=this.collection.get(l).get("sortID"));var a=t.helper.find("a").data("field-type"),d=t.helper.find("a").data("field-category");f(a,d,this.collection,i),this.update_sort_index(),t.helper.remove()},update_sort_index:function(){var e=this.collection;d.default(".pp-builder-form-content .pp-builder-element").each((function(t){t++;var i=d.default(this).data("modelCID");e.get(i).set("sortID",t)})),e.sort()},render:function(){var e=this.collection,t=[];e.each((function(i){var l=new s({model:i,collection:e});l.render(),t.push(l.el)})),this.$el.find(".pp-form-builder-body .pp-builder-form-content").html(t),this.initSortable()}}),m=n.default.View.extend({el:"#pp-form-builder-metabox",events:{"click .pp_upload_button":"media_upload"},initialize:function(){d.default(".pp-color-field",this.$el).wpColorPicker(),d.default(".ppselect2",this.$el).select2(),this.tabify(),new jBox("Tooltip",{attach:".pp-form-builder-help-tip",maxWidth:200,theme:"TooltipDark"}),d.default(".form-field .wp-picker-container",this.$el).parent(".pp-field-row-content").css("width","auto")},tabify:function(){d.default("ul.pp-tabs li a",this.$el).click((function(e){e.preventDefault(),d.default(".pp-form-builder_options_panel").hide(),d.default("#pp-form-builder-metabox ul.pp-tabs li").removeClass("active"),d.default(this).parent().addClass("active"),d.default(d.default(this).attr("href")).show()})).get(0).click()},media_upload:function(e){e.preventDefault();var t,i=d.default(e.target);t||(t=wp.media.frames.file_frame=wp.media({frame:"select",multiple:!1,library:{type:"image"}})).on("select",(function(){var e=t.state().get("selection").first().toJSON();i.parents(".pp_upload_field_container").find(".pp_upload_field").val(e.url)})),t.open()}}),h=n.default.View.extend({el:".pp-form-builder-sidebar-wrap",template:o.default.template("pp-form-builder-sidebar-fields-block"),events:{"click .pp-draggable-field":"add_field","click .pp-form-save-changes":"save_changes"},initialize:function(){this.listenTo(this.collection,"add",this.disable_active_standard_fields),this.listenTo(this.collection,"remove",this.enable_inactive_standard_fields)},initDraggable:function(){this.$el.find(".pp-draggable-field").draggable({connectToSortable:"#pp-form-builder",helper:"clone",revert:"invalid",delay:10})},add_field:function(e){if(e.preventDefault(),d.default(e.target).parent(".pp-draggable-field").hasClass("ui-draggable-disabled"))return!1;var t=d.default(e.target).data("field-type"),i=d.default(e.target).data("field-category");f(t,i,this.collection)},save_changes:function(e){e.preventDefault(),c(this.collection)},disable_active_standard_fields:function(){this.collection.each((function(e){var t=e.get("fieldType");r.default.contains(pp_form_builder_fields_multiple_addition,t)||(d.default('[data-field-type="'+t+'"]',"#pp-form-builder-standard-fields").attr("disabled","disabled").parent(".pp-draggable-field").draggable("disable"),d.default('[data-field-type="'+t+'"]',"#pp-form-builder-defined-fields").attr("disabled","disabled").parent(".pp-draggable-field").draggable("disable"))}))},enable_inactive_standard_fields:function(e){var t=e.get("fieldType");r.default.contains(pp_form_builder_fields_multiple_addition,t)||(d.default('[data-field-type="'+t+'"]',"#pp-form-builder-standard-fields").removeAttr("disabled","disabled").parent(".pp-draggable-field").draggable("enable"),d.default('[data-field-type="'+t+'"]',"#pp-form-builder-defined-fields").removeAttr("disabled","disabled").parent(".pp-draggable-field").draggable("enable"))},render:function(){var e=[this.template({fieldsBlockType:"standard",fields:pp_form_builder_standard_fields})];!1===r.default.isEmpty(pp_form_builder_defined_fields)&&e.push(this.template({fieldsBlockType:"defined",fields:pp_form_builder_defined_fields})),!1===r.default.isEmpty(pp_form_builder_wc_billing_fields)&&e.push(this.template({fieldsBlockType:"wc_billing",fields:pp_form_builder_wc_billing_fields})),!1===r.default.isEmpty(pp_form_builder_wc_shipping_fields)&&e.push(this.template({fieldsBlockType:"wc_shipping",fields:pp_form_builder_wc_shipping_fields})),this.$el.find("#pp-form-builder-sidebar-fields-block").html(e),this.initDraggable(),this.disable_active_standard_fields()}}),b=n.default.Model.extend({initialize:function(){this.on("change:fieldBarTitle",(function(e,t){this.trigger("pp_fieldBarTitle_changed")}))}}),v=n.default.Collection.extend({model:b}),g=function(){d.default("#title").each((function(){var e=d.default(this),t=d.default("#"+this.id+"-prompt-text");""===this.value&&t.removeClass("screen-reader-text"),t.click((function(){d.default(this).addClass("screen-reader-text"),e.focus()})),e.blur((function(){""===this.value&&t.removeClass("screen-reader-text")})),e.focus((function(){t.addClass("screen-reader-text")}))}))},w=function(){d.default(document).on("click",".pp-metabox-handle",(function(e){e.preventDefault();var t=d.default(this),i=d.default(".pp-metabox-handle"),l=d.default(this).parents(".pp-postbox-wrap");i.parents(".pp-postbox-wrap").find(".postbox-header").removeClass("postbox").removeClass("closed"),i.not(t).parents(".pp-postbox-wrap").addClass("closed"),l.hasClass("closed")?l.removeClass("closed"):l.addClass("closed")})),d.default("#pp-form-builder-standard-fields .pp-metabox-handle").click()},k=function(){var e=new v(pp_form_builder_fields_settings);window.ppFormSettings=e,e.comparator="sortID",new u({collection:e}).render(),new h({collection:e}).render(),d.default(document).on("click",".pp-form-save-changes",(function(e){e.preventDefault(),c(window.ppFormSettings)})),new m};d.default((function(){var e=d.default(".pp-dnd-form-builder-wrap");0!==e.length&&(k(),g(),w(),setTimeout((function(){e.css("opacity","1")}),500))}))}(jQuery,Backbone,wp,_);
assets/js/builder/src/app.js ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import $ from 'jquery';
2
+
3
+ import MainView from './views/main-layout';
4
+ import MetaboxView from './views/metabox';
5
+ import SidebarView from './views/sidebar-layout';
6
+ import FormSettings from "./collections/form-settings";
7
+ import Util from './util';
8
+
9
+ let App = {
10
+
11
+ titleShit() {
12
+ $('#title').each(function () {
13
+ let input = $(this), prompt = $('#' + this.id + '-prompt-text');
14
+
15
+ if ('' === this.value) {
16
+ prompt.removeClass('screen-reader-text');
17
+ }
18
+
19
+ prompt.click(function () {
20
+ $(this).addClass('screen-reader-text');
21
+ input.focus();
22
+ });
23
+
24
+ input.blur(function () {
25
+ if ('' === this.value) {
26
+ prompt.removeClass('screen-reader-text');
27
+ }
28
+ });
29
+
30
+ input.focus(function () {
31
+ prompt.addClass('screen-reader-text');
32
+ });
33
+ });
34
+ },
35
+
36
+ metabox_handle_shit() {
37
+ // handle metabox toggling.
38
+ $(document).on('click', '.pp-metabox-handle', function (e) {
39
+
40
+ e.preventDefault();
41
+
42
+ let _this = $(this),
43
+ cache = $('.pp-metabox-handle'),
44
+ parent = $(this).parents('.pp-postbox-wrap');
45
+
46
+ // cleanup.
47
+ cache.parents('.pp-postbox-wrap').find('.postbox-header').removeClass('postbox').removeClass('closed');
48
+ // close all boxes except for the one being toggled
49
+ cache.not(_this).parents('.pp-postbox-wrap').addClass('closed');
50
+
51
+ if (parent.hasClass('closed')) {
52
+ parent.removeClass('closed');
53
+ } else {
54
+ parent.addClass('closed');
55
+ }
56
+ });
57
+
58
+ $('#pp-form-builder-standard-fields .pp-metabox-handle').click();
59
+ },
60
+
61
+ init() {
62
+
63
+ let formSettings = new FormSettings(pp_form_builder_fields_settings);
64
+ window.ppFormSettings = formSettings;
65
+
66
+ formSettings.comparator = 'sortID';
67
+
68
+ const mainLayout = new MainView({
69
+ collection: formSettings
70
+ });
71
+
72
+ mainLayout.render();
73
+
74
+ const sidebarLayout = new SidebarView({
75
+ collection: formSettings
76
+ });
77
+
78
+ sidebarLayout.render();
79
+
80
+ $(document).on('click', '.pp-form-save-changes', function (e) {
81
+ e.preventDefault();
82
+ Util.save_changes(window.ppFormSettings);
83
+ });
84
+
85
+ new MetaboxView();
86
+ }
87
+ };
88
+
89
+ $(function () {
90
+
91
+ let cache = $('.pp-dnd-form-builder-wrap');
92
+
93
+ if (cache.length === 0) return;
94
+
95
+ App.init();
96
+ App.titleShit();
97
+ App.metabox_handle_shit();
98
+
99
+ setTimeout(function () {
100
+ cache.css('opacity', '1');
101
+ }, 500);
102
+ });
assets/js/builder/src/collections/form-settings.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+ import FormSetting from '../model/form-setting';
3
+
4
+ export default Backbone.Collection.extend({
5
+ model: FormSetting
6
+ });
assets/js/builder/src/model/form-setting.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+
3
+ export default Backbone.Model.extend({
4
+ initialize() {
5
+ this.on('change:fieldBarTitle', function (model, title) {
6
+ this.trigger('pp_fieldBarTitle_changed');
7
+ });
8
+ }
9
+ });
assets/js/builder/src/util.js ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import $ from 'jquery';
2
+
3
+ export default {
4
+ addField(fieldType, fieldCategory, collection, position) {
5
+ let footerModel = collection.findWhere({fieldType: "footer"});
6
+ let instance = 'pp_form_builder_' + fieldCategory + '_fields';
7
+ position = typeof position !== 'undefined' ? position : collection.indexOf(footerModel);
8
+
9
+ const model = _.extend(window[instance][fieldType], {fieldType: fieldType});
10
+
11
+ collection.add(model, {at: position, sort: false});
12
+ },
13
+
14
+ save_changes(collection) {
15
+ $('#pp-form-builder-fields-settings').val(JSON.stringify(collection.toJSON()));
16
+ $('.pp_edit_form form').submit();
17
+ },
18
+ }
assets/js/builder/src/views/field-bar.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+ import wp from 'wp';
3
+ import $ from 'jquery';
4
+ import FieldSettingsView from "./field-settings";
5
+
6
+ export default Backbone.View.extend({
7
+
8
+ className: 'pp-builder-element',
9
+
10
+ template: wp.template('pp-form-builder-field-bar'),
11
+
12
+ events: {
13
+ "click .pp-builder-element-expand-button.pp-settings": "reveal_settings",
14
+ "click .pp-builder-element-expand-button.pp-delete": "delete_field",
15
+ "click .pp-builder-element-expand-button.pp-clone": "clone_field"
16
+ },
17
+
18
+ reveal_settings(e) {
19
+ e.preventDefault();
20
+
21
+ $(e.target).parent('a').blur();
22
+ const fieldType = this.model.get('fieldType');
23
+ let activeSettingsView = new FieldSettingsView({fieldType, model: this.model});
24
+ activeSettingsView.render();
25
+ $('body').append(activeSettingsView.$el);
26
+
27
+ var cache = $('.pp-form-control-wpeditor');
28
+ if (cache.length > 0) {
29
+ cache.each(function () {
30
+ var id = $(this).attr('id');
31
+ $('#' + id).pp_wp_editor({mode: 'tmce'});
32
+
33
+ tinymce.get(id).on('keyup change undo redo SetContent', function () {
34
+ this.save();
35
+ });
36
+ });
37
+ }
38
+ },
39
+
40
+ delete_field(e) {
41
+ e.preventDefault();
42
+ if (confirm(pp_form_builder.confirm_delete)) {
43
+ $(e.target).parent('a').blur();
44
+ this.remove();
45
+ this.collection.remove(this.model);
46
+ }
47
+ },
48
+
49
+ clone_field(e) {
50
+ e.preventDefault();
51
+ $(e.target).parent('a').blur();
52
+ this.collection.add(
53
+ this.model.clone(),
54
+ {
55
+ at: this.collection.indexOf(this.model)
56
+ }
57
+ );
58
+ },
59
+
60
+ render() {
61
+ const fieldType = this.model.get('fieldType');
62
+ const fieldTitle = typeof pp_form_builder_combined_fields[fieldType] !== 'undefined' &&
63
+ pp_form_builder_combined_fields[fieldType]["fieldTitle"] !== 'undefined' ? pp_form_builder_combined_fields[fieldType]["fieldTitle"] :
64
+ this.model.get('fieldTitle');
65
+
66
+ this.$el.html(this.template({
67
+ fieldType: fieldType,
68
+ fieldTitle: fieldTitle,
69
+ fieldIcon: this.model.get('fieldIcon'),
70
+ fieldBarTitle: this.model.get('fieldBarTitle')
71
+ })).data('modelCID', this.model.cid);
72
+ }
73
+ });
assets/js/builder/src/views/field-settings.js ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+ import wp from 'wp';
3
+ import $ from 'jquery';
4
+
5
+ export default Backbone.View.extend({
6
+
7
+ className: 'pp-form-buider-settings-popup-container',
8
+
9
+ iconPickerTemplate: wp.template('pp-form-builder-material-icon'),
10
+
11
+ events: {
12
+ //"click": "cancel_settings_outside",
13
+ "click .pp-form-cancel-btn": "cancel_settings",
14
+ "click .pp-form-buider-settings-popup-tab-menu": "switch_tab",
15
+ "click .pp-form-save-btn": "save_changes",
16
+ "click .pp-form-control-icon-picker": "icon_picker",
17
+ "keyup input[name=label].pp-form-control": "make_label_placeholder",
18
+ },
19
+
20
+ initialize(options) {
21
+ if (typeof options.fieldType === 'undefined') throw new Error('Field Type required');
22
+ this.options = options;
23
+ _.bindAll(this, 'switch_tab');
24
+ _.bindAll(this, 'save_changes');
25
+ _.bindAll(this, 'icon_picker');
26
+ },
27
+
28
+ icon_picker(e) {
29
+ e.preventDefault();
30
+
31
+ const _this = this;
32
+ const origin_button = $(e.target);
33
+
34
+ const instance = _this.jboxInstance = new jBox('Modal', {
35
+ title: $('#pp-form-material-icon-picker-tmpl-title').html(),
36
+ maxWidth: 600,
37
+ zIndex: 999999999,
38
+ addClass: 'pp-icon-picker-jbox-wrap',
39
+ overlayClass: 'pp-icon-picker-jbox-overlay',
40
+ animation: 'zoomIn',
41
+ content: $('#pp-form-material-icon-picker-tmpl'),
42
+ onOpen: function () {
43
+ let hidden_input = $('input.pp-form-control', origin_button.parent());
44
+ let hidden_input_val = hidden_input.val();
45
+
46
+ const cache = $('#pp-form-material-icon-picker-tmpl');
47
+ cache.find('.pp-form-material-icon-wrap').removeClass('pp-active');
48
+
49
+ if (hidden_input_val !== "") {
50
+ cache.find('.pp-form-material-icon-wrap[data-material-icon="' + hidden_input_val + '"]').addClass('pp-active');
51
+ }
52
+
53
+ $('.pp-form-material-icon-wrap').click(function () {
54
+ let icon = $(this).data('material-icon');
55
+ origin_button.html(_this.iconPickerTemplate({icon}));
56
+ hidden_input.val(icon);
57
+ _this.jboxInstance.close();
58
+ });
59
+ }
60
+ });
61
+
62
+ instance.open();
63
+ },
64
+
65
+ save_changes(e) {
66
+ e.preventDefault();
67
+ let _this = this;
68
+
69
+ $('.pp-form-control').each(function () {
70
+ let key = $(this).attr('name'),
71
+ value = $(this).val();
72
+ if ($(this).attr('type') === 'checkbox') {
73
+ value = this.checked;
74
+ }
75
+
76
+ if (typeof key === 'undefined') return;
77
+
78
+ _this.options.model.set(key, value);
79
+ });
80
+
81
+ if ($('#label', this.$el).length > 0) {
82
+ _this.options.model.set('fieldBarTitle', $('#label', this.$el).val());
83
+ } else {
84
+ _this.options.model.set('fieldBarTitle', $('#placeholder', this.$el).val());
85
+ }
86
+
87
+ _this.remove();
88
+ },
89
+
90
+ switch_tab(e) {
91
+ e.preventDefault();
92
+ $('.pp-form-buider-settings-popup-tab-menu', this.$el).removeClass('active');
93
+ $(e.target).addClass('active');
94
+
95
+ $('.pp-form-buider-settings-popup-tab-content', this.$el).hide();
96
+ $($(e.target).attr('href')).show();
97
+ },
98
+
99
+ make_label_placeholder(e) {
100
+ e.preventDefault();
101
+ var cache = $('input[name=placeholder]', this.$el);
102
+ if (this.$el.data('make_label_placeholder_flag') !== true) {
103
+ this.$el.data('make_label_placeholder_flag', cache.val() === '');
104
+ }
105
+
106
+ if (this.$el.data('make_label_placeholder_flag') === true) {
107
+ cache.val($(e.target).val());
108
+ }
109
+ },
110
+
111
+ cancel_settings_outside(e) {
112
+ if (e.target == this.el) {
113
+ this.remove();
114
+ }
115
+ },
116
+
117
+ cancel_settings(e) {
118
+ e.preventDefault();
119
+ this.remove();
120
+ },
121
+
122
+ render() {
123
+ let fieldType = this.options.fieldType.indexOf('reg-cpf') !== -1 ? 'reg-cpf' : this.options.fieldType;
124
+ fieldType = fieldType.indexOf('edit-profile-cpf') !== -1 ? 'edit-profile-cpf' : fieldType;
125
+ let definedFieldType = this.options.model.get('definedFieldType');
126
+
127
+ if (typeof definedFieldType !== 'undefined') {
128
+ fieldType = fieldType + '-' + definedFieldType;
129
+ }
130
+
131
+ const tmpl = wp.template('pp-form-builder-popup-settings-' + fieldType);
132
+ this.$el.html(tmpl(this.options.model.toJSON()));
133
+ $('.pp-form-buider-settings-popup-tab-menu', this.$el).eq(0).addClass('active');
134
+ $('.pp-form-buider-settings-popup-tab-content', this.$el).hide().eq(0).show();
135
+ }
136
+ });
assets/js/builder/src/views/main-layout.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+ import FieldBarView from './field-bar';
3
+ import $ from 'jquery';
4
+ import Util from '../util';
5
+
6
+ export default Backbone.View.extend({
7
+
8
+ el: '#pp-form-builder',
9
+
10
+ initialize() {
11
+
12
+ _.bindAll(this, 'update_sort_index');
13
+ _.bindAll(this, 'addFieldOnDrop');
14
+
15
+ this.listenTo(this.collection, 'add', this.render);
16
+ this.listenTo(this.collection, 'remove', this.render);
17
+ this.listenTo(this.collection, 'pp_fieldBarTitle_changed', this.render);
18
+ },
19
+
20
+ initSortable() {
21
+ this.$el.sortable({
22
+ items: ".pp-builder-element",
23
+ cursor: "move",
24
+ placeholder: "pp-form-builder-drag-bg",
25
+ update: this.update_sort_index,
26
+ receive: this.addFieldOnDrop
27
+ });
28
+ },
29
+
30
+ addFieldOnDrop(event, ui) {
31
+
32
+ let position, previousFieldBarModelCID;
33
+
34
+ if (ui.helper.prev().length === 0 || typeof ui.helper.prev().data('modelCID') === 'undefined') {
35
+ position = 0;
36
+ }
37
+ else {
38
+ previousFieldBarModelCID = ui.helper.prev().data('modelCID');
39
+ position = this.collection.get(previousFieldBarModelCID).get('sortID');
40
+ }
41
+
42
+ let fieldType = ui.helper.find('a').data('field-type');
43
+ let fieldCategory = ui.helper.find('a').data('field-category');
44
+
45
+ Util.addField(fieldType, fieldCategory, this.collection, position);
46
+
47
+ this.update_sort_index();
48
+
49
+ // remove the redundant helper/clone representing the draggable.
50
+ ui.helper.remove();
51
+ },
52
+
53
+ update_sort_index() {
54
+ let collection = this.collection;
55
+ $('.pp-builder-form-content .pp-builder-element').each(function (index) {
56
+ index++;
57
+ let cid = $(this).data('modelCID');
58
+ collection.get(cid).set('sortID', index);
59
+ });
60
+
61
+ collection.sort();
62
+ },
63
+
64
+ render() {
65
+
66
+ let formSettings = this.collection;
67
+
68
+ let output = [];
69
+ formSettings.each(function (formSetting) {
70
+ const field = new FieldBarView({
71
+ model: formSetting,
72
+ collection: formSettings
73
+ });
74
+ field.render();
75
+ output.push(field.el);
76
+ });
77
+
78
+ this.$el.find('.pp-form-builder-body .pp-builder-form-content').html(output);
79
+
80
+ this.initSortable();
81
+ }
82
+ });
assets/js/builder/src/views/metabox.js ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+ import $ from 'jquery';
3
+
4
+ export default Backbone.View.extend({
5
+ el: '#pp-form-builder-metabox',
6
+
7
+ events: {
8
+ "click .pp_upload_button": "media_upload",
9
+ },
10
+
11
+ initialize() {
12
+
13
+ $('.pp-color-field', this.$el).wpColorPicker();
14
+ $('.ppselect2', this.$el).select2();
15
+ this.tabify();
16
+
17
+ new jBox('Tooltip', {
18
+ attach: '.pp-form-builder-help-tip',
19
+ maxWidth: 200,
20
+ theme: 'TooltipDark'
21
+ });
22
+
23
+ // Makes tooltip close to the color picker field
24
+ $('.form-field .wp-picker-container', this.$el).parent('.pp-field-row-content').css('width', 'auto');
25
+ },
26
+
27
+ tabify() {
28
+ $('ul.pp-tabs li a', this.$el).click(function (e) {
29
+ e.preventDefault();
30
+ $('.pp-form-builder_options_panel').hide();
31
+ $('#pp-form-builder-metabox ul.pp-tabs li').removeClass('active');
32
+ $(this).parent().addClass('active');
33
+ $($(this).attr('href')).show();
34
+
35
+ }).get(0).click();
36
+ },
37
+
38
+ media_upload(e) {
39
+
40
+ e.preventDefault();
41
+
42
+ let frame, _this = $(e.target);
43
+
44
+ if (frame) {
45
+ frame.open();
46
+ return;
47
+ }
48
+
49
+ frame = wp.media.frames.file_frame = wp.media({
50
+ frame: 'select',
51
+ multiple: false,
52
+ library: {
53
+ type: 'image' // limits the frame to show only images
54
+ },
55
+ });
56
+
57
+ frame.on('select', function () {
58
+ let attachment = frame.state().get('selection').first().toJSON();
59
+ _this.parents('.pp_upload_field_container').find('.pp_upload_field').val(attachment.url);
60
+
61
+ });
62
+
63
+ frame.open();
64
+ }
65
+ });
assets/js/builder/src/views/sidebar-layout.js ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import Backbone from 'backbone';
2
+ import $ from 'jquery';
3
+ import wp from 'wp';
4
+ import _ from 'underscore';
5
+ import Util from '../util';
6
+
7
+ export default Backbone.View.extend({
8
+
9
+ el: '.pp-form-builder-sidebar-wrap',
10
+
11
+ template: wp.template('pp-form-builder-sidebar-fields-block'),
12
+
13
+ events: {
14
+ "click .pp-draggable-field": "add_field",
15
+ "click .pp-form-save-changes": "save_changes",
16
+ },
17
+
18
+ initialize() {
19
+ this.listenTo(this.collection, 'add', this.disable_active_standard_fields);
20
+ this.listenTo(this.collection, 'remove', this.enable_inactive_standard_fields);
21
+ },
22
+
23
+ initDraggable() {
24
+ this.$el.find(".pp-draggable-field").draggable({
25
+ connectToSortable: "#pp-form-builder",
26
+ helper: 'clone',
27
+ revert: 'invalid',
28
+ delay: 10,
29
+ });
30
+ },
31
+
32
+ add_field(e) {
33
+ e.preventDefault();
34
+ if ($(e.target).parent('.pp-draggable-field').hasClass('ui-draggable-disabled')) return false;
35
+
36
+ let fieldType = $(e.target).data('field-type');
37
+ let fieldCategory = $(e.target).data('field-category');
38
+
39
+ Util.addField(fieldType, fieldCategory, this.collection);
40
+ },
41
+
42
+ save_changes(e) {
43
+ e.preventDefault();
44
+ Util.save_changes(this.collection);
45
+ },
46
+
47
+ disable_active_standard_fields() {
48
+ this.collection.each(function (model) {
49
+
50
+ const fieldType = model.get('fieldType');
51
+ // we need to allow profile custom field bar to be included multiple times.
52
+ if (_.contains(pp_form_builder_fields_multiple_addition, fieldType)) return;
53
+
54
+ $('[data-field-type="' + fieldType + '"]', '#pp-form-builder-standard-fields').attr('disabled', 'disabled').parent('.pp-draggable-field').draggable('disable');
55
+ $('[data-field-type="' + fieldType + '"]', '#pp-form-builder-defined-fields').attr('disabled', 'disabled').parent('.pp-draggable-field').draggable('disable');
56
+ });
57
+ },
58
+
59
+ enable_inactive_standard_fields(model) {
60
+ const fieldType = model.get('fieldType');
61
+ // we need to allow profile custom field bar to be included multiple times.
62
+ if (_.contains(pp_form_builder_fields_multiple_addition, fieldType)) return;
63
+
64
+ $('[data-field-type="' + fieldType + '"]', '#pp-form-builder-standard-fields').removeAttr('disabled', 'disabled').parent('.pp-draggable-field').draggable('enable');
65
+ $('[data-field-type="' + fieldType + '"]', '#pp-form-builder-defined-fields').removeAttr('disabled', 'disabled').parent('.pp-draggable-field').draggable('enable');
66
+ },
67
+
68
+ render() {
69
+
70
+ let rendered_html = [
71
+ this.template({
72
+ fieldsBlockType: 'standard',
73
+ fields: pp_form_builder_standard_fields
74
+ }),
75
+ ];
76
+
77
+ if (_.isEmpty(pp_form_builder_defined_fields) === false) {
78
+ rendered_html.push(
79
+ this.template({
80
+ fieldsBlockType: 'defined',
81
+ fields: pp_form_builder_defined_fields
82
+ })
83
+ );
84
+ }
85
+
86
+ if (_.isEmpty(pp_form_builder_wc_billing_fields) === false) {
87
+ rendered_html.push(
88
+ this.template({
89
+ fieldsBlockType: 'wc_billing',
90
+ fields: pp_form_builder_wc_billing_fields
91
+ })
92
+ );
93
+ }
94
+
95
+ if (_.isEmpty(pp_form_builder_wc_shipping_fields) === false) {
96
+ rendered_html.push(
97
+ this.template({
98
+ fieldsBlockType: 'wc_shipping',
99
+ fields: pp_form_builder_wc_shipping_fields
100
+ })
101
+ );
102
+ }
103
+
104
+ // Since shortcode builder doesn't have extra fields, let's comment it out.
105
+ // if (_.isEmpty(pp_form_builder_extra_fields) === false) {
106
+ // rendered_html.push(
107
+ // this.template({
108
+ // fieldsBlockType: 'extra',
109
+ // fields: pp_form_builder_extra_fields
110
+ // })
111
+ // );
112
+ // }
113
+
114
+ this.$el.find('#pp-form-builder-sidebar-fields-block').html(rendered_html);
115
+
116
+ this.initDraggable();
117
+
118
+ this.disable_active_standard_fields();
119
+ }
120
+ });
assets/js/clipboard.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*!
2
+ * clipboard.js v2.0.6
3
+ * https://clipboardjs.com/
4
+ *
5
+ * Licensed MIT © Zeno Rocha
6
+ */
7
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return o={},r.m=n=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,a=o.length;i<a;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=n,t.exports.TinyEmitter=n},function(t,e,n){var d=n(3),h=n(4);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!d.string(e))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(t))return s=e,f=n,(u=t).addEventListener(s,f),{destroy:function(){u.removeEventListener(s,f)}};if(d.nodeList(t))return a=t,c=e,l=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(c,l)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(c,l)})}};if(d.string(t))return o=t,r=e,i=n,h(document.body,o,r,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,a,c,l,u,s,f}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(5);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},function(t,e,n){"use strict";n.r(e);var o=n(0),r=n.n(o),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function c(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),this.resolveOptions(t),this.initSelection()}var l=(function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t}(c,[{key:"resolveOptions",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=r()(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=r()(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(t){var e=0<arguments.length&&void 0!==t?t:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),c),u=n(1),s=n.n(u),f=n(2),d=n.n(f),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(t,e,n){return e&&y(t.prototype,e),n&&y(t,n),t};function y(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}var m=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(v,s.a),p(v,[{key:"resolveOptions",value:function(t){var e=0<arguments.length&&void 0!==t?t:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===h(e.container)?e.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=d()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return b("action",t)}},{key:"defaultTarget",value:function(t){var e=b("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return b("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(t){var e=0<arguments.length&&void 0!==t?t:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),v);function v(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,v);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return n.resolveOptions(e),n.listenClick(t),n}function b(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}e.default=m}],r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6).default;function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}var n,o});
assets/js/content-control.js ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+
3
+ var cr = {
4
+ orRuleTemplate: wp.template('ppress-cr-or-rule'),
5
+ andRuleTemplate: wp.template('ppress-cr-and-rule'),
6
+ unlinkedAndRuleBadge: wp.template('ppress-cr-unlinked-and-rule-badge'),
7
+ linkedAndRuleBadge: wp.template('ppress-cr-linked-and-rule-badge')
8
+ };
9
+
10
+ cr.uiBlock = function () {
11
+ $('#ppress-content-protection-content').block({
12
+ message: '<span class="spinner" style="visibility:visible;float:none;"></span>',
13
+ css: {border: '0', backgroundColor: 'transparent'},
14
+ overlayCSS: {
15
+ backgroundColor: '#fff',
16
+ opacity: 0.9
17
+ }
18
+ });
19
+ };
20
+
21
+ cr.uiUnBlock = function () {
22
+ $('#ppress-content-protection-content').unblock();
23
+ };
24
+
25
+ cr.select2Init = function () {
26
+ $('.facetList .facet').each(function (index, element) {
27
+
28
+ var selected_condition, select2options, fieldType, parent = $(element);
29
+
30
+ $('.ppress-cr-select2', parent).each(function (index2, element2) {
31
+ if ($(element2).hasClass("select2-hidden-accessible") === false) {
32
+ selected_condition = $('.ppress-content-condition-rule-name', parent).val();
33
+ select2options = typeof ppress_cr_conditions[selected_condition]['field'] ? ppress_cr_conditions[selected_condition]['field'] : {};
34
+ fieldType = typeof select2options['type'] !== "undefined" ? select2options['type'] : '';
35
+ if (_.contains(['postselect', 'taxonomyselect'], fieldType)) {
36
+ select2options = _.extend(select2options, {
37
+ ajax: {
38
+ url: ajaxurl,
39
+ delay: 250,
40
+ cache: true,
41
+ data: function (params) {
42
+ return {
43
+ search: params.term,
44
+ nonce: ppress_cr_nonce,
45
+ action: 'ppress_cr_object_search',
46
+ object_type: fieldType === 'postselect' ? 'post_type' : 'taxonomy',
47
+ object_key: select2options.type === 'postselect' ? select2options.post_type : select2options.taxonomy
48
+ };
49
+ }
50
+ }
51
+ });
52
+ }
53
+
54
+ $(element2).select2(select2options);
55
+ }
56
+ })
57
+ })
58
+ };
59
+
60
+ cr.generateUniqueID = function () {
61
+ return Math.random().toString(36).substring(2) + Date.now().toString(36);
62
+ };
63
+
64
+ cr.addOrRule = function () {
65
+ $(document).on('click', '#ppress-content-protection-content .addFacet', function () {
66
+ $(this).blur();
67
+ var parent = $(this).parents('.condAction');
68
+ parent.find('.facetList').append(
69
+ cr.orRuleTemplate({
70
+ facetListId: parent.data('facet-list'),
71
+ facetId: cr.generateUniqueID()
72
+ })
73
+ );
74
+ });
75
+ };
76
+
77
+ cr.addAndRule = function () {
78
+ $(document).on('click', '#ppress-content-protection-content .addCondition', function () {
79
+ $(this).blur();
80
+ $('#workflowConditions').append(
81
+ cr.andRuleTemplate({
82
+ facetListId: cr.generateUniqueID(),
83
+ facetId: cr.generateUniqueID()
84
+ })
85
+ );
86
+
87
+ $(this).parents('.and').replaceWith(cr.unlinkedAndRuleBadge());
88
+ });
89
+ };
90
+
91
+ cr.deleteOrRule = function () {
92
+ $(document).on('click', '#ppress-content-protection-content .removeFacet', function () {
93
+ $(this).blur();
94
+ var andRuleWrapper = $(this).parents('.condAction').parent(),
95
+ rule_wrapper = $(this).parents('.facetList').find('.facet');
96
+
97
+ if (rule_wrapper.length === 1) {
98
+
99
+ if ($('#ppress-content-protection-content .condAction').length === 1) {
100
+ rule_wrapper.find('.ppress-cr-rule-values').html('');
101
+ rule_wrapper.find('.ppress-content-condition-rule-name').val('');
102
+ return false;
103
+ }
104
+
105
+ andRuleWrapper.remove();
106
+
107
+ $('p.and').eq(-1).replaceWith(cr.linkedAndRuleBadge());
108
+ return;
109
+ }
110
+
111
+ $(this).parents('.facet').remove();
112
+ });
113
+ };
114
+
115
+ cr.getConditionValueField = function () {
116
+
117
+ $(document).on('change', '.ppress-content-condition-rule-name', function () {
118
+
119
+ var cr_rule_value_container = $(this).parents('.facet').find('.ppress-cr-rule-values'),
120
+ selected_condition = this.value;
121
+
122
+ cr_rule_value_container.html('');
123
+
124
+ if (selected_condition === "") return false;
125
+
126
+ var ajaxData = {
127
+ 'action': 'ppress_content_condition_field',
128
+ 'condition_id': this.value,
129
+ 'nonce': ppress_cr_nonce
130
+ },
131
+ facetId = $(this).parents('.facet').data('facet'),
132
+ facetListId = $(this).parents('.condAction').data('facet-list');
133
+
134
+ if (typeof facetId !== "undefined") {
135
+ ajaxData.facetId = facetId;
136
+ }
137
+
138
+ if (typeof facetListId !== "undefined") {
139
+ ajaxData.facetListId = facetListId;
140
+ }
141
+
142
+ try {
143
+ ajaxData.field_type = ppress_cr_conditions[selected_condition]['field']['type'];
144
+ } catch (e) {
145
+ return false;
146
+ }
147
+
148
+ cr.uiBlock();
149
+
150
+ $.post(ajaxurl, ajaxData, function (response) {
151
+
152
+ if ('success' in response && response.success === true) {
153
+ cr_rule_value_container.append(response.data);
154
+ $(document).trigger('ppress_cr_field_added', selected_condition)
155
+ }
156
+
157
+ cr.uiUnBlock();
158
+ }
159
+ );
160
+ })
161
+ };
162
+
163
+ cr.EventsListener = function () {
164
+ $(document).on('ppress_cr_field_added', function () {
165
+ cr.select2Init();
166
+ });
167
+ };
168
+
169
+ $(function () {
170
+ cr.select2Init();
171
+ cr.addOrRule();
172
+ cr.addAndRule();
173
+ cr.deleteOrRule();
174
+ cr.getConditionValueField();
175
+ cr.EventsListener();
176
+ });
177
+
178
+ })(jQuery);
assets/js/create-form.js ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ var fb = {};
3
+
4
+ fb.uiBlock = function () {
5
+ $('#post-body-content').block({
6
+ message: '<span class="spinner" style="visibility:visible;float:none;"></span>',
7
+ css: {border: '0', backgroundColor: 'transparent'},
8
+ overlayCSS: {
9
+ backgroundColor: '#fff',
10
+ opacity: 0.9
11
+ }
12
+ });
13
+ };
14
+
15
+ fb.uiUnBlock = function () {
16
+ $('#post-body-content').unblock();
17
+ };
18
+
19
+ fb.fetchThemes = function () {
20
+ $(document).on('click', '.pp-hald-first', function (e) {
21
+ e.preventDefault();
22
+ $('.pp-half-meta-inner').removeClass('pp-builder-select-active');
23
+ $(this).find('.pp-half-meta-inner').addClass('pp-builder-select-active');
24
+ fb.uiBlock();
25
+ var builder_type = $(this).data('builder-type');
26
+ $('.pp-main-ajax-body').html('');
27
+
28
+ $.post(
29
+ ajaxurl, {
30
+ action: "pp_get_forms_by_builder_type",
31
+ data: builder_type
32
+ }, function (response) {
33
+ $('.pp-main-ajax-body').html(response);
34
+ fb.uiUnBlock();
35
+ $('html, body').animate({
36
+ scrollTop: $(".pp-main-ajax-body .pp-form-new-list").offset().top
37
+ }, 1500);
38
+
39
+ new jBox('Tooltip', {
40
+ attach: '.pp-melange-jbox',
41
+ maxWidth: 200,
42
+ theme: 'TooltipDark'
43
+ });
44
+ }
45
+ );
46
+ });
47
+ };
48
+
49
+ fb.filterFormByType = function () {
50
+ $(document).on('click', '.pp-select-form-type', function (e) {
51
+ e.preventDefault();
52
+ $('.pp-select-form-type').removeClass('pp-type-active');
53
+ $(this).addClass('pp-type-active');
54
+ $('.pp-form-new-list .pp-dash-spinner').css('visibility', 'visible');
55
+
56
+ var ajaxData = {
57
+ action: 'pp_form_type_selection',
58
+ nonce: $('#pp_plugin_nonce').val(),
59
+ 'form-type': $(this).attr('data-form-type').trim(),
60
+ 'builder-type': $(this).attr('data-builder-type').trim()
61
+ };
62
+
63
+ $.post(ajaxurl, ajaxData, function (response) {
64
+ if (typeof response === 'string') {
65
+ $('.pp-optin-themes').replaceWith(response);
66
+ }
67
+ $('.pp-form-new-list .pp-dash-spinner').css('visibility', 'hidden');
68
+ }
69
+ );
70
+ });
71
+ };
72
+
73
+ fb.createShortcodeForm = function () {
74
+ $(document).on('click', '.pp-optin-theme.ppress-allow-activate', function (e) {
75
+ e.preventDefault();
76
+ var form_title_obj = $('#pp-add-form-title');
77
+ // remove input field error on change.
78
+ form_title_obj.change(function () {
79
+ form_title_obj.removeClass('pp-input-error');
80
+ });
81
+
82
+ if (!form_title_obj.val()) {
83
+ form_title_obj.addClass('pp-input-error');
84
+ } else {
85
+ form_title_obj.removeClass('pp-input-error');
86
+ $(".pp-error").remove();
87
+ $('.pp-form-new-list .pp-dash-spinner').css('visibility', 'visible');
88
+
89
+ var theme_class = typeof $(this).attr('data-theme-class') !== 'undefined' ? $(this).attr('data-theme-class').trim() : '';
90
+ var theme_type = typeof $(this).attr('data-theme-type') !== 'undefined' ? $(this).attr('data-theme-type').trim() : '';
91
+
92
+ var ajaxData = {
93
+ action: 'pp_create_form',
94
+ nonce: $('#pp_plugin_nonce').val(),
95
+ title: form_title_obj.val().trim(),
96
+ theme_class: theme_class,
97
+ theme_type: theme_type,
98
+ builder_type: $(this).attr('data-builder-type').trim()
99
+ };
100
+
101
+ $.post(ajaxurl, ajaxData, function (response) {
102
+ if (response.success && response.data.redirect) {
103
+ window.location.assign(response.data.redirect);
104
+ } else {
105
+ var error_msg = response.data ? response.data : '';
106
+ form_title_obj.after('<span class="pp-error">' + error_msg + '</span>');
107
+ $('.pp-form-new-list .pp-dash-spinner').css('visibility', 'hidden');
108
+ }
109
+ }, 'json'
110
+ );
111
+ }
112
+ });
113
+ };
114
+
115
+ fb.fetchThemes();
116
+ fb.createShortcodeForm();
117
+ fb.filterFormByType();
118
+
119
+ })(jQuery);
assets/js/frontend.js ADDED
@@ -0,0 +1,474 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($, window, undefined) {
2
+
3
+ function Frontend() {
4
+
5
+ var _this = this;
6
+
7
+ this.init = function () {
8
+
9
+ window.ppFormRecaptchaLoadCallback = this.recaptcha_processing;
10
+
11
+ $('.pp-del-profile-avatar').click(this.delete_avatar);
12
+ $('.pp-del-cover-image').click(this.delete_profile_image_cover);
13
+
14
+ $(document).on('click', '.has-password-visibility-icon .pp-form-material-icons', this.toggle_password_visibility);
15
+
16
+ // used by the WooCommerce module for toggling wc overridden checkout login form
17
+ $(document.body).on('click', 'a.showlogin', function () {
18
+ $(".pp_wc_login").slideToggle();
19
+ });
20
+
21
+ $(window).on('load resize', function () {
22
+ _this.defaultUserProfileResponsive();
23
+ });
24
+
25
+ // only enable if pp_disable_ajax_form filter is false.
26
+ if (pp_ajax_form.disable_ajax_form === 'true') return;
27
+
28
+ $(document).on('submit', 'form[data-pp-form-submit="login"]', this.ajax_login);
29
+ $(document).on('submit', 'form[data-pp-form-submit="signup"]', this.ajax_registration);
30
+ $(document).on('submit', 'form[data-pp-form-submit="passwordreset"]', this.ajax_password_reset);
31
+ $(document).on('submit', 'form[data-pp-form-submit="editprofile"]', this.ajax_edit_profile);
32
+ };
33
+
34
+ this.recaptcha_processing = function () {
35
+ $('.pp-g-recaptcha').each(function (index, el) {
36
+ var $site_key = $(el).attr('data-sitekey');
37
+ var $form = $(this).parents('.pp-form-container').find('form');
38
+
39
+ if ($(el).attr('data-type') === 'v3') {
40
+
41
+ $form.find('input.pp-submit-form').on('click', function (e) {
42
+ e.preventDefault();
43
+ _this._add_processing_label($form);
44
+ grecaptcha.ready(function () {
45
+ grecaptcha.execute($site_key, {action: 'form'}).then(function (token) {
46
+ $form.find('[name="g-recaptcha-response"]').remove();
47
+
48
+ $form.append($('<input>', {
49
+ type: 'hidden',
50
+ value: token,
51
+ name: 'g-recaptcha-response'
52
+ }));
53
+
54
+ $form.submit();
55
+ });
56
+ });
57
+ });
58
+ } else {
59
+ var widgetId1 = grecaptcha.render(el, {
60
+ 'sitekey': $site_key,
61
+ 'theme': $(el).attr('data-theme'),
62
+ 'size': $(el).attr('data-size')
63
+ });
64
+
65
+ $form.on('pp_form_submitted', function () {
66
+ grecaptcha.reset(widgetId1)
67
+ });
68
+ }
69
+ });
70
+ };
71
+
72
+ this.toggle_password_visibility = function (e) {
73
+ e.preventDefault();
74
+ var input = $(this).parents('.pp-form-field-input-textarea-wrap').find('.pp-form-field');
75
+
76
+ if (input.attr('type') === 'password') {
77
+ input.attr('type', 'text');
78
+ $(this).text('visibility_off')
79
+ } else {
80
+ input.attr('type', 'password');
81
+ $(this).text('visibility')
82
+ }
83
+ };
84
+
85
+ this.ajax_edit_profile = function (e) {
86
+
87
+ if (typeof window.FormData === 'undefined' || !window.FormData) return;
88
+
89
+ e.preventDefault();
90
+
91
+ var $editprofile_form = $('form[data-pp-form-submit="editprofile"]');
92
+
93
+ var melange_id = _this.get_melange_id($editprofile_form);
94
+
95
+ var formData = new FormData(this);
96
+ formData.append("action", "pp_ajax_editprofile");
97
+ formData.append("nonce", pp_ajax_form.nonce);
98
+ formData.append("melange_id", melange_id);
99
+
100
+ // remove any prior edit profile error.
101
+ $('.profilepress-edit-profile-status').remove();
102
+ $('.profilepress-edit-profile-success').remove();
103
+
104
+ // remove any prior status message. Fixes removal of message with custom class.
105
+ if ("" !== window.edit_profile_msg_class) {
106
+ $('.' + window.edit_profile_msg_class).remove();
107
+ }
108
+
109
+ _this._add_processing_label($editprofile_form);
110
+
111
+ $.post({
112
+ url: pp_ajax_form.ajaxurl,
113
+ data: formData,
114
+ cache: false,
115
+ contentType: false,
116
+ enctype: 'multipart/form-data',
117
+ processData: false,
118
+ dataType: 'json',
119
+ success: function (response) {
120
+ $editprofile_form.trigger('pp_form_submitted');
121
+ $editprofile_form.trigger('pp_form_edit_profile_success', [$editprofile_form]);
122
+ if ("avatar_url" in response && response.avatar_url !== '') {
123
+ $("img[data-del='avatar'], img.pp-user-avatar").attr('src', response.avatar_url);
124
+ // remove the picture upload path text.
125
+ $('input[name=eup_avatar]', $editprofile_form).val('');
126
+ }
127
+
128
+ if ("cover_image_url" in response && response.cover_image_url !== '') {
129
+ $("img[data-del='cover-image'], img.pp-user-cover-image").attr('src', response.cover_image_url);
130
+ // remove the picture upload path text.
131
+ $('input[name=eup_cover_image]', $editprofile_form).val('');
132
+ $('.profilepress-myaccount-has-cover-image', $editprofile_form).show();
133
+ $('.profilepress-myaccount-cover-image-empty', $editprofile_form).hide();
134
+ }
135
+
136
+ if ('message' in response) {
137
+ // save the response error message class for early removal in next request.
138
+ window.edit_profile_msg_class = $(response.message).attr('class');
139
+
140
+ $editprofile_form.before(response.message);
141
+ }
142
+
143
+ if ('redirect' in response) {
144
+ $editprofile_form.trigger('pp_edit_profile_success_before_redirect');
145
+ window.location.assign(response.redirect)
146
+ }
147
+
148
+ _this._remove_processing_label($editprofile_form);
149
+ }
150
+ }, 'json');
151
+ };
152
+
153
+ this.ajax_password_reset = function (e) {
154
+ e.preventDefault();
155
+
156
+ var $passwordreset_form = $(this),
157
+ melange_id = _this.get_melange_id($passwordreset_form),
158
+ is_tab_widget = $passwordreset_form.find('input[name="is-pp-tab-widget"]').val() === 'true',
159
+ ajaxData = {
160
+ action: 'pp_ajax_passwordreset',
161
+ // if this is melange, we need it ID thus "&melange_id".
162
+ data: $(this).serialize() + '&melange_id=' + melange_id
163
+ };
164
+
165
+ _this._remove_status_notice();
166
+
167
+ $passwordreset_form.parents('.pp-tab-widget-form').prev('.pp-tab-status').remove();
168
+
169
+ _this._add_processing_label($passwordreset_form);
170
+
171
+ $.post(pp_ajax_form.ajaxurl, ajaxData, function (response) {
172
+
173
+ $passwordreset_form.trigger('pp_form_submitted');
174
+ // remove the processing label and do nothing if 0 is returned which perhaps means the user is
175
+ // already logged in.
176
+ if (typeof response !== 'object') {
177
+ return _this._remove_processing_label($passwordreset_form);
178
+ }
179
+
180
+ if ('message' in response) {
181
+ $passwordreset_form.trigger('pp_password_reset_status');
182
+ if (is_tab_widget) {
183
+ // tab widget has its own class for status notice/message which is pp-tab-status thus the replacement.
184
+ var notice = response.message.replace('profilepress-reset-status', 'pp-tab-status');
185
+ $passwordreset_form.parents('.pp-tab-widget-form').before(notice);
186
+ } else if ($passwordreset_form.parents('.lucidContainer').length > 0) {
187
+ $passwordreset_form.parents('.lucidContainer').before(response.message)
188
+ } else {
189
+ $passwordreset_form.before(response.message);
190
+ }
191
+
192
+ if ('status' in response && response.status === true) {
193
+ $passwordreset_form.hide();
194
+ }
195
+
196
+ $('input[name="user_login"]', $passwordreset_form).val('');
197
+ }
198
+
199
+ _this._remove_processing_label($passwordreset_form);
200
+
201
+ }, 'json');
202
+ };
203
+
204
+ this.ajax_registration = function (e) {
205
+
206
+ if (typeof window.FormData === 'undefined' || !window.FormData) return;
207
+
208
+ e.preventDefault();
209
+
210
+ var $signup_form = $(this),
211
+ melange_id = _this.get_melange_id($signup_form),
212
+ formData = new FormData(this),
213
+ is_tab_widget = $signup_form.find('input[name="is-pp-tab-widget"]').val() === 'true';
214
+
215
+ formData.append("action", "pp_ajax_signup");
216
+ formData.append("melange_id", melange_id);
217
+
218
+ _this._remove_status_notice();
219
+
220
+ $signup_form.parents('.pp-tab-widget-form').prev('.pp-tab-status').remove();
221
+
222
+ _this._add_processing_label($signup_form);
223
+
224
+ $.post({
225
+ url: pp_ajax_form.ajaxurl,
226
+ data: formData,
227
+ cache: false,
228
+ contentType: false,
229
+ enctype: 'multipart/form-data',
230
+ processData: false,
231
+ dataType: 'json',
232
+ success: function (response) {
233
+ $signup_form.trigger('pp_form_submitted');
234
+ // remove the processing label and do nothing if 0 is returned which perhaps means the user is
235
+ // already logged in.
236
+ if (typeof response !== 'object') {
237
+ return _this._remove_processing_label($signup_form);
238
+ }
239
+
240
+ if ('message' in response) {
241
+ // backward compat. To be removed in future
242
+ $signup_form.trigger('pp_registration_error', [response]);
243
+
244
+ $signup_form.trigger('pp_registration_ajax_response', [response]);
245
+
246
+ if (is_tab_widget) {
247
+ // tab widget has its own class for status notice/message which is pp-tab-status thus the replacement.
248
+ var notice = response.message.replace('profilepress-reg-status', 'pp-tab-status');
249
+ $signup_form.parents('.pp-tab-widget-form').before(notice);
250
+ }
251
+ // if lucid tab widget
252
+ else if ($signup_form.parents('.lucidContainer').length > 0) {
253
+ $signup_form.parents('.lucidContainer').before(response.message)
254
+ } else {
255
+ $signup_form.before(response.message);
256
+ }
257
+ } else if ('redirect' in response) {
258
+ $signup_form.trigger('pp_registration_success', [response]);
259
+ window.location.assign(response.redirect)
260
+ }
261
+ _this._remove_processing_label($signup_form);
262
+ }
263
+ });
264
+ };
265
+
266
+ this.ajax_login = function (e) {
267
+ e.preventDefault();
268
+
269
+ var $login_form = $(this),
270
+ ajaxData = {action: 'pp_ajax_login', data: $(this).serialize()},
271
+ is_tab_widget = $login_form.find('input[name="is-pp-tab-widget"]').val() === 'true';
272
+
273
+ _this._remove_status_notice();
274
+
275
+ _this._add_processing_label($login_form);
276
+
277
+ $.post(pp_ajax_form.ajaxurl, ajaxData, function (response) {
278
+ $login_form.trigger('pp_form_submitted');
279
+ // remove the processing label and do nothing if 0 is returned which perhaps means the user is
280
+ // already logged in.
281
+ // we are checking for null because response can be null hence we want the processing label removed.
282
+ if (response === null || typeof response !== 'object') {
283
+ return _this._remove_processing_label($login_form);
284
+ }
285
+
286
+ if ('success' in response && response.success === true && 'redirect' in response) {
287
+ $login_form.trigger('pp_login_form_success');
288
+ window.location.assign(response.redirect)
289
+ } else {
290
+ $login_form.trigger('pp_login_form_error');
291
+
292
+ if (is_tab_widget) {
293
+ // tab widget has its own class for status notice/message which is pp-tab-status thus the replacement.
294
+ var notice = response.message.replace('profilepress-login-status', 'pp-tab-status');
295
+ $login_form.parents('.pp-tab-widget-form').before(notice);
296
+ }
297
+ // if lucid tab widget
298
+ else if ($login_form.parents('.lucidContainer').length > 0) {
299
+ $login_form.parents('.lucidContainer').before(response.message)
300
+ } else {
301
+ $login_form.before(response.message);
302
+ }
303
+ }
304
+
305
+ _this._remove_processing_label($login_form);
306
+
307
+ }, 'json');
308
+ };
309
+
310
+ this.delete_avatar = function (e) {
311
+
312
+ e.preventDefault();
313
+
314
+ var button_text = $(this).text(),
315
+ this_obj = $(this);
316
+
317
+ e.preventDefault();
318
+ if (confirm(pp_ajax_form.confirm_delete)) {
319
+
320
+ if (this_obj.is('button')) {
321
+ this_obj.text(pp_ajax_form.deleting_text);
322
+ }
323
+
324
+ $.post(pp_ajax_form.ajaxurl, {
325
+ action: 'pp_del_avatar',
326
+ nonce: pp_ajax_form.nonce
327
+ }).done(function (data) {
328
+ if ('error' in data && data.error === 'nonce_failed') {
329
+ this_obj.text(button_text);
330
+ alert(pp_ajax_form.deleting_error);
331
+ } else if ('success' in data) {
332
+ $("img[data-del='avatar']").attr('src', data.default);
333
+ this_obj.remove();
334
+ }
335
+ });
336
+
337
+ }
338
+ };
339
+
340
+ this.delete_profile_image_cover = function (e) {
341
+
342
+ e.preventDefault();
343
+
344
+ var button_text = $(this).text(), this_obj = $(this);
345
+
346
+ e.preventDefault();
347
+
348
+ if (confirm(pp_ajax_form.confirm_delete)) {
349
+
350
+ if (this_obj.is('button')) {
351
+ this_obj.text(pp_ajax_form.deleting_text);
352
+ }
353
+
354
+ $.post(pp_ajax_form.ajaxurl, {
355
+ action: 'pp_del_cover_image',
356
+ nonce: pp_ajax_form.nonce
357
+ }).done(function (data) {
358
+ if ('error' in data && data.error === 'nonce_failed') {
359
+ this_obj.text(button_text);
360
+ alert(pp_ajax_form.deleting_error);
361
+ }
362
+
363
+ if ('success' in data) {
364
+ if (data.default !== '') {
365
+ $("img[data-del='cover-image']").attr('src', data.default);
366
+ this_obj.parent().find('.profilepress-myaccount-has-cover-image').show();
367
+ this_obj.parent().find('.profilepress-myaccount-cover-image-empty').hide();
368
+ } else {
369
+ this_obj.parent().find('.profilepress-myaccount-has-cover-image').hide();
370
+ this_obj.parent().find('.profilepress-myaccount-cover-image-empty').show();
371
+ }
372
+
373
+ this_obj.remove();
374
+ }
375
+ });
376
+
377
+ }
378
+ };
379
+
380
+ this.get_melange_id = function ($scope) {
381
+ var melange_id = $('input.pp_melange_id', $scope).val();
382
+ return melange_id === undefined ? '' : melange_id;
383
+ };
384
+
385
+ this._add_processing_label = function (obj) {
386
+ var submit_btn = obj.find('input[data-pp-submit-label]');
387
+ submit_btn.attr({
388
+ 'value': submit_btn.data('pp-processing-label'),
389
+ 'disabled': 'disabled',
390
+ }).css("opacity", ".4");
391
+ };
392
+
393
+ this._remove_processing_label = function (obj) {
394
+ var submit_btn = obj.find('input[data-pp-submit-label]');
395
+ submit_btn.attr('value', submit_btn.data('pp-submit-label'));
396
+ submit_btn.attr({
397
+ 'value': submit_btn.data('pp-submit-label'),
398
+ // set to null to remove. See https://api.jquery.com/attr/#attr-attributeName-value
399
+ 'disabled': null,
400
+ }).css("opacity", "");
401
+ };
402
+
403
+ this._remove_status_notice = function () {
404
+ $('.profilepress-login-status,.pp-tab-status,.profilepress-edit-profile-success,.profilepress-edit-profile-status,.pp-reset-success,.profilepress-reset-status,.profilepress-reg-status').remove();
405
+ };
406
+
407
+ this.defaultUserProfileResponsive = function () {
408
+
409
+ $('.ppress-default-profile, .pp-member-directory').each(function () {
410
+
411
+ var obj = $(this),
412
+ element_width = obj.width();
413
+
414
+ if (element_width <= 340) {
415
+
416
+ obj.removeClass('ppressui340');
417
+ obj.removeClass('ppressui500');
418
+ obj.removeClass('ppressui800');
419
+ obj.removeClass('ppressui960');
420
+
421
+ obj.addClass('ppressui340');
422
+
423
+ } else if (element_width <= 500) {
424
+
425
+ obj.removeClass('ppressui340');
426
+ obj.removeClass('ppressui500');
427
+ obj.removeClass('ppressui800');
428
+ obj.removeClass('ppressui960');
429
+
430
+ obj.addClass('ppressui500');
431
+
432
+ } else if (element_width <= 800) {
433
+
434
+ obj.removeClass('ppressui340');
435
+ obj.removeClass('ppressui500');
436
+ obj.removeClass('ppressui800');
437
+ obj.removeClass('ppressui960');
438
+
439
+ obj.addClass('ppressui800');
440
+
441
+ } else if (element_width <= 960) {
442
+
443
+ obj.removeClass('ppressui340');
444
+ obj.removeClass('ppressui500');
445
+ obj.removeClass('ppressui800');
446
+ obj.removeClass('ppressui960');
447
+
448
+ obj.addClass('ppressui960');
449
+
450
+ } else if (element_width > 960) {
451
+
452
+ obj.removeClass('ppressui340');
453
+ obj.removeClass('ppressui500');
454
+ obj.removeClass('ppressui800');
455
+ obj.removeClass('ppressui960');
456
+ }
457
+
458
+ obj.css('opacity', 1);
459
+ });
460
+
461
+ $('.ppress-default-profile-cover, .ppress-default-profile-cover-e').each(function () {
462
+
463
+ var elem = $(this),
464
+ calcHeight = Math.round(elem.width() / elem.data('ratio')) + 'px';
465
+
466
+ elem.height(calcHeight);
467
+ elem.find('.ppress-dpf-cover-add').height(calcHeight);
468
+ });
469
+ };
470
+ }
471
+
472
+ (new Frontend()).init();
473
+
474
+ })(jQuery, window, undefined);
assets/js/frontend.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(){"use strict";!function(e,t,a){(new function(){var s=this;this.init=function(){t.ppFormRecaptchaLoadCallback=this.recaptcha_processing,e(".pp-del-profile-avatar").click(this.delete_avatar),e(".pp-del-cover-image").click(this.delete_profile_image_cover),e(document).on("click",".has-password-visibility-icon .pp-form-material-icons",this.toggle_password_visibility),e(document.body).on("click","a.showlogin",(function(){e(".pp_wc_login").slideToggle()})),e(t).on("load resize",(function(){s.defaultUserProfileResponsive()})),"true"!==pp_ajax_form.disable_ajax_form&&(e(document).on("submit",'form[data-pp-form-submit="login"]',this.ajax_login),e(document).on("submit",'form[data-pp-form-submit="signup"]',this.ajax_registration),e(document).on("submit",'form[data-pp-form-submit="passwordreset"]',this.ajax_password_reset),e(document).on("submit",'form[data-pp-form-submit="editprofile"]',this.ajax_edit_profile))},this.recaptcha_processing=function(){e(".pp-g-recaptcha").each((function(t,a){var r=e(a).attr("data-sitekey"),i=e(this).parents(".pp-form-container").find("form");if("v3"===e(a).attr("data-type"))i.find("input.pp-submit-form").on("click",(function(t){t.preventDefault(),s._add_processing_label(i),grecaptcha.ready((function(){grecaptcha.execute(r,{action:"form"}).then((function(t){i.find('[name="g-recaptcha-response"]').remove(),i.append(e("<input>",{type:"hidden",value:t,name:"g-recaptcha-response"})),i.submit()}))}))}));else{var p=grecaptcha.render(a,{sitekey:r,theme:e(a).attr("data-theme"),size:e(a).attr("data-size")});i.on("pp_form_submitted",(function(){grecaptcha.reset(p)}))}}))},this.toggle_password_visibility=function(t){t.preventDefault();var a=e(this).parents(".pp-form-field-input-textarea-wrap").find(".pp-form-field");"password"===a.attr("type")?(a.attr("type","text"),e(this).text("visibility_off")):(a.attr("type","password"),e(this).text("visibility"))},this.ajax_edit_profile=function(a){if(void 0!==t.FormData&&t.FormData){a.preventDefault();var r=e('form[data-pp-form-submit="editprofile"]'),i=s.get_melange_id(r),p=new FormData(this);p.append("action","pp_ajax_editprofile"),p.append("nonce",pp_ajax_form.nonce),p.append("melange_id",i),e(".profilepress-edit-profile-status").remove(),e(".profilepress-edit-profile-success").remove(),""!==t.edit_profile_msg_class&&e("."+t.edit_profile_msg_class).remove(),s._add_processing_label(r),e.post({url:pp_ajax_form.ajaxurl,data:p,cache:!1,contentType:!1,enctype:"multipart/form-data",processData:!1,dataType:"json",success:function(a){r.trigger("pp_form_submitted"),r.trigger("pp_form_edit_profile_success",[r]),"avatar_url"in a&&""!==a.avatar_url&&(e("img[data-del='avatar'], img.pp-user-avatar").attr("src",a.avatar_url),e("input[name=eup_avatar]",r).val("")),"cover_image_url"in a&&""!==a.cover_image_url&&(e("img[data-del='cover-image'], img.pp-user-cover-image").attr("src",a.cover_image_url),e("input[name=eup_cover_image]",r).val(""),e(".profilepress-myaccount-has-cover-image",r).show(),e(".profilepress-myaccount-cover-image-empty",r).hide()),"message"in a&&(t.edit_profile_msg_class=e(a.message).attr("class"),r.before(a.message)),"redirect"in a&&(r.trigger("pp_edit_profile_success_before_redirect"),t.location.assign(a.redirect)),s._remove_processing_label(r)}},"json")}},this.ajax_password_reset=function(t){t.preventDefault();var a=e(this),r=s.get_melange_id(a),i="true"===a.find('input[name="is-pp-tab-widget"]').val(),p={action:"pp_ajax_passwordreset",data:e(this).serialize()+"&melange_id="+r};s._remove_status_notice(),a.parents(".pp-tab-widget-form").prev(".pp-tab-status").remove(),s._add_processing_label(a),e.post(pp_ajax_form.ajaxurl,p,(function(t){if(a.trigger("pp_form_submitted"),"object"!=typeof t)return s._remove_processing_label(a);if("message"in t){if(a.trigger("pp_password_reset_status"),i){var r=t.message.replace("profilepress-reset-status","pp-tab-status");a.parents(".pp-tab-widget-form").before(r)}else a.parents(".lucidContainer").length>0?a.parents(".lucidContainer").before(t.message):a.before(t.message);"status"in t&&!0===t.status&&a.hide(),e('input[name="user_login"]',a).val("")}s._remove_processing_label(a)}),"json")},this.ajax_registration=function(a){if(void 0!==t.FormData&&t.FormData){a.preventDefault();var r=e(this),i=s.get_melange_id(r),p=new FormData(this),o="true"===r.find('input[name="is-pp-tab-widget"]').val();p.append("action","pp_ajax_signup"),p.append("melange_id",i),s._remove_status_notice(),r.parents(".pp-tab-widget-form").prev(".pp-tab-status").remove(),s._add_processing_label(r),e.post({url:pp_ajax_form.ajaxurl,data:p,cache:!1,contentType:!1,enctype:"multipart/form-data",processData:!1,dataType:"json",success:function(e){if(r.trigger("pp_form_submitted"),"object"!=typeof e)return s._remove_processing_label(r);if("message"in e)if(r.trigger("pp_registration_error",[e]),r.trigger("pp_registration_ajax_response",[e]),o){var a=e.message.replace("profilepress-reg-status","pp-tab-status");r.parents(".pp-tab-widget-form").before(a)}else r.parents(".lucidContainer").length>0?r.parents(".lucidContainer").before(e.message):r.before(e.message);else"redirect"in e&&(r.trigger("pp_registration_success",[e]),t.location.assign(e.redirect));s._remove_processing_label(r)}})}},this.ajax_login=function(a){a.preventDefault();var r=e(this),i={action:"pp_ajax_login",data:e(this).serialize()},p="true"===r.find('input[name="is-pp-tab-widget"]').val();s._remove_status_notice(),s._add_processing_label(r),e.post(pp_ajax_form.ajaxurl,i,(function(e){if(r.trigger("pp_form_submitted"),null===e||"object"!=typeof e)return s._remove_processing_label(r);if("success"in e&&!0===e.success&&"redirect"in e)r.trigger("pp_login_form_success"),t.location.assign(e.redirect);else if(r.trigger("pp_login_form_error"),p){var a=e.message.replace("profilepress-login-status","pp-tab-status");r.parents(".pp-tab-widget-form").before(a)}else r.parents(".lucidContainer").length>0?r.parents(".lucidContainer").before(e.message):r.before(e.message);s._remove_processing_label(r)}),"json")},this.delete_avatar=function(t){t.preventDefault();var a=e(this).text(),s=e(this);t.preventDefault(),confirm(pp_ajax_form.confirm_delete)&&(s.is("button")&&s.text(pp_ajax_form.deleting_text),e.post(pp_ajax_form.ajaxurl,{action:"pp_del_avatar",nonce:pp_ajax_form.nonce}).done((function(t){"error"in t&&"nonce_failed"===t.error?(s.text(a),alert(pp_ajax_form.deleting_error)):"success"in t&&(e("img[data-del='avatar']").attr("src",t.default),s.remove())})))},this.delete_profile_image_cover=function(t){t.preventDefault();var a=e(this).text(),s=e(this);t.preventDefault(),confirm(pp_ajax_form.confirm_delete)&&(s.is("button")&&s.text(pp_ajax_form.deleting_text),e.post(pp_ajax_form.ajaxurl,{action:"pp_del_cover_image",nonce:pp_ajax_form.nonce}).done((function(t){"error"in t&&"nonce_failed"===t.error&&(s.text(a),alert(pp_ajax_form.deleting_error)),"success"in t&&(""!==t.default?(e("img[data-del='cover-image']").attr("src",t.default),s.parent().find(".profilepress-myaccount-has-cover-image").show(),s.parent().find(".profilepress-myaccount-cover-image-empty").hide()):(s.parent().find(".profilepress-myaccount-has-cover-image").hide(),s.parent().find(".profilepress-myaccount-cover-image-empty").show()),s.remove())})))},this.get_melange_id=function(t){var s=e("input.pp_melange_id",t).val();return s===a?"":s},this._add_processing_label=function(e){var t=e.find("input[data-pp-submit-label]");t.attr({value:t.data("pp-processing-label"),disabled:"disabled"}).css("opacity",".4")},this._remove_processing_label=function(e){var t=e.find("input[data-pp-submit-label]");t.attr("value",t.data("pp-submit-label")),t.attr({value:t.data("pp-submit-label"),disabled:null}).css("opacity","")},this._remove_status_notice=function(){e(".profilepress-login-status,.pp-tab-status,.profilepress-edit-profile-success,.profilepress-edit-profile-status,.pp-reset-success,.profilepress-reset-status,.profilepress-reg-status").remove()},this.defaultUserProfileResponsive=function(){e(".ppress-default-profile, .pp-member-directory").each((function(){var t=e(this),a=t.width();a<=340?(t.removeClass("ppressui340"),t.removeClass("ppressui500"),t.removeClass("ppressui800"),t.removeClass("ppressui960"),t.addClass("ppressui340")):a<=500?(t.removeClass("ppressui340"),t.removeClass("ppressui500"),t.removeClass("ppressui800"),t.removeClass("ppressui960"),t.addClass("ppressui500")):a<=800?(t.removeClass("ppressui340"),t.removeClass("ppressui500"),t.removeClass("ppressui800"),t.removeClass("ppressui960"),t.addClass("ppressui800")):a<=960?(t.removeClass("ppressui340"),t.removeClass("ppressui500"),t.removeClass("ppressui800"),t.removeClass("ppressui960"),t.addClass("ppressui960")):a>960&&(t.removeClass("ppressui340"),t.removeClass("ppressui500"),t.removeClass("ppressui800"),t.removeClass("ppressui960")),t.css("opacity",1)})),e(".ppress-default-profile-cover, .ppress-default-profile-cover-e").each((function(){var t=e(this),a=Math.round(t.width()/t.data("ratio"))+"px";t.height(a),t.find(".ppress-dpf-cover-add").height(a)}))}}).init()}(jQuery,window,void 0)}();
assets/js/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Do not modify the files in this folder.
5
+ */
assets/js/jcarousel.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jCarousel - v0.3.9 - 2018-07-30
2
+ * http://sorgalla.com/jcarousel/
3
+ * Copyright (c) 2006-2018 Jan Sorgalla; Licensed MIT */
4
+
5
+ !function(t){"use strict";var i=t.jCarousel={};i.version="0.3.9";var s=/^([+\-]=)?(.+)$/;i.parseTarget=function(t){var i=!1,e="object"!=typeof t?s.exec(t):null;return e?(t=parseInt(e[2],10)||0,e[1]&&(i=!0,"-="===e[1]&&(t*=-1))):"object"!=typeof t&&(t=parseInt(t,10)||0),{target:t,relative:i}},i.detectCarousel=function(t){for(var i;t.length>0;){if((i=t.filter("[data-jcarousel]")).length>0)return i;if((i=t.find("[data-jcarousel]")).length>0)return i;t=t.parent()}return null},i.base=function(s){return{version:i.version,_options:{},_element:null,_carousel:null,_init:t.noop,_create:t.noop,_destroy:t.noop,_reload:t.noop,create:function(){return this._element.attr("data-"+s.toLowerCase(),!0).data(s,this),!1===this._trigger("create")?this:(this._create(),this._trigger("createend"),this)},destroy:function(){return!1===this._trigger("destroy")?this:(this._destroy(),this._trigger("destroyend"),this._element.removeData(s).removeAttr("data-"+s.toLowerCase()),this)},reload:function(t){return!1===this._trigger("reload")?this:(t&&this.options(t),this._reload(),this._trigger("reloadend"),this)},element:function(){return this._element},options:function(i,s){if(0===arguments.length)return t.extend({},this._options);if("string"==typeof i){if(void 0===s)return void 0===this._options[i]?null:this._options[i];this._options[i]=s}else this._options=t.extend({},this._options,i);return this},carousel:function(){return this._carousel||(this._carousel=i.detectCarousel(this.options("carousel")||this._element),this._carousel||t.error('Could not detect carousel for plugin "'+s+'"')),this._carousel},_trigger:function(i,e,r){var n,o=!1;return r=[this].concat(r||[]),(e||this._element).each(function(){n=t.Event((s+":"+i).toLowerCase()),t(this).trigger(n,r),n.isDefaultPrevented()&&(o=!0)}),!o}}},i.plugin=function(s,e){var r=t[s]=function(i,s){this._element=t(i),this.options(s),this._init(),this.create()};return r.fn=r.prototype=t.extend({},i.base(s),e),t.fn[s]=function(i){var e=Array.prototype.slice.call(arguments,1),n=this;return"string"==typeof i?this.each(function(){var r=t(this).data(s);if(!r)return t.error("Cannot call methods on "+s+' prior to initialization; attempted to call method "'+i+'"');if(!t.isFunction(r[i])||"_"===i.charAt(0))return t.error('No such method "'+i+'" for '+s+" instance");var o=r[i].apply(r,e);return o!==r&&void 0!==o?(n=o,!1):void 0}):this.each(function(){var e=t(this).data(s);e instanceof r?e.reload(i):new r(this,i)}),n},r}}(jQuery),function(t,i){"use strict";var s=t(i),e=function(t){return parseFloat(t)||0};t.jCarousel.plugin("jcarousel",{animating:!1,tail:0,inTail:!1,resizeState:null,resizeTimer:null,lt:null,vertical:!1,rtl:!1,circular:!1,underflow:!1,relative:!1,_options:{list:function(){return this.element().children().eq(0)},items:function(){return this.list().children()},animation:400,transitions:!1,wrap:null,vertical:null,rtl:null,center:!1},_list:null,_items:null,_target:t(),_first:t(),_last:t(),_visible:t(),_fullyvisible:t(),_init:function(){var t=this;return t.resizeState=s.width()+"x"+s.height(),this.onWindowResize=function(){t.resizeTimer&&clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){var i=s.width()+"x"+s.height();i!==t.resizeState&&(t.resizeState=i,t.reload())},100)},this},_create:function(){this._reload(),s.on("resize.jcarousel",this.onWindowResize)},_destroy:function(){s.off("resize.jcarousel",this.onWindowResize)},_reload:function(){this.vertical=this.options("vertical"),null==this.vertical&&(this.vertical=e(this.list().height())>e(this.list().width())),this.rtl=this.options("rtl"),null==this.rtl&&(this.rtl=function(i){if("rtl"===(""+i.attr("dir")).toLowerCase())return!0;var s=!1;return i.parents("[dir]").each(function(){if(/rtl/i.test(t(this).attr("dir")))return s=!0,!1}),s}(this._element)),this.lt=this.vertical?"top":"left",this.relative="relative"===this.list().css("position"),this._list=null,this._items=null;var i=this.index(this._target)>=0?this._target:this.closest();this.circular="circular"===this.options("wrap"),this.underflow=!1;var s={left:0,top:0};return i.length>0&&(this._prepare(i),this.list().find("[data-jcarousel-clone]").remove(),this._items=null,this.underflow=this._fullyvisible.length>=this.items().length,this.circular=this.circular&&!this.underflow,s[this.lt]=this._position(i)+"px"),this.move(s),this},list:function(){if(null===this._list){var i=this.options("list");this._list=t.isFunction(i)?i.call(this):this._element.find(i)}return this._list},items:function(){if(null===this._items){var i=this.options("items");this._items=(t.isFunction(i)?i.call(this):this.list().find(i)).not("[data-jcarousel-clone]")}return this._items},index:function(t){return this.items().index(t)},closest:function(){var i,s=this,r=this.list().position()[this.lt],n=t(),o=!1,l=this.vertical?"bottom":this.rtl&&!this.relative?"left":"right";return this.rtl&&this.relative&&!this.vertical&&(r+=e(this.list().width())-this.clipping()),this.items().each(function(){if(n=t(this),o)return!1;var a=s.dimension(n);if((r+=a)>=0){if(i=a-e(n.css("margin-"+l)),!(Math.abs(r)-a+i/2<=0))return!1;o=!0}}),n},target:function(){return this._target},first:function(){return this._first},last:function(){return this._last},visible:function(){return this._visible},fullyvisible:function(){return this._fullyvisible},hasNext:function(){if(!1===this._trigger("hasnext"))return!0;var t=this.options("wrap"),i=this.items().length-1,s=this.options("center")?this._target:this._last;return!!(i>=0&&!this.underflow&&(t&&"first"!==t||this.index(s)<i||this.tail&&!this.inTail))},hasPrev:function(){if(!1===this._trigger("hasprev"))return!0;var t=this.options("wrap");return!!(this.items().length>0&&!this.underflow&&(t&&"last"!==t||this.index(this._first)>0||this.tail&&this.inTail))},clipping:function(){return e(this._element["inner"+(this.vertical?"Height":"Width")]())},dimension:function(t){return e(t["outer"+(this.vertical?"Height":"Width")](!0))},scroll:function(i,s,e){if(this.animating)return this;if(!1===this._trigger("scroll",null,[i,s]))return this;t.isFunction(s)&&(e=s,s=!0);var r=t.jCarousel.parseTarget(i);if(r.relative){var n,o,l,a,h,u,c,f,d=this.items().length-1,_=Math.abs(r.target),p=this.options("wrap");if(r.target>0){var g=this.index(this._last);if(g>=d&&this.tail)this.inTail?"both"===p||"last"===p?this._scroll(0,s,e):t.isFunction(e)&&e.call(this,!1):this._scrollTail(s,e);else if(n=this.index(this._target),this.underflow&&n===d&&("circular"===p||"both"===p||"last"===p)||!this.underflow&&g===d&&("both"===p||"last"===p))this._scroll(0,s,e);else if(l=n+_,this.circular&&l>d){for(f=d,h=this.items().get(-1);f++<l;)h=this.items().eq(0),(u=this._visible.index(h)>=0)&&h.after(h.clone(!0).attr("data-jcarousel-clone",!0)),this.list().append(h),u||((c={})[this.lt]=this.dimension(h),this.moveBy(c)),this._items=null;this._scroll(h,s,e)}else this._scroll(Math.min(l,d),s,e)}else if(this.inTail)this._scroll(Math.max(this.index(this._first)-_+1,0),s,e);else if(o=this.index(this._first),n=this.index(this._target),l=(a=this.underflow?n:o)-_,a<=0&&(this.underflow&&"circular"===p||"both"===p||"first"===p))this._scroll(d,s,e);else if(this.circular&&l<0){for(f=l,h=this.items().get(0);f++<0;){h=this.items().eq(-1),(u=this._visible.index(h)>=0)&&h.after(h.clone(!0).attr("data-jcarousel-clone",!0)),this.list().prepend(h),this._items=null;var m=this.dimension(h);(c={})[this.lt]=-m,this.moveBy(c)}this._scroll(h,s,e)}else this._scroll(Math.max(l,0),s,e)}else this._scroll(r.target,s,e);return this._trigger("scrollend"),this},moveBy:function(t,i){var s=this.list().position(),r=1,n=0;return this.rtl&&!this.vertical&&(r=-1,this.relative&&(n=e(this.list().width())-this.clipping())),t.left&&(t.left=e(s.left)+n+e(t.left)*r+"px"),t.top&&(t.top=e(s.top)+n+e(t.top)*r+"px"),this.move(t,i)},move:function(i,s){s=s||{};var e=this.options("transitions"),r=!!e,n=!!e.transforms,o=!!e.transforms3d,l=s.duration||0,a=this.list();if(!r&&l>0)a.animate(i,s);else{var h=s.complete||t.noop,u={};if(r){var c={transitionDuration:a.css("transitionDuration"),transitionTimingFunction:a.css("transitionTimingFunction"),transitionProperty:a.css("transitionProperty")},f=h;h=function(){t(this).css(c),f.call(this)},u={transitionDuration:(l>0?l/1e3:0)+"s",transitionTimingFunction:e.easing||s.easing,transitionProperty:l>0?n||o?"all":i.left?"left":"top":"none",transform:"none"}}o?u.transform="translate3d("+(i.left||0)+","+(i.top||0)+",0)":n?u.transform="translate("+(i.left||0)+","+(i.top||0)+")":t.extend(u,i),r&&l>0&&a.one("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd",h),a.css(u),l<=0&&a.each(function(){h.call(this)})}},_scroll:function(i,s,r){if(this.animating)return t.isFunction(r)&&r.call(this,!1),this;if("object"!=typeof i?i=this.items().eq(i):void 0===i.jquery&&(i=t(i)),0===i.length)return t.isFunction(r)&&r.call(this,!1),this;this.inTail=!1,this._prepare(i);var n=this._position(i);if(n===e(this.list().position()[this.lt]))return t.isFunction(r)&&r.call(this,!1),this;var o={};return o[this.lt]=n+"px",this._animate(o,s,r),this},_scrollTail:function(i,s){if(this.animating||!this.tail)return t.isFunction(s)&&s.call(this,!1),this;var r=this.list().position()[this.lt];this.rtl&&this.relative&&!this.vertical&&(r+=e(this.list().width())-this.clipping()),this.rtl&&!this.vertical?r+=this.tail:r-=this.tail,this.inTail=!0;var n={};return n[this.lt]=r+"px",this._update({target:this._target.next(),fullyvisible:this._fullyvisible.slice(1).add(this._visible.last())}),this._animate(n,i,s),this},_animate:function(i,s,e){if(e=e||t.noop,!1===this._trigger("animate"))return e.call(this,!1),this;this.animating=!0;var r=this.options("animation"),n=t.proxy(function(){this.animating=!1;var t=this.list().find("[data-jcarousel-clone]");t.length>0&&(t.remove(),this._reload()),this._trigger("animateend"),e.call(this,!0)},this),o="object"==typeof r?t.extend({},r):{duration:r},l=o.complete||t.noop;return!1===s?o.duration=0:void 0!==t.fx.speeds[o.duration]&&(o.duration=t.fx.speeds[o.duration]),o.complete=function(){n(),l.call(this)},this.move(i,o),this},_prepare:function(i){var s,r,n,o=this.index(i),l=o,a=this.dimension(i),h=this.clipping(),u=this.vertical?"bottom":this.rtl?"left":"right",c=this.options("center"),f={target:i,first:i,last:i,visible:i,fullyvisible:a<=h?i:t()};if(c&&(a/=2,h/=2),a<h)for(;;){if(0===(s=this.items().eq(++l)).length){if(!this.circular)break;if(s=this.items().eq(0),i.get(0)===s.get(0))break;if((r=this._visible.index(s)>=0)&&s.after(s.clone(!0).attr("data-jcarousel-clone",!0)),this.list().append(s),!r){var d={};d[this.lt]=this.dimension(s),this.moveBy(d)}this._items=null}if(0===(n=this.dimension(s)))break;if(a+=n,f.last=s,f.visible=f.visible.add(s),a-e(s.css("margin-"+u))<=h&&(f.fullyvisible=f.fullyvisible.add(s)),a>=h)break}if(!this.circular&&!c&&a<h)for(l=o;!(--l<0||0===(s=this.items().eq(l)).length||0===(n=this.dimension(s))||(a+=n,f.first=s,f.visible=f.visible.add(s),a-e(s.css("margin-"+u))<=h&&(f.fullyvisible=f.fullyvisible.add(s)),a>=h)););return this._update(f),this.tail=0,c||"circular"===this.options("wrap")||"custom"===this.options("wrap")||this.index(f.last)!==this.items().length-1||(a-=e(f.last.css("margin-"+u)))>h&&(this.tail=a-h),this},_position:function(t){var i=this._first,s=e(i.position()[this.lt]),r=this.options("center"),n=r?this.clipping()/2-this.dimension(i)/2:0;return this.rtl&&!this.vertical?(this.relative?s-=e(this.list().width())-this.dimension(i):s-=this.clipping()-this.dimension(i),s+=n):s-=n,!r&&(this.index(t)>this.index(i)||this.inTail)&&this.tail?(s=this.rtl&&!this.vertical?s-this.tail:s+this.tail,this.inTail=!0):this.inTail=!1,-s},_update:function(i){var s,e=this,r={target:this._target,first:this._first,last:this._last,visible:this._visible,fullyvisible:this._fullyvisible},n=this.index(i.first||r.first)<this.index(r.first),o=function(s){var o=[],l=[];i[s].each(function(){r[s].index(this)<0&&o.push(this)}),r[s].each(function(){i[s].index(this)<0&&l.push(this)}),n?o=o.reverse():l=l.reverse(),e._trigger(s+"in",t(o)),e._trigger(s+"out",t(l)),e["_"+s]=i[s]};for(s in i)o(s);return this}})}(jQuery,window),function(t){"use strict";t.jcarousel.fn.scrollIntoView=function(i,s,e){var r,n=t.jCarousel.parseTarget(i),o=this.index(this._fullyvisible.first()),l=this.index(this._fullyvisible.last());if((r=n.relative?n.target<0?Math.max(0,o+n.target):l+n.target:"object"!=typeof n.target?n.target:this.index(n.target))<o)return this.scroll(r,s,e);if(r>=o&&r<=l)return t.isFunction(e)&&e.call(this,!1),this;for(var a,h=this.items(),u=this.clipping(),c=this.vertical?"bottom":this.rtl?"left":"right",f=0;0!==(a=h.eq(r)).length;){if((f+=this.dimension(a))>=u){f-(parseFloat(a.css("margin-"+c))||0)!==u&&r++;break}if(r<=0)break;r--}return this.scroll(r,s,e)}}(jQuery),function(t){"use strict";t.jCarousel.plugin("jcarouselControl",{_options:{target:"+=1",event:"click",method:"scroll"},_active:null,_init:function(){this.onDestroy=t.proxy(function(){this._destroy(),this.carousel().one("jcarousel:createend",t.proxy(this._create,this))},this),this.onReload=t.proxy(this._reload,this),this.onEvent=t.proxy(function(i){i.preventDefault();var s=this.options("method");t.isFunction(s)?s.call(this):this.carousel().jcarousel(this.options("method"),this.options("target"))},this)},_create:function(){this.carousel().one("jcarousel:destroy",this.onDestroy).on("jcarousel:reloadend jcarousel:scrollend",this.onReload),this._element.on(this.options("event")+".jcarouselcontrol",this.onEvent),this._reload()},_destroy:function(){this._element.off(".jcarouselcontrol",this.onEvent),this.carousel().off("jcarousel:destroy",this.onDestroy).off("jcarousel:reloadend jcarousel:scrollend",this.onReload)},_reload:function(){var i,s=t.jCarousel.parseTarget(this.options("target")),e=this.carousel();if(s.relative)i=e.jcarousel(s.target>0?"hasNext":"hasPrev");else{var r="object"!=typeof s.target?e.jcarousel("items").eq(s.target):s.target;i=e.jcarousel("target").index(r)>=0}return this._active!==i&&(this._trigger(i?"active":"inactive"),this._active=i),this}})}(jQuery),function(t){"use strict";t.jCarousel.plugin("jcarouselPagination",{_options:{perPage:null,item:function(t){return'<a href="#'+t+'">'+t+"</a>"},event:"click",method:"scroll"},_carouselItems:null,_pages:{},_items:{},_currentPage:null,_init:function(){this.onDestroy=t.proxy(function(){this._destroy(),this.carousel().one("jcarousel:createend",t.proxy(this._create,this))},this),this.onReload=t.proxy(this._reload,this),this.onScroll=t.proxy(this._update,this)},_create:function(){this.carousel().one("jcarousel:destroy",this.onDestroy).on("jcarousel:reloadend",this.onReload).on("jcarousel:scrollend",this.onScroll),this._reload()},_destroy:function(){this._clear(),this.carousel().off("jcarousel:destroy",this.onDestroy).off("jcarousel:reloadend",this.onReload).off("jcarousel:scrollend",this.onScroll),this._carouselItems=null},_reload:function(){var i=this.options("perPage");if(this._pages={},this._items={},t.isFunction(i)&&(i=i.call(this)),null==i)this._pages=this._calculatePages();else for(var s,e=parseInt(i,10)||0,r=this._getCarouselItems(),n=1,o=0;0!==(s=r.eq(o++)).length;)this._pages[n]?this._pages[n]=this._pages[n].add(s):this._pages[n]=s,o%e==0&&n++;this._clear();var l=this,a=this.carousel().data("jcarousel"),h=this._element,u=this.options("item"),c=this._getCarouselItems().length;t.each(this._pages,function(i,s){var e=l._items[i]=t(u.call(l,i,s));e.on(l.options("event")+".jcarouselpagination",t.proxy(function(){var t=s.eq(0);if(a.circular){var e=a.index(a.target()),r=a.index(t);parseFloat(i)>parseFloat(l._currentPage)?r<e&&(t="+="+(c-e+r)):r>e&&(t="-="+(e+(c-r)))}a[this.options("method")](t)},l)),h.append(e)}),this._update()},_update:function(){var i,s=this.carousel().jcarousel("target");t.each(this._pages,function(t,e){if(e.each(function(){if(s.is(this))return i=t,!1}),i)return!1}),this._currentPage!==i&&(this._trigger("inactive",this._items[this._currentPage]),this._trigger("active",this._items[i])),this._currentPage=i},items:function(){return this._items},reloadCarouselItems:function(){return this._carouselItems=null,this},_clear:function(){this._element.empty(),this._currentPage=null},_calculatePages:function(){for(var t,i,s=this.carousel().data("jcarousel"),e=this._getCarouselItems(),r=s.clipping(),n=0,o=0,l=1,a={};0!==(t=e.eq(o++)).length;)n+(i=s.dimension(t))>r&&(l++,n=0),n+=i,a[l]?a[l]=a[l].add(t):a[l]=t;return a},_getCarouselItems:function(){return this._carouselItems||(this._carouselItems=this.carousel().jcarousel("items")),this._carouselItems}})}(jQuery),function(t,i){"use strict";var s,e;t.each({hidden:"visibilitychange",mozHidden:"mozvisibilitychange",msHidden:"msvisibilitychange",webkitHidden:"webkitvisibilitychange"},function(t,r){if(void 0!==i[t])return s=t,e=r,!1}),t.jCarousel.plugin("jcarouselAutoscroll",{_options:{target:"+=1",interval:3e3,autostart:!0,method:"scroll"},_timer:null,_started:!1,_init:function(){this.onDestroy=t.proxy(function(){this._destroy(),this.carousel().one("jcarousel:createend",t.proxy(this._create,this))},this),this.onAnimateEnd=t.proxy(this._start,this),this.onVisibilityChange=t.proxy(function(){i[s]?this._stop():this._start()},this)},_create:function(){this.carousel().one("jcarousel:destroy",this.onDestroy),t(i).on(e,this.onVisibilityChange),this.options("autostart")&&this.start()},_destroy:function(){this._stop(),this.carousel().off("jcarousel:destroy",this.onDestroy),t(i).off(e,this.onVisibilityChange)},_start:function(){if(this._stop(),this._started)return this.carousel().one("jcarousel:animateend",this.onAnimateEnd),this._timer=setTimeout(t.proxy(function(){this.carousel().jcarousel(this.options("method"),this.options("target"))},this),this.options("interval")),this},_stop:function(){return this._timer&&(this._timer=clearTimeout(this._timer)),this.carousel().off("jcarousel:animateend",this.onAnimateEnd),this},start:function(){return this._started=!0,this._start(),this},stop:function(){return this._started=!1,this._stop(),this}})}(jQuery,document);
assets/js/jquery.blockUI.js ADDED
@@ -0,0 +1,620 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery blockUI plugin
3
+ * Version 2.70.0-2014.11.23
4
+ * Requires jQuery v1.7 or later
5
+ *
6
+ * Examples at: http://malsup.com/jquery/block/
7
+ * Copyright (c) 2007-2013 M. Alsup
8
+ * Dual licensed under the MIT and GPL licenses:
9
+ * http://www.opensource.org/licenses/mit-license.php
10
+ * http://www.gnu.org/licenses/gpl.html
11
+ *
12
+ * Thanks to Amir-Hossein Sobhi for some excellent contributions!
13
+ */
14
+
15
+ ;(function() {
16
+ /*jshint eqeqeq:false curly:false latedef:false */
17
+ "use strict";
18
+
19
+ function setup($) {
20
+ $.fn._fadeIn = $.fn.fadeIn;
21
+
22
+ var noOp = $.noop || function() {};
23
+
24
+ // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
25
+ // confusing userAgent strings on Vista)
26
+ var msie = /MSIE/.test(navigator.userAgent);
27
+ var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
28
+ var mode = document.documentMode || 0;
29
+ var setExpr = $.isFunction( document.createElement('div').style.setExpression );
30
+
31
+ // global $ methods for blocking/unblocking the entire page
32
+ $.blockUI = function(opts) { install(window, opts); };
33
+ $.unblockUI = function(opts) { remove(window, opts); };
34
+
35
+ // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
36
+ $.growlUI = function(title, message, timeout, onClose) {
37
+ var $m = $('<div class="growlUI"></div>');
38
+ if (title) $m.append('<h1>'+title+'</h1>');
39
+ if (message) $m.append('<h2>'+message+'</h2>');
40
+ if (timeout === undefined) timeout = 3000;
41
+
42
+ // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
43
+ var callBlock = function(opts) {
44
+ opts = opts || {};
45
+
46
+ $.blockUI({
47
+ message: $m,
48
+ fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,
49
+ fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
50
+ timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
51
+ centerY: false,
52
+ showOverlay: false,
53
+ onUnblock: onClose,
54
+ css: $.blockUI.defaults.growlCSS
55
+ });
56
+ };
57
+
58
+ callBlock();
59
+ var nonmousedOpacity = $m.css('opacity');
60
+ $m.mouseover(function() {
61
+ callBlock({
62
+ fadeIn: 0,
63
+ timeout: 30000
64
+ });
65
+
66
+ var displayBlock = $('.blockMsg');
67
+ displayBlock.stop(); // cancel fadeout if it has started
68
+ displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
69
+ }).mouseout(function() {
70
+ $('.blockMsg').fadeOut(1000);
71
+ });
72
+ // End konapun additions
73
+ };
74
+
75
+ // plugin method for blocking element content
76
+ $.fn.block = function(opts) {
77
+ if ( this[0] === window ) {
78
+ $.blockUI( opts );
79
+ return this;
80
+ }
81
+ var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
82
+ this.each(function() {
83
+ var $el = $(this);
84
+ if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
85
+ return;
86
+ $el.unblock({ fadeOut: 0 });
87
+ });
88
+
89
+ return this.each(function() {
90
+ if ($.css(this,'position') == 'static') {
91
+ this.style.position = 'relative';
92
+ $(this).data('blockUI.static', true);
93
+ }
94
+ this.style.zoom = 1; // force 'hasLayout' in ie
95
+ install(this, opts);
96
+ });
97
+ };
98
+
99
+ // plugin method for unblocking element content
100
+ $.fn.unblock = function(opts) {
101
+ if ( this[0] === window ) {
102
+ $.unblockUI( opts );
103
+ return this;
104
+ }
105
+ return this.each(function() {
106
+ remove(this, opts);
107
+ });
108
+ };
109
+
110
+ $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost!
111
+
112
+ // override these in your code to change the default behavior and style
113
+ $.blockUI.defaults = {
114
+ // message displayed when blocking (use null for no message)
115
+ message: '<h1>Please wait...</h1>',
116
+
117
+ title: null, // title string; only used when theme == true
118
+ draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
119
+
120
+ theme: false, // set to true to use with jQuery UI themes
121
+
122
+ // styles for the message when blocking; if you wish to disable
123
+ // these and use an external stylesheet then do this in your code:
124
+ // $.blockUI.defaults.css = {};
125
+ css: {
126
+ padding: 0,
127
+ margin: 0,
128
+ width: '30%',
129
+ top: '40%',
130
+ left: '35%',
131
+ textAlign: 'center',
132
+ color: '#000',
133
+ border: '3px solid #aaa',
134
+ backgroundColor:'#fff',
135
+ cursor: 'wait'
136
+ },
137
+
138
+ // minimal style set used when themes are used
139
+ themedCSS: {
140
+ width: '30%',
141
+ top: '40%',
142
+ left: '35%'
143
+ },
144
+
145
+ // styles for the overlay
146
+ overlayCSS: {
147
+ backgroundColor: '#000',
148
+ opacity: 0.6,
149
+ cursor: 'wait'
150
+ },
151
+
152
+ // style to replace wait cursor before unblocking to correct issue
153
+ // of lingering wait cursor
154
+ cursorReset: 'default',
155
+
156
+ // styles applied when using $.growlUI
157
+ growlCSS: {
158
+ width: '350px',
159
+ top: '10px',
160
+ left: '',
161
+ right: '10px',
162
+ border: 'none',
163
+ padding: '5px',
164
+ opacity: 0.6,
165
+ cursor: 'default',
166
+ color: '#fff',
167
+ backgroundColor: '#000',
168
+ '-webkit-border-radius':'10px',
169
+ '-moz-border-radius': '10px',
170
+ 'border-radius': '10px'
171
+ },
172
+
173
+ // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
174
+ // (hat tip to Jorge H. N. de Vasconcelos)
175
+ /*jshint scripturl:true */
176
+ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
177
+
178
+ // force usage of iframe in non-IE browsers (handy for blocking applets)
179
+ forceIframe: false,
180
+
181
+ // z-index for the blocking overlay
182
+ baseZ: 1000,
183
+
184
+ // set these to true to have the message automatically centered
185
+ centerX: true, // <-- only effects element blocking (page block controlled via css above)
186
+ centerY: true,
187
+
188
+ // allow body element to be stetched in ie6; this makes blocking look better
189
+ // on "short" pages. disable if you wish to prevent changes to the body height
190
+ allowBodyStretch: true,
191
+
192
+ // enable if you want key and mouse events to be disabled for content that is blocked
193
+ bindEvents: true,
194
+
195
+ // be default blockUI will supress tab navigation from leaving blocking content
196
+ // (if bindEvents is true)
197
+ constrainTabKey: true,
198
+
199
+ // fadeIn time in millis; set to 0 to disable fadeIn on block
200
+ fadeIn: 200,
201
+
202
+ // fadeOut time in millis; set to 0 to disable fadeOut on unblock
203
+ fadeOut: 400,
204
+
205
+ // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
206
+ timeout: 0,
207
+
208
+ // disable if you don't want to show the overlay
209
+ showOverlay: true,
210
+
211
+ // if true, focus will be placed in the first available input field when
212
+ // page blocking
213
+ focusInput: true,
214
+
215
+ // elements that can receive focus
216
+ focusableElements: ':input:enabled:visible',
217
+
218
+ // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
219
+ // no longer needed in 2012
220
+ // applyPlatformOpacityRules: true,
221
+
222
+ // callback method invoked when fadeIn has completed and blocking message is visible
223
+ onBlock: null,
224
+
225
+ // callback method invoked when unblocking has completed; the callback is
226
+ // passed the element that has been unblocked (which is the window object for page
227
+ // blocks) and the options that were passed to the unblock call:
228
+ // onUnblock(element, options)
229
+ onUnblock: null,
230
+
231
+ // callback method invoked when the overlay area is clicked.
232
+ // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
233
+ onOverlayClick: null,
234
+
235
+ // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
236
+ quirksmodeOffsetHack: 4,
237
+
238
+ // class name of the message block
239
+ blockMsgClass: 'blockMsg',
240
+
241
+ // if it is already blocked, then ignore it (don't unblock and reblock)
242
+ ignoreIfBlocked: false
243
+ };
244
+
245
+ // private data and functions follow...
246
+
247
+ var pageBlock = null;
248
+ var pageBlockEls = [];
249
+
250
+ function install(el, opts) {
251
+ var css, themedCSS;
252
+ var full = (el == window);
253
+ var msg = (opts && opts.message !== undefined ? opts.message : undefined);
254
+ opts = $.extend({}, $.blockUI.defaults, opts || {});
255
+
256
+ if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
257
+ return;
258
+
259
+ opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
260
+ css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
261
+ if (opts.onOverlayClick)
262
+ opts.overlayCSS.cursor = 'pointer';
263
+
264
+ themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
265
+ msg = msg === undefined ? opts.message : msg;
266
+
267
+ // remove the current block (if there is one)
268
+ if (full && pageBlock)
269
+ remove(window, {fadeOut:0});
270
+
271
+ // if an existing element is being used as the blocking content then we capture
272
+ // its current place in the DOM (and current display style) so we can restore
273
+ // it when we unblock
274
+ if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
275
+ var node = msg.jquery ? msg[0] : msg;
276
+ var data = {};
277
+ $(el).data('blockUI.history', data);
278
+ data.el = node;
279
+ data.parent = node.parentNode;
280
+ data.display = node.style.display;
281
+ data.position = node.style.position;
282
+ if (data.parent)
283
+ data.parent.removeChild(node);
284
+ }
285
+
286
+ $(el).data('blockUI.onUnblock', opts.onUnblock);
287
+ var z = opts.baseZ;
288
+
289
+ // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
290
+ // layer1 is the iframe layer which is used to supress bleed through of underlying content
291
+ // layer2 is the overlay layer which has opacity and a wait cursor (by default)
292
+ // layer3 is the message content that is displayed while blocking
293
+ var lyr1, lyr2, lyr3, s;
294
+ if (msie || opts.forceIframe)
295
+ lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'">