Hueman Addons - Version 2.0.8

Version Description

February 26th 2017 = * improved : better customizer user interface * improved : javascript error handling in the customizer

Download this release

Release Info

Developer nikeo
Plugin Icon 128x128 Hueman Addons
Version 2.0.8
Comparing to
See all releases

Code changes from version 2.0.7 to 2.0.8

addons/assets/czr/css/customizer-czr-content-picker.css ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .czr-sub-set[data-input-type="content_picker"] .customize-control-title {
2
+ width: 100%;
3
+ }
4
+ .czr-sub-set[data-input-type="content_picker"] .czr-input {
5
+ width: 100%;
6
+ }
7
+ .content-item-bar {
8
+ line-height: 1.5em;
9
+ }
10
+
11
+ .czr-sub-set[data-input-type="content_picker"] span.item-title {
12
+ display: block;
13
+ float: left;
14
+ max-width: 80%;
15
+ }
16
+
17
+ .czr-sub-set[data-input-type="content_picker"] span.item-type {
18
+ display: inline-block;
19
+ padding: 0;
20
+ padding-right: 10px;
21
+ float: right;
22
+ }
addons/assets/czr/css/customizer-czr-content-picker.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .czr-sub-set[data-input-type=content_picker] .customize-control-title,.czr-sub-set[data-input-type=content_picker] .czr-input{width:100%}.content-item-bar{line-height:1.5em}.czr-sub-set[data-input-type=content_picker] span.item-title{display:block;float:left;max-width:80%}.czr-sub-set[data-input-type=content_picker] span.item-type{display:inline-block;padding:0 10px 0 0;float:right}
addons/assets/czr/css/czr-control-base.css ADDED
@@ -0,0 +1,3166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* OVERRIDE WP CUSTOMIZER */
2
+ /* LINKS */
3
+ .wp-customizer a {
4
+ color: #000;
5
+ }
6
+ .wp-customizer a:hover, .wp-customizer a:focus {
7
+ color: #0073aa;
8
+ }
9
+
10
+ /* LAYOUT */
11
+ .wp-customizer .wp-full-overlay.expanded {
12
+ margin-left: 440px;
13
+ }
14
+ .wp-customizer .wp-full-overlay-sidebar {
15
+ width: 440px;
16
+ }
17
+ .wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
18
+ margin-left: -440px;
19
+ }
20
+ /*.in-sub-panel #customize-info,
21
+ .in-sub-panel #customize-theme-controls > ul > .accordion-section {
22
+ left: -440px;
23
+ width: 440px;
24
+ }*/
25
+ #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
26
+ left: -440px;
27
+ }
28
+ .accordion-sub-container.control-panel-content {
29
+ left: 440px;
30
+ }
31
+
32
+
33
+ /* RTL*/
34
+ .rtl.wp-customizer .wp-full-overlay.expanded {
35
+ margin-right: 440px;
36
+ margin-left: 0;
37
+ }
38
+ .rtl.wp-customizer .wp-full-overlay-sidebar {
39
+ width: 440px;
40
+ }
41
+ .rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
42
+ margin-right: -440px;
43
+ margin-left: 0;
44
+ }
45
+ /*.rtl .in-sub-panel #customize-info,
46
+ .rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
47
+ right: -440px;
48
+ width: 440px;
49
+ }*/
50
+ .rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
51
+ right: -440px;
52
+ }
53
+ .rtl .accordion-sub-container.control-panel-content {
54
+ right: 440px;
55
+ }
56
+
57
+ /* CUSTOM CSS ( since wp 4.7 ) */
58
+ .customize-section-description-container + #customize-control-custom_css:last-child {
59
+ margin: 0;
60
+ width: 100%;
61
+ }
62
+ li#customize-control-custom_css textarea {
63
+ font-size: 13px;
64
+ background: #394143;
65
+ color: #95ff0c;
66
+ min-height: 300px;
67
+ }
68
+
69
+ @media screen and (max-width: 1400px) {
70
+ .wp-customizer .wp-full-overlay.expanded {
71
+ margin-left: 380px;
72
+ }
73
+ .wp-customizer .wp-full-overlay-sidebar {
74
+ width: 380px;
75
+ }
76
+ .wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
77
+ margin-left: -380px;
78
+ }
79
+ /* .in-sub-panel #customize-info,
80
+ .in-sub-panel #customize-theme-controls > ul > .accordion-section {
81
+ left: -380px;
82
+ width: 380px;
83
+ }*/
84
+ #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
85
+ left: -380px;
86
+ }
87
+ .accordion-sub-container.control-panel-content {
88
+ left: 380px;
89
+ }
90
+
91
+ /* RTL */
92
+ .rtl.wp-customizer .wp-full-overlay.expanded {
93
+ margin-right: 380px;
94
+ margin-left: 0;
95
+ }
96
+ .rtl.wp-customizer .wp-full-overlay-sidebar {
97
+ width: 380px;
98
+ }
99
+ .rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
100
+ margin-right: -380px;
101
+ margin-left: 0;
102
+ }
103
+ /* .rtl .in-sub-panel #customize-info,
104
+ .rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
105
+ right: -380px;
106
+ width: 380px;
107
+ }*/
108
+ .rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
109
+ right: -380px;
110
+ }
111
+ .rtl .accordion-sub-container.control-panel-content {
112
+ right: 380px;
113
+ }
114
+ }
115
+
116
+ @media screen and (max-width: 979px) {
117
+ .wp-customizer .wp-full-overlay.expanded {
118
+ margin-left: 300px;
119
+ }
120
+ .wp-customizer .wp-full-overlay-sidebar {
121
+ width: 300px;
122
+ }
123
+ .wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
124
+ margin-left: -300px;
125
+ }
126
+ /* .in-sub-panel #customize-info,
127
+ .in-sub-panel #customize-theme-controls > ul > .accordion-section {
128
+ left: -300px;
129
+ width: 300px;
130
+ }*/
131
+ #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
132
+ left: -300px;
133
+ }
134
+ .accordion-sub-container.control-panel-content {
135
+ left: 300px;
136
+ }
137
+
138
+ /* RTL */
139
+ .rtl.wp-customizer .wp-full-overlay.expanded {
140
+ margin-right: 300px;
141
+ margin-left: 0;
142
+ }
143
+ .rtl.wp-customizer .wp-full-overlay-sidebar {
144
+ width: 300px;
145
+ }
146
+ .rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
147
+ margin-right: -300px;
148
+ margin-left: 0;
149
+ }
150
+ /* .rtl .in-sub-panel #customize-info,
151
+ .rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
152
+ right: -300px;
153
+ width: 300px;
154
+ }*/
155
+ .rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
156
+ right: -300px;
157
+ }
158
+ .rtl .accordion-sub-container.control-panel-content {
159
+ right: 300px;
160
+ }
161
+ }
162
+
163
+ /* at max-width 640px the wp-full-overlay-sidebar becomes 100% */
164
+ @media screen and (max-width: 640px) {
165
+ .wp-customizer .customize-controls-preview-toggle {
166
+ height: 46px;
167
+ border-bottom: 1px solid #ddd;
168
+ left: 87px;
169
+ }
170
+
171
+ .wp-customizer .wp-full-overlay.expanded {
172
+ margin-left: 0;
173
+ }
174
+
175
+ /* .in-sub-panel #customize-info,
176
+ .in-sub-panel #customize-theme-controls > ul > .accordion-section {
177
+ left: -100%;
178
+ width: 100%;
179
+ }*/
180
+
181
+ #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
182
+ left: -100%;
183
+ }
184
+ .accordion-sub-container.control-panel-content {
185
+ left: 100%;
186
+ }
187
+
188
+ /* RTL */
189
+ .rtl.wp-customizer .wp-full-overlay.expanded {
190
+ margin-right: 0;
191
+ }
192
+
193
+ /* .rtl .in-sub-panel #customize-info,
194
+ .rtl .in-sub-panel #customize-theme-controls > ul > .accordion-section {
195
+ right: -100%;
196
+ width: 100%;
197
+ left: auto;
198
+ }*/
199
+ .rtl .in-sub-panel #czr-donate-customizer,
200
+ .rtl .in-sub-panel .czr-cta-wrap,
201
+ .rtl #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
202
+ right: -100%;
203
+ left: auto;
204
+ }
205
+ .rtl .accordion-sub-container.control-panel-content {
206
+ right: 100%;
207
+ }
208
+ }
209
+
210
+
211
+ /* PANELS AND SECTIONS TITLES */
212
+ .wp-customizer .control-section.control-panel .accordion-section-title .panel-title {
213
+ font-size: 24px;
214
+ font-weight: inherit;
215
+ line-height: 30px;
216
+ }
217
+
218
+ .wp-core-ui h3 {
219
+ color: #555;
220
+ }
221
+ .accordion-section-content {
222
+ padding: 10px 10px 15px 20px;
223
+ }
224
+ .widget-action, .handlediv, .item-edit, .sidebar-name-arrow, .accordion-section-title:after {
225
+ color: #00a0d2;
226
+ }
227
+ .control-section.control-panel > .accordion-section-title:after {
228
+ color: #00a0d2;
229
+ }
230
+ .customize-control-title {
231
+ line-height: 19px;
232
+ }
233
+
234
+ /* since v4.3 */
235
+ .wp-customizer #customize-theme-controls .accordion-section-content {
236
+ background: #fff;
237
+ }
238
+ /*.wp-customizer .customize-panel-back {
239
+ height: 60px;
240
+ }*/
241
+ .wp-customizer #customize-controls .customize-info .customize-help-toggle:hover, .wp-customizer #customize-controls .customize-info.open .customize-help-toggle, .wp-customizer #customize-controls .customize-info .customize-help-toggle:focus {
242
+ color:#00a0d2;
243
+ }
244
+ .wp-customizer .customize-screen-options-toggle:focus:before, .wp-customizer #customize-controls .customize-info .customize-help-toggle:focus:before {
245
+ -webkit-box-shadow: 0 0 0 1px #00a0d2;
246
+ box-shadow: 0 0 0 1px #00a0d2;
247
+ -webkit-border-radius: 100%;
248
+ border-radius: 100%;
249
+ }
250
+
251
+ .wp-customizer .menu-item-handle:hover .item-type, .wp-customizer .menu-item-handle:hover .item-edit, .wp-customizer #available-menu-items .menu-item-handle:hover .item-add, .wp-customizer .menu-item-handle:hover{
252
+ color: #00a0d2;
253
+ }
254
+
255
+ .customize-screen-options-toggle:hover, .customize-screen-options-toggle:active, .customize-screen-options-toggle:focus, .active-menu-screen-options .customize-screen-options-toggle, #customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover, #customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active, #customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus {
256
+ color: #00a0d2!important;
257
+ }
258
+
259
+ .customize-control input[type="text"] {
260
+ line-height: 23px;
261
+ }
262
+
263
+
264
+ /* CONTROLS */
265
+ li[id*="customize-control-"] {
266
+ margin: 8px 0;
267
+ padding: 2%;
268
+ width: 96%;
269
+ border: 1px solid rgba(221, 221, 221, 0.43);
270
+ box-shadow: 1px 0px 2px 0px rgba(204, 204, 204, 0.45);
271
+ -webkit-box-shadow: 1px 0px 2px 0px rgba(204, 204, 204, 0.45);
272
+ }
273
+
274
+ /* GENERAL STYLE */
275
+ .control-section .accordion-section-content {
276
+ overflow-y: auto;
277
+ }
278
+ li[id*="customize-control-"] {
279
+ margin: 8px 0;
280
+ }
281
+
282
+ .wp-customizer .control-section h3.accordion-section-title {
283
+ padding: 10px 25px 11px 14px;
284
+
285
+ }
286
+ .wp-customizer #customize-controls h3 {
287
+ font-size: 15px;
288
+ font-weight: 400;
289
+ }
290
+
291
+ .control-section .accordion-section-title:after {
292
+ top: 7px;
293
+ }
294
+ .control-section.control-panel .accordion-section-title:after {
295
+ top: 11px;
296
+ -webkit-transition: right .3s ease-in-out, opacity .3s ease-in-out;
297
+ -moz-transition: right .3s ease-in-out, opacity .3s ease-in-out;
298
+ -ms-transition: right .3s ease-in-out, opacity .3s ease-in-out;
299
+ -o-transition: right .3s ease-in-out, opacity .3s ease-in-out;
300
+ transition: right .3s ease-in-out, opacity .3s ease-in-out;
301
+ right: 10px;
302
+ opacity:0.7;
303
+ }
304
+ .rtl .control-section.control-panel .accordion-section-title:after {
305
+ -webkit-transition: left .3s ease-in-out, opacity .3s ease-in-out;
306
+ -moz-transition: left .3s ease-in-out, opacity .3s ease-in-out;
307
+ -ms-transition: left .3s ease-in-out, opacity .3s ease-in-out;
308
+ -o-transition: left .3s ease-in-out, opacity .3s ease-in-out;
309
+ transition: left .3s ease-in-out, opacity .3s ease-in-out;
310
+ left: 10px;
311
+ right: initial;
312
+ }
313
+ #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after , #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after {
314
+ right: 8px;
315
+ opacity:1;
316
+ color: #666!important;
317
+ }
318
+
319
+ .rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after , .rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after {
320
+ left: 6px;
321
+ right: initial;
322
+ }
323
+ /* Overrides WP built in style : hack for nested section arrow */
324
+ #customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after, #customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after, .control-section.control-panel>.accordion-section-title:after {
325
+ background: none!important;
326
+ border: none!important;
327
+ }
328
+
329
+ #customize-theme-controls h3.accordion-section-title {
330
+ /*font-family: "Open Sans", sans-serif;*/
331
+ -webkit-transition: background .1s ease-in-out;
332
+ -moz-transition: background .1s ease-in-out;
333
+ -ms-transition: background .1s ease-in-out;
334
+ -o-transition: background .1s ease-in-out;
335
+ transition: background .1s ease-in-out;
336
+ }
337
+
338
+ /*#customize-theme-controls > .control-section:hover .accordion-section-title::after, #customize-theme-controls .control-section .accordion-section-title:hover::after, #customize-theme-controls .control-section.open .accordion-section-title::after, #customize-theme-controls .control-section .accordion-section-title:focus::after {
339
+ color: #FFF;
340
+ }*/
341
+
342
+
343
+ .customize-control-checkbox label, .customize-control-nav_menu_auto_add label, .customize-control-radio label {
344
+ line-height: 16px;
345
+ margin-left: 0;
346
+ }
347
+
348
+ /* Placeholders Styling for inputs */
349
+ input::-webkit-input-placeholder {
350
+ color:#9A9A9A;
351
+ font-style: italic;
352
+ }
353
+ input:-moz-placeholder { /* Firefox 18- */
354
+ color: #9A9A9A;
355
+ font-style: italic;
356
+ }
357
+ input::-moz-placeholder { /* Firefox 19+ */
358
+ color: #9A9A9A;
359
+ font-style: italic;
360
+ }
361
+ input:-ms-input-placeholder {
362
+ color: #9A9A9A;
363
+ font-style: italic;
364
+ }
365
+
366
+
367
+ .czr-customizr-title {
368
+ /* color: #555; */
369
+ text-transform: uppercase;
370
+ /* text-shadow: 0 1px 0 #FFF; */
371
+ margin: 1em 0em 5px 0em;
372
+ font-size: 15px!important;
373
+ border-bottom: 1px dotted #00a0d2;
374
+ padding-bottom: 5px;
375
+ text-align: center;
376
+ }
377
+ h3.czr-customizr-title::before {
378
+ content: '\00b7';
379
+ padding-right: 3px;
380
+ }
381
+ h3.czr-customizr-title::after {
382
+ content: '\00b7';
383
+ padding-left: 3px;
384
+ }
385
+ .czr-after-button {
386
+ border-color: white;
387
+ margin-top:15px;
388
+ }
389
+ .czr-emphasize {
390
+ line-height: 1.2em;
391
+ color: #2E2E2E;
392
+ }
393
+ i.czr-notice {
394
+ display: block;
395
+ clear: both;
396
+ }
397
+ span.czr-notice {
398
+ color: #313131;
399
+ font-size:12px;
400
+ font-style: italic;
401
+ clear: both;
402
+ display: block;
403
+ line-height: 18px;
404
+ }
405
+ .czr-customizer-separator-invisible {
406
+ border:none;
407
+ margin-top:15px;
408
+ }
409
+ .czr-skin-gen-label {
410
+ float: left;
411
+ }
412
+ .czr-skin-gen-color-picker {
413
+ float: right;
414
+ }
415
+ .czr-number-label {
416
+ float: left;
417
+ }
418
+ .czr-number-input {
419
+ float: right;
420
+ }
421
+ .czr-check-label {
422
+ float: left;
423
+ max-width: 85%;
424
+ }
425
+ /* RTL position fix */
426
+ .rtl .czr-check-label {
427
+ float: right;
428
+ }
429
+ input[type=checkbox], input[type=radio] {
430
+ float: right;
431
+ min-height: 18px;
432
+ }
433
+ .czr-font-select {
434
+ float: left;
435
+ }
436
+
437
+ /* CUSTOM CSS TEXT AREA */
438
+ li#customize-control-tc_theme_options-tc_custom_css textarea {
439
+ font-size: 14px;
440
+ background: #394143;
441
+ color: #E2E728;
442
+ min-height: 300px;
443
+ }
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+ .customize-control .czr-navigate-to-post-list {
458
+ color: #00a0d2;
459
+ font-weight: bold;
460
+ float: left;
461
+ clear: both;
462
+ width: 100%;
463
+ margin-bottom: 8px;
464
+ }
465
+
466
+ .czr-sub-control {
467
+ padding-left: 13%;
468
+ max-width: 87%;
469
+ position: relative;
470
+ }
471
+
472
+ .czr-sub-control:before {
473
+ content: '';
474
+ height: 116%;
475
+ background: #00a0d2;
476
+ width: 2%;
477
+ position: absolute;
478
+ left: 7%;
479
+ }
480
+
481
+ /* Cropped Image style */
482
+ /* Unified with the default cropped_image CSS */
483
+ .customize-control-tc_cropped_image .upload-button {
484
+ float: right;
485
+ }
486
+ .customize-control-tc_cropped_image .remove-button {
487
+ float: left;
488
+ margin-right: 3px;
489
+ }
490
+ .customize-control-tc_cropped_image .actions {
491
+ margin-bottom: 32px;
492
+ }
493
+ .customize-control-tc_cropped_image .current {
494
+ margin-bottom: 8px;
495
+ }
496
+ .customize-control-tc_cropped_image .upload-button,
497
+ .customize-control-tc_cropped_image .remove-button {
498
+ white-space: normal;
499
+ width: 48%;
500
+ height: auto;
501
+ }
502
+
503
+ .customize-control-tc_cropped_image .current .container {
504
+ min-height: 40px;
505
+ overflow: hidden;
506
+ border: 1px solid #eee;
507
+ -webkit-border-radius: 2px;
508
+ border-radius: 2px;
509
+ }
510
+ .customize-control-tc_cropped_image img {
511
+ width: 100%;
512
+ -webkit-border-radius: 2px;
513
+ border-radius: 2px;
514
+ }
515
+ .customize-control-tc_cropped_image .inner {
516
+ line-height: 20px;
517
+ top: 10px;
518
+ }
519
+ /* rtl */
520
+ /* end tc cropped image */
521
+ .rtl .customize-control-tc_cropped_image .upload-button {
522
+ float: left;
523
+ }
524
+ .rtl .customize-control-tc_cropped_image .remove-button {
525
+ float: right;
526
+ margin-left: 3px;
527
+ }
528
+
529
+
530
+
531
+
532
+
533
+ /* LAYOUT SELECTION SPECIFICS */
534
+ .czr-layout-img {
535
+ height: 26px;
536
+ padding-top: 2px;
537
+ border: 1px solid #FFF;
538
+ }
539
+ .czr-layout-title {
540
+ padding: 0 0px 18px 12px;
541
+ display: inline-block;
542
+ line-height: 0px;
543
+ vertical-align: middle;
544
+ }
545
+
546
+
547
+
548
+ /* MULTI INPUT */
549
+ .customize-control-czr_multi_input {
550
+ width: 96%;
551
+ border: 1px solid #ccc;
552
+ padding: 2%;
553
+ }
554
+ .czr-multi-input-wrapper {
555
+ width: 95%;
556
+ padding: 0px 0% 0 5%;
557
+ }
558
+ .czr-multi-input-wrapper [data-input-type="color"] .czr-input {
559
+ float: left;
560
+ clear: both;
561
+ }
562
+
563
+
564
+
565
+ /* SPECIFIC PANELS AND SECTIONS MARGIN */
566
+ #customize-theme-controls #accordion-panel-czr-footer-panel {
567
+ border-bottom: 1px solid #ddd;
568
+ }
569
+ #customize-theme-controls .control-panel-widgets,
570
+ #customize-theme-controls #accordion-panel-nav_menus,
571
+ #customize-theme-controls #accordion-panel-hu-advanced-panel {
572
+ margin-top: 10px;
573
+ }
574
+ #customize-theme-controls #accordion-panel-hu-header-panel,
575
+ #customize-theme-controls .control-panel-widgets,
576
+ #customize-theme-controls #accordion-panel-nav_menus,
577
+ #customize-theme-controls #accordion-panel-hu-advanced-panel {
578
+ border-top: 1px solid #ddd;
579
+ }
580
+ #customize-theme-controls #accordion-panel-hu-general-panel {
581
+ margin-bottom: 10px;
582
+ }
583
+
584
+ #customize-theme-controls #accordion-section-static_front_page {
585
+ margin-bottom: 10px;
586
+ }
587
+
588
+ /* HOME BUTTON */
589
+ #customize-header-actions .customize-controls-close {
590
+ left: 45px;
591
+ }
592
+
593
+ .customize-controls-home, .customize-controls-close {
594
+ top: -1px;
595
+ }
596
+ .customize-controls-home {
597
+ display: block;
598
+ position: absolute;
599
+ left: 0;
600
+ width: 45px;
601
+ height: 41px;
602
+ padding: 0 2px 0 0;
603
+ background: #eee;
604
+ border: none;
605
+ border-top: 4px solid #eee;
606
+ border-right: 1px solid #ddd;
607
+ border-bottom: 1px solid #ddd;
608
+ color: #444;
609
+ text-align: left;
610
+ cursor: pointer;
611
+ text-decoration: none;
612
+ -webkit-transition: color .15s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out;
613
+ transition: color .1s ease-in-out, border-color .15s ease-in-out, background .15s ease-in-out;
614
+ -webkit-box-sizing: content-box;
615
+ -moz-box-sizing: content-box;
616
+ box-sizing: content-box;
617
+ }
618
+
619
+ .customize-controls-home:before {
620
+ font-size: 17px;
621
+ line-height:45px;
622
+ position: relative;
623
+ top: -4px;
624
+ left: 15px;
625
+ }
626
+ .customize-controls-home:hover {
627
+ background: #fff;
628
+ color: #0073aa;
629
+ border-top-color: #0073aa;
630
+ outline: none;
631
+ -webkit-box-shadow: none;
632
+ box-shadow: none;
633
+ }
634
+ /* rtl: home button */
635
+ .rtl.wp-customizer #customize-header-actions .customize-controls-close {
636
+ right: 45px;
637
+ left: auto;
638
+ }
639
+ .rtl.wp-customizer .customize-controls-home {
640
+ left: auto;
641
+ right: 0;
642
+ border-right: 0;
643
+ border-left: 1px solid #ddd;
644
+ }
645
+
646
+ /* HEADER MENU NOTICE */
647
+ .control-panel-content .hu-menu-notice {
648
+ margin-left: 3%;
649
+
650
+ }
651
+
652
+ /* PANEL SUBTITLE */
653
+ span.czr-panel-subtitle {
654
+ display: block;
655
+ font-size: 12px;
656
+ font-style: italic;
657
+ }/*******************************************************************
658
+ * DYNAMIC CONTROLS : sidebars, socials, ...
659
+ ********************************************************************/
660
+ .czr-open-pre-add-new {
661
+ display: block;
662
+ float: left;
663
+ margin: 2% 2% 0%;
664
+ width: 99%;
665
+ padding: 2%;
666
+ background: #3b8dbd;
667
+ opacity: 1;
668
+ color: #fff;
669
+ font-size: 16px;
670
+ cursor: pointer;
671
+ border-width: 1px;
672
+ border-style: solid;
673
+ -webkit-appearance: none;
674
+ -webkit-border-radius: 3px;
675
+ border-radius: 3px;
676
+ white-space: nowrap;
677
+ -webkit-box-sizing: border-box;
678
+ -moz-box-sizing: border-box;
679
+ box-sizing: border-box;
680
+ -webkit-transition: opacity 1s ease-in-out;
681
+ -moz-transition: opacity 1s ease-in-out;
682
+ -ms-transition: opacity 1s ease-in-out;
683
+ -o-transition: opacity 1s ease-in-out;
684
+ transition: opacity 1s ease-in-out;
685
+ }
686
+
687
+ .czr-open-pre-add-new.active {
688
+ background: #646464;
689
+ opacity: 0.5;
690
+ border-radius: 3px 3px 0 0;
691
+ }
692
+
693
+ .czr-single-item {
694
+ padding: 0%;
695
+ border: 1px solid #ccc;
696
+ margin: 1% 0 0 2%;
697
+ float: left;
698
+ width: 98%;
699
+ -webkit-border-radius: 3px;
700
+ border-radius: 3px;
701
+ -webkit-transition: opacity 1s ease-in-out;
702
+ -moz-transition: opacity 1s ease-in-out;
703
+ -ms-transition: opacity 1s ease-in-out;
704
+ -o-transition: opacity 1s ease-in-out;
705
+ transition: opacity 1s ease-in-out;
706
+ }
707
+
708
+ #customize-theme-controls .czr-single-item.open {
709
+ border: 1px solid #dedede;
710
+ }
711
+ /* Keep the normal border for single module, mono items controls */
712
+ #customize-theme-controls .mono-item-mod .czr-single-item {
713
+ border: 1px solid #ccc;
714
+ }
715
+
716
+ .czr-single-item .czr-item-header, .czr-single-item .czr-item-content {
717
+ padding: 1%;
718
+ }
719
+
720
+ .czr-items-wrapper .czr-single-item .czr-builtin-model {
721
+ background: #E1DFDF;
722
+ color: #555
723
+ }
724
+
725
+ .czr-items-wrapper .inactive {
726
+ opacity: 0.6;
727
+ }
728
+
729
+ .czr-item-sort-handle {
730
+ cursor: move;
731
+ }
732
+
733
+ .czr-single-item .czr-item-header {
734
+ position: relative;
735
+ background: #dfdfdf;
736
+ color: white;
737
+ float: left;
738
+ width: 98%;
739
+ -webkit-transition: background .1s ease-in-out;
740
+ -moz-transition: background .1s ease-in-out;
741
+ -ms-transition: background .1s ease-in-out;
742
+ -o-transition: background .1s ease-in-out;
743
+ transition: background .1s ease-in-out;
744
+ }
745
+
746
+
747
+ /* sidebar specifics */
748
+ .czr_widget_areas_module .czr-single-item .czr-custom-model {
749
+ background: #3b8dbd;
750
+ }
751
+ . .czr-single-item .czr-custom-model:hover {
752
+ background: #aaa;
753
+ }
754
+ .czr-single-item .czr-item-header:hover {
755
+ background: #ccc;
756
+ }
757
+
758
+ /* sidebar specifics */
759
+ /*.czr-builtin-model .czr-single-item .czr-item-header {
760
+ background:#3b8dbd;
761
+ }*/
762
+ .czr-items-wrapper .czr-single-item .czr-builtin-model:hover {
763
+ background: #ccc;
764
+ }
765
+
766
+ .czr-move-icon {
767
+ position: absolute;
768
+ top: -2px;
769
+ left: 3px;
770
+ font-size: 10px;
771
+ color: #999;
772
+ }
773
+ .czr-item-title {
774
+ float: left;
775
+ font-size: 17px;
776
+ color: #000;
777
+ padding: 7px;
778
+ width: 67%;
779
+ }
780
+
781
+ .czr-inactive-alert {
782
+ font-size: 12px;
783
+ font-style: italic;
784
+ }
785
+ /* sidebar specifics */
786
+ .czr_widget_areas_module .czr-item-title {
787
+ color: #fff;
788
+ }
789
+
790
+
791
+ .czr-builtin-model .czr-item-title {
792
+ color: #23282d;
793
+ }
794
+ .czr-item-title h4 {
795
+ margin: 0;
796
+ }
797
+ .czr-item-title .fa:before {
798
+ padding-right: 2px;
799
+ }
800
+ .czr-item-btns {
801
+ float: right;
802
+ }
803
+ .czr-item-btns a {
804
+ font-size: 17px;
805
+ padding: 7px 5px;
806
+ color: #777;
807
+ -webkit-transition: color .1s ease-in-out;
808
+ -moz-transition: color .1s ease-in-out;
809
+ -ms-transition: color .1s ease-in-out;
810
+ -o-transition: color .1s ease-in-out;
811
+ transition: color .1s ease-in-out;
812
+ }
813
+ .czr-item-btns a:active, .czr-item-btns a:focus {
814
+ outline: none;
815
+ outline: 0;
816
+ -webkit-box-shadow: none;
817
+ box-shadow: none;
818
+ }
819
+ /* sidebar specifics */
820
+ .czr_widget_areas_module .czr-item-btns a {
821
+ color: #fff;
822
+ }
823
+
824
+ .czr-builtin-model .czr-item-btns a {
825
+ color: #555
826
+ }
827
+
828
+ .czr-builtin-model .czr-item-btns .czr-edit-view:hover, .czr-builtin-model .czr-item-btns .czr-edit-view.active {
829
+ color: #00a0d2;
830
+ }
831
+
832
+ .czr-item-btns .czr-edit-view:hover, .czr-item-btns .czr-edit-view.active {
833
+ color: #00a0d2;
834
+ }
835
+
836
+ /* sidebar specifics */
837
+ .czr_widget_areas_module .czr-edit-view:hover, .czr_widget_areas_module .czr-item-btns .czr-edit-view.active {
838
+ color: #000000;
839
+ }
840
+ .czr_widget_areas_module .czr-builtin-model .czr-edit-view:hover, .czr_widget_areas_module .czr-builtin-model .czr-edit-view.active {
841
+ color: #00a0d2;
842
+ }
843
+
844
+ .czr-item-btns .czr-display-alert:hover, .czr-item-btns .czr-display-alert.active {
845
+ color: #23282d;
846
+ }
847
+
848
+
849
+ .czr-single-item .czr-item-content {
850
+ display: none;
851
+ background: rgba(238, 238, 238, 0.5);
852
+ clear: both;
853
+ width: 96%;
854
+ padding: 2%;
855
+ }
856
+ .czr-single-item .czr-item-content input {
857
+ margin-bottom: 0;
858
+ }
859
+ .czr-sub-set {
860
+ margin-bottom: 0;
861
+ display: block;
862
+ float: left;
863
+ width: 100%;
864
+ padding: 1% 0;
865
+ position: relative;
866
+ }
867
+
868
+ .czr-sub-set .czr-input {
869
+ float: right;
870
+ width: 60%;
871
+ }
872
+
873
+ .width-100 .czr-input, .czr-sub-set .customize-control-title.width-100 {
874
+ width: 100%;
875
+ }
876
+ .czr-sub-set .customize-control-title {
877
+ float: left;
878
+ width: 40%;
879
+ padding: 1px 0;
880
+ font-size: 13px;
881
+ }
882
+ /* rtl */
883
+ .rtl.wp-customizer .czr-sub-set .customize-control-title {
884
+ float: right;
885
+ }
886
+ .czr-item-title .fa {
887
+ font-size: 18px;
888
+ }
889
+
890
+ /* Remove alert block */
891
+ .czr-remove-alert-wrapper {
892
+ display: none;
893
+ clear: both;
894
+ float: left;
895
+ padding: 2%;
896
+ width: 95%;
897
+ margin: 10px 0;
898
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
899
+ background-color: #EEE;
900
+ color: #000;
901
+ -webkit-border-radius: 4px;
902
+ -moz-border-radius: 4px;
903
+ border-radius: 4px;
904
+ }
905
+
906
+ .czr-remove-alert-wrapper p {
907
+ padding: 5px;
908
+ margin: 0px;
909
+ }
910
+
911
+ /* pre add dialog */
912
+ .czr-pre-add-wrapper {
913
+ position: relative;
914
+ float: left;
915
+ width: 100%;
916
+ }
917
+
918
+ .czr-adding-new .czr-items-wrapper {
919
+ opacity: 0.6;
920
+ }
921
+
922
+ .czr-pre-add-view-content {
923
+ display: none;
924
+ padding: 3%;
925
+ border: 1px solid #00a0d2;
926
+ border-top: none;
927
+ margin: 0 0 0 2%;
928
+ float: left;
929
+ width: 92%;
930
+ background: #eee;
931
+ -webkit-border-radius: 0px 0px 3px 3px;
932
+ -moz-border-radius: 0px 0px 3px 3px;
933
+ border-radius: 0px 0px 3px 3px;
934
+ position: relative;
935
+ opacity: 1;
936
+ -webkit-transition: opacity .2s linear;
937
+ -moz-transition: opacity .2s linear;
938
+ -ms-transition: opacity .2s linear;
939
+ -o-transition: opacity .2s linear;
940
+ transition: opacity .2s linear;
941
+ }
942
+
943
+ .czr-model-added .czr-pre-add-view-content {
944
+ opacity: 0.2;
945
+ }
946
+
947
+ .czr-pre-add-wrapper .czr-add-new {
948
+ background: #3b8dbd;
949
+ color: #fff;
950
+ -webkit-transition: background .5s linear;
951
+ -moz-transition: background .5s linear;
952
+ -ms-transition: background .5s linear;
953
+ -o-transition: background .5s linear;
954
+ transition: background .5s linear;
955
+ float: right;
956
+ border: none;
957
+ }
958
+
959
+ .czr-add-success {
960
+ width: 100%;
961
+ margin: 0 0 0 2%;
962
+ position: absolute;
963
+ top: 0;
964
+ left: 0;
965
+ font-size: 25px;
966
+ text-align: center;
967
+ opacity: 0;
968
+ -webkit-transition: opacity .1s linear;
969
+ -moz-transition: opacity .1s linear;
970
+ -ms-transition: opacity .1s linear;
971
+ -o-transition: opacity .1s linear;
972
+ transition: opacity .1s linear;
973
+ }
974
+ .czr-model-added .czr-add-success {
975
+ opacity: 1;
976
+ }
977
+
978
+ .czr-add-success p {
979
+ vertical-align: middle;
980
+ display: inline-block;
981
+ line-height: 35px;
982
+ margin: 0;
983
+ font-size: 25px;
984
+ color: #82b965;
985
+ padding: 0 3%;
986
+ }
987
+
988
+
989
+ /* WIDGETS ZONE SPECIFICS */
990
+ .control-section-widget_zones_management {
991
+ margin: 10px 0;
992
+ z-index: 1;
993
+ }
994
+ /*#customize-theme-controls .control-section-widget_zones_management .accordion-section-content {
995
+ display: none;
996
+ left: 0;
997
+ position: relative;
998
+ }*/
999
+
1000
+ .czr-zone-infos {
1001
+ width: 96%;
1002
+ padding: 0 2%;
1003
+ font-size: 12px;
1004
+ float: left;
1005
+ font-style: italic;
1006
+ }
1007
+
1008
+ /*#customize-theme-controls .control-section-widget_zones_management .accordion-section-title:after {
1009
+ content: "\f078";
1010
+ display: inline-block;
1011
+ font: normal normal normal 14px/1 FontAwesome;
1012
+ font-size: inherit;
1013
+ text-rendering: auto;
1014
+ -webkit-font-smoothing: antialiased;
1015
+ -moz-osx-font-smoothing: grayscale;
1016
+ }
1017
+
1018
+ #customize-theme-controls .control-section-widget_zones_management.open .accordion-section-title:after {
1019
+ content: "\f077";
1020
+ }*/
1021
+ .czr-unavailable-location {
1022
+ opacity: 0.7;
1023
+ }
1024
+ .czr-location-alert {
1025
+ float: left;
1026
+ width: 100%;
1027
+ padding: 1% 0;
1028
+ margin: 1% 0;
1029
+ text-align: center;
1030
+ border: 1px solid orange;
1031
+ background: #FEE5B6;
1032
+ color: #000;
1033
+ font-size: 11px;
1034
+ font-style: italic;
1035
+ }
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+
1046
+
1047
+
1048
+
1049
+
1050
+ /* MODULE OPTIONS ICON AND PANEL*/
1051
+ .czr-toggle-modopt {
1052
+ color: #95a5a6;
1053
+ text-shadow: 1px 1px 0px white;
1054
+ -webkit-transition: color 0.4s;
1055
+ transition: color 0.4s;
1056
+ position: absolute;
1057
+ right: 0;
1058
+ padding-left: 3px;
1059
+ font-size: 25px;
1060
+ line-height: 24px;
1061
+ }
1062
+ /* rtl */
1063
+ .rtl.wp-customizer .czr-toggle-modopt {
1064
+ left: 0;
1065
+ right: auto;
1066
+ padding-left: 0;
1067
+ padding-right: 3px;
1068
+ }
1069
+ .czr-modopt-visible .czr-toggle-modopt, .czr-toggle-modopt:hover {
1070
+ color: #3b8dbd;
1071
+ }
1072
+
1073
+ body.czr-editing-modopt #customize-preview {
1074
+ opacity: 0.7;
1075
+ }
1076
+ body #customize-controls {
1077
+ -webkit-transition: opacity .4s ease-in-out;
1078
+ -moz-transition: opacity .4s ease-in-out;
1079
+ -ms-transition: opacity .4s ease-in-out;
1080
+ -o-transition: opacity .4s ease-in-out;
1081
+ transition: opacity .4s ease-in-out;
1082
+ }
1083
+ body.czr-editing-modopt #customize-controls {
1084
+ opacity: 0.4;
1085
+ }
1086
+ .czr-mod-opt-wrapper {
1087
+ position: absolute;
1088
+ top: 0;
1089
+ bottom: 0;
1090
+ left: -301px;
1091
+ /*visibility: hidden;*/
1092
+ opacity: 0;
1093
+ overflow-x: hidden;
1094
+ overflow-y: auto;
1095
+ margin: 0;
1096
+ z-index: 4;
1097
+ width: 60%;
1098
+ min-width: 300px;
1099
+ padding: 1% 2%;
1100
+ color: #fff;
1101
+ background: rgba(0, 0, 0, 0.8);
1102
+ -webkit-transition: all .18s ease-in-out;
1103
+ -moz-transition: all .18s ease-in-out;
1104
+ -ms-transition: all .18s ease-in-out;
1105
+ -o-transition: all .18s ease-in-out;
1106
+ transition: all .18s ease-in-out;
1107
+ border-right: 1px solid #4c4c4c;
1108
+ }
1109
+
1110
+ body.czr-editing-modopt .czr-mod-opt-wrapper {
1111
+ left: 0;
1112
+ visibility: visible;
1113
+ opacity: 1;
1114
+ }
1115
+ .czr-close-modopt {
1116
+ position: absolute;
1117
+ top: 10px;
1118
+ right: 25px;
1119
+ font-size: 31px;
1120
+ cursor: pointer;
1121
+ }
1122
+
1123
+
1124
+
1125
+ /* OPTIONS STYLE */
1126
+ .czr-mod-opt-wrapper .czr-sub-set {
1127
+ /*border: 1px dotted #ccc;*/
1128
+ background: rgba(238, 238, 238, 0.13);
1129
+ padding: 3% 2%;
1130
+ width: 96%;
1131
+ margin: 5px 0;
1132
+ }
1133
+ .czr-mod-opt-wrapper .czr-notice {
1134
+ color: #fff;
1135
+ }
1136
+
1137
+ .czr-mod-opt-wrapper .mod-opt-title {
1138
+ color: #fff;
1139
+ border-bottom: 1px solid #fff;
1140
+ padding: 5% 0;
1141
+ text-align: center;
1142
+ }
1143
+
1144
+
1145
+
1146
+ /**************************************
1147
+ /* MODULE OPTIONS : TABS NAVIGATION */
1148
+ /*************************************/
1149
+ .tabs {
1150
+ position: relative;
1151
+ display: none;
1152
+ overflow: hidden;
1153
+ margin: 0 auto;
1154
+ width: 100%;
1155
+ font-weight: 300;
1156
+ font-size: 1.25em;
1157
+ }
1158
+
1159
+ /* Nav */
1160
+ .tabs nav {
1161
+ text-align: center;
1162
+ }
1163
+
1164
+ .tabs nav ul {
1165
+ position: relative;
1166
+ overflow: hidden;
1167
+ display: -ms-flexbox;
1168
+ display: -webkit-flex;
1169
+ display: -moz-flex;
1170
+ display: -ms-flex;
1171
+ display: flex;
1172
+ margin: 0 auto;
1173
+ padding: 0;
1174
+ max-width: 1200px;
1175
+ list-style: none;
1176
+ -ms-box-orient: horizontal;
1177
+ -ms-box-pack: center;
1178
+ -webkit-flex-flow: row wrap;
1179
+ -moz-flex-flow: row wrap;
1180
+ -ms-flex-flow: row wrap;
1181
+ flex-flow: row wrap;
1182
+ -webkit-justify-content: center;
1183
+ -moz-justify-content: center;
1184
+ -ms-justify-content: center;
1185
+ justify-content: center;
1186
+ }
1187
+
1188
+ .tabs nav ul li {
1189
+ position: relative;
1190
+ z-index: 1;
1191
+ display: block;
1192
+ margin: 0;
1193
+ text-align: center;
1194
+ -webkit-flex: 1;
1195
+ -moz-flex: 1;
1196
+ -ms-flex: 1;
1197
+ flex: 1;
1198
+ }
1199
+
1200
+ /* colums layouts */
1201
+ .tabs nav ul li.cols-4 {
1202
+ width: 25%
1203
+ }
1204
+ .tabs nav ul li.cols-3 {
1205
+ width: 33%
1206
+ }
1207
+ .tabs nav ul li.cols-2 {
1208
+ width: 50%
1209
+ }
1210
+ .tabs nav ul li.cols-1 {
1211
+ width: 100%
1212
+ }
1213
+ .tabs nav a {
1214
+ position: relative;
1215
+ display: block;
1216
+ overflow: hidden;
1217
+ text-overflow: ellipsis;
1218
+ white-space: nowrap;
1219
+ line-height: 2.5;
1220
+ }
1221
+
1222
+ .tabs nav a span {
1223
+ vertical-align: middle;
1224
+ font-size: 0.75em;
1225
+ }
1226
+
1227
+ .tabs nav li.tab-current a {
1228
+ color: #74777b;
1229
+ }
1230
+
1231
+ .tabs nav a:focus {
1232
+ outline: none;
1233
+ }
1234
+
1235
+ li.tab-current::after, li.tab-current::before {
1236
+ content: '';
1237
+ height: 100%;
1238
+ position: absolute;
1239
+ -webkit-box-shadow: 4px 0px 15px 0px rgba(37, 37, 37, 0.63);
1240
+ box-shadow: 4px 0px 15px 0px rgba(37, 37, 37, 0.63);
1241
+ top: 0;
1242
+ width: 0px;
1243
+ right: 0px;
1244
+ z-index: 4;
1245
+ width: 100%;
1246
+ }
1247
+
1248
+ li.tab-current::before{
1249
+ left: 0;
1250
+ -webkit-box-shadow: 0px 0px 15px 4px rgba(37, 37, 37, 0.63);
1251
+ box-shadow: 0px 0px 15px 4px rgba(37, 37, 37, 0.63);
1252
+ }
1253
+
1254
+ li.tab-inactive::after {
1255
+ content: '';
1256
+ width: 100%;
1257
+ position: absolute;
1258
+ height: 2px;
1259
+ bottom: -7px;
1260
+ left: 0;
1261
+ -webkit-box-shadow: 4px 0px 15px 0px rgba(119, 119, 119, 0.58);;
1262
+ box-shadow: 4px 0px 15px 0px rgba(0, 0, 0, 0.86);;
1263
+ }
1264
+
1265
+ /* Content */
1266
+ .content-wrap {
1267
+ position: relative;
1268
+ }
1269
+
1270
+ .content-wrap section {
1271
+ display: none;
1272
+ margin: 0 auto;
1273
+ max-width: 1200px;
1274
+ }
1275
+
1276
+ section .czr-sub-set:first-child {
1277
+ margin: 0;
1278
+ }
1279
+
1280
+ .content-wrap section.content-current {
1281
+ display: block;
1282
+ }
1283
+
1284
+ .no-flexbox nav ul {
1285
+ display: block;
1286
+ }
1287
+
1288
+ .no-flexbox nav ul li {
1289
+ min-width: 15%;
1290
+ display: inline-block;
1291
+ }
1292
+
1293
+ /*****************************/
1294
+ /* Top Line */
1295
+ /*****************************/
1296
+
1297
+ .tabs-style-topline {
1298
+ max-width: 1200px;
1299
+ }
1300
+
1301
+ .tabs-style-topline nav li {
1302
+ border: 1px solid rgba(40,44,42,0.1);
1303
+ }
1304
+
1305
+ .czr-items-wrapper .tabs-style-topline nav li {
1306
+ border: none;
1307
+ }
1308
+
1309
+ .tabs-style-topline nav li:not(:last-child) {
1310
+ border-right: none;
1311
+ }
1312
+
1313
+ .tabs-style-topline nav li.tab-current {
1314
+ border-top-color: #ffffff;
1315
+ border-bottom: none;
1316
+ background: rgba(238, 238, 238, 0.13);
1317
+ }
1318
+
1319
+ .tabs-style-topline nav a {
1320
+ padding: 0.65em 0.5em;
1321
+ background: rgba(40,44,42,0.05);
1322
+ color: #fff;
1323
+ line-height: 1;
1324
+ -webkit-transition: color 0.2s;
1325
+ transition: color 0.2s;
1326
+ text-decoration: none;
1327
+ }
1328
+ .czr-items-wrapper .tabs-style-topline nav a {
1329
+ background: rgba(40, 44, 42, 0.45);
1330
+ }
1331
+
1332
+ .tabs-style-topline nav a:hover,
1333
+ .tabs-style-topline nav a:focus {
1334
+ text-decoration: underline;
1335
+ }
1336
+
1337
+ .tabs-style-topline nav li.tab-current a {
1338
+ background: none;
1339
+ box-shadow: inset 0 3px 0 #ffffff;
1340
+ color: #ffffff;
1341
+ text-decoration: underline;
1342
+ }
1343
+
1344
+ .czr-items-wrapper .tabs-style-topline nav li.tab-current a {
1345
+ color: #000;
1346
+ }
1347
+
1348
+ .tabs-style-topline .icon::before {
1349
+ display: block;
1350
+ margin: 0;
1351
+ }
1352
+
1353
+ .tabs-style-topline nav a span {
1354
+ text-transform: uppercase;
1355
+ letter-spacing: 1px;
1356
+ font-weight: 700;
1357
+ }
1358
+
1359
+
1360
+ @media screen and (max-width: 58em) {
1361
+ .tabs nav a.icon span {
1362
+ display: none;
1363
+ }
1364
+ .tabs nav a:before {
1365
+ margin-right: 0;
1366
+ }
1367
+ }
1368
+
1369
+
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+ /* SLIDER MODULE SPECIFICS */
1377
+ .czr_slide_module .czr-item-title {
1378
+ padding: 0px 7px;
1379
+ height: 32px;
1380
+ }
1381
+ .czr_slide_module .slide-title, .czr_slide_module .slide-thumb {
1382
+ display: block;
1383
+ height: 32px;
1384
+ line-height: 32px;
1385
+ float: left;
1386
+ }
1387
+ .czr_slide_module .slide-title {
1388
+ padding-left: 5px;
1389
+ }
1390
+ .in-sub-panel #czr-donate-customizer,
1391
+ .in-sub-panel .czr-cta-wrap {
1392
+ left: -450px;
1393
+ height: 0;
1394
+ }
1395
+
1396
+
1397
+ .rtl .in-sub-panel #czr-donate-customizer,
1398
+ .rtl .in-sub-panel .czr-cta-wrap {
1399
+ right: -450px;
1400
+ }
1401
+
1402
+
1403
+ @media screen and (max-width: 1400px) {
1404
+
1405
+ .in-sub-panel #czr-donate-customizer,
1406
+ .in-sub-panel .czr-cta-wrap {
1407
+ left: -380px;
1408
+ }
1409
+
1410
+ .rtl .in-sub-panel #czr-donate-customizer,
1411
+ .rtl .in-sub-panel .czr-cta-wrap {
1412
+ right: -380px;
1413
+ }
1414
+ }
1415
+
1416
+
1417
+
1418
+
1419
+ @media screen and (max-width: 979px) {
1420
+
1421
+
1422
+ .in-sub-panel #czr-donate-customizer,
1423
+ .in-sub-panel .czr-cta-wrap {
1424
+ left: -300px;
1425
+ }
1426
+
1427
+ .rtl .in-sub-panel #czr-donate-customizer,
1428
+ .rtl .in-sub-panel .czr-cta-wrap {
1429
+ right: -300px;
1430
+ }
1431
+ }
1432
+
1433
+ /* at max-width 640px the wp-full-overlay-sidebar becomes 100% */
1434
+ @media screen and (max-width: 640px) {
1435
+ .in-sub-panel .czr-cta-wrap,
1436
+ .in-sub-panel #czr-donate-customizer {
1437
+ left: -100%;
1438
+ }
1439
+
1440
+ .rtl .in-sub-panel #czr-donate-customizer,
1441
+ .rtl .in-sub-panel .czr-cta-wrap {
1442
+ right: -100%;
1443
+ left: auto;
1444
+ }
1445
+ }
1446
+
1447
+ @media screen and (min-width: 980px) {
1448
+ .wp-customizer .expanded #customize-footer-actions {
1449
+ width: 380px;
1450
+ }
1451
+ }
1452
+
1453
+ @media screen and (min-width: 1401px) {
1454
+ .wp-customizer .expanded #customize-footer-actions {
1455
+ width: 440px;
1456
+ }
1457
+ }
1458
+ /*
1459
+ * Selecter v3.1.9 - 2014-09-02
1460
+ * A jQuery plugin for replacing default select elements. Part of the Formstone Library.
1461
+ * http://formstone.it/selecter/
1462
+ *
1463
+ * Copyright 2014 Ben Plum; MIT Licensed
1464
+ */
1465
+ .selecter-element { *left: -999999px; position: absolute; opacity: 0; }
1466
+ .selecter { display: block;float: right;margin: 2px 0;position: relative;width: 100%;z-index: 100; }
1467
+ .selecter .selecter-selected { background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat right center; border: 1px solid #ccc; border-radius: 3px; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 4px 4.6%; position: relative; text-overflow: clip; z-index: 49; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);height: auto;line-height: 18px;width: 90%; }
1468
+
1469
+ .selecter .selecter-options { border: 1px solid #ccc; border-width: 0 1px 1px; background-color: #fefefe; border-radius: 0 0 3px 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); display: none; left: 0; margin: 0; max-height: 260px; overflow: auto; overflow-x: hidden; padding: 0; position: relative; top: 100%; width: 99%; *width: auto; z-index: 50; }
1470
+ .selecter .selecter-group { background: #F9F9F9; border-bottom: 1px solid #e3e3e3; color: #999; display: block; font-size: 11px; padding: 5px 10px 4px; text-transform: uppercase; }
1471
+ .selecter .selecter-item { background: #fff; border-bottom: 1px solid #e3e3e3; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 8px 10px; text-overflow: ellipsis; width: 86%;height: auto;line-height: 14px;padding: 8px 24px 8px 10px;}
1472
+ .selecter .selecter-item.selected { background: #F9F9F9; }
1473
+ .selecter .selecter-item.disabled { color: #999; cursor: default; }
1474
+ .selecter .selecter-item:first-child { border-radius: 0; }
1475
+ .selecter .selecter-item:last-child { border-radius: 0 0 2px 2px; border-bottom: 0; }
1476
+
1477
+ /* CUSTOM FOR CUSTOMIZR */
1478
+ .rtl .selecter .selecter-selected {
1479
+ background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat 4% center;
1480
+ }
1481
+
1482
+ @media screen and (min-width: 980px) {
1483
+ .selecter .selecter-item:hover,
1484
+ .selecter .selecter-item.selected:hover { background-color: #f3f3f3; }
1485
+ .selecter .selecter-item.disabled:hover { background-color: #fff; }
1486
+
1487
+ .selecter:hover .selecter-selected { background-color: #fff; }
1488
+
1489
+ .selecter.disabled .selecter-item:hover { background: #fff; }
1490
+ }
1491
+
1492
+ /* Open */
1493
+ .selecter.open { z-index: 101; }
1494
+ .selecter.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 51; }
1495
+
1496
+ .selecter.open .selecter-selected,
1497
+ .selecter.focus .selecter-selected { background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); }
1498
+
1499
+ /* 'Cover' Positioning */
1500
+ .selecter.cover .selecter-options { border-radius: 3px; border-width: 1px; top: 0; }
1501
+ .selecter.cover .selecter-options .selecter-item.first { border-radius: 3px 3px 0 0; }
1502
+ .selecter.cover.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 49; }
1503
+
1504
+ /* 'Bottom' Positioning */
1505
+ .selecter.bottom .selecter-options { border-width: 1px 1px 0; bottom: 100%; top: auto; }
1506
+ .selecter.bottom .selecter-item:last-child { border: none; }
1507
+ .selecter.bottom.open .selecter-selected { border-radius: 0 0 3px 3px; }
1508
+ .selecter.bottom.open .selecter-options { border-radius: 3px 3px 0 0; }
1509
+
1510
+ /* 'Bottom' + 'Cover' Positioning */
1511
+ .selecter.bottom.cover .selecter-options { bottom: 0; top: auto; }
1512
+ .selecter.bottom.cover.open .selecter-selected { border-radius: 3px; }
1513
+ .selecter.bottom.cover.open .selecter-options { border-radius: 3px; }
1514
+
1515
+ /* Multiple Select */
1516
+ .selecter.multiple .selecter-options { border-radius: 3px; border-width: 1px; box-shadow: none; display: block; position: static; width: 100%; }
1517
+
1518
+ /* 'Disabled' State */
1519
+ .selecter.disabled .selecter-selected { background: #fff; border-color: #eee; color: #ccc; cursor: default; }
1520
+ .selecter.disabled .selecter-options { background: #fff; border-color: #eee; }
1521
+ .selecter.disabled .selecter-group,
1522
+ .selecter.disabled .selecter-item { border-color: #eee; color: #ccc; cursor: default; }
1523
+ .selecter.disabled .selecter-item.selected { background: #fafafa; }
1524
+
1525
+ /* Scroller Support */
1526
+ .selecter .selecter-options.scroller { overflow: hidden; }
1527
+ .selecter .selecter-options.scroller .scroller-content { max-height: 260px; padding: 0; }
1528
+
1529
+ /* Media Queries */
1530
+ @media screen and (max-width: 740px) {
1531
+ .selecter { max-width: 100%; }
1532
+ }
1533
+ @media screen and (max-width: 500px) {
1534
+ .selecter { max-width: 100%; }
1535
+ }
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+
1545
+
1546
+
1547
+ /*
1548
+ * Stepper v3.0.7 - 2014-05-07
1549
+ * A jQuery plugin for cross browser number inputs. Part of the Formstone Library.
1550
+ * http://formstone.it/stepper/
1551
+ *
1552
+ * Copyright 2014 Ben Plum; MIT Licensed
1553
+ */
1554
+ .stepper { border-radius: 3px; margin: 0 0 10px 0; overflow: hidden; position: relative; width: 35%;float: left; clear: both;}
1555
+ .stepper .stepper-input { background: #F9F9F9; border: 1px solid #ccc; border-radius: 3px; color: #333; font-size: 13px; line-height: 1.2; margin: 0; overflow: hidden; padding: 5px 10px 5px!important; width: 100%!important; z-index: 49; -moz-appearance: textfield;max-width: none!important;
1556
+ }
1557
+
1558
+ .stepper .stepper-input::-webkit-inner-spin-button,
1559
+ .stepper .stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
1560
+
1561
+ .stepper .stepper-input:focus { background-color: #fff; }
1562
+ .stepper .stepper-arrow { background: #eee url(img/jquery.fs.stepper-arrows.png) no-repeat; border: 1px solid #ccc; cursor: pointer; display: block; height: 46%; position: absolute; right: 0; text-indent: -99999px; width: 20px; z-index: 50; }
1563
+ .stepper .stepper-arrow.up { background-position: center top; border-bottom: none; top: 0; }
1564
+ .stepper .stepper-arrow.down { background-position: center bottom; bottom: 0; }
1565
+
1566
+ /* CUSTOM FOR CUSTOMIZR */
1567
+ .rtl .stepper .stepper-input {
1568
+ text-align: left;
1569
+ }
1570
+
1571
+ @media screen and (min-width: 740px) {
1572
+ .stepper:hover .stepper-input { background-color: #fff; }
1573
+
1574
+ .stepper .stepper-step:hover { background-color: #F9F9F9; }
1575
+
1576
+ .stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
1577
+ }
1578
+
1579
+ .stepper.disabled .stepper-input { background: #fff; border-color: #eee; color: #ccc; }
1580
+ .stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
1581
+
1582
+
1583
+
1584
+
1585
+
1586
+
1587
+
1588
+
1589
+
1590
+
1591
+
1592
+
1593
+ /* iCheck plugin Flat skin, green
1594
+ ----------------------------------- */
1595
+ .icheckbox_flat-green,
1596
+ .iradio_flat-green {
1597
+ display: inline-block;
1598
+ *display: inline;
1599
+ vertical-align: middle;
1600
+ margin: 0;
1601
+ padding: 0;
1602
+ width: 20px;
1603
+ height: 20px;
1604
+ background: url(img/green.png) no-repeat;
1605
+ border: none;
1606
+ cursor: pointer;
1607
+ top: 4px;
1608
+ float: right;
1609
+ }
1610
+ /* RTL fix of check box position */
1611
+ .rtl [class*=icheckbox_flat-] {
1612
+ float: left;
1613
+ }
1614
+ .icheckbox_flat-green {
1615
+ background-position: 0 0;
1616
+ }
1617
+ .icheckbox_flat-green.checked {
1618
+ background-position: -22px 0;
1619
+ }
1620
+ .icheckbox_flat-green.disabled {
1621
+ background-position: -44px 0;
1622
+ cursor: default;
1623
+ }
1624
+ .icheckbox_flat-green.checked.disabled {
1625
+ background-position: -66px 0;
1626
+ }
1627
+
1628
+ .iradio_flat-green {
1629
+ background-position: -88px 0;
1630
+ }
1631
+ .iradio_flat-green.checked {
1632
+ background-position: -110px 0;
1633
+ }
1634
+ .iradio_flat-green.disabled {
1635
+ background-position: -132px 0;
1636
+ cursor: default;
1637
+ }
1638
+ .iradio_flat-green.checked.disabled {
1639
+ background-position: -154px 0;
1640
+ }
1641
+
1642
+ /* Retina support */
1643
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
1644
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
1645
+ only screen and (-o-min-device-pixel-ratio: 3/2),
1646
+ only screen and (min-device-pixel-ratio: 1.5) {
1647
+ .icheckbox_flat-green,
1648
+ .iradio_flat-green {
1649
+ background-image: url(img/green@2x.png);
1650
+ -webkit-background-size: 176px 22px;
1651
+ background-size: 176px 22px;
1652
+ }
1653
+ }
1654
+
1655
+ /* iCheck plugin Flat skin, grey
1656
+ ----------------------------------- */
1657
+ .icheckbox_flat-grey,
1658
+ .iradio_flat-grey {
1659
+ display: inline-block;
1660
+ *display: inline;
1661
+ vertical-align: middle;
1662
+ margin: 0;
1663
+ padding: 0;
1664
+ width: 20px;
1665
+ height: 20px;
1666
+ background: url(img/grey.png) no-repeat;
1667
+ border: none;
1668
+ cursor: pointer;
1669
+ top: 4px;
1670
+ float: right;
1671
+ }
1672
+
1673
+ .icheckbox_flat-grey {
1674
+ background-position: 0 0;
1675
+ }
1676
+ .icheckbox_flat-grey.checked {
1677
+ background-position: -22px 0;
1678
+ }
1679
+ .icheckbox_flat-grey.disabled {
1680
+ background-position: -44px 0;
1681
+ cursor: default;
1682
+ }
1683
+ .icheckbox_flat-grey.checked.disabled {
1684
+ background-position: -66px 0;
1685
+ }
1686
+
1687
+ .iradio_flat-grey {
1688
+ background-position: -88px 0;
1689
+ }
1690
+ .iradio_flat-grey.checked {
1691
+ background-position: -110px 0;
1692
+ }
1693
+ .iradio_flat-grey.disabled {
1694
+ background-position: -132px 0;
1695
+ cursor: default;
1696
+ }
1697
+ .iradio_flat-grey.checked.disabled {
1698
+ background-position: -154px 0;
1699
+ }
1700
+
1701
+ /* Retina support */
1702
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
1703
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
1704
+ only screen and (-o-min-device-pixel-ratio: 3/2),
1705
+ only screen and (min-device-pixel-ratio: 1.5) {
1706
+ .icheckbox_flat-grey,
1707
+ .iradio_flat-grey {
1708
+ background-image: url(img/grey@2x.png);
1709
+ -webkit-background-size: 176px 22px;
1710
+ background-size: 176px 22px;
1711
+ }
1712
+ }
1713
+
1714
+ .czr-sub-set .icheckbox_flat-green, .iradio_flat-green {
1715
+ float: left;
1716
+ }
1717
+
1718
+
1719
+
1720
+
1721
+
1722
+
1723
+
1724
+
1725
+
1726
+
1727
+
1728
+
1729
+
1730
+
1731
+
1732
+
1733
+ /* SELECT 2 SPECIFICS */
1734
+ body .select2-container {
1735
+ z-index: 1000000;
1736
+ width: 100%!important;
1737
+ }
1738
+
1739
+ .customize-control-czr_layouts .select2-selection--single {
1740
+ height: 33px;
1741
+ }
1742
+ .customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow {
1743
+ height: 30px;
1744
+ }
1745
+ .select2-selection__rendered:focus, .customize-control-czr_layouts .select2-selection--single:focus {
1746
+ outline: none;
1747
+ }
1748
+
1749
+
1750
+
1751
+
1752
+
1753
+ /* SPECIFIC INPUT STYLE */
1754
+ span.select2-results, body .select2-container {
1755
+ font-size: 14px;
1756
+ }
1757
+
1758
+
1759
+ /* for multipe picker */
1760
+ .select2-container--default .select2-selection--multiple {
1761
+ -webkit-border-radius: 0px;
1762
+ -moz-border-radius: 0px;
1763
+ border-radius: 0;
1764
+ width: 99%;
1765
+ min-height: 36px;
1766
+ border: 1px solid #ddd;
1767
+ -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
1768
+ box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
1769
+ }
1770
+ .select2-container--default.select2-container--focus .select2-selection--multiple {
1771
+ border-color: #00a0d2!important;
1772
+ -webkit-box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
1773
+ box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
1774
+ }
1775
+ .select2-results__options li {
1776
+ margin-bottom: 0
1777
+ }
1778
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
1779
+ padding: 2px;
1780
+ font-size: 13px;
1781
+ -webkit-border-radius: 2px;
1782
+ -moz-border-radius: 2px;
1783
+ border-radius: 2px;
1784
+ margin-bottom: 0;
1785
+ }
1786
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
1787
+ background-color: #00a0d2;
1788
+ }
1789
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
1790
+ font-size: 17px;
1791
+ position: relative;
1792
+ top: 2px;
1793
+ color: #23282d;
1794
+ }
1795
+
1796
+ /* Socials Specifics */
1797
+ .customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered {
1798
+ padding: 5px;
1799
+ line-height: 16px;
1800
+ }
1801
+
1802
+
1803
+
1804
+
1805
+
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+ /* WP TEXT EDITOR */
1814
+ #czr-customize-content_editor-pane {
1815
+ border-top: solid 1px #ddd;
1816
+ position: absolute;
1817
+ height: 300px;
1818
+ bottom: -301px;
1819
+ right: 0;
1820
+ left: 0;
1821
+ z-index: 20;
1822
+ background: #f1f1f1;
1823
+ display: block;
1824
+ -webkit-transition: all 0.2s;
1825
+ transition: all 0.2s;
1826
+ visibility: hidden;
1827
+ }
1828
+ body.czr-customize-content_editor-pane-resize #customize-preview,
1829
+ body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane {
1830
+ -webkit-transition: none;
1831
+ transition: none;
1832
+ }
1833
+ body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
1834
+ top: 0;
1835
+ }
1836
+ body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
1837
+ bottom: 0;
1838
+ visibility: inherit;
1839
+ }
1840
+ #czr-customize-content_editor-pane .wp-editor-tools {
1841
+ padding-top: 5px;
1842
+ padding-right: 10px;
1843
+ }
1844
+ #czr-customize-content_editor-pane .wp-media-buttons {
1845
+ padding-left: 5px;
1846
+ }
1847
+ #customize-preview {
1848
+ height: auto;
1849
+ }
1850
+ body.czr-customize-content_editor-pane-open #customize-preview {
1851
+ bottom: 300px;
1852
+ }
1853
+ body.mce-fullscreen #customize-preview {
1854
+ bottom: 0;
1855
+ }
1856
+ body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen {
1857
+ position: relative;
1858
+ left: 0;
1859
+ }
1860
+ #wp-czr-customize-content_editor-container {
1861
+ border-left: 0;
1862
+ }
1863
+ /* vertical resize bar */
1864
+ #czr-customize-content_editor-dragbar {
1865
+ top: 0;
1866
+ cursor: row-resize;
1867
+ display: block;
1868
+ height: 4px;
1869
+ position: absolute;
1870
+ width: 100%;
1871
+ z-index: 21;
1872
+ }
1873
+ body.czr-customize-content_editor-pane-resize #customize-preview:before {
1874
+ top: 0;
1875
+ right: 0;
1876
+ bottom: 0;
1877
+ left: 0;
1878
+ position: absolute;
1879
+ height: 100%;
1880
+ width: 100%;
1881
+ z-index: 999999;
1882
+ }
1883
+ /* @todo Mobile support for rich text editor */
1884
+ .wp-customizer .ui-autocomplete.wplink-autocomplete {
1885
+ z-index: 500110; /* originally 100110, but z-index of .wp-full-overlay is 500000 */
1886
+ }
1887
+ .wp-customizer #wp-link-wrap {
1888
+ z-index: 500105; /* originally 100105, but z-index of .wp-full-overlay is 500000 */
1889
+ }
1890
+ .wp-customizer #wp_editbtns,
1891
+ .wp-customizer #wp_gallerybtns {
1892
+ z-index: 500020; /* originally 100020, but z-index of .wp-full-overlay is 500000 */
1893
+ }
1894
+ .wp-customizer #TB_overlay,
1895
+ .wp-customizer #TB_window {
1896
+ z-index: 500050;
1897
+ }
1898
+ .wp-customizer .mce-panel,
1899
+ .wp-customizer .mce-tooltip {
1900
+ z-index: 500100 !important; /* originally 100100, but z-index of .wp-full-overlay is 500000 */
1901
+ }
1902
+ .czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
1903
+ z-index: 30;
1904
+ }
1905
+ .czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar {
1906
+ bottom: 308px;
1907
+ }
1908
+ .czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar {
1909
+ bottom: 0 !important;
1910
+ }
1911
+ .czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar {
1912
+ -webkit-transition: none;
1913
+ transition: none;
1914
+ }
1915
+ .czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar {
1916
+ bottom: 8px !important;
1917
+ }
1918
+
1919
+
1920
+
1921
+ /* CONTENT PICKER */
1922
+ .czr-sub-set[data-input-type="content_picker"] .customize-control-title {
1923
+ width: 100%;
1924
+ }
1925
+ .czr-sub-set[data-input-type="content_picker"] .czr-input {
1926
+ width: 100%;
1927
+ }
1928
+ .content-item-bar {
1929
+ line-height: 1.5em;
1930
+ }
1931
+
1932
+ .czr-sub-set[data-input-type="content_picker"] span.item-title {
1933
+ display: block;
1934
+ float: left;
1935
+ max-width: 80%;
1936
+ }
1937
+
1938
+ .czr-sub-set[data-input-type="content_picker"] span.item-type {
1939
+ display: inline-block;
1940
+ padding: 0;
1941
+ padding-right: 10px;
1942
+ float: right;
1943
+ }
1944
+
1945
+
1946
+
1947
+
1948
+
1949
+
1950
+
1951
+
1952
+
1953
+
1954
+
1955
+
1956
+
1957
+ /* RANGE SLIDER rangeslider.js - v2.3.0 - https://github.com/andreruffert/rangeslider.js */
1958
+ .rangeslider,
1959
+ .rangeslider__fill {
1960
+ display: block;
1961
+ -moz-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
1962
+ -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
1963
+ box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
1964
+ -moz-border-radius: 10px;
1965
+ -webkit-border-radius: 10px;
1966
+ border-radius: 10px;
1967
+ }
1968
+
1969
+ .rangeslider {
1970
+ background: #e6e6e6;
1971
+ position: relative;
1972
+ }
1973
+
1974
+ .rangeslider--horizontal {
1975
+ height: 20px;
1976
+ width: 100%;
1977
+ }
1978
+
1979
+ .rangeslider--vertical {
1980
+ width: 20px;
1981
+ min-height: 150px;
1982
+ max-height: 100%;
1983
+ }
1984
+
1985
+ .rangeslider--disabled {
1986
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
1987
+ opacity: 0.4;
1988
+ }
1989
+
1990
+ .rangeslider__fill {
1991
+ background: #3b8dbd;
1992
+ position: absolute;
1993
+ }
1994
+ .rangeslider--horizontal .rangeslider__fill {
1995
+ top: 0;
1996
+ height: 100%;
1997
+ }
1998
+ .rangeslider--vertical .rangeslider__fill {
1999
+ bottom: 0;
2000
+ width: 100%;
2001
+ }
2002
+
2003
+ .rangeslider__handle {
2004
+ background: white;
2005
+ border: 1px solid #ccc;
2006
+ cursor: pointer;
2007
+ display: inline-block;
2008
+ width: 40px;
2009
+ height: 40px;
2010
+ position: absolute;
2011
+ background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g');
2012
+ background-size: 100%;
2013
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(0, 0, 0, 0.1)));
2014
+ background-image: -moz-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
2015
+ background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
2016
+ background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
2017
+ -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
2018
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
2019
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
2020
+ -moz-border-radius: 50%;
2021
+ -webkit-border-radius: 50%;
2022
+ border-radius: 50%;
2023
+ line-height: 42px;
2024
+ text-align: center;
2025
+ color: #000000;
2026
+ font-size: 13px;
2027
+ font-weight: bold;
2028
+ }
2029
+
2030
+ .rangeslider__handle:after {
2031
+ content: "";
2032
+ display: block;
2033
+ width: 18px;
2034
+ height: 18px;
2035
+ margin: auto;
2036
+ position: absolute;
2037
+ top: 0;
2038
+ right: 0;
2039
+ bottom: 0;
2040
+ left: 0;
2041
+ background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
2042
+ background-size: 100%;
2043
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.13)), color-stop(100%, rgba(255, 255, 255, 0)));
2044
+ background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
2045
+ background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
2046
+ background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
2047
+ -moz-border-radius: 50%;
2048
+ -webkit-border-radius: 50%;
2049
+ border-radius: 50%;
2050
+ }
2051
+ .rangeslider__handle:active, .rangeslider--active .rangeslider__handle {
2052
+ background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
2053
+ background-size: 100%;
2054
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, rgba(0, 0, 0, 0.12)));
2055
+ background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
2056
+ background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
2057
+ background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
2058
+ }
2059
+ .rangeslider--horizontal .rangeslider__handle {
2060
+ top: -10px;
2061
+ touch-action: pan-y;
2062
+ -ms-touch-action: pan-y;
2063
+ }
2064
+ .rangeslider--vertical .rangeslider__handle {
2065
+ left: -10px;
2066
+ touch-action: pan-x;
2067
+ -ms-touch-action: pan-x;
2068
+ }
2069
+
2070
+ input[type="range"]:focus + .rangeslider .rangeslider__handle {
2071
+ -moz-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
2072
+ -webkit-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
2073
+ box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
2074
+ }
2075
+
2076
+
2077
+ /* IMAGE UPLOADER */
2078
+ .attachment-media-view button {
2079
+ color: #000;
2080
+ padding: 5px 7px;
2081
+ line-height: 1.5em;
2082
+ }/* OVERRIDE WP CUSTOMIZER */
2083
+
2084
+ /* SEKTIONS AND COLUMNS */
2085
+ .czr-sektion-buttons {
2086
+ position: absolute;
2087
+ right: 0;
2088
+ }
2089
+ .czr-column {
2090
+ width: 99%;
2091
+ margin-bottom: 1%;
2092
+ float: left;
2093
+ padding: 2% 0%;
2094
+ border: 2px dotted #aaa;
2095
+ text-align: center;
2096
+ }
2097
+ .czr-column-header {
2098
+ position: relative;
2099
+ }
2100
+ .czr-col-drag-handler {
2101
+ position: absolute;
2102
+ left: 0%;
2103
+ padding: 1%;
2104
+ color: #999;
2105
+ cursor: move;
2106
+ cursor: grab;
2107
+ cursor: -moz-grab;
2108
+ cursor: -webkit-grab;
2109
+ }
2110
+
2111
+
2112
+
2113
+
2114
+ /* MODULES */
2115
+ .czr-module-collection-wrapper {
2116
+ width: 100%;
2117
+ min-height: 5px;
2118
+ float: left;
2119
+ }
2120
+ .czr-single-module {
2121
+ width: 98%;
2122
+ float: left;
2123
+ min-height: 20px;
2124
+ margin: 1px 1%;
2125
+ border: 1px solid #ccc;
2126
+ }
2127
+
2128
+ .czr-single-module textarea {
2129
+ max-width: 100%;
2130
+ }
2131
+
2132
+ /*.czr-single-module .czr-single-item .czr-item-content {
2133
+ display: block;
2134
+ }*/
2135
+
2136
+ #customize-theme-controls .czr-single-module .czr-single-item {
2137
+ width: 96%;
2138
+ }
2139
+
2140
+ .czr-mod-header {
2141
+ background: #eee;
2142
+ float: left;
2143
+ width: 100%;
2144
+ }
2145
+ .czr-mod-title {
2146
+ position: relative;
2147
+ }
2148
+ .czr-mod-title > h4 {
2149
+ float: left;
2150
+ width: 70%;
2151
+ margin: 2% 0;
2152
+ }
2153
+ .czr-mod-drag-handler {
2154
+ position: absolute;
2155
+ left: 0%;
2156
+ padding: 1%;
2157
+ margin: 2% 0;
2158
+ color: #999;
2159
+ cursor: move;
2160
+ cursor: grab;
2161
+ cursor: -moz-grab;
2162
+ cursor: -webkit-grab;
2163
+ }
2164
+ .czr-mod-buttons {
2165
+ float: right;
2166
+ width: 30%;
2167
+ margin: 2% 0;
2168
+ }
2169
+
2170
+ .czr-mod-content {
2171
+ position: absolute;
2172
+ top: 0;
2173
+ left: 100%;
2174
+ float: left;
2175
+ width: 100%;
2176
+ background: #d5e9cc;
2177
+ display: none;
2178
+ }
2179
+
2180
+
2181
+
2182
+
2183
+
2184
+
2185
+
2186
+
2187
+
2188
+ /* EDIT MODULE */
2189
+ .czr-module-open #customize-info,
2190
+ .czr-module-open #customize-theme-controls {
2191
+ left: -200%;
2192
+ }
2193
+ .czr-module-open #customize-theme-controls .accordion-section-content {
2194
+ overflow: visible;
2195
+ }
2196
+ .czr-module-description-container {
2197
+ margin-bottom: 15px
2198
+ }
2199
+ .czr-module-title {
2200
+ /*margin: -12px -12px 0 -12px;*/
2201
+ border-bottom: 1px solid #ddd;
2202
+ background: #fff;
2203
+ }
2204
+ .czr-module-title h3 {
2205
+ padding: 10px 10px 12px 14px;
2206
+ margin: 0;
2207
+ line-height: 21px;
2208
+ color: #555;
2209
+ font-size: 20px;
2210
+ font-weight: 200;
2211
+ line-height: 26px;
2212
+ display: block;
2213
+ overflow: hidden;
2214
+ white-space: nowrap;
2215
+ text-overflow: ellipsis;
2216
+ }
2217
+
2218
+ #customize-controls .czr-module-title span.customize-action {
2219
+ overflow: hidden;
2220
+ white-space: nowrap;
2221
+ text-overflow: ellipsis;
2222
+ font-size: 13px;
2223
+ display: block;
2224
+ font-weight: 400;
2225
+ }
2226
+
2227
+ .czr-module-back {
2228
+ display: block;
2229
+ float: left;
2230
+ width: 48px;
2231
+ height: 74px;
2232
+ padding: 0 24px 0 0;
2233
+ margin: 0;
2234
+ background: #fff;
2235
+ border: none;
2236
+ border-right: 1px solid #ddd;
2237
+ -webkit-box-shadow: none;
2238
+ box-shadow: none;
2239
+ cursor: pointer;
2240
+ -webkit-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
2241
+ -moz-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
2242
+ -ms-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
2243
+ -o-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
2244
+ transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
2245
+ }
2246
+
2247
+ .czr-module-back:hover,
2248
+ .czr-module-back:focus {
2249
+ color: #23282d;
2250
+ background: #f5f5f5;
2251
+ outline: none;
2252
+ -webkit-box-shadow: none;
2253
+ box-shadow: none;
2254
+ }
2255
+
2256
+ .czr-module-back:before {
2257
+ font: normal 20px/72px dashicons;
2258
+ content: "\f341";
2259
+ position: relative;
2260
+ left: 13px;
2261
+ }
2262
+
2263
+
2264
+ .czr-module-back:hover {
2265
+ color: #23282d;
2266
+ background: #f5f5f5;
2267
+ outline: none;
2268
+ -webkit-box-shadow: none;
2269
+ box-shadow: none;
2270
+ }
2271
+
2272
+
2273
+
2274
+
2275
+
2276
+
2277
+
2278
+ /* DRAGULA */
2279
+ .gu-mirror {
2280
+ position: fixed !important;
2281
+ margin: 0 !important;
2282
+ z-index: 999999 !important;
2283
+ opacity: 0.8;
2284
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
2285
+ filter: alpha(opacity=80);
2286
+ }
2287
+
2288
+ .gu-hide {
2289
+ display: none !important;
2290
+ }
2291
+ .gu-unselectable {
2292
+ -webkit-user-select: none !important;
2293
+ -moz-user-select: none !important;
2294
+ -ms-user-select: none !important;
2295
+ user-select: none !important;
2296
+ }
2297
+ .gu-transit {
2298
+ opacity: 0.2;
2299
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
2300
+ filter: alpha(opacity=20);
2301
+ }
2302
+
2303
+ /* CUSTOM FOR DRAGULA */
2304
+ .gu-unselectable .czr-module-collection-wrapper {
2305
+ width: 98%;
2306
+ border: 1px dotted green;
2307
+ background: #d1ffe0;
2308
+ min-height: 31px;
2309
+ }
2310
+ li.czr-single-module.gu-mirror, li.czr-module-candidate.gu-mirror {
2311
+ list-style: none;
2312
+ }
2313
+ /*.czr-dragula-fake-container {
2314
+ display: none;
2315
+ float: left;
2316
+ height: 60px;
2317
+ width: 96%;
2318
+ margin: 2%;
2319
+ border: 2px dotted #aaa;
2320
+ text-align: center;
2321
+ line-height: 30px;
2322
+ }
2323
+ .czr-show-fake-container .czr-dragula-fake-container {
2324
+ display: block;
2325
+ }*/
2326
+
2327
+
2328
+
2329
+
2330
+
2331
+
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+
2340
+ /* MODULES LIST PANEL */
2341
+ #czr-module-list-panel {
2342
+ position: absolute;
2343
+ top: 0;
2344
+ bottom: 0;
2345
+ left: -301px;
2346
+ /*visibility: hidden;*/
2347
+ opacity: 0;
2348
+ overflow-x: hidden;
2349
+ overflow-y: auto;
2350
+ margin: 0;
2351
+ z-index: 4;
2352
+ background: rgba(0, 0, 0, 0.47);
2353
+ -webkit-transition: all .18s;
2354
+ -moz-transition: all .18s;
2355
+ -ms-transition: all .18s;
2356
+ -o-transition: all .18s;
2357
+ transition: all .18s;
2358
+ border-right: 1px solid #ddd;
2359
+ }
2360
+ #czr-module-list-panel, #czr-available-modules-filter {
2361
+ width: 45%;
2362
+ min-width: 300px;
2363
+ }
2364
+ body.czr-adding-module #czr-module-list-panel {
2365
+ left: 0;
2366
+ visibility: visible;
2367
+ opacity: 1;
2368
+ }
2369
+
2370
+ /*body.czr-adding-module .wp-full-overlay-main {
2371
+ left: 300px;
2372
+ }*/
2373
+
2374
+ body.czr-adding-module #customize-preview {
2375
+ opacity: 0.7;
2376
+ }
2377
+
2378
+
2379
+ .add-new-module:before {
2380
+ content: "\f132";
2381
+ display: inline-block;
2382
+ position: relative;
2383
+ left: -2px;
2384
+ top: -1px;
2385
+ font: normal 20px/1 dashicons;
2386
+ vertical-align: middle;
2387
+ -webkit-transition: all .2s;
2388
+ -moz-transition: all .2s;
2389
+ -ms-transition: all .2s;
2390
+ -o-transition: all .2s;
2391
+ transition: all .2s;
2392
+ -webkit-font-smoothing: antialiased;
2393
+ -moz-osx-font-smoothing: grayscale;
2394
+ }
2395
+
2396
+ .czr-column .add-new-module {
2397
+ margin: 1%;
2398
+ float: right;
2399
+ }
2400
+
2401
+ body.czr-adding-module .add-new-module,
2402
+ body.czr-adding-module .add-new-module:hover {
2403
+ background: #eee;
2404
+ border-color: #929793;
2405
+ color: #32373c;
2406
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
2407
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
2408
+ }
2409
+
2410
+ body.czr-adding-module .add-new-module:before {
2411
+ -webkit-transform: rotate(45deg);
2412
+ -ms-transform: rotate(45deg);
2413
+ transform: rotate(45deg);
2414
+ }
2415
+
2416
+
2417
+ #czr-available-modules-list {
2418
+ top: 60px;
2419
+ position: absolute;
2420
+ overflow: auto;
2421
+ bottom: 0;
2422
+ width: 100%;
2423
+ }
2424
+
2425
+ #czr-available-modules-filter {
2426
+ position: fixed;
2427
+ top: 0;
2428
+ z-index: 1;
2429
+ background: rgba(0, 0, 0, 0.47);
2430
+ border-bottom: 1px solid #e5e5e5;
2431
+ }
2432
+
2433
+ /* search field container */
2434
+ #czr-available-modules-filter {
2435
+ padding: 12px 15px;
2436
+ -webkit-box-sizing: border-box;
2437
+ -moz-box-sizing: border-box;
2438
+ box-sizing: border-box;
2439
+ }
2440
+
2441
+ #czr-available-modules-filter input {
2442
+ padding: 6px 10px;
2443
+ width: 100%;
2444
+ }
2445
+
2446
+ #czr-available-modules-list .czr-module-candidate {
2447
+ position: relative;
2448
+ /*padding: 1%;*/
2449
+ border-bottom: 1px solid #e5e5e5;
2450
+ }
2451
+
2452
+ #czr-available-modules-list .czr-module-candidate h3 {
2453
+ color: #fff;
2454
+ padding: 0px;
2455
+ margin: 0;
2456
+ }
2457
+ #czr-available-modules-list .czr-mod-drag-handler {
2458
+ position: relative;
2459
+ left: 0%;
2460
+ padding: 1%;
2461
+ margin: 2% 4%;
2462
+ color: inherit;
2463
+ cursor: move;
2464
+ cursor: grab;
2465
+ cursor: -moz-grab;
2466
+ cursor: -webkit-grab;
2467
+ }
2468
+
2469
+
2470
+
2471
+
2472
+
2473
+
2474
+ /* SEKTION SETTINGS PANEL */
2475
+ #czr-sektion-settings-panel {
2476
+ position: absolute;
2477
+ top: 0;
2478
+ bottom: 0;
2479
+ width: 45%;
2480
+ min-width: 300px;
2481
+ left: -301px;
2482
+ /*visibility: hidden;*/
2483
+ opacity: 0;
2484
+ overflow-x: hidden;
2485
+ overflow-y: auto;
2486
+ margin: 0;
2487
+ z-index: 4;
2488
+ background: rgba(0, 0, 0, 0.47);
2489
+ -webkit-transition: all .18s;
2490
+ -moz-transition: all .18s;
2491
+ -ms-transition: all .18s;
2492
+ -o-transition: all .18s;
2493
+ transition: all .18s;
2494
+ border-right: 1px solid #ddd;
2495
+ color: #fff;
2496
+ }
2497
+ #czr-sektion-settings-panel h3 {
2498
+ color: #fff;
2499
+ }
2500
+ body.czr-editing-sektion #czr-sektion-settings-panel {
2501
+ left: 0;
2502
+ visibility: visible;
2503
+ opacity: 1;
2504
+ }
2505
+
2506
+ /*body.czr-editing-sektion .wp-full-overlay-main {
2507
+ left: 300px;
2508
+ }*/
2509
+
2510
+ body.czr-editing-sektion #customize-preview {
2511
+ opacity: 0.7;
2512
+ }/* WP SAVE BUTTON */
2513
+ .czr-api-dirty input#save {
2514
+ background-color: #FFBD2E;
2515
+ border-color: #d99400;
2516
+ color: black;
2517
+ text-shadow: none;
2518
+ -webkit-box-shadow: none;
2519
+ box-shadow: none;
2520
+ -webkit-transition: background-color .2s ease-in-out;
2521
+ -moz-transition: background-color .2s ease-in-out;
2522
+ -ms-transition: background-color .2s ease-in-out;
2523
+ -o-transition: background-color .2s ease-in-out;
2524
+ transition: background-color .2s ease-in-out;
2525
+ }
2526
+ .czr-api-dirty input#save:hover {
2527
+ background-color: #fcad06;
2528
+ }
2529
+
2530
+
2531
+ /* HEADER AND SCOPE SWITCHER */
2532
+ .czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header {
2533
+ height: 185px;
2534
+ }
2535
+ .czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
2536
+ top: 185px;
2537
+ }
2538
+ .wp-customizer .in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header {
2539
+ padding: 0 15px;
2540
+ }
2541
+ .customize-controls-close {
2542
+ border-bottom: 1px solid #ddd;
2543
+ }
2544
+
2545
+
2546
+
2547
+ .wp-customizer #customize-header-actions {
2548
+ border-bottom: 0px;
2549
+ }
2550
+ .czr-scope-switcher {
2551
+ width: 100%;
2552
+ float: right;
2553
+ position: absolute;
2554
+ left: 0;
2555
+ bottom: 0;
2556
+ overflow: hidden;
2557
+ }
2558
+ .czr-scope-switcher .czr-skp-permanent-title {
2559
+ position: relative;
2560
+ color: #5f5f5f;
2561
+ }
2562
+ #customize-header-actions .czr-scope-switcher .spinner {
2563
+ float: none;
2564
+ display: none;
2565
+ margin: 0px;
2566
+ left: -26px;
2567
+ top: 0px;
2568
+ position: absolute;
2569
+ visibility: visible;
2570
+ }
2571
+ h2.czr-current-skope-title {
2572
+ font-size: 13px;
2573
+ line-height: 21px;
2574
+ margin: 6px 0 4px;
2575
+ text-align: center;
2576
+ height: 63px;
2577
+ font-weight:normal;
2578
+ overflow: hidden;
2579
+ }
2580
+ .czr-main-title {
2581
+ max-height: 24px;
2582
+ overflow: hidden;
2583
+ display: inline-block;
2584
+ text-overflow: ellipsis;
2585
+ white-space: nowrap;
2586
+ width: 95%;
2587
+ }
2588
+ .czr-skope-title {
2589
+ display: block;
2590
+ font-size: 17px;
2591
+ font-style: italic;
2592
+ line-height: 25px;
2593
+ }
2594
+ .czr-toggle-title-notice {
2595
+ cursor: pointer;
2596
+ font-size: 14px;
2597
+ color: #777;
2598
+ }
2599
+ .czr-skope-inherits-from {
2600
+ display: inline-block;
2601
+ opacity: 0;
2602
+ width: 90%;
2603
+ font-size: 12px;
2604
+ line-height: 18px;
2605
+ color: #0029ff;
2606
+ top: -6px;
2607
+ position: relative;
2608
+ }
2609
+ .notice-visible .czr-toggle-title-notice {
2610
+ color: #0029ff;
2611
+ }
2612
+ .notice-visible .czr-skope-inherits-from {
2613
+ opacity: 1;
2614
+ -webkit-transition: opacity .3s ease-in-out;
2615
+ -moz-transition: opacity .3s ease-in-out;
2616
+ -ms-transition: opacity .3s ease-in-out;
2617
+ -o-transition: opacity .3s ease-in-out;
2618
+ transition: opacity .3s ease-in-out;
2619
+ }
2620
+ .czr-scope-switcher .button {
2621
+ float: left;
2622
+ width: 40%;
2623
+ text-align: center;
2624
+ margin: 0 2%;
2625
+ opacity: 0.7;
2626
+ -webkit-transition: opacity .3s ease-in-out;
2627
+ -moz-transition: opacity .3s ease-in-out;
2628
+ -ms-transition: opacity .3s ease-in-out;
2629
+ -o-transition: opacity .3s ease-in-out;
2630
+ transition: opacity .3s ease-in-out;
2631
+ }
2632
+ .czr-scope-switcher .button.active {
2633
+ font-weight: bold;
2634
+ opacity: 1;
2635
+ }
2636
+ .czr-scope-switcher .active, .czr-scope-switcher .czr-scope:hover {
2637
+ opacity: 1;
2638
+ /*border-bottom: 2px solid #52ff3f;*/
2639
+ }
2640
+ .czr-skopes-wrapper {
2641
+ overflow: hidden;
2642
+ position: relative;
2643
+ }
2644
+ .czr-scope.active:before {
2645
+ height: 101%;
2646
+ float: left;
2647
+ position: absolute;
2648
+ z-index: 1;
2649
+ content: '';
2650
+ -webkit-box-shadow : -4px 0px 15px 0px rgba(119, 119, 119, 0.58);
2651
+ box-shadow: -4px 0px 15px 0px rgba(119, 119, 119, 0.58);
2652
+ top: 0;
2653
+ }
2654
+ .czr-scope-switcher .active:after {
2655
+ content: '';
2656
+ height: 100%;
2657
+ position: absolute;
2658
+ -webkit-box-shadow : 4px 0px 15px 0px rgba(119, 119, 119, 0.58);
2659
+ box-shadow: 4px 0px 15px 0px rgba(119, 119, 119, 0.58);
2660
+ top: 0;
2661
+ z-index: 3;
2662
+ }
2663
+
2664
+ .czr-skopes-wrapper .active-collection.local:after {
2665
+ right:0;
2666
+ }
2667
+ .czr-scope-switcher .czr-scope:last-child:after {
2668
+ -webkit-box-shadow :none;
2669
+ box-shadow: none;
2670
+ right: 0;
2671
+ }
2672
+ .czr-scope-switcher .czr-scope:first-child:after {
2673
+ left: 0;
2674
+ }
2675
+ .czr-scope {
2676
+ float: left;
2677
+ width: 30.5%;
2678
+ /*margin-left: 1.5%;*/
2679
+ background: #fff;
2680
+ /*border-bottom: 2px solid #cccccc;*/
2681
+ border-top: 1px solid #cccccc;
2682
+ /*-webkit-border-radius: 3px;
2683
+ border-radius: 3px;*/
2684
+ overflow: hidden;
2685
+ opacity: 0.65;
2686
+ -webkit-transition: opacity .3s ease-in-out;
2687
+ -moz-transition: opacity .3s ease-in-out;
2688
+ -ms-transition: opacity .3s ease-in-out;
2689
+ -o-transition: opacity .3s ease-in-out;
2690
+ transition: opacity .3s ease-in-out;
2691
+ }
2692
+
2693
+ /* LAYOUTS */
2694
+ .czr-scope-switcher .width-100, .czr-scope.width-100.active:before, .czr-scope.width-100.active:after { width: 100%; }
2695
+ .czr-scope-switcher .width-50, .czr-scope.width-50.active:before, .czr-scope.width-50.active:after { width: 50%; }
2696
+ .czr-scope-switcher .width-33, .czr-scope.width-33.active:before, .czr-scope.width-33.active:after { width: 33.33%; }
2697
+ .czr-scope-switcher .width-25, .czr-scope.width-25.active:before, .czr-scope.width-25.active:after { width: 25%; }
2698
+
2699
+ .czr-scope-header, .czr-scope-footer {
2700
+ width: 100%;
2701
+ min-height: 16px;
2702
+ position: relative;
2703
+ z-index: 5;
2704
+ }
2705
+ .inactive .czr-scope-footer:after {
2706
+ content: '';
2707
+ width: 100%;
2708
+ position: absolute;
2709
+ height: 5px;
2710
+ bottom: -7px;
2711
+ left: 0;
2712
+ -webkit-box-shadow : 0px 0px 13px 4px rgba(119, 119, 119, 0.85);
2713
+ box-shadow: 0px 0px 13px 4px rgba(119, 119, 119, 0.85);
2714
+ }
2715
+ .czr-scope-content {
2716
+ height: 35px;
2717
+ padding: 0 3%;
2718
+ width: 94%;
2719
+ line-height: 35px;
2720
+ text-align: center;
2721
+ clear: both;
2722
+ color: #000;
2723
+ overflow: hidden;
2724
+ }
2725
+ .czr-scope-content h4 {
2726
+ margin: 0;
2727
+ display: inline-block;
2728
+ text-align: center;
2729
+ font-size: 14px;
2730
+ line-height: 18px;
2731
+ font-weight: normal;
2732
+ text-shadow: 1px 1px 0px #dedede;
2733
+ }
2734
+ .czr-scope .fa {
2735
+ font-size: 10px;
2736
+ padding: 2%;
2737
+ color: #585858;
2738
+ cursor: pointer;
2739
+ -webkit-transition: opacity .3s ease-in-out;
2740
+ -moz-transition: opacity .3s ease-in-out;
2741
+ -ms-transition: opacity .3s ease-in-out;
2742
+ -o-transition: opacity .3s ease-in-out;
2743
+ transition: opacity .3s ease-in-out;
2744
+ }
2745
+ .czr-scope .czr-scope-footer .info {
2746
+ cursor: inherit;
2747
+ }
2748
+ .czr-scope-header .czr-scope-switch {
2749
+ font-size: 22px;
2750
+ padding: 0 2px 0 0;
2751
+ text-shadow: 1px 1px 2px white;
2752
+ }
2753
+ .czr-skp-switch-link {
2754
+ cursor: pointer;
2755
+ }
2756
+ .czr-skp-switch-link:hover {
2757
+ text-decoration: underline;
2758
+ }
2759
+ .czr-pull-left {
2760
+ float: left;
2761
+ }
2762
+ .czr-pull-right {
2763
+ float: right;
2764
+ }
2765
+
2766
+
2767
+ /* DIALOG BOX REACTIONS */
2768
+ .active .czr-scope-switch {
2769
+ color: #52ff3f;
2770
+ cursor:inherit;
2771
+ }
2772
+
2773
+ .czr-scope .czr-scope-reset {
2774
+ /*opacity: 0;*/
2775
+ display: none;
2776
+ font-size: 13px;
2777
+ text-shadow: 1px 1px 0px #dedede;
2778
+
2779
+ }
2780
+ .has-db-val .czr-scope-reset {
2781
+ color: #00a0d2;
2782
+ }
2783
+ .dirty .czr-scope-reset {
2784
+ color: #FFBD2E!important;
2785
+ }
2786
+
2787
+ .is_winner .czr-scope-winner {
2788
+ color: #52ff3f;
2789
+ font-size: 14px;
2790
+ position: absolute;
2791
+ bottom: 2px;
2792
+ left: 2px;
2793
+ }
2794
+
2795
+ .czr-scope-force {
2796
+ display: none;
2797
+ }
2798
+
2799
+ /* Underline skope switch text in control notices and in the main skope switcher title */
2800
+ .czr-skope-notice .czr-skope-switch, .czr-scope-switcher .czr-skope-switch {
2801
+ cursor: pointer;
2802
+ text-decoration: underline;
2803
+ }
2804
+
2805
+ /**************************************
2806
+ ******* RESET */
2807
+ /* RESET COMMONS */
2808
+ .czr-spinner-wrapper {
2809
+ visibility: hidden;
2810
+ }
2811
+ .czr-reset-success, .czr-reset-fail {
2812
+ display: none;
2813
+ }
2814
+ .czr-spinner {
2815
+ background: url(img/czr-spinner.gif) no-repeat;
2816
+ -webkit-background-size: 32px 32px;
2817
+ background-size: 32px 32px;
2818
+ display: inline-block;
2819
+ float: right;
2820
+ vertical-align: middle;
2821
+ opacity: 0.7;
2822
+ filter: alpha(opacity=70);
2823
+ width: 32px;
2824
+ height: 32px;
2825
+ margin: 4px 10px 0;
2826
+ }
2827
+
2828
+
2829
+ /* SINGLE CONTROL RESET */
2830
+ .customize-control span.customize-control-title:first-child {
2831
+ padding-left: 16px;
2832
+ -webkit-transition: left, right, 0.15s ease-in-out;
2833
+ -moz-transition: left, right, 0.15s ease-in-out;
2834
+ -ms-transition: left, right, 0.15s ease-in-out;
2835
+ -o-transition: left, right, 0.15s ease-in-out;
2836
+ transition: left, right, 0.15s ease-in-out;
2837
+ position: relative;
2838
+ }
2839
+
2840
+ .wp-customizer .customize-control.czr-not-skoped .customize-control-title {
2841
+ padding-left: 0px;
2842
+ }
2843
+ .czr-setting-reset {
2844
+ color: #eee;
2845
+ -webkit-transition: color 0.4s;
2846
+ transition: color 0.4s;
2847
+ position: absolute;
2848
+ left: 0px;
2849
+ line-height: 21px;
2850
+ display: none;
2851
+ text-shadow: 1px 1px 0px #a0a0a0;
2852
+ }
2853
+ .czr-global-skope-level .is-wp-authorized-setting.has-db-val .czr-setting-reset {
2854
+ color: #eee;
2855
+ }
2856
+ .has-db-val .czr-setting-reset {
2857
+ color: #00a0d2;
2858
+ }
2859
+ .is-dirty .czr-setting-reset {
2860
+ color: #FFBD2E!important;
2861
+ }
2862
+ .czr-ctrl-reset-warning .czr-spinner {
2863
+ display: none;
2864
+ }
2865
+ .czr-resetting-control .czr-ctrl-reset-warning .czr-spinner {
2866
+ display: block;
2867
+ }
2868
+
2869
+ /* RESET ALERTS */
2870
+ .is-dirty .czr-remove-alert-wrapper {
2871
+ background-color: rgba(255, 189, 46, 0.54)!important;
2872
+ border: 1px solid #FFBD2E!important;
2873
+ text-shadow:none;
2874
+ color: #000;
2875
+ }
2876
+
2877
+ .has-db-val .czr-remove-alert-wrapper {
2878
+ background-color: rgba(0, 160, 210, 0.45);
2879
+ border: 1px solid #00a0d2;
2880
+ text-shadow:none;
2881
+ color: #000;
2882
+ }
2883
+
2884
+ .czr-resetting-control .czr-remove-alert-wrapper {
2885
+ -webkit-transition: all, 0.3s ease-in-out;
2886
+ -moz-transition: all, 0.3s ease-in-out;
2887
+ -ms-transition: all, 0.3s ease-in-out;
2888
+ -o-transition: all, 0.3s ease-in-out;
2889
+ transition: all, 0.3s ease-in-out;
2890
+ }
2891
+
2892
+ /* SKOPE LOADING */
2893
+ body.czr-skop-loading #czr-skope-pane {
2894
+ top : 0;
2895
+ }
2896
+ body.czr-skop-loading #customize-preview {
2897
+ opacity: 0!important;
2898
+ }
2899
+
2900
+ /* Pure CSS loader */
2901
+ @-webkit-keyframes czr-mr-loader {
2902
+ 0% {
2903
+ -webkit-transform: scale(0.1);
2904
+ transform: scale(0.1);
2905
+ opacity: 1; }
2906
+
2907
+ 70% {
2908
+ -webkit-transform: scale(1);
2909
+ transform: scale(1);
2910
+ opacity: 0.7; }
2911
+
2912
+ 100% {
2913
+ opacity: 0.0; }
2914
+ }
2915
+
2916
+ @keyframes czr-mr-loader {
2917
+ 0% {
2918
+ -webkit-transform: scale(0.1);
2919
+ transform: scale(0.1);
2920
+ opacity: 1; }
2921
+
2922
+ 70% {
2923
+ -webkit-transform: scale(1);
2924
+ transform: scale(1);
2925
+ opacity: 0.7; }
2926
+
2927
+ 100% {
2928
+ opacity: 0.0; }
2929
+ }
2930
+ /*.czr-css-loader {
2931
+ display: none;
2932
+ }*/
2933
+ .czr-css-loader {
2934
+ width: 50px;
2935
+ height: 50px;
2936
+ position: absolute;
2937
+ -webkit-transform: translate3d(-50%, -50%, 0);
2938
+ -ms-transform: translate3d(-50%, -50%, 0);
2939
+ transform: translate3d(-50%, -50%, 0);
2940
+ top: 50%;
2941
+ left: 50%;
2942
+ display: block;
2943
+ }
2944
+ .czr-mr-loader > div:nth-child(0) {
2945
+ -webkit-animation-delay: -0.8s;
2946
+ animation-delay: -0.8s;
2947
+ }
2948
+ .czr-mr-loader > div:nth-child(1) {
2949
+ -webkit-animation-delay: -0.6s;
2950
+ animation-delay: -0.6s;
2951
+ }
2952
+ .czr-mr-loader > div:nth-child(2) {
2953
+ -webkit-animation-delay: -0.4s;
2954
+ animation-delay: -0.4s;
2955
+ }
2956
+ .czr-mr-loader > div:nth-child(3) {
2957
+ -webkit-animation-delay: -0.2s;
2958
+ animation-delay: -0.2s;
2959
+ }
2960
+ .czr-mr-loader > div {
2961
+ -webkit-animation-fill-mode: both;
2962
+ animation-fill-mode: both;
2963
+ position: absolute;
2964
+ top: -4%;
2965
+ left: -4%;
2966
+ width: 100%;
2967
+ height: 100%;
2968
+ border-radius: 100%;
2969
+ border: 2px solid #fff;
2970
+ -webkit-animation: czr-mr-loader 1.25s 0s infinite cubic-bezier(.21, .53, .56, .8);
2971
+ animation: czr-mr-loader 1.25s 0s infinite cubic-bezier(.21, .53, .56, .8);
2972
+ }
2973
+
2974
+
2975
+
2976
+ /* TOP NOTE ( for Welcome, etc ) */
2977
+ #czr-top-note {
2978
+ position: absolute;
2979
+ text-align: center;
2980
+ padding: 2%;
2981
+ top : -100%;
2982
+ right: 0;
2983
+ left: 0;
2984
+ z-index: 20;
2985
+ color: #fff;
2986
+ display: block;
2987
+ -webkit-transition: all 0.3s ease-in-out;
2988
+ -moz-transition: all, 0.3s ease-in-out;
2989
+ -ms-transition: all, 0.3s ease-in-out;
2990
+ -o-transition: all, 0.3s ease-in-out;
2991
+ transition: all 0.3s ease-in-out;
2992
+ visibility: hidden;
2993
+ background: rgba(0, 0, 0, 0.80);
2994
+ }
2995
+ #czr-top-note h2 {
2996
+ color: #fff;
2997
+ font-size: 25px
2998
+ }
2999
+ #czr-top-note a {
3000
+ color: #fff;
3001
+ }
3002
+ #czr-top-note .czr-top-note-close {
3003
+ position: absolute;
3004
+ top: 10px;
3005
+ right: 25px;
3006
+ font-size: 31px;
3007
+ cursor: pointer;
3008
+ }
3009
+
3010
+ #czr-top-note .fa-arrow-left {
3011
+ position: absolute;
3012
+ bottom: 10px;
3013
+ left: 25px;
3014
+ font-size: 40px;
3015
+ }
3016
+ #czr-top-note .czr-note-content {
3017
+ display: inline-block;
3018
+ line-height: 20px;
3019
+ width: 80%;
3020
+ }
3021
+ #czr-top-note .czr-note-message {
3022
+ font-size: 16px;
3023
+ line-height: 20px;
3024
+ }
3025
+ body.czr-top-note-open #czr-top-note {
3026
+ top: 0;
3027
+ visibility: inherit;
3028
+ }
3029
+
3030
+
3031
+
3032
+
3033
+ /* SKOPE PANE */
3034
+ /* WP TEXT EDITOR */
3035
+ #czr-skope-pane {
3036
+ position: absolute;
3037
+ min-height: 100%;
3038
+ text-align: center;
3039
+ padding: 2%;
3040
+ top : -100%;
3041
+ right: 0;
3042
+ left: 0;
3043
+ z-index: 20;
3044
+ color: #fff;
3045
+ display: block;
3046
+ -webkit-transition: all 0.3s ease-in-out;
3047
+ -moz-transition: all, 0.3s ease-in-out;
3048
+ -ms-transition: all, 0.3s ease-in-out;
3049
+ -o-transition: all, 0.3s ease-in-out;
3050
+ transition: all 0.3s ease-in-out;
3051
+ visibility: hidden;
3052
+ }
3053
+
3054
+ /* RESET */
3055
+ #czr-skope-pane.dirty-reset {
3056
+ background: rgba(252, 173, 6, 0.23);
3057
+ }
3058
+ #czr-skope-pane.db-reset {
3059
+ background: rgba(0, 160, 210, 0.3);
3060
+ }
3061
+ .czr-reset-content {
3062
+ display: inline-block;
3063
+ line-height: 20px;
3064
+ width: 80%;
3065
+ padding: 5%;
3066
+ background: rgba(0, 0, 0, 0.63);
3067
+ }
3068
+
3069
+ #czr-skope-pane h2 {
3070
+ color: #fff;
3071
+ line-height: 1.5em;
3072
+ }
3073
+ body.czr-skope-pane-open #czr-skope-pane {
3074
+ top: 0;
3075
+ visibility: inherit;
3076
+ min-height: 100%;
3077
+ }
3078
+
3079
+ body.czr-skope-pane-open #customize-preview, body.czr-skope-pane-open .wp-full-overlay-sidebar {
3080
+ opacity: 0.5;
3081
+ }
3082
+
3083
+ body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper {
3084
+ visibility: visible;
3085
+ }
3086
+
3087
+ .czr-skope-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
3088
+ z-index: 30;
3089
+ }
3090
+ .czr-skope-pane-open .wp-full-overlay.expanded .collapse-sidebar {
3091
+ bottom: 0 !important;
3092
+ }
3093
+
3094
+
3095
+ /* CONTROL INFOS */
3096
+ .customize-control .czr-skope-notice {
3097
+ color: #0029ff;
3098
+ }
3099
+
3100
+ .czr-toggle-notice {
3101
+ color: #95a5a6;
3102
+ text-shadow: 1px 1px 0px white;
3103
+ -webkit-transition: color 0.4s;
3104
+ transition: color 0.4s;
3105
+ position: absolute;
3106
+ padding-left: 3px;
3107
+ line-height: 21px;
3108
+ display: none;
3109
+ }
3110
+ .czr-notice-visible .czr-toggle-notice, .czr-toggle-notice:hover {
3111
+ color: #0029ff;
3112
+ }
3113
+
3114
+
3115
+
3116
+ /* Error Notification */
3117
+ .wp-full-overlay-header, .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
3118
+ -webkit-transition: height, top, .4s ease-in-out;
3119
+ -moz-transition: height, top, .4s ease-in-out;
3120
+ -ms-transition: height, top, .4s ease-in-out;
3121
+ -o-transition: height, top, .4s ease-in-out;
3122
+ transition: height, top, .4s ease-in-out;
3123
+ }
3124
+ .czr-server-notice {
3125
+ width: calc(96% - 2px);
3126
+ bottom: 75px;
3127
+ text-align: center;
3128
+ background: rgba(0, 156, 0, 0.18);
3129
+ color: #000;
3130
+ display: none;
3131
+ position: absolute;
3132
+ font-size: 12px;
3133
+ line-height: 13px;
3134
+ padding: 2%;
3135
+ overflow: hidden;
3136
+ }
3137
+ .czr-server-notice.czr-server-error {
3138
+ color: #000;
3139
+ background: rgba(255, 0, 0, 0.24);
3140
+ }
3141
+
3142
+ .czr-dismiss-notification {
3143
+ position: absolute;
3144
+ right: 5px;
3145
+ top: 5px;
3146
+ cursor: pointer;
3147
+ }
3148
+
3149
+ /*ickeck specifics */
3150
+ .wp-customizer .icheckbox_flat-grey, .wp-customizer .iradio_flat-grey {
3151
+ border: 1px solid white;
3152
+ -webkit-border-radius: 5px;
3153
+ border-radius: 5px;
3154
+ background-color : white;
3155
+ }
3156
+
3157
+ /* SKOPE PAINTING */
3158
+ .czr-painted {
3159
+ -webkit-transition: background .3s ease-in-out!important;
3160
+ -moz-transition: background .3s ease-in-out!important;
3161
+ -ms-transition: background .3s ease-in-out!important;
3162
+ -o-transition: background .3s ease-in-out!important;
3163
+ transition: background .3s ease-in-out!important;
3164
+ }
3165
+
3166
+
addons/assets/czr/css/czr-control-base.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:440px}i.czr-notice,span.czr-notice{display:block;clear:both}.tabs nav ul,li.czr-module-candidate.gu-mirror,li.czr-single-module.gu-mirror{list-style:none}.wp-customizer a{color:#000}.wp-customizer a:focus,.wp-customizer a:hover{color:#0073aa}.wp-customizer .wp-full-overlay.expanded{margin-left:440px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-440px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-440px}.accordion-sub-container.control-panel-content{left:440px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:440px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-440px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-440px}.rtl .accordion-sub-container.control-panel-content{right:440px}.customize-section-description-container+#customize-control-custom_css:last-child{margin:0;width:100%}li#customize-control-custom_css textarea{font-size:13px;background:#394143;color:#95ff0c;min-height:300px}@media screen and (max-width:1400px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:380px}.wp-customizer .wp-full-overlay.expanded{margin-left:380px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-380px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-380px}.accordion-sub-container.control-panel-content{left:380px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:380px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-380px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-380px}.rtl .accordion-sub-container.control-panel-content{right:380px}}@media screen and (max-width:979px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:300px}.wp-customizer .wp-full-overlay.expanded{margin-left:300px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-300px}.accordion-sub-container.control-panel-content{left:300px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:300px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-300px}.rtl .accordion-sub-container.control-panel-content{right:300px}}@media screen and (max-width:640px){.wp-customizer .customize-controls-preview-toggle{height:46px;border-bottom:1px solid #ddd;left:87px}.wp-customizer .wp-full-overlay.expanded{margin-left:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-100%}.accordion-sub-container.control-panel-content{left:100%}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title,.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}.rtl .accordion-sub-container.control-panel-content{right:100%}}.wp-customizer .control-section.control-panel .accordion-section-title .panel-title{font-size:24px;font-weight:inherit;line-height:30px}.wp-core-ui h3{color:#555}.accordion-section-title:after,.control-section.control-panel>.accordion-section-title:after,.handlediv,.item-edit,.sidebar-name-arrow,.widget-action,.wp-customizer #available-menu-items .menu-item-handle:hover .item-add,.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus,.wp-customizer #customize-controls .customize-info .customize-help-toggle:hover,.wp-customizer #customize-controls .customize-info.open .customize-help-toggle,.wp-customizer .menu-item-handle:hover,.wp-customizer .menu-item-handle:hover .item-edit,.wp-customizer .menu-item-handle:hover .item-type{color:#00a0d2}.accordion-section-content{padding:10px 10px 15px 20px}.customize-control-title{line-height:19px}.wp-customizer #customize-theme-controls .accordion-section-content{background:#fff}.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus:before,.wp-customizer .customize-screen-options-toggle:focus:before{-webkit-box-shadow:0 0 0 1px #00a0d2;box-shadow:0 0 0 1px #00a0d2;-webkit-border-radius:100%;border-radius:100%}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#00a0d2!important}.customize-control input[type=text]{line-height:23px}li[id*=customize-control-]{padding:2%;width:96%;border:1px solid rgba(221,221,221,.43);box-shadow:1px 0 2px 0 rgba(204,204,204,.45);-webkit-box-shadow:1px 0 2px 0 rgba(204,204,204,.45);margin:8px 0}.control-section .accordion-section-content{overflow-y:auto}.wp-customizer .control-section h3.accordion-section-title{padding:10px 25px 11px 14px}.wp-customizer #customize-controls h3{font-size:15px;font-weight:400}.control-section .accordion-section-title:after{top:7px}.control-section.control-panel .accordion-section-title:after{top:11px;-webkit-transition:right .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:right .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:right .3s ease-in-out,opacity .3s ease-in-out;-o-transition:right .3s ease-in-out,opacity .3s ease-in-out;transition:right .3s ease-in-out,opacity .3s ease-in-out;right:10px;opacity:.7}.rtl .control-section.control-panel .accordion-section-title:after{-webkit-transition:left .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:left .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:left .3s ease-in-out,opacity .3s ease-in-out;-o-transition:left .3s ease-in-out,opacity .3s ease-in-out;transition:left .3s ease-in-out,opacity .3s ease-in-out;left:10px;right:initial}#customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{right:8px;opacity:1;color:#666!important}.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{left:6px;right:initial}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after,.control-section.control-panel>.accordion-section-title:after{background:0 0!important;border:none!important}#customize-theme-controls h3.accordion-section-title{-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.customize-control-checkbox label,.customize-control-nav_menu_auto_add label,.customize-control-radio label{line-height:16px;margin-left:0}input::-webkit-input-placeholder{color:#9A9A9A;font-style:italic}input:-moz-placeholder{color:#9A9A9A;font-style:italic}input::-moz-placeholder{color:#9A9A9A;font-style:italic}input:-ms-input-placeholder{color:#9A9A9A;font-style:italic}.czr-customizr-title{text-transform:uppercase;margin:1em 0 5px;font-size:15px!important;border-bottom:1px dotted #00a0d2;padding-bottom:5px;text-align:center}h3.czr-customizr-title::before{content:'\00b7';padding-right:3px}h3.czr-customizr-title::after{content:'\00b7';padding-left:3px}.czr-after-button{border-color:#fff;margin-top:15px}.czr-emphasize{line-height:1.2em;color:#2E2E2E}span.czr-notice{color:#313131;font-size:12px;font-style:italic;line-height:18px}.czr-customizer-separator-invisible{border:none;margin-top:15px}.czr-skin-gen-label{float:left}.czr-skin-gen-color-picker{float:right}.czr-number-label{float:left}.czr-number-input{float:right}.czr-check-label{float:left;max-width:85%}.rtl .czr-check-label{float:right}input[type=checkbox],input[type=radio]{float:right;min-height:18px}.czr-font-select{float:left}li#customize-control-tc_theme_options-tc_custom_css textarea{font-size:14px;background:#394143;color:#E2E728;min-height:300px}.customize-control .czr-navigate-to-post-list{color:#00a0d2;font-weight:700;float:left;clear:both;width:100%;margin-bottom:8px}.czr-sub-control{padding-left:13%;max-width:87%;position:relative}.czr-sub-control:before{content:'';height:116%;background:#00a0d2;width:2%;position:absolute;left:7%}.customize-control-tc_cropped_image .upload-button{float:right}.customize-control-tc_cropped_image .remove-button{float:left;margin-right:3px}.customize-control-tc_cropped_image .actions{margin-bottom:32px}.customize-control-tc_cropped_image .current{margin-bottom:8px}.customize-control-tc_cropped_image .remove-button,.customize-control-tc_cropped_image .upload-button{white-space:normal;width:48%;height:auto}.customize-control-tc_cropped_image .current .container{min-height:40px;overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image .inner{line-height:20px;top:10px}.rtl .customize-control-tc_cropped_image .upload-button{float:left}.rtl .customize-control-tc_cropped_image .remove-button{float:right;margin-left:3px}.czr-layout-img{height:26px;padding-top:2px;border:1px solid #FFF}.czr-layout-title{padding:0 0 18px 12px;display:inline-block;line-height:0;vertical-align:middle}.customize-control-czr_multi_input{width:96%;border:1px solid #ccc;padding:2%}.czr-multi-input-wrapper{width:95%;padding:0 0 0 5%}.czr-multi-input-wrapper [data-input-type=color] .czr-input{float:left;clear:both}#customize-theme-controls #accordion-panel-czr-footer-panel{border-bottom:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{margin-top:10px}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-hu-header-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{border-top:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-general-panel,#customize-theme-controls #accordion-section-static_front_page{margin-bottom:10px}#customize-header-actions .customize-controls-close{left:45px}.customize-controls-close,.customize-controls-home{top:-1px}.customize-controls-home{display:block;position:absolute;left:0;width:45px;height:41px;padding:0 2px 0 0;background:#eee;border:none;border-top:4px solid #eee;border-right:1px solid #ddd;border-bottom:1px solid #ddd;color:#444;text-align:left;cursor:pointer;text-decoration:none;-webkit-transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;transition:color .1s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.czr-add-success,.czr-location-alert,.tabs nav,.tabs nav ul li{text-align:center}.customize-controls-home:before{font-size:17px;line-height:45px;position:relative;top:-4px;left:15px}.customize-controls-home:hover{background:#fff;color:#0073aa;border-top-color:#0073aa;outline:0;-webkit-box-shadow:none;box-shadow:none}.rtl.wp-customizer #customize-header-actions .customize-controls-close{right:45px;left:auto}.rtl.wp-customizer .customize-controls-home{left:auto;right:0;border-right:0;border-left:1px solid #ddd}.control-panel-content .hu-menu-notice{margin-left:3%}span.czr-panel-subtitle{display:block;font-size:12px;font-style:italic}.czr-open-pre-add-new{display:block;float:left;margin:2% 2% 0;width:99%;padding:2%;background:#3b8dbd;opacity:1;color:#fff;font-size:16px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-open-pre-add-new.active{background:#646464;opacity:.5;border-radius:3px 3px 0 0}.czr-adding-new .czr-items-wrapper,.czr-items-wrapper .inactive{opacity:.6}.czr-single-item{padding:0;border:1px solid #ccc;margin:1% 0 0 2%;float:left;width:98%;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-single-item .czr-item-content input,.czr-sub-set{margin-bottom:0}#customize-theme-controls .czr-single-item.open{border:1px solid #dedede}#customize-theme-controls .mono-item-mod .czr-single-item{border:1px solid #ccc}.czr-single-item .czr-item-content,.czr-single-item .czr-item-header{padding:1%}.czr-items-wrapper .czr-single-item .czr-builtin-model{background:#E1DFDF;color:#555}.czr-item-sort-handle{cursor:move}.czr-single-item .czr-item-header{position:relative;background:#dfdfdf;color:#fff;float:left;width:98%;-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.czr_widget_areas_module .czr-single-item .czr-custom-model{background:#3b8dbd}. .czr-single-item .czr-custom-model:hover{background:#aaa}.czr-items-wrapper .czr-single-item .czr-builtin-model:hover,.czr-single-item .czr-item-header:hover{background:#ccc}.czr-move-icon{position:absolute;top:-2px;left:3px;font-size:10px;color:#999}.czr-item-title{float:left;font-size:17px;color:#000;padding:7px;width:67%}.czr-inactive-alert{font-size:12px;font-style:italic}.czr_widget_areas_module .czr-item-title{color:#fff}.czr-builtin-model .czr-item-title{color:#23282d}.czr-item-title h4{margin:0}.czr-item-title .fa:before{padding-right:2px}.czr-item-btns{float:right}.czr-item-btns a{font-size:17px;padding:7px 5px;color:#777;-webkit-transition:color .1s ease-in-out;-moz-transition:color .1s ease-in-out;-ms-transition:color .1s ease-in-out;-o-transition:color .1s ease-in-out;transition:color .1s ease-in-out}.czr-item-btns a:active,.czr-item-btns a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.czr_widget_areas_module .czr-item-btns a{color:#fff}.czr-builtin-model .czr-item-btns a{color:#555}.czr-builtin-model .czr-item-btns .czr-edit-view.active,.czr-builtin-model .czr-item-btns .czr-edit-view:hover,.czr-item-btns .czr-edit-view.active,.czr-item-btns .czr-edit-view:hover{color:#00a0d2}.czr_widget_areas_module .czr-edit-view:hover,.czr_widget_areas_module .czr-item-btns .czr-edit-view.active{color:#000}.czr_widget_areas_module .czr-builtin-model .czr-edit-view.active,.czr_widget_areas_module .czr-builtin-model .czr-edit-view:hover{color:#00a0d2}.czr-item-btns .czr-display-alert.active,.czr-item-btns .czr-display-alert:hover{color:#23282d}.czr-single-item .czr-item-content{display:none;background:rgba(238,238,238,.5);clear:both;width:96%;padding:2%}.czr-sub-set{display:block;float:left;width:100%;padding:1% 0;position:relative}.czr-sub-set .czr-input{float:right;width:60%}.czr-sub-set .customize-control-title.width-100,.width-100 .czr-input{width:100%}.czr-sub-set .customize-control-title{float:left;width:40%;padding:1px 0;font-size:13px}.rtl.wp-customizer .czr-sub-set .customize-control-title{float:right}.czr-item-title .fa{font-size:18px}.czr-remove-alert-wrapper{display:none;clear:both;float:left;padding:2%;width:95%;margin:10px 0;text-shadow:0 1px 0 rgba(255,255,255,.5);background-color:#EEE;color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.czr-remove-alert-wrapper p{padding:5px;margin:0}.czr-pre-add-wrapper{position:relative;float:left;width:100%}.czr-pre-add-view-content{display:none;padding:3%;border:1px solid #00a0d2;border-top:none;margin:0 0 0 2%;float:left;width:92%;background:#eee;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;position:relative;opacity:1;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-ms-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.czr-model-added .czr-pre-add-view-content{opacity:.2}.czr-pre-add-wrapper .czr-add-new{background:#3b8dbd;color:#fff;-webkit-transition:background .5s linear;-moz-transition:background .5s linear;-ms-transition:background .5s linear;-o-transition:background .5s linear;transition:background .5s linear;float:right;border:none}.czr-add-success{width:100%;margin:0 0 0 2%;position:absolute;top:0;left:0;font-size:25px;opacity:0;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-ms-transition:opacity .1s linear;-o-transition:opacity .1s linear;transition:opacity .1s linear}.czr-model-added .czr-add-success{opacity:1}.czr-unavailable-location,body.czr-editing-modopt #customize-preview{opacity:.7}.czr-add-success p{vertical-align:middle;display:inline-block;line-height:35px;margin:0;font-size:25px;color:#82b965;padding:0 3%}.control-section-widget_zones_management{margin:10px 0;z-index:1}.czr-zone-infos{width:96%;padding:0 2%;font-size:12px;float:left;font-style:italic}.czr-location-alert{float:left;width:100%;padding:1% 0;margin:1% 0;border:1px solid orange;background:#FEE5B6;color:#000;font-size:11px;font-style:italic}.czr-toggle-modopt{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;right:0;padding-left:3px;font-size:25px;line-height:24px}.rtl.wp-customizer .czr-toggle-modopt{left:0;right:auto;padding-left:0;padding-right:3px}.czr-modopt-visible .czr-toggle-modopt,.czr-toggle-modopt:hover{color:#3b8dbd}body #customize-controls{-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;-ms-transition:opacity .4s ease-in-out;-o-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}body.czr-editing-modopt #customize-controls{opacity:.4}.czr-mod-opt-wrapper{position:absolute;top:0;bottom:0;left:-301px;opacity:0;overflow-x:hidden;overflow-y:auto;margin:0;z-index:4;width:60%;min-width:300px;padding:1% 2%;color:#fff;background:rgba(0,0,0,.8);-webkit-transition:all .18s ease-in-out;-moz-transition:all .18s ease-in-out;-ms-transition:all .18s ease-in-out;-o-transition:all .18s ease-in-out;transition:all .18s ease-in-out;border-right:1px solid #4c4c4c}body.czr-editing-modopt .czr-mod-opt-wrapper{left:0;visibility:visible;opacity:1}.czr-close-modopt{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}.czr-mod-opt-wrapper .czr-sub-set{background:rgba(238,238,238,.13);padding:3% 2%;width:96%;margin:5px 0}.tabs,.tabs nav ul{position:relative;margin:0 auto;overflow:hidden}.czr-mod-opt-wrapper .czr-notice{color:#fff}.czr-mod-opt-wrapper .mod-opt-title{color:#fff;border-bottom:1px solid #fff;padding:5% 0;text-align:center}.tabs{display:none;width:100%;font-weight:300;font-size:1.25em}.tabs nav ul{display:-ms-flexbox;display:-webkit-flex;display:-moz-flex;display:-ms-flex;display:flex;padding:0;max-width:1200px;-ms-box-orient:horizontal;-ms-box-pack:center;-webkit-flex-flow:row wrap;-moz-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-justify-content:center;-moz-justify-content:center;-ms-justify-content:center;justify-content:center}.tabs nav a,.tabs nav ul li{position:relative;display:block}.tabs nav ul li{z-index:1;margin:0;-webkit-flex:1;-moz-flex:1;-ms-flex:1;flex:1}.tabs nav ul li.cols-4{width:25%}.tabs nav ul li.cols-3{width:33%}.tabs nav ul li.cols-2{width:50%}.tabs nav ul li.cols-1{width:100%}.tabs nav a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:2.5}li.tab-current::after,li.tab-current::before,li.tab-inactive::after{content:'';width:100%;position:absolute}.tabs nav a span{vertical-align:middle;font-size:.75em}.tabs nav li.tab-current a{color:#74777b}.tabs nav a:focus{outline:0}li.tab-current::after,li.tab-current::before{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(37,37,37,.63);box-shadow:4px 0 15px 0 rgba(37,37,37,.63);top:0;right:0;z-index:4}li.tab-current::before{left:0;-webkit-box-shadow:0 0 15px 4px rgba(37,37,37,.63);box-shadow:0 0 15px 4px rgba(37,37,37,.63)}li.tab-inactive::after{height:2px;bottom:-7px;left:0;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(0,0,0,.86)}.content-wrap{position:relative}.content-wrap section{display:none;margin:0 auto;max-width:1200px}section .czr-sub-set:first-child{margin:0}.content-wrap section.content-current,.no-flexbox nav ul{display:block}.no-flexbox nav ul li{min-width:15%;display:inline-block}.tabs-style-topline{max-width:1200px}.tabs-style-topline nav li{border:1px solid rgba(40,44,42,.1)}.czr-items-wrapper .tabs-style-topline nav li{border:none}.tabs-style-topline nav li:not(:last-child){border-right:none}.tabs-style-topline nav li.tab-current{border-top-color:#fff;border-bottom:none;background:rgba(238,238,238,.13)}.tabs-style-topline nav a{padding:.65em .5em;background:rgba(40,44,42,.05);color:#fff;line-height:1;-webkit-transition:color .2s;transition:color .2s;text-decoration:none}.czr-skp-switch-link:hover,.tabs-style-topline nav a:focus,.tabs-style-topline nav a:hover,.tabs-style-topline nav li.tab-current a{text-decoration:underline}.czr-items-wrapper .tabs-style-topline nav a{background:rgba(40,44,42,.45)}.tabs-style-topline nav li.tab-current a{background:0 0;box-shadow:inset 0 3px 0 #fff;color:#fff}.czr-items-wrapper .tabs-style-topline nav li.tab-current a{color:#000}.tabs-style-topline .icon::before{display:block;margin:0}.tabs-style-topline nav a span{text-transform:uppercase;letter-spacing:1px;font-weight:700}@media screen and (max-width:58em){.tabs nav a.icon span{display:none}.tabs nav a:before{margin-right:0}}.czr_slide_module .czr-item-title{padding:0 7px;height:32px}.czr_slide_module .slide-thumb,.czr_slide_module .slide-title{display:block;height:32px;line-height:32px;float:left}.czr_slide_module .slide-title{padding-left:5px}.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-450px;height:0}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-450px}@media screen and (max-width:1400px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-380px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-380px}}@media screen and (max-width:979px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-300px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-300px}}@media screen and (max-width:640px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-100%}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}}@media screen and (min-width:980px){.wp-customizer .expanded #customize-footer-actions{width:380px}}@media screen and (min-width:1401px){.wp-customizer .expanded #customize-footer-actions{width:440px}}.selecter-element{position:absolute;opacity:0}.selecter{display:block;float:right;margin:2px 0;position:relative;width:100%;z-index:100}.selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) right center no-repeat #F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;padding:4px 4.6%;position:relative;text-overflow:clip;z-index:49;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);height:auto;line-height:18px;width:90%}.selecter .selecter-options{border:1px solid #ccc;border-width:0 1px 1px;background-color:#fefefe;border-radius:0 0 3px 3px;box-shadow:0 1px 4px rgba(0,0,0,.15);display:none;left:0;margin:0;max-height:260px;overflow:auto;overflow-x:hidden;padding:0;position:relative;top:100%;width:99%;z-index:50}.selecter .selecter-group{background:#F9F9F9;border-bottom:1px solid #e3e3e3;color:#999;display:block;font-size:11px;padding:5px 10px 4px;text-transform:uppercase}.selecter .selecter-item{background:#fff;border-bottom:1px solid #e3e3e3;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;text-overflow:ellipsis;width:86%;height:auto;line-height:14px;padding:8px 24px 8px 10px}.selecter.disabled .selecter-group,.selecter.disabled .selecter-item,.selecter.disabled .selecter-selected{cursor:default;color:#ccc;border-color:#eee}.selecter .selecter-item.selected{background:#F9F9F9}.selecter .selecter-item.disabled{color:#999;cursor:default}.selecter .selecter-item:first-child{border-radius:0}.selecter .selecter-item:last-child{border-radius:0 0 2px 2px;border-bottom:0}.rtl .selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) 4% center no-repeat #F9F9F9}@media screen and (min-width:980px){.selecter .selecter-item.selected:hover,.selecter .selecter-item:hover{background-color:#f3f3f3}.selecter .selecter-item.disabled:hover,.selecter:hover .selecter-selected{background-color:#fff}.selecter.disabled .selecter-item:hover{background:#fff}}.selecter.open{z-index:101}.selecter.open .selecter-selected{border-radius:3px 3px 0 0;z-index:51}.selecter.focus .selecter-selected,.selecter.open .selecter-selected{background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.1)}.selecter.cover .selecter-options{border-radius:3px;border-width:1px;top:0}.selecter.cover .selecter-options .selecter-item.first{border-radius:3px 3px 0 0}.selecter.cover.open .selecter-selected{border-radius:3px 3px 0 0;z-index:49}.selecter.bottom .selecter-options{border-width:1px 1px 0;bottom:100%;top:auto}.selecter.bottom .selecter-item:last-child{border:none}.selecter.bottom.open .selecter-selected{border-radius:0 0 3px 3px}.selecter.bottom.open .selecter-options{border-radius:3px 3px 0 0}.selecter.bottom.cover.open .selecter-options,.selecter.bottom.cover.open .selecter-selected,.stepper{border-radius:3px}.selecter.bottom.cover .selecter-options{bottom:0;top:auto}.selecter.multiple .selecter-options{border-radius:3px;border-width:1px;box-shadow:none;display:block;position:static;width:100%}.selecter.disabled .selecter-selected{background:#fff}.selecter.disabled .selecter-options{background:#fff;border-color:#eee}.selecter.disabled .selecter-item.selected{background:#fafafa}.selecter .selecter-options.scroller{overflow:hidden}.selecter .selecter-options.scroller .scroller-content{max-height:260px;padding:0}@media screen and (max-width:740px){.selecter{max-width:100%}}@media screen and (max-width:500px){.selecter{max-width:100%}}.stepper{margin:0 0 10px;overflow:hidden;position:relative;width:35%;float:left;clear:both}.stepper .stepper-input{background:#F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;font-size:13px;line-height:1.2;margin:0;overflow:hidden;padding:5px 10px!important;width:100%!important;z-index:49;-moz-appearance:textfield;max-width:none!important}.stepper .stepper-input::-webkit-inner-spin-button,.stepper .stepper-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.stepper .stepper-input:focus{background-color:#fff}.stepper .stepper-arrow{background:url(img/jquery.fs.stepper-arrows.png) no-repeat #eee;border:1px solid #ccc;cursor:pointer;display:block;height:46%;position:absolute;right:0;text-indent:-99999px;width:20px;z-index:50}.stepper .stepper-arrow.up{background-position:center top;border-bottom:none;top:0}.stepper .stepper-arrow.down{background-position:center bottom;bottom:0}.rtl .stepper .stepper-input{text-align:left}@media screen and (min-width:740px){.stepper:hover .stepper-input{background-color:#fff}.stepper .stepper-step:hover{background-color:#F9F9F9}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}}.stepper.disabled .stepper-input{background:#fff;border-color:#eee;color:#ccc}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}.icheckbox_flat-green,.icheckbox_flat-grey,.iradio_flat-green,.iradio_flat-grey{display:inline-block;margin:0;padding:0;width:20px;height:20px;border:none;top:4px;vertical-align:middle}.icheckbox_flat-green,.iradio_flat-green{background:url(img/green.png) no-repeat;cursor:pointer;float:right}.rtl [class*=icheckbox_flat-]{float:left}.icheckbox_flat-green{background-position:0 0}.icheckbox_flat-green.checked{background-position:-22px 0}.icheckbox_flat-green.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-green.checked.disabled{background-position:-66px 0}.iradio_flat-green{background-position:-88px 0}.iradio_flat-green.checked{background-position:-110px 0}.iradio_flat-green.disabled{background-position:-132px 0;cursor:default}.iradio_flat-green.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-green,.iradio_flat-green{background-image:url(img/green@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.icheckbox_flat-grey,.iradio_flat-grey{background:url(img/grey.png) no-repeat;cursor:pointer;float:right}.icheckbox_flat-grey{background-position:0 0}.icheckbox_flat-grey.checked{background-position:-22px 0}.icheckbox_flat-grey.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-grey.checked.disabled{background-position:-66px 0}.iradio_flat-grey{background-position:-88px 0}.iradio_flat-grey.checked{background-position:-110px 0}.iradio_flat-grey.disabled{background-position:-132px 0;cursor:default}.iradio_flat-grey.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-grey,.iradio_flat-grey{background-image:url(img/grey@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.czr-sub-set .icheckbox_flat-green,.iradio_flat-green{float:left}body .select2-container{z-index:1000000;width:100%!important}.customize-control-czr_layouts .select2-selection--single{height:33px}.customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow{height:30px}.customize-control-czr_layouts .select2-selection--single:focus,.select2-selection__rendered:focus{outline:0}body .select2-container,span.select2-results{font-size:14px}.select2-container--default .select2-selection--multiple{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;width:99%;min-height:36px;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#00a0d2!important;-webkit-box-shadow:0 0 2px rgba(26,188,156,.8)!important;box-shadow:0 0 2px rgba(26,188,156,.8)!important}.select2-results__options li{margin-bottom:0}.select2-container--default .select2-selection--multiple .select2-selection__choice{padding:2px;font-size:13px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;margin-bottom:0}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#00a0d2}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{font-size:17px;position:relative;top:2px;color:#23282d}.customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered{padding:5px;line-height:16px}#czr-customize-content_editor-pane{border-top:solid 1px #ddd;position:absolute;height:300px;bottom:-301px;right:0;left:0;z-index:20;background:#f1f1f1;display:block;-webkit-transition:all .2s;transition:all .2s;visibility:hidden}body.czr-customize-content_editor-pane-resize #customize-preview,body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane{-webkit-transition:none;transition:none}body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{top:0}body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{bottom:0;visibility:inherit}#czr-customize-content_editor-pane .wp-editor-tools{padding-top:5px;padding-right:10px}#czr-customize-content_editor-pane .wp-media-buttons{padding-left:5px}#customize-preview{height:auto}body.czr-customize-content_editor-pane-open #customize-preview{bottom:300px}body.mce-fullscreen #customize-preview{bottom:0}body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen{position:relative;left:0}#wp-czr-customize-content_editor-container{border-left:0}#czr-customize-content_editor-dragbar{top:0;cursor:row-resize;display:block;height:4px;position:absolute;width:100%;z-index:21}body.czr-customize-content_editor-pane-resize #customize-preview:before{top:0;right:0;bottom:0;left:0;position:absolute;height:100%;width:100%;z-index:999999}.wp-customizer .ui-autocomplete.wplink-autocomplete{z-index:500110}.wp-customizer #wp-link-wrap{z-index:500105}.wp-customizer #wp_editbtns,.wp-customizer #wp_gallerybtns{z-index:500020}.wp-customizer #TB_overlay,.wp-customizer #TB_window{z-index:500050}.wp-customizer .mce-panel,.wp-customizer .mce-tooltip{z-index:500100!important}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar{bottom:308px}.czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar{-webkit-transition:none;transition:none}.czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar{bottom:8px!important}.czr-sub-set[data-input-type=content_picker] .customize-control-title,.czr-sub-set[data-input-type=content_picker] .czr-input{width:100%}.content-item-bar{line-height:1.5em}.czr-sub-set[data-input-type=content_picker] span.item-title{display:block;float:left;max-width:80%}.czr-sub-set[data-input-type=content_picker] span.item-type{display:inline-block;padding:0 10px 0 0;float:right}.rangeslider,.rangeslider__fill{display:block;-moz-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}.rangeslider{background:#e6e6e6;position:relative}.rangeslider--horizontal{height:20px;width:100%}.rangeslider--vertical{width:20px;min-height:150px;max-height:100%}.rangeslider--disabled{filter:alpha(Opacity=40);opacity:.4}.rangeslider__fill{background:#3b8dbd;position:absolute}.rangeslider--horizontal .rangeslider__fill{top:0;height:100%}.rangeslider--vertical .rangeslider__fill{bottom:0;width:100%}.rangeslider__handle{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g) #fff;border:1px solid #ccc;cursor:pointer;display:inline-block;width:40px;height:40px;position:absolute;background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(0,0,0,.1)));background-image:-moz-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:-webkit-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));-moz-box-shadow:0 0 8px rgba(0,0,0,.3);-webkit-box-shadow:0 0 8px rgba(0,0,0,.3);box-shadow:0 0 8px rgba(0,0,0,.3);-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;line-height:42px;text-align:center;color:#000;font-size:13px;font-weight:700}.rangeslider__handle:after{content:"";display:block;width:18px;height:18px;margin:auto;position:absolute;top:0;right:0;bottom:0;left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.13)),color-stop(100%,rgba(255,255,255,0)));background-image:-moz-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:-webkit-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%}.rangeslider--active .rangeslider__handle,.rangeslider__handle:active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,rgba(0,0,0,.12)));background-image:-moz-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:-webkit-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12))}.rangeslider--horizontal .rangeslider__handle{top:-10px;touch-action:pan-y;-ms-touch-action:pan-y}.rangeslider--vertical .rangeslider__handle{left:-10px;touch-action:pan-x;-ms-touch-action:pan-x}input[type=range]:focus+.rangeslider .rangeslider__handle{-moz-box-shadow:0 0 8px rgba(255,0,255,.9);-webkit-box-shadow:0 0 8px rgba(255,0,255,.9);box-shadow:0 0 8px rgba(255,0,255,.9)}.attachment-media-view button{color:#000;padding:5px 7px;line-height:1.5em}.czr-sektion-buttons{position:absolute;right:0}.czr-column{width:99%;margin-bottom:1%;float:left;padding:2% 0;border:2px dotted #aaa;text-align:center}.czr-column-header{position:relative}.czr-col-drag-handler{position:absolute;left:0;padding:1%;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-module-collection-wrapper{width:100%;min-height:5px;float:left}.czr-single-module{width:98%;float:left;min-height:20px;margin:1px 1%;border:1px solid #ccc}.czr-single-module textarea{max-width:100%}#customize-theme-controls .czr-single-module .czr-single-item{width:96%}.czr-mod-header{background:#eee;float:left;width:100%}.czr-mod-title{position:relative}.czr-mod-title>h4{float:left;width:70%;margin:2% 0}.czr-mod-drag-handler{position:absolute;left:0;padding:1%;margin:2% 0;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-mod-buttons{float:right;width:30%;margin:2% 0}.czr-mod-content{position:absolute;top:0;left:100%;float:left;width:100%;background:#d5e9cc;display:none}.czr-module-open #customize-info,.czr-module-open #customize-theme-controls{left:-200%}.czr-module-open #customize-theme-controls .accordion-section-content{overflow:visible}.czr-module-description-container{margin-bottom:15px}.czr-module-title{border-bottom:1px solid #ddd;background:#fff}.czr-module-title h3{padding:10px 10px 12px 14px;margin:0;color:#555;font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#customize-controls .czr-module-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;display:block;font-weight:400}.czr-module-back{display:block;float:left;width:48px;height:74px;padding:0 24px 0 0;margin:0;background:#fff;border:none;border-right:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;-webkit-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-moz-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-ms-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-o-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.czr-module-back:focus,.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.czr-module-back:before{font:400 20px/72px dashicons;content:"\f341";position:relative;left:13px}.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.gu-mirror{position:fixed!important;margin:0!important;z-index:999999!important;opacity:.8;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";filter:alpha(opacity=80)}#czr-module-list-panel,#czr-sektion-settings-panel{left:-301px;overflow-x:hidden;overflow-y:auto;z-index:4;bottom:0}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter:alpha(opacity=20)}.gu-unselectable .czr-module-collection-wrapper{width:98%;border:1px dotted green;background:#d1ffe0;min-height:31px}#czr-module-list-panel{position:absolute;top:0;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd}#czr-available-modules-filter,#czr-module-list-panel{width:45%;min-width:300px}body.czr-adding-module #czr-module-list-panel{left:0;visibility:visible;opacity:1}body.czr-adding-module #customize-preview{opacity:.7}.add-new-module:before{content:"\f132";display:inline-block;position:relative;left:-2px;top:-1px;font:400 20px/1 dashicons;vertical-align:middle;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.czr-column .add-new-module{margin:1%;float:right}body.czr-adding-module .add-new-module,body.czr-adding-module .add-new-module:hover{background:#eee;border-color:#929793;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}body.czr-adding-module .add-new-module:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#czr-available-modules-list{top:60px;position:absolute;overflow:auto;bottom:0;width:100%}#czr-available-modules-filter{position:fixed;top:0;z-index:1;background:rgba(0,0,0,.47);border-bottom:1px solid #e5e5e5;padding:12px 15px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#czr-available-modules-filter input{padding:6px 10px;width:100%}#czr-available-modules-list .czr-module-candidate{position:relative;border-bottom:1px solid #e5e5e5}#czr-available-modules-list .czr-module-candidate h3{color:#fff;padding:0;margin:0}#czr-available-modules-list .czr-mod-drag-handler{position:relative;left:0;padding:1%;margin:2% 4%;color:inherit;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}#czr-sektion-settings-panel{position:absolute;top:0;width:45%;min-width:300px;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd;color:#fff}#czr-sektion-settings-panel h3{color:#fff}body.czr-editing-sektion #czr-sektion-settings-panel{left:0;visibility:visible;opacity:1}body.czr-editing-sektion #customize-preview{opacity:.7}.czr-api-dirty input#save{background-color:#FFBD2E;border-color:#d99400;color:#000;text-shadow:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out;-ms-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.czr-api-dirty input#save:hover{background-color:#fcad06}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header{height:185px}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{top:185px}.wp-customizer .in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding:0 15px}.customize-controls-close{border-bottom:1px solid #ddd}.wp-customizer #customize-header-actions{border-bottom:0}.czr-scope-switcher{width:100%;float:right;position:absolute;left:0;bottom:0;overflow:hidden}.czr-scope-switcher .czr-skp-permanent-title{position:relative;color:#5f5f5f}#customize-header-actions .czr-scope-switcher .spinner{float:none;display:none;margin:0;left:-26px;top:0;position:absolute;visibility:visible}#czr-top-note,.czr-spinner-wrapper{visibility:hidden}h2.czr-current-skope-title{font-size:13px;line-height:21px;margin:6px 0 4px;text-align:center;height:63px;font-weight:400;overflow:hidden}.czr-main-title{max-height:24px;overflow:hidden;display:inline-block;text-overflow:ellipsis;white-space:nowrap;width:95%}.czr-skope-title{display:block;font-size:17px;font-style:italic;line-height:25px}.czr-toggle-title-notice{cursor:pointer;font-size:14px;color:#777}.czr-skope-inherits-from{display:inline-block;opacity:0;width:90%;font-size:12px;line-height:18px;color:#0029ff;top:-6px;position:relative}.notice-visible .czr-toggle-title-notice{color:#0029ff}.notice-visible .czr-skope-inherits-from{opacity:1;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope,.czr-scope-switcher .button{-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;float:left}.czr-scope-switcher .button{width:40%;text-align:center;margin:0 2%;opacity:.7;transition:opacity .3s ease-in-out}.czr-scope-switcher .button.active{font-weight:700;opacity:1}.czr-scope-switcher .active,.czr-scope-switcher .czr-scope:hover{opacity:1}.czr-skopes-wrapper{overflow:hidden;position:relative}.czr-scope-switcher .active:after,.czr-scope.active:before{position:absolute;content:'';top:0}.czr-scope.active:before{height:101%;float:left;z-index:1;-webkit-box-shadow:-4px 0 15px 0 rgba(119,119,119,.58);box-shadow:-4px 0 15px 0 rgba(119,119,119,.58)}.czr-scope-switcher .active:after{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(119,119,119,.58);z-index:3}.czr-skopes-wrapper .active-collection.local:after{right:0}.czr-scope-switcher .czr-scope:last-child:after{-webkit-box-shadow:none;box-shadow:none;right:0}.czr-scope-switcher .czr-scope:first-child:after{left:0}.czr-scope{width:30.5%;background:#fff;border-top:1px solid #ccc;overflow:hidden;opacity:.65;transition:opacity .3s ease-in-out}.czr-scope-switcher .width-100,.czr-scope.width-100.active:after,.czr-scope.width-100.active:before{width:100%}.czr-scope-switcher .width-50,.czr-scope.width-50.active:after,.czr-scope.width-50.active:before{width:50%}.czr-scope-switcher .width-33,.czr-scope.width-33.active:after,.czr-scope.width-33.active:before{width:33.33%}.czr-scope-switcher .width-25,.czr-scope.width-25.active:after,.czr-scope.width-25.active:before{width:25%}.czr-scope-footer,.czr-scope-header{width:100%;min-height:16px;position:relative;z-index:5}.inactive .czr-scope-footer:after{content:'';width:100%;position:absolute;height:5px;bottom:-7px;left:0;-webkit-box-shadow:0 0 13px 4px rgba(119,119,119,.85);box-shadow:0 0 13px 4px rgba(119,119,119,.85)}.czr-scope-content{height:35px;padding:0 3%;width:94%;line-height:35px;text-align:center;clear:both;color:#000;overflow:hidden}.czr-scope-content h4{margin:0;display:inline-block;text-align:center;font-size:14px;line-height:18px;font-weight:400;text-shadow:1px 1px 0 #dedede}.czr-reset-fail,.czr-reset-success,.czr-scope-force{display:none}.czr-scope .fa{font-size:10px;padding:2%;color:#585858;cursor:pointer;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope .czr-scope-footer .info{cursor:inherit}.czr-scope-header .czr-scope-switch{font-size:22px;padding:0 2px 0 0;text-shadow:1px 1px 2px #fff}.czr-skp-switch-link{cursor:pointer}.czr-pull-left{float:left}.czr-pull-right{float:right}.active .czr-scope-switch{color:#52ff3f;cursor:inherit}.czr-scope .czr-scope-reset{display:none;font-size:13px;text-shadow:1px 1px 0 #dedede}.has-db-val .czr-scope-reset{color:#00a0d2}.dirty .czr-scope-reset{color:#FFBD2E!important}.is_winner .czr-scope-winner{color:#52ff3f;font-size:14px;position:absolute;bottom:2px;left:2px}.czr-scope-switcher .czr-skope-switch,.czr-skope-notice .czr-skope-switch{cursor:pointer;text-decoration:underline}.czr-spinner{background:url(img/czr-spinner.gif) no-repeat;-webkit-background-size:32px 32px;background-size:32px 32px;display:inline-block;float:right;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:32px;height:32px;margin:4px 10px 0}.customize-control span.customize-control-title:first-child{padding-left:16px;-webkit-transition:left,right,.15s ease-in-out;-moz-transition:left,right,.15s ease-in-out;-ms-transition:left,right,.15s ease-in-out;-o-transition:left,right,.15s ease-in-out;transition:left,right,.15s ease-in-out;position:relative}.wp-customizer .customize-control.czr-not-skoped .customize-control-title{padding-left:0}#czr-skope-pane,#czr-top-note{padding:2%;z-index:20;text-align:center;position:absolute}.czr-setting-reset{color:#eee;-webkit-transition:color .4s;transition:color .4s;position:absolute;left:0;line-height:21px;display:none;text-shadow:1px 1px 0 #a0a0a0}#czr-top-note,.czr-resetting-control .czr-remove-alert-wrapper{-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out}.czr-global-skope-level .is-wp-authorized-setting.has-db-val .czr-setting-reset{color:#eee}.has-db-val .czr-setting-reset{color:#00a0d2}.is-dirty .czr-setting-reset{color:#FFBD2E!important}.czr-ctrl-reset-warning .czr-spinner{display:none}#czr-top-note,.czr-resetting-control .czr-ctrl-reset-warning .czr-spinner{display:block}.is-dirty .czr-remove-alert-wrapper{background-color:rgba(255,189,46,.54)!important;border:1px solid #FFBD2E!important;text-shadow:none;color:#000}.has-db-val .czr-remove-alert-wrapper{background-color:rgba(0,160,210,.45);border:1px solid #00a0d2;text-shadow:none;color:#000}.czr-resetting-control .czr-remove-alert-wrapper{-webkit-transition:all,.3s ease-in-out;transition:all,.3s ease-in-out}body.czr-skop-loading #czr-skope-pane{top:0}body.czr-skop-loading #customize-preview{opacity:0!important}@-webkit-keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.czr-css-loader{width:50px;height:50px;position:absolute;-webkit-transform:translate3d(-50%,-50%,0);-ms-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);top:50%;left:50%;display:block}.czr-mr-loader>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.czr-mr-loader>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.czr-mr-loader>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.czr-mr-loader>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.czr-mr-loader>div{position:absolute;top:-4%;left:-4%;width:100%;height:100%;border-radius:100%;border:2px solid #fff;-webkit-animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}#czr-top-note{top:-100%;right:0;left:0;color:#fff;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:rgba(0,0,0,.8)}#czr-top-note h2{color:#fff;font-size:25px}#czr-top-note a{color:#fff}#czr-top-note .czr-top-note-close{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}#czr-top-note .fa-arrow-left{position:absolute;bottom:10px;left:25px;font-size:40px}#czr-top-note .czr-note-content{display:inline-block;line-height:20px;width:80%}#czr-top-note .czr-note-message{font-size:16px;line-height:20px}body.czr-top-note-open #czr-top-note{top:0;visibility:inherit}#czr-skope-pane{min-height:100%;top:-100%;right:0;left:0;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;visibility:hidden}#czr-skope-pane.dirty-reset{background:rgba(252,173,6,.23)}#czr-skope-pane.db-reset{background:rgba(0,160,210,.3)}.czr-reset-content{display:inline-block;line-height:20px;width:80%;padding:5%;background:rgba(0,0,0,.63)}#czr-skope-pane h2{color:#fff;line-height:1.5em}body.czr-skope-pane-open #czr-skope-pane{top:0;visibility:inherit;min-height:100%}body.czr-skope-pane-open #customize-preview,body.czr-skope-pane-open .wp-full-overlay-sidebar{opacity:.5}body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper{visibility:visible}.czr-skope-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-skope-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.customize-control .czr-skope-notice{color:#0029ff}.czr-toggle-notice{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;padding-left:3px;line-height:21px;display:none}.czr-notice-visible .czr-toggle-notice,.czr-toggle-notice:hover{color:#0029ff}.wp-full-overlay-header,.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{-webkit-transition:height,top,.4s ease-in-out;-moz-transition:height,top,.4s ease-in-out;-ms-transition:height,top,.4s ease-in-out;-o-transition:height,top,.4s ease-in-out;transition:height,top,.4s ease-in-out}.czr-server-notice{width:calc(96% - 2px);bottom:75px;text-align:center;background:rgba(0,156,0,.18);color:#000;display:none;position:absolute;font-size:12px;line-height:13px;padding:2%;overflow:hidden}.czr-server-notice.czr-server-error{color:#000;background:rgba(255,0,0,.24)}.czr-dismiss-notification{position:absolute;right:5px;top:5px;cursor:pointer}.wp-customizer .icheckbox_flat-grey,.wp-customizer .iradio_flat-grey{border:1px solid #fff;-webkit-border-radius:5px;border-radius:5px;background-color:#fff}.czr-painted{-webkit-transition:background .3s ease-in-out!important;-moz-transition:background .3s ease-in-out!important;-ms-transition:background .3s ease-in-out!important;-o-transition:background .3s ease-in-out!important;transition:background .3s ease-in-out!important}
{assets → addons/assets}/czr/css/czr-control-footer.css RENAMED
File without changes
{assets → addons/assets}/czr/css/czr-control.css RENAMED
@@ -202,7 +202,6 @@ li#customize-control-custom_css textarea {
202
 
203
 
204
  /* PANELS AND SECTIONS TITLES */
205
-
206
  .wp-customizer .control-section.control-panel .accordion-section-title .panel-title {
207
  font-size: 24px;
208
  font-weight: inherit;
@@ -255,6 +254,16 @@ li#customize-control-custom_css textarea {
255
  }
256
 
257
 
 
 
 
 
 
 
 
 
 
 
258
  /* GENERAL STYLE */
259
  .control-section .accordion-section-content {
260
  overflow-y: auto;
@@ -1000,6 +1009,95 @@ span.czr-panel-subtitle {
1000
  font-size: 11px;
1001
  font-style: italic;
1002
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1003
  .in-sub-panel #czr-donate-customizer,
1004
  .in-sub-panel .czr-cta-wrap {
1005
  left: -450px;
@@ -1068,883 +1166,1051 @@ span.czr-panel-subtitle {
1068
  width: 440px;
1069
  }
1070
  }
1071
- /*
1072
- * Selecter v3.1.9 - 2014-09-02
1073
- * A jQuery plugin for replacing default select elements. Part of the Formstone Library.
1074
- * http://formstone.it/selecter/
1075
- *
1076
- * Copyright 2014 Ben Plum; MIT Licensed
1077
- */
1078
- .selecter-element { *left: -999999px; position: absolute; opacity: 0; }
1079
- .selecter { display: block;float: right;margin: 2px 0;position: relative;width: 100%;z-index: 100; }
1080
- .selecter .selecter-selected { background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat right center; border: 1px solid #ccc; border-radius: 3px; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 4px 4.6%; position: relative; text-overflow: clip; z-index: 49; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);height: auto;line-height: 18px;width: 90%; }
1081
-
1082
- .selecter .selecter-options { border: 1px solid #ccc; border-width: 0 1px 1px; background-color: #fefefe; border-radius: 0 0 3px 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); display: none; left: 0; margin: 0; max-height: 260px; overflow: auto; overflow-x: hidden; padding: 0; position: relative; top: 100%; width: 99%; *width: auto; z-index: 50; }
1083
- .selecter .selecter-group { background: #F9F9F9; border-bottom: 1px solid #e3e3e3; color: #999; display: block; font-size: 11px; padding: 5px 10px 4px; text-transform: uppercase; }
1084
- .selecter .selecter-item { background: #fff; border-bottom: 1px solid #e3e3e3; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 8px 10px; text-overflow: ellipsis; width: 86%;height: auto;line-height: 14px;padding: 8px 24px 8px 10px;}
1085
- .selecter .selecter-item.selected { background: #F9F9F9; }
1086
- .selecter .selecter-item.disabled { color: #999; cursor: default; }
1087
- .selecter .selecter-item:first-child { border-radius: 0; }
1088
- .selecter .selecter-item:last-child { border-radius: 0 0 2px 2px; border-bottom: 0; }
1089
-
1090
- /* CUSTOM FOR CUSTOMIZR */
1091
- .rtl .selecter .selecter-selected {
1092
- background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat 4% center;
1093
- }
1094
-
1095
- @media screen and (min-width: 980px) {
1096
- .selecter .selecter-item:hover,
1097
- .selecter .selecter-item.selected:hover { background-color: #f3f3f3; }
1098
- .selecter .selecter-item.disabled:hover { background-color: #fff; }
1099
-
1100
- .selecter:hover .selecter-selected { background-color: #fff; }
1101
-
1102
- .selecter.disabled .selecter-item:hover { background: #fff; }
1103
- }
1104
-
1105
- /* Open */
1106
- .selecter.open { z-index: 101; }
1107
- .selecter.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 51; }
1108
-
1109
- .selecter.open .selecter-selected,
1110
- .selecter.focus .selecter-selected { background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); }
1111
-
1112
- /* 'Cover' Positioning */
1113
- .selecter.cover .selecter-options { border-radius: 3px; border-width: 1px; top: 0; }
1114
- .selecter.cover .selecter-options .selecter-item.first { border-radius: 3px 3px 0 0; }
1115
- .selecter.cover.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 49; }
1116
-
1117
- /* 'Bottom' Positioning */
1118
- .selecter.bottom .selecter-options { border-width: 1px 1px 0; bottom: 100%; top: auto; }
1119
- .selecter.bottom .selecter-item:last-child { border: none; }
1120
- .selecter.bottom.open .selecter-selected { border-radius: 0 0 3px 3px; }
1121
- .selecter.bottom.open .selecter-options { border-radius: 3px 3px 0 0; }
1122
-
1123
- /* 'Bottom' + 'Cover' Positioning */
1124
- .selecter.bottom.cover .selecter-options { bottom: 0; top: auto; }
1125
- .selecter.bottom.cover.open .selecter-selected { border-radius: 3px; }
1126
- .selecter.bottom.cover.open .selecter-options { border-radius: 3px; }
1127
-
1128
- /* Multiple Select */
1129
- .selecter.multiple .selecter-options { border-radius: 3px; border-width: 1px; box-shadow: none; display: block; position: static; width: 100%; }
1130
-
1131
- /* 'Disabled' State */
1132
- .selecter.disabled .selecter-selected { background: #fff; border-color: #eee; color: #ccc; cursor: default; }
1133
- .selecter.disabled .selecter-options { background: #fff; border-color: #eee; }
1134
- .selecter.disabled .selecter-group,
1135
- .selecter.disabled .selecter-item { border-color: #eee; color: #ccc; cursor: default; }
1136
- .selecter.disabled .selecter-item.selected { background: #fafafa; }
1137
-
1138
- /* Scroller Support */
1139
- .selecter .selecter-options.scroller { overflow: hidden; }
1140
- .selecter .selecter-options.scroller .scroller-content { max-height: 260px; padding: 0; }
1141
-
1142
- /* Media Queries */
1143
- @media screen and (max-width: 740px) {
1144
- .selecter { max-width: 100%; }
1145
- }
1146
- @media screen and (max-width: 500px) {
1147
- .selecter { max-width: 100%; }
1148
- }
1149
-
1150
-
1151
-
1152
-
1153
-
1154
-
1155
-
1156
-
1157
-
1158
-
1159
-
1160
- /*
1161
- * Stepper v3.0.7 - 2014-05-07
1162
- * A jQuery plugin for cross browser number inputs. Part of the Formstone Library.
1163
- * http://formstone.it/stepper/
1164
- *
1165
- * Copyright 2014 Ben Plum; MIT Licensed
1166
- */
1167
- .stepper { border-radius: 3px; margin: 0 0 10px 0; overflow: hidden; position: relative; width: 35%;float: left; clear: both;}
1168
- .stepper .stepper-input { background: #F9F9F9; border: 1px solid #ccc; border-radius: 3px; color: #333; font-size: 13px; line-height: 1.2; margin: 0; overflow: hidden; padding: 5px 10px 5px!important; width: 100%!important; z-index: 49; -moz-appearance: textfield;max-width: none!important;
1169
- }
1170
-
1171
- .stepper .stepper-input::-webkit-inner-spin-button,
1172
- .stepper .stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
1173
-
1174
- .stepper .stepper-input:focus { background-color: #fff; }
1175
- .stepper .stepper-arrow { background: #eee url(img/jquery.fs.stepper-arrows.png) no-repeat; border: 1px solid #ccc; cursor: pointer; display: block; height: 46%; position: absolute; right: 0; text-indent: -99999px; width: 20px; z-index: 50; }
1176
- .stepper .stepper-arrow.up { background-position: center top; border-bottom: none; top: 0; }
1177
- .stepper .stepper-arrow.down { background-position: center bottom; bottom: 0; }
1178
-
1179
- /* CUSTOM FOR CUSTOMIZR */
1180
- .rtl .stepper .stepper-input {
1181
- text-align: left;
1182
- }
1183
-
1184
- @media screen and (min-width: 740px) {
1185
- .stepper:hover .stepper-input { background-color: #fff; }
1186
-
1187
- .stepper .stepper-step:hover { background-color: #F9F9F9; }
1188
-
1189
- .stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
1190
- }
1191
-
1192
- .stepper.disabled .stepper-input { background: #fff; border-color: #eee; color: #ccc; }
1193
- .stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
1194
-
1195
-
1196
-
1197
-
1198
-
1199
-
1200
-
1201
-
1202
-
1203
-
1204
-
1205
-
1206
- /* iCheck plugin Flat skin, green
1207
- ----------------------------------- */
1208
- .icheckbox_flat-green,
1209
- .iradio_flat-green {
1210
- display: inline-block;
1211
- *display: inline;
1212
- vertical-align: middle;
1213
- margin: 0;
1214
- padding: 0;
1215
- width: 20px;
1216
- height: 20px;
1217
- background: url(img/green.png) no-repeat;
1218
- border: none;
1219
- cursor: pointer;
1220
- top: 4px;
1221
- float: right;
1222
- }
1223
- /* RTL fix of check box position */
1224
- .rtl .icheckbox_flat-green {
1225
- float: left;
1226
- }
1227
- .icheckbox_flat-green {
1228
- background-position: 0 0;
1229
- }
1230
- .icheckbox_flat-green.checked {
1231
- background-position: -22px 0;
1232
- }
1233
- .icheckbox_flat-green.disabled {
1234
- background-position: -44px 0;
1235
- cursor: default;
1236
- }
1237
- .icheckbox_flat-green.checked.disabled {
1238
- background-position: -66px 0;
1239
- }
1240
-
1241
- .iradio_flat-green {
1242
- background-position: -88px 0;
1243
- }
1244
- .iradio_flat-green.checked {
1245
- background-position: -110px 0;
1246
- }
1247
- .iradio_flat-green.disabled {
1248
- background-position: -132px 0;
1249
- cursor: default;
1250
- }
1251
- .iradio_flat-green.checked.disabled {
1252
- background-position: -154px 0;
1253
- }
1254
-
1255
- /* Retina support */
1256
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
1257
- only screen and (-moz-min-device-pixel-ratio: 1.5),
1258
- only screen and (-o-min-device-pixel-ratio: 3/2),
1259
- only screen and (min-device-pixel-ratio: 1.5) {
1260
- .icheckbox_flat-green,
1261
- .iradio_flat-green {
1262
- background-image: url(img/green@2x.png);
1263
- -webkit-background-size: 176px 22px;
1264
- background-size: 176px 22px;
1265
- }
1266
- }
1267
-
1268
- /* iCheck plugin Flat skin, grey
1269
- ----------------------------------- */
1270
- .icheckbox_flat-grey,
1271
- .iradio_flat-grey {
1272
- display: inline-block;
1273
- *display: inline;
1274
- vertical-align: middle;
1275
- margin: 0;
1276
- padding: 0;
1277
- width: 20px;
1278
- height: 20px;
1279
- background: url(img/grey.png) no-repeat;
1280
- border: none;
1281
- cursor: pointer;
1282
- top: 4px;
1283
- float: right;
1284
- }
1285
-
1286
- .icheckbox_flat-grey {
1287
- background-position: 0 0;
1288
- }
1289
- .icheckbox_flat-grey.checked {
1290
- background-position: -22px 0;
1291
- }
1292
- .icheckbox_flat-grey.disabled {
1293
- background-position: -44px 0;
1294
- cursor: default;
1295
- }
1296
- .icheckbox_flat-grey.checked.disabled {
1297
- background-position: -66px 0;
1298
- }
1299
-
1300
- .iradio_flat-grey {
1301
- background-position: -88px 0;
1302
- }
1303
- .iradio_flat-grey.checked {
1304
- background-position: -110px 0;
1305
- }
1306
- .iradio_flat-grey.disabled {
1307
- background-position: -132px 0;
1308
- cursor: default;
1309
- }
1310
- .iradio_flat-grey.checked.disabled {
1311
- background-position: -154px 0;
1312
- }
1313
-
1314
- /* Retina support */
1315
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
1316
- only screen and (-moz-min-device-pixel-ratio: 1.5),
1317
- only screen and (-o-min-device-pixel-ratio: 3/2),
1318
- only screen and (min-device-pixel-ratio: 1.5) {
1319
- .icheckbox_flat-grey,
1320
- .iradio_flat-grey {
1321
- background-image: url(img/grey@2x.png);
1322
- -webkit-background-size: 176px 22px;
1323
- background-size: 176px 22px;
1324
- }
1325
- }
1326
-
1327
- .czr-sub-set .icheckbox_flat-green, .iradio_flat-green {
1328
- float: left;
1329
- }
1330
-
1331
-
1332
-
1333
-
1334
-
1335
-
1336
-
1337
-
1338
-
1339
-
1340
-
1341
-
1342
-
1343
-
1344
-
1345
-
1346
- /* SELECT 2 SPECIFICS */
1347
- body .select2-container {
1348
- z-index: 1000000;
1349
- width: 100%!important;
1350
- }
1351
-
1352
- .customize-control-czr_layouts .select2-selection--single {
1353
- height: 33px;
1354
- }
1355
- .customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow {
1356
- height: 30px;
1357
- }
1358
- .select2-selection__rendered:focus, .customize-control-czr_layouts .select2-selection--single:focus {
1359
- outline: none;
1360
- }
1361
-
1362
-
1363
-
1364
-
1365
-
1366
- /* SPECIFIC INPUT STYLE */
1367
- span.select2-results, body .select2-container {
1368
- font-size: 14px;
1369
- }
1370
-
1371
-
1372
- /* for multipe picker */
1373
- .select2-container--default .select2-selection--multiple {
1374
- -webkit-border-radius: 0px;
1375
- -moz-border-radius: 0px;
1376
- border-radius: 0;
1377
- width: 99%;
1378
- min-height: 36px;
1379
- border: 1px solid #ddd;
1380
- -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
1381
- box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
1382
- }
1383
- .select2-container--default.select2-container--focus .select2-selection--multiple {
1384
- border-color: #00a0d2!important;
1385
- -webkit-box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
1386
- box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
1387
- }
1388
- .select2-results__options li {
1389
- margin-bottom: 0
1390
- }
1391
- .select2-container--default .select2-selection--multiple .select2-selection__choice {
1392
- padding: 2px;
1393
- font-size: 13px;
1394
- -webkit-border-radius: 2px;
1395
- -moz-border-radius: 2px;
1396
- border-radius: 2px;
1397
- margin-bottom: 0;
1398
- }
1399
- .select2-container--default .select2-results__option--highlighted[aria-selected] {
1400
- background-color: #00a0d2;
1401
- }
1402
- .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
1403
- font-size: 17px;
1404
- position: relative;
1405
- top: 2px;
1406
- color: #23282d;
1407
- }
1408
-
1409
- /* Socials Specifics */
1410
- .customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered {
1411
- padding: 5px;
1412
- line-height: 16px;
1413
- }
1414
-
1415
-
1416
-
1417
-
1418
-
1419
-
1420
-
1421
-
1422
-
1423
-
1424
-
1425
-
1426
- /* WP TEXT EDITOR */
1427
- #czr-customize-content_editor-pane {
1428
- border-top: solid 1px #ddd;
1429
- position: absolute;
1430
- height: 300px;
1431
- bottom: -301px;
1432
- right: 0;
1433
- left: 0;
1434
- z-index: 20;
1435
- background: #f1f1f1;
1436
- display: block;
1437
- -webkit-transition: all 0.2s;
1438
- transition: all 0.2s;
1439
- visibility: hidden;
1440
- }
1441
- body.czr-customize-content_editor-pane-resize #customize-preview,
1442
- body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane {
1443
- -webkit-transition: none;
1444
- transition: none;
1445
- }
1446
- body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
1447
- top: 0;
1448
- }
1449
- body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
1450
- bottom: 0;
1451
- visibility: inherit;
1452
- }
1453
- #czr-customize-content_editor-pane .wp-editor-tools {
1454
- padding-top: 5px;
1455
- padding-right: 10px;
1456
- }
1457
- #czr-customize-content_editor-pane .wp-media-buttons {
1458
- padding-left: 5px;
1459
- }
1460
- #customize-preview {
1461
- height: auto;
1462
- }
1463
- body.czr-customize-content_editor-pane-open #customize-preview {
1464
- bottom: 300px;
1465
- }
1466
- body.mce-fullscreen #customize-preview {
1467
- bottom: 0;
1468
- }
1469
- body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen {
1470
- position: relative;
1471
- left: 0;
1472
- }
1473
- #wp-czr-customize-content_editor-container {
1474
- border-left: 0;
1475
- }
1476
- /* vertical resize bar */
1477
- #czr-customize-content_editor-dragbar {
1478
- top: 0;
1479
- cursor: row-resize;
1480
- display: block;
1481
- height: 4px;
1482
- position: absolute;
1483
- width: 100%;
1484
- z-index: 21;
1485
- }
1486
- body.czr-customize-content_editor-pane-resize #customize-preview:before {
1487
- top: 0;
1488
- right: 0;
1489
- bottom: 0;
1490
- left: 0;
1491
- position: absolute;
1492
- height: 100%;
1493
- width: 100%;
1494
- z-index: 999999;
1495
- }
1496
- /* @todo Mobile support for rich text editor */
1497
- .wp-customizer .ui-autocomplete.wplink-autocomplete {
1498
- z-index: 500110; /* originally 100110, but z-index of .wp-full-overlay is 500000 */
1499
- }
1500
- .wp-customizer #wp-link-wrap {
1501
- z-index: 500105; /* originally 100105, but z-index of .wp-full-overlay is 500000 */
1502
- }
1503
- .wp-customizer #wp_editbtns,
1504
- .wp-customizer #wp_gallerybtns {
1505
- z-index: 500020; /* originally 100020, but z-index of .wp-full-overlay is 500000 */
1506
- }
1507
- .wp-customizer #TB_overlay,
1508
- .wp-customizer #TB_window {
1509
- z-index: 500050;
1510
- }
1511
- .wp-customizer .mce-panel,
1512
- .wp-customizer .mce-tooltip {
1513
- z-index: 500100 !important; /* originally 100100, but z-index of .wp-full-overlay is 500000 */
1514
- }
1515
- .czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
1516
- z-index: 30;
1517
- }
1518
- .czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar {
1519
- bottom: 308px;
1520
- }
1521
- .czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar {
1522
- bottom: 0 !important;
1523
- }
1524
- .czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar {
1525
- -webkit-transition: none;
1526
- transition: none;
1527
- }
1528
- .czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar {
1529
- bottom: 8px !important;
1530
- }/* OVERRIDE WP CUSTOMIZER */
1531
-
1532
- /* SEKTIONS AND COLUMNS */
1533
- .czr-sektion-buttons {
1534
- position: absolute;
1535
- right: 0;
1536
- }
1537
- .czr-column {
1538
- width: 99%;
1539
- margin-bottom: 1%;
1540
- float: left;
1541
- padding: 2% 0%;
1542
- border: 2px dotted #aaa;
1543
- text-align: center;
1544
- }
1545
- .czr-column-header {
1546
- position: relative;
1547
- }
1548
- .czr-col-drag-handler {
1549
- position: absolute;
1550
- left: 0%;
1551
- padding: 1%;
1552
- color: #999;
1553
- cursor: move;
1554
- cursor: grab;
1555
- cursor: -moz-grab;
1556
- cursor: -webkit-grab;
1557
- }
1558
-
1559
-
1560
-
1561
-
1562
- /* MODULES */
1563
- .czr-module-collection-wrapper {
1564
- width: 100%;
1565
- min-height: 5px;
1566
- float: left;
1567
- }
1568
- .czr-single-module {
1569
- width: 98%;
1570
- float: left;
1571
- min-height: 20px;
1572
- margin: 1px 1%;
1573
- border: 1px solid #ccc;
1574
- }
1575
-
1576
- .czr-single-module textarea {
1577
- max-width: 100%;
1578
- }
1579
-
1580
- /*.czr-single-module .czr-single-item .czr-item-content {
1581
- display: block;
1582
- }*/
1583
-
1584
- #customize-theme-controls .czr-single-module .czr-single-item {
1585
- width: 96%;
1586
- }
1587
-
1588
- .czr-mod-header {
1589
- background: #eee;
1590
- float: left;
1591
- width: 100%;
1592
- }
1593
- .czr-mod-title {
1594
- position: relative;
1595
- }
1596
- .czr-mod-title > h4 {
1597
- float: left;
1598
- width: 70%;
1599
- margin: 2% 0;
1600
- }
1601
- .czr-mod-drag-handler {
1602
- position: absolute;
1603
- left: 0%;
1604
- padding: 1%;
1605
- margin: 2% 0;
1606
- color: #999;
1607
- cursor: move;
1608
- cursor: grab;
1609
- cursor: -moz-grab;
1610
- cursor: -webkit-grab;
1611
- }
1612
- .czr-mod-buttons {
1613
- float: right;
1614
- width: 30%;
1615
- margin: 2% 0;
1616
- }
1617
-
1618
- .czr-mod-content {
1619
- position: absolute;
1620
- top: 0;
1621
- left: 100%;
1622
- float: left;
1623
- width: 100%;
1624
- background: #d5e9cc;
1625
- display: none;
1626
- }
1627
-
1628
-
1629
-
1630
-
1631
-
1632
-
1633
-
1634
-
1635
-
1636
- /* EDIT MODULE */
1637
- .czr-module-open #customize-info,
1638
- .czr-module-open #customize-theme-controls {
1639
- left: -200%;
1640
- }
1641
- .czr-module-open #customize-theme-controls .accordion-section-content {
1642
- overflow: visible;
1643
- }
1644
- .czr-module-description-container {
1645
- margin-bottom: 15px
1646
- }
1647
- .czr-module-title {
1648
- /*margin: -12px -12px 0 -12px;*/
1649
- border-bottom: 1px solid #ddd;
1650
- background: #fff;
1651
- }
1652
- .czr-module-title h3 {
1653
- padding: 10px 10px 12px 14px;
1654
- margin: 0;
1655
- line-height: 21px;
1656
- color: #555;
1657
- font-size: 20px;
1658
- font-weight: 200;
1659
- line-height: 26px;
1660
- display: block;
1661
- overflow: hidden;
1662
- white-space: nowrap;
1663
- text-overflow: ellipsis;
1664
- }
1665
-
1666
- #customize-controls .czr-module-title span.customize-action {
1667
- overflow: hidden;
1668
- white-space: nowrap;
1669
- text-overflow: ellipsis;
1670
- font-size: 13px;
1671
- display: block;
1672
- font-weight: 400;
1673
- }
1674
-
1675
- .czr-module-back {
1676
- display: block;
1677
- float: left;
1678
- width: 48px;
1679
- height: 74px;
1680
- padding: 0 24px 0 0;
1681
- margin: 0;
1682
- background: #fff;
1683
- border: none;
1684
- border-right: 1px solid #ddd;
1685
- -webkit-box-shadow: none;
1686
- box-shadow: none;
1687
- cursor: pointer;
1688
- -webkit-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1689
- transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1690
- }
1691
-
1692
- .czr-module-back:hover,
1693
- .czr-module-back:focus {
1694
- color: #23282d;
1695
- background: #f5f5f5;
1696
- outline: none;
1697
- -webkit-box-shadow: none;
1698
- box-shadow: none;
1699
- }
1700
-
1701
- .czr-module-back:before {
1702
- font: normal 20px/72px dashicons;
1703
- content: "\f341";
1704
- position: relative;
1705
- left: 13px;
1706
- }
1707
-
1708
-
1709
- .czr-module-back:hover {
1710
- color: #23282d;
1711
- background: #f5f5f5;
1712
- outline: none;
1713
- -webkit-box-shadow: none;
1714
- box-shadow: none;
1715
- }
1716
-
1717
-
1718
-
1719
-
1720
-
1721
-
1722
-
1723
- /* DRAGULA */
1724
- .gu-mirror {
1725
- position: fixed !important;
1726
- margin: 0 !important;
1727
- z-index: 999999 !important;
1728
- opacity: 0.8;
1729
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
1730
- filter: alpha(opacity=80);
1731
- }
1732
-
1733
- .gu-hide {
1734
- display: none !important;
1735
- }
1736
- .gu-unselectable {
1737
- -webkit-user-select: none !important;
1738
- -moz-user-select: none !important;
1739
- -ms-user-select: none !important;
1740
- user-select: none !important;
1741
- }
1742
- .gu-transit {
1743
- opacity: 0.2;
1744
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
1745
- filter: alpha(opacity=20);
1746
- }
1747
-
1748
- /* CUSTOM FOR DRAGULA */
1749
- .gu-unselectable .czr-module-collection-wrapper {
1750
- width: 98%;
1751
- border: 1px dotted green;
1752
- background: #d1ffe0;
1753
- min-height: 31px;
1754
- }
1755
- li.czr-single-module.gu-mirror, li.czr-module-candidate.gu-mirror {
1756
- list-style: none;
1757
- }
1758
- /*.czr-dragula-fake-container {
1759
- display: none;
1760
- float: left;
1761
- height: 60px;
1762
- width: 96%;
1763
- margin: 2%;
1764
- border: 2px dotted #aaa;
1765
- text-align: center;
1766
- line-height: 30px;
1767
- }
1768
- .czr-show-fake-container .czr-dragula-fake-container {
1769
- display: block;
1770
- }*/
1771
-
1772
-
1773
-
1774
-
1775
-
1776
-
1777
-
1778
-
1779
-
1780
-
1781
-
1782
-
1783
-
1784
-
1785
- /* MODULES LIST PANEL */
1786
- #czr-module-list-panel {
1787
- position: absolute;
1788
- top: 0;
1789
- bottom: 0;
1790
- left: -301px;
1791
- /*visibility: hidden;*/
1792
- opacity: 0;
1793
- overflow-x: hidden;
1794
- overflow-y: auto;
1795
- margin: 0;
1796
- z-index: 4;
1797
- background: rgba(0, 0, 0, 0.47);
1798
- -webkit-transition: all .18s;
1799
- transition: all .18s;
1800
- border-right: 1px solid #ddd;
1801
- }
1802
- #czr-module-list-panel, #czr-available-modules-filter {
1803
- width: 45%;
1804
- min-width: 300px;
1805
- }
1806
- body.czr-adding-module #czr-module-list-panel {
1807
- left: 0;
1808
- visibility: visible;
1809
- opacity: 1;
1810
- }
1811
-
1812
- /*body.czr-adding-module .wp-full-overlay-main {
1813
- left: 300px;
1814
- }*/
1815
-
1816
- body.czr-adding-module #customize-preview {
1817
- opacity: 0.7;
1818
- }
1819
-
1820
-
1821
- .add-new-module:before {
1822
- content: "\f132";
1823
- display: inline-block;
1824
- position: relative;
1825
- left: -2px;
1826
- top: -1px;
1827
- font: normal 20px/1 dashicons;
1828
- vertical-align: middle;
1829
- -webkit-transition: all 0.2s;
1830
- transition: all 0.2s;
1831
- -webkit-font-smoothing: antialiased;
1832
- -moz-osx-font-smoothing: grayscale;
1833
- }
1834
-
1835
- .czr-column .add-new-module {
1836
- margin: 1%;
1837
- float: right;
1838
- }
1839
-
1840
- body.czr-adding-module .add-new-module,
1841
- body.czr-adding-module .add-new-module:hover {
1842
- background: #eee;
1843
- border-color: #929793;
1844
- color: #32373c;
1845
- -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
1846
- box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
1847
- }
1848
-
1849
- body.czr-adding-module .add-new-module:before {
1850
- -webkit-transform: rotate(45deg);
1851
- -ms-transform: rotate(45deg);
1852
- transform: rotate(45deg);
1853
- }
1854
-
1855
-
1856
- #czr-available-modules-list {
1857
- top: 60px;
1858
- position: absolute;
1859
- overflow: auto;
1860
- bottom: 0;
1861
- width: 100%;
1862
- }
1863
-
1864
- #czr-available-modules-filter {
1865
- position: fixed;
1866
- top: 0;
1867
- z-index: 1;
1868
- background: rgba(0, 0, 0, 0.47);
1869
- border-bottom: 1px solid #e5e5e5;
1870
- }
1871
-
1872
- /* search field container */
1873
- #czr-available-modules-filter {
1874
- padding: 12px 15px;
1875
- -webkit-box-sizing: border-box;
1876
- -moz-box-sizing: border-box;
1877
- box-sizing: border-box;
1878
- }
1879
-
1880
- #czr-available-modules-filter input {
1881
- padding: 6px 10px;
1882
- width: 100%;
1883
- }
1884
-
1885
- #czr-available-modules-list .czr-module-candidate {
1886
- position: relative;
1887
- /*padding: 1%;*/
1888
- border-bottom: 1px solid #e5e5e5;
1889
- }
1890
-
1891
- #czr-available-modules-list .czr-module-candidate h3 {
1892
- color: #fff;
1893
- padding: 0px;
1894
- margin: 0;
1895
- }
1896
- #czr-available-modules-list .czr-mod-drag-handler {
1897
- position: relative;
1898
- left: 0%;
1899
- padding: 1%;
1900
- margin: 2% 4%;
1901
- color: inherit;
1902
- cursor: move;
1903
- cursor: grab;
1904
- cursor: -moz-grab;
1905
- cursor: -webkit-grab;
1906
- }
1907
-
1908
-
1909
-
1910
-
1911
-
1912
-
1913
- /* SEKTION SETTINGS PANEL */
1914
- #czr-sektion-settings-panel {
1915
- position: absolute;
1916
- top: 0;
1917
- bottom: 0;
1918
- width: 45%;
1919
- min-width: 300px;
1920
- left: -301px;
1921
- /*visibility: hidden;*/
1922
- opacity: 0;
1923
- overflow-x: hidden;
1924
- overflow-y: auto;
1925
- margin: 0;
1926
- z-index: 4;
1927
- background: rgba(0, 0, 0, 0.47);
1928
- -webkit-transition: all .18s;
1929
- transition: all .18s;
1930
- border-right: 1px solid #ddd;
1931
- color: #fff;
1932
- }
1933
- #czr-sektion-settings-panel h3 {
1934
- color: #fff;
1935
- }
1936
- body.czr-editing-sektion #czr-sektion-settings-panel {
1937
- left: 0;
1938
- visibility: visible;
1939
- opacity: 1;
1940
- }
1941
-
1942
- /*body.czr-editing-sektion .wp-full-overlay-main {
1943
- left: 300px;
1944
- }*/
1945
-
1946
- body.czr-editing-sektion #customize-preview {
1947
- opacity: 0.7;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1948
  }/* WP SAVE BUTTON */
1949
  .czr-api-dirty input#save {
1950
  background-color: #FFBD2E;
202
 
203
 
204
  /* PANELS AND SECTIONS TITLES */
 
205
  .wp-customizer .control-section.control-panel .accordion-section-title .panel-title {
206
  font-size: 24px;
207
  font-weight: inherit;
254
  }
255
 
256
 
257
+ /* CONTROLS */
258
+ li[id*="customize-control-"] {
259
+ margin: 8px 0;
260
+ padding: 2%;
261
+ width: 96%;
262
+ border: 1px solid #ddd;
263
+ box-shadow: 1px 1px 2px 1px rgba(204, 204, 204, 0.4);
264
+ -webkit-box-shadow: 1px 1px 2px 1px rgba(204, 204, 204, 0.4);
265
+ }
266
+
267
  /* GENERAL STYLE */
268
  .control-section .accordion-section-content {
269
  overflow-y: auto;
1009
  font-size: 11px;
1010
  font-style: italic;
1011
  }
1012
+
1013
+
1014
+ /* MODULE OPTIONS ICON AND PANEL*/
1015
+ .czr-toggle-modopt {
1016
+ color: #95a5a6;
1017
+ text-shadow: 1px 1px 0px white;
1018
+ -webkit-transition: color 0.4s;
1019
+ transition: color 0.4s;
1020
+ position: absolute;
1021
+ right: 0;
1022
+ padding-left: 3px;
1023
+ font-size: 25px;
1024
+ line-height: 24px;
1025
+ }
1026
+
1027
+ .czr-modopt-visible .czr-toggle-modopt, .czr-toggle-modopt:hover {
1028
+ color: #3b8dbd;
1029
+ }
1030
+
1031
+ body.czr-editing-modopt #customize-preview {
1032
+ opacity: 0.7;
1033
+ }
1034
+ body #customize-controls {
1035
+ -webkit-transition: opacity .4s ease-in-out;
1036
+ -moz-transition: opacity .4s ease-in-out;
1037
+ -ms-transition: opacity .4s ease-in-out;
1038
+ -o-transition: opacity .4s ease-in-out;
1039
+ transition: opacity .4s ease-in-out;
1040
+ }
1041
+ body.czr-editing-modopt #customize-controls {
1042
+ opacity: 0.4;
1043
+ }
1044
+ .czr-mod-opt-wrapper {
1045
+ position: absolute;
1046
+ top: 0;
1047
+ bottom: 0;
1048
+ left: -301px;
1049
+ /*visibility: hidden;*/
1050
+ opacity: 0;
1051
+ overflow-x: hidden;
1052
+ overflow-y: auto;
1053
+ margin: 0;
1054
+ z-index: 4;
1055
+ background: rgba(0, 0, 0, 0.47);
1056
+ -webkit-transition: all .18s ease-in-out;
1057
+ -moz-transition: all .18s ease-in-out;
1058
+ -ms-transition: all .18s ease-in-out;
1059
+ -o-transition: all .18s ease-in-out;
1060
+ transition: all .18s ease-in-out;
1061
+ border-right: 1px solid #4c4c4c;
1062
+ }
1063
+ .czr-mod-opt-wrapper {
1064
+ width: 45%;
1065
+ min-width: 300px;
1066
+ padding: 6%;
1067
+ color: #fff;
1068
+ }
1069
+ body.czr-editing-modopt .czr-mod-opt-wrapper {
1070
+ left: 0;
1071
+ visibility: visible;
1072
+ opacity: 1;
1073
+ }
1074
+ .czr-close-modopt {
1075
+ position: absolute;
1076
+ top: 10px;
1077
+ right: 25px;
1078
+ font-size: 31px;
1079
+ cursor: pointer;
1080
+ }
1081
+
1082
+ /* OPTIONS STYLE */
1083
+ .czr-mod-opt-wrapper .czr-sub-set {
1084
+ border: 1px dotted #ccc;
1085
+ background: rgba(238, 238, 238, 0.18);
1086
+ padding: 3%;
1087
+ width: 94%;
1088
+ margin: 5px 0;
1089
+ }
1090
+ .czr-mod-opt-wrapper .czr-notice {
1091
+ color: #fff;
1092
+ }
1093
+
1094
+ .czr-mod-opt-wrapper .mod-opt-title {
1095
+ color: #fff;
1096
+ border-bottom: 1px solid #fff;
1097
+ padding: 5% 0;
1098
+ text-align: center;
1099
+ }
1100
+
1101
  .in-sub-panel #czr-donate-customizer,
1102
  .in-sub-panel .czr-cta-wrap {
1103
  left: -450px;
1166
  width: 440px;
1167
  }
1168
  }
1169
+ /*
1170
+ * Selecter v3.1.9 - 2014-09-02
1171
+ * A jQuery plugin for replacing default select elements. Part of the Formstone Library.
1172
+ * http://formstone.it/selecter/
1173
+ *
1174
+ * Copyright 2014 Ben Plum; MIT Licensed
1175
+ */
1176
+ .selecter-element { *left: -999999px; position: absolute; opacity: 0; }
1177
+ .selecter { display: block;float: right;margin: 2px 0;position: relative;width: 100%;z-index: 100; }
1178
+ .selecter .selecter-selected { background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat right center; border: 1px solid #ccc; border-radius: 3px; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 4px 4.6%; position: relative; text-overflow: clip; z-index: 49; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);height: auto;line-height: 18px;width: 90%; }
1179
+
1180
+ .selecter .selecter-options { border: 1px solid #ccc; border-width: 0 1px 1px; background-color: #fefefe; border-radius: 0 0 3px 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); display: none; left: 0; margin: 0; max-height: 260px; overflow: auto; overflow-x: hidden; padding: 0; position: relative; top: 100%; width: 99%; *width: auto; z-index: 50; }
1181
+ .selecter .selecter-group { background: #F9F9F9; border-bottom: 1px solid #e3e3e3; color: #999; display: block; font-size: 11px; padding: 5px 10px 4px; text-transform: uppercase; }
1182
+ .selecter .selecter-item { background: #fff; border-bottom: 1px solid #e3e3e3; color: #333; cursor: pointer; display: block; font-size: 13px; margin: 0; overflow: hidden; padding: 8px 10px; text-overflow: ellipsis; width: 86%;height: auto;line-height: 14px;padding: 8px 24px 8px 10px;}
1183
+ .selecter .selecter-item.selected { background: #F9F9F9; }
1184
+ .selecter .selecter-item.disabled { color: #999; cursor: default; }
1185
+ .selecter .selecter-item:first-child { border-radius: 0; }
1186
+ .selecter .selecter-item:last-child { border-radius: 0 0 2px 2px; border-bottom: 0; }
1187
+
1188
+ /* CUSTOM FOR CUSTOMIZR */
1189
+ .rtl .selecter .selecter-selected {
1190
+ background: #F9F9F9 url(img/jquery.fs.selecter-arrow.png) no-repeat 4% center;
1191
+ }
1192
+
1193
+ @media screen and (min-width: 980px) {
1194
+ .selecter .selecter-item:hover,
1195
+ .selecter .selecter-item.selected:hover { background-color: #f3f3f3; }
1196
+ .selecter .selecter-item.disabled:hover { background-color: #fff; }
1197
+
1198
+ .selecter:hover .selecter-selected { background-color: #fff; }
1199
+
1200
+ .selecter.disabled .selecter-item:hover { background: #fff; }
1201
+ }
1202
+
1203
+ /* Open */
1204
+ .selecter.open { z-index: 101; }
1205
+ .selecter.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 51; }
1206
+
1207
+ .selecter.open .selecter-selected,
1208
+ .selecter.focus .selecter-selected { background-color: #fff; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); }
1209
+
1210
+ /* 'Cover' Positioning */
1211
+ .selecter.cover .selecter-options { border-radius: 3px; border-width: 1px; top: 0; }
1212
+ .selecter.cover .selecter-options .selecter-item.first { border-radius: 3px 3px 0 0; }
1213
+ .selecter.cover.open .selecter-selected { border-radius: 3px 3px 0 0; z-index: 49; }
1214
+
1215
+ /* 'Bottom' Positioning */
1216
+ .selecter.bottom .selecter-options { border-width: 1px 1px 0; bottom: 100%; top: auto; }
1217
+ .selecter.bottom .selecter-item:last-child { border: none; }
1218
+ .selecter.bottom.open .selecter-selected { border-radius: 0 0 3px 3px; }
1219
+ .selecter.bottom.open .selecter-options { border-radius: 3px 3px 0 0; }
1220
+
1221
+ /* 'Bottom' + 'Cover' Positioning */
1222
+ .selecter.bottom.cover .selecter-options { bottom: 0; top: auto; }
1223
+ .selecter.bottom.cover.open .selecter-selected { border-radius: 3px; }
1224
+ .selecter.bottom.cover.open .selecter-options { border-radius: 3px; }
1225
+
1226
+ /* Multiple Select */
1227
+ .selecter.multiple .selecter-options { border-radius: 3px; border-width: 1px; box-shadow: none; display: block; position: static; width: 100%; }
1228
+
1229
+ /* 'Disabled' State */
1230
+ .selecter.disabled .selecter-selected { background: #fff; border-color: #eee; color: #ccc; cursor: default; }
1231
+ .selecter.disabled .selecter-options { background: #fff; border-color: #eee; }
1232
+ .selecter.disabled .selecter-group,
1233
+ .selecter.disabled .selecter-item { border-color: #eee; color: #ccc; cursor: default; }
1234
+ .selecter.disabled .selecter-item.selected { background: #fafafa; }
1235
+
1236
+ /* Scroller Support */
1237
+ .selecter .selecter-options.scroller { overflow: hidden; }
1238
+ .selecter .selecter-options.scroller .scroller-content { max-height: 260px; padding: 0; }
1239
+
1240
+ /* Media Queries */
1241
+ @media screen and (max-width: 740px) {
1242
+ .selecter { max-width: 100%; }
1243
+ }
1244
+ @media screen and (max-width: 500px) {
1245
+ .selecter { max-width: 100%; }
1246
+ }
1247
+
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+
1254
+
1255
+
1256
+
1257
+
1258
+ /*
1259
+ * Stepper v3.0.7 - 2014-05-07
1260
+ * A jQuery plugin for cross browser number inputs. Part of the Formstone Library.
1261
+ * http://formstone.it/stepper/
1262
+ *
1263
+ * Copyright 2014 Ben Plum; MIT Licensed
1264
+ */
1265
+ .stepper { border-radius: 3px; margin: 0 0 10px 0; overflow: hidden; position: relative; width: 35%;float: left; clear: both;}
1266
+ .stepper .stepper-input { background: #F9F9F9; border: 1px solid #ccc; border-radius: 3px; color: #333; font-size: 13px; line-height: 1.2; margin: 0; overflow: hidden; padding: 5px 10px 5px!important; width: 100%!important; z-index: 49; -moz-appearance: textfield;max-width: none!important;
1267
+ }
1268
+
1269
+ .stepper .stepper-input::-webkit-inner-spin-button,
1270
+ .stepper .stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
1271
+
1272
+ .stepper .stepper-input:focus { background-color: #fff; }
1273
+ .stepper .stepper-arrow { background: #eee url(img/jquery.fs.stepper-arrows.png) no-repeat; border: 1px solid #ccc; cursor: pointer; display: block; height: 46%; position: absolute; right: 0; text-indent: -99999px; width: 20px; z-index: 50; }
1274
+ .stepper .stepper-arrow.up { background-position: center top; border-bottom: none; top: 0; }
1275
+ .stepper .stepper-arrow.down { background-position: center bottom; bottom: 0; }
1276
+
1277
+ /* CUSTOM FOR CUSTOMIZR */
1278
+ .rtl .stepper .stepper-input {
1279
+ text-align: left;
1280
+ }
1281
+
1282
+ @media screen and (min-width: 740px) {
1283
+ .stepper:hover .stepper-input { background-color: #fff; }
1284
+
1285
+ .stepper .stepper-step:hover { background-color: #F9F9F9; }
1286
+
1287
+ .stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
1288
+ }
1289
+
1290
+ .stepper.disabled .stepper-input { background: #fff; border-color: #eee; color: #ccc; }
1291
+ .stepper.disabled .stepper-arrow { background: #fff; border-color: #eee; cursor: default; }
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+ /* iCheck plugin Flat skin, green
1305
+ ----------------------------------- */
1306
+ .icheckbox_flat-green,
1307
+ .iradio_flat-green {
1308
+ display: inline-block;
1309
+ *display: inline;
1310
+ vertical-align: middle;
1311
+ margin: 0;
1312
+ padding: 0;
1313
+ width: 20px;
1314
+ height: 20px;
1315
+ background: url(img/green.png) no-repeat;
1316
+ border: none;
1317
+ cursor: pointer;
1318
+ top: 4px;
1319
+ float: right;
1320
+ }
1321
+ /* RTL fix of check box position */
1322
+ .rtl .icheckbox_flat-green {
1323
+ float: left;
1324
+ }
1325
+ .icheckbox_flat-green {
1326
+ background-position: 0 0;
1327
+ }
1328
+ .icheckbox_flat-green.checked {
1329
+ background-position: -22px 0;
1330
+ }
1331
+ .icheckbox_flat-green.disabled {
1332
+ background-position: -44px 0;
1333
+ cursor: default;
1334
+ }
1335
+ .icheckbox_flat-green.checked.disabled {
1336
+ background-position: -66px 0;
1337
+ }
1338
+
1339
+ .iradio_flat-green {
1340
+ background-position: -88px 0;
1341
+ }
1342
+ .iradio_flat-green.checked {
1343
+ background-position: -110px 0;
1344
+ }
1345
+ .iradio_flat-green.disabled {
1346
+ background-position: -132px 0;
1347
+ cursor: default;
1348
+ }
1349
+ .iradio_flat-green.checked.disabled {
1350
+ background-position: -154px 0;
1351
+ }
1352
+
1353
+ /* Retina support */
1354
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
1355
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
1356
+ only screen and (-o-min-device-pixel-ratio: 3/2),
1357
+ only screen and (min-device-pixel-ratio: 1.5) {
1358
+ .icheckbox_flat-green,
1359
+ .iradio_flat-green {
1360
+ background-image: url(img/green@2x.png);
1361
+ -webkit-background-size: 176px 22px;
1362
+ background-size: 176px 22px;
1363
+ }
1364
+ }
1365
+
1366
+ /* iCheck plugin Flat skin, grey
1367
+ ----------------------------------- */
1368
+ .icheckbox_flat-grey,
1369
+ .iradio_flat-grey {
1370
+ display: inline-block;
1371
+ *display: inline;
1372
+ vertical-align: middle;
1373
+ margin: 0;
1374
+ padding: 0;
1375
+ width: 20px;
1376
+ height: 20px;
1377
+ background: url(img/grey.png) no-repeat;
1378
+ border: none;
1379
+ cursor: pointer;
1380
+ top: 4px;
1381
+ float: right;
1382
+ }
1383
+
1384
+ .icheckbox_flat-grey {
1385
+ background-position: 0 0;
1386
+ }
1387
+ .icheckbox_flat-grey.checked {
1388
+ background-position: -22px 0;
1389
+ }
1390
+ .icheckbox_flat-grey.disabled {
1391
+ background-position: -44px 0;
1392
+ cursor: default;
1393
+ }
1394
+ .icheckbox_flat-grey.checked.disabled {
1395
+ background-position: -66px 0;
1396
+ }
1397
+
1398
+ .iradio_flat-grey {
1399
+ background-position: -88px 0;
1400
+ }
1401
+ .iradio_flat-grey.checked {
1402
+ background-position: -110px 0;
1403
+ }
1404
+ .iradio_flat-grey.disabled {
1405
+ background-position: -132px 0;
1406
+ cursor: default;
1407
+ }
1408
+ .iradio_flat-grey.checked.disabled {
1409
+ background-position: -154px 0;
1410
+ }
1411
+
1412
+ /* Retina support */
1413
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
1414
+ only screen and (-moz-min-device-pixel-ratio: 1.5),
1415
+ only screen and (-o-min-device-pixel-ratio: 3/2),
1416
+ only screen and (min-device-pixel-ratio: 1.5) {
1417
+ .icheckbox_flat-grey,
1418
+ .iradio_flat-grey {
1419
+ background-image: url(img/grey@2x.png);
1420
+ -webkit-background-size: 176px 22px;
1421
+ background-size: 176px 22px;
1422
+ }
1423
+ }
1424
+
1425
+ .czr-sub-set .icheckbox_flat-green, .iradio_flat-green {
1426
+ float: left;
1427
+ }
1428
+
1429
+
1430
+
1431
+
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+ /* SELECT 2 SPECIFICS */
1445
+ body .select2-container {
1446
+ z-index: 1000000;
1447
+ width: 100%!important;
1448
+ }
1449
+
1450
+ .customize-control-czr_layouts .select2-selection--single {
1451
+ height: 33px;
1452
+ }
1453
+ .customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow {
1454
+ height: 30px;
1455
+ }
1456
+ .select2-selection__rendered:focus, .customize-control-czr_layouts .select2-selection--single:focus {
1457
+ outline: none;
1458
+ }
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+ /* SPECIFIC INPUT STYLE */
1465
+ span.select2-results, body .select2-container {
1466
+ font-size: 14px;
1467
+ }
1468
+
1469
+
1470
+ /* for multipe picker */
1471
+ .select2-container--default .select2-selection--multiple {
1472
+ -webkit-border-radius: 0px;
1473
+ -moz-border-radius: 0px;
1474
+ border-radius: 0;
1475
+ width: 99%;
1476
+ min-height: 36px;
1477
+ border: 1px solid #ddd;
1478
+ -webkit-box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
1479
+ box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
1480
+ }
1481
+ .select2-container--default.select2-container--focus .select2-selection--multiple {
1482
+ border-color: #00a0d2!important;
1483
+ -webkit-box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
1484
+ box-shadow: 0 0 2px rgba(26, 188, 156, 0.8)!important;
1485
+ }
1486
+ .select2-results__options li {
1487
+ margin-bottom: 0
1488
+ }
1489
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
1490
+ padding: 2px;
1491
+ font-size: 13px;
1492
+ -webkit-border-radius: 2px;
1493
+ -moz-border-radius: 2px;
1494
+ border-radius: 2px;
1495
+ margin-bottom: 0;
1496
+ }
1497
+ .select2-container--default .select2-results__option--highlighted[aria-selected] {
1498
+ background-color: #00a0d2;
1499
+ }
1500
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
1501
+ font-size: 17px;
1502
+ position: relative;
1503
+ top: 2px;
1504
+ color: #23282d;
1505
+ }
1506
+
1507
+ /* Socials Specifics */
1508
+ .customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered {
1509
+ padding: 5px;
1510
+ line-height: 16px;
1511
+ }
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+
1520
+
1521
+
1522
+
1523
+
1524
+ /* WP TEXT EDITOR */
1525
+ #czr-customize-content_editor-pane {
1526
+ border-top: solid 1px #ddd;
1527
+ position: absolute;
1528
+ height: 300px;
1529
+ bottom: -301px;
1530
+ right: 0;
1531
+ left: 0;
1532
+ z-index: 20;
1533
+ background: #f1f1f1;
1534
+ display: block;
1535
+ -webkit-transition: all 0.2s;
1536
+ transition: all 0.2s;
1537
+ visibility: hidden;
1538
+ }
1539
+ body.czr-customize-content_editor-pane-resize #customize-preview,
1540
+ body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane {
1541
+ -webkit-transition: none;
1542
+ transition: none;
1543
+ }
1544
+ body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
1545
+ top: 0;
1546
+ }
1547
+ body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane {
1548
+ bottom: 0;
1549
+ visibility: inherit;
1550
+ }
1551
+ #czr-customize-content_editor-pane .wp-editor-tools {
1552
+ padding-top: 5px;
1553
+ padding-right: 10px;
1554
+ }
1555
+ #czr-customize-content_editor-pane .wp-media-buttons {
1556
+ padding-left: 5px;
1557
+ }
1558
+ #customize-preview {
1559
+ height: auto;
1560
+ }
1561
+ body.czr-customize-content_editor-pane-open #customize-preview {
1562
+ bottom: 300px;
1563
+ }
1564
+ body.mce-fullscreen #customize-preview {
1565
+ bottom: 0;
1566
+ }
1567
+ body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen {
1568
+ position: relative;
1569
+ left: 0;
1570
+ }
1571
+ #wp-czr-customize-content_editor-container {
1572
+ border-left: 0;
1573
+ }
1574
+ /* vertical resize bar */
1575
+ #czr-customize-content_editor-dragbar {
1576
+ top: 0;
1577
+ cursor: row-resize;
1578
+ display: block;
1579
+ height: 4px;
1580
+ position: absolute;
1581
+ width: 100%;
1582
+ z-index: 21;
1583
+ }
1584
+ body.czr-customize-content_editor-pane-resize #customize-preview:before {
1585
+ top: 0;
1586
+ right: 0;
1587
+ bottom: 0;
1588
+ left: 0;
1589
+ position: absolute;
1590
+ height: 100%;
1591
+ width: 100%;
1592
+ z-index: 999999;
1593
+ }
1594
+ /* @todo Mobile support for rich text editor */
1595
+ .wp-customizer .ui-autocomplete.wplink-autocomplete {
1596
+ z-index: 500110; /* originally 100110, but z-index of .wp-full-overlay is 500000 */
1597
+ }
1598
+ .wp-customizer #wp-link-wrap {
1599
+ z-index: 500105; /* originally 100105, but z-index of .wp-full-overlay is 500000 */
1600
+ }
1601
+ .wp-customizer #wp_editbtns,
1602
+ .wp-customizer #wp_gallerybtns {
1603
+ z-index: 500020; /* originally 100020, but z-index of .wp-full-overlay is 500000 */
1604
+ }
1605
+ .wp-customizer #TB_overlay,
1606
+ .wp-customizer #TB_window {
1607
+ z-index: 500050;
1608
+ }
1609
+ .wp-customizer .mce-panel,
1610
+ .wp-customizer .mce-tooltip {
1611
+ z-index: 500100 !important; /* originally 100100, but z-index of .wp-full-overlay is 500000 */
1612
+ }
1613
+ .czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar {
1614
+ z-index: 30;
1615
+ }
1616
+ .czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar {
1617
+ bottom: 308px;
1618
+ }
1619
+ .czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar {
1620
+ bottom: 0 !important;
1621
+ }
1622
+ .czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar {
1623
+ -webkit-transition: none;
1624
+ transition: none;
1625
+ }
1626
+ .czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar {
1627
+ bottom: 8px !important;
1628
+ }
1629
+
1630
+
1631
+
1632
+ /* CONTENT PICKER */
1633
+ .czr-sub-set[data-input-type="content_picker"] .customize-control-title {
1634
+ width: 100%;
1635
+ }
1636
+ .czr-sub-set[data-input-type="content_picker"] .czr-input {
1637
+ width: 100%;
1638
+ }
1639
+ .content-item-bar {
1640
+ line-height: 1.5em;
1641
+ }
1642
+
1643
+ .czr-sub-set[data-input-type="content_picker"] span.item-title {
1644
+ display: block;
1645
+ float: left;
1646
+ max-width: 80%;
1647
+ }
1648
+
1649
+ .czr-sub-set[data-input-type="content_picker"] span.item-type {
1650
+ display: inline-block;
1651
+ padding: 0;
1652
+ padding-right: 10px;
1653
+ float: right;
1654
+ }
1655
+
1656
+
1657
+
1658
+
1659
+
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1667
+
1668
+ /* RANGE SLIDER rangeslider.js - v2.3.0 - https://github.com/andreruffert/rangeslider.js */
1669
+ .rangeslider,
1670
+ .rangeslider__fill {
1671
+ display: block;
1672
+ -moz-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
1673
+ -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
1674
+ box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.3);
1675
+ -moz-border-radius: 10px;
1676
+ -webkit-border-radius: 10px;
1677
+ border-radius: 10px;
1678
+ }
1679
+
1680
+ .rangeslider {
1681
+ background: #e6e6e6;
1682
+ position: relative;
1683
+ }
1684
+
1685
+ .rangeslider--horizontal {
1686
+ height: 20px;
1687
+ width: 100%;
1688
+ }
1689
+
1690
+ .rangeslider--vertical {
1691
+ width: 20px;
1692
+ min-height: 150px;
1693
+ max-height: 100%;
1694
+ }
1695
+
1696
+ .rangeslider--disabled {
1697
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40);
1698
+ opacity: 0.4;
1699
+ }
1700
+
1701
+ .rangeslider__fill {
1702
+ background: #00ff00;
1703
+ position: absolute;
1704
+ }
1705
+ .rangeslider--horizontal .rangeslider__fill {
1706
+ top: 0;
1707
+ height: 100%;
1708
+ }
1709
+ .rangeslider--vertical .rangeslider__fill {
1710
+ bottom: 0;
1711
+ width: 100%;
1712
+ }
1713
+
1714
+ .rangeslider__handle {
1715
+ background: white;
1716
+ border: 1px solid #ccc;
1717
+ cursor: pointer;
1718
+ display: inline-block;
1719
+ width: 40px;
1720
+ height: 40px;
1721
+ position: absolute;
1722
+ background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g');
1723
+ background-size: 100%;
1724
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(0, 0, 0, 0.1)));
1725
+ background-image: -moz-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
1726
+ background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
1727
+ background-image: linear-gradient(rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
1728
+ -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
1729
+ -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
1730
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
1731
+ -moz-border-radius: 50%;
1732
+ -webkit-border-radius: 50%;
1733
+ border-radius: 50%;
1734
+ line-height: 42px;
1735
+ text-align: center;
1736
+ color: #404040;
1737
+ font-size: 15px;
1738
+ }
1739
+
1740
+ .rangeslider__handle:after {
1741
+ content: "";
1742
+ display: block;
1743
+ width: 18px;
1744
+ height: 18px;
1745
+ margin: auto;
1746
+ position: absolute;
1747
+ top: 0;
1748
+ right: 0;
1749
+ bottom: 0;
1750
+ left: 0;
1751
+ background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
1752
+ background-size: 100%;
1753
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.13)), color-stop(100%, rgba(255, 255, 255, 0)));
1754
+ background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
1755
+ background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
1756
+ background-image: linear-gradient(rgba(0, 0, 0, 0.13), rgba(255, 255, 255, 0));
1757
+ -moz-border-radius: 50%;
1758
+ -webkit-border-radius: 50%;
1759
+ border-radius: 50%;
1760
+ }
1761
+ .rangeslider__handle:active, .rangeslider--active .rangeslider__handle {
1762
+ background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
1763
+ background-size: 100%;
1764
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(0, 0, 0, 0.1)), color-stop(100%, rgba(0, 0, 0, 0.12)));
1765
+ background-image: -moz-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
1766
+ background-image: -webkit-linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
1767
+ background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.12));
1768
+ }
1769
+ .rangeslider--horizontal .rangeslider__handle {
1770
+ top: -10px;
1771
+ touch-action: pan-y;
1772
+ -ms-touch-action: pan-y;
1773
+ }
1774
+ .rangeslider--vertical .rangeslider__handle {
1775
+ left: -10px;
1776
+ touch-action: pan-x;
1777
+ -ms-touch-action: pan-x;
1778
+ }
1779
+
1780
+ input[type="range"]:focus + .rangeslider .rangeslider__handle {
1781
+ -moz-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
1782
+ -webkit-box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
1783
+ box-shadow: 0 0 8px rgba(255, 0, 255, 0.9);
1784
+ }/* OVERRIDE WP CUSTOMIZER */
1785
+
1786
+ /* SEKTIONS AND COLUMNS */
1787
+ .czr-sektion-buttons {
1788
+ position: absolute;
1789
+ right: 0;
1790
+ }
1791
+ .czr-column {
1792
+ width: 99%;
1793
+ margin-bottom: 1%;
1794
+ float: left;
1795
+ padding: 2% 0%;
1796
+ border: 2px dotted #aaa;
1797
+ text-align: center;
1798
+ }
1799
+ .czr-column-header {
1800
+ position: relative;
1801
+ }
1802
+ .czr-col-drag-handler {
1803
+ position: absolute;
1804
+ left: 0%;
1805
+ padding: 1%;
1806
+ color: #999;
1807
+ cursor: move;
1808
+ cursor: grab;
1809
+ cursor: -moz-grab;
1810
+ cursor: -webkit-grab;
1811
+ }
1812
+
1813
+
1814
+
1815
+
1816
+ /* MODULES */
1817
+ .czr-module-collection-wrapper {
1818
+ width: 100%;
1819
+ min-height: 5px;
1820
+ float: left;
1821
+ }
1822
+ .czr-single-module {
1823
+ width: 98%;
1824
+ float: left;
1825
+ min-height: 20px;
1826
+ margin: 1px 1%;
1827
+ border: 1px solid #ccc;
1828
+ }
1829
+
1830
+ .czr-single-module textarea {
1831
+ max-width: 100%;
1832
+ }
1833
+
1834
+ /*.czr-single-module .czr-single-item .czr-item-content {
1835
+ display: block;
1836
+ }*/
1837
+
1838
+ #customize-theme-controls .czr-single-module .czr-single-item {
1839
+ width: 96%;
1840
+ }
1841
+
1842
+ .czr-mod-header {
1843
+ background: #eee;
1844
+ float: left;
1845
+ width: 100%;
1846
+ }
1847
+ .czr-mod-title {
1848
+ position: relative;
1849
+ }
1850
+ .czr-mod-title > h4 {
1851
+ float: left;
1852
+ width: 70%;
1853
+ margin: 2% 0;
1854
+ }
1855
+ .czr-mod-drag-handler {
1856
+ position: absolute;
1857
+ left: 0%;
1858
+ padding: 1%;
1859
+ margin: 2% 0;
1860
+ color: #999;
1861
+ cursor: move;
1862
+ cursor: grab;
1863
+ cursor: -moz-grab;
1864
+ cursor: -webkit-grab;
1865
+ }
1866
+ .czr-mod-buttons {
1867
+ float: right;
1868
+ width: 30%;
1869
+ margin: 2% 0;
1870
+ }
1871
+
1872
+ .czr-mod-content {
1873
+ position: absolute;
1874
+ top: 0;
1875
+ left: 100%;
1876
+ float: left;
1877
+ width: 100%;
1878
+ background: #d5e9cc;
1879
+ display: none;
1880
+ }
1881
+
1882
+
1883
+
1884
+
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+ /* EDIT MODULE */
1891
+ .czr-module-open #customize-info,
1892
+ .czr-module-open #customize-theme-controls {
1893
+ left: -200%;
1894
+ }
1895
+ .czr-module-open #customize-theme-controls .accordion-section-content {
1896
+ overflow: visible;
1897
+ }
1898
+ .czr-module-description-container {
1899
+ margin-bottom: 15px
1900
+ }
1901
+ .czr-module-title {
1902
+ /*margin: -12px -12px 0 -12px;*/
1903
+ border-bottom: 1px solid #ddd;
1904
+ background: #fff;
1905
+ }
1906
+ .czr-module-title h3 {
1907
+ padding: 10px 10px 12px 14px;
1908
+ margin: 0;
1909
+ line-height: 21px;
1910
+ color: #555;
1911
+ font-size: 20px;
1912
+ font-weight: 200;
1913
+ line-height: 26px;
1914
+ display: block;
1915
+ overflow: hidden;
1916
+ white-space: nowrap;
1917
+ text-overflow: ellipsis;
1918
+ }
1919
+
1920
+ #customize-controls .czr-module-title span.customize-action {
1921
+ overflow: hidden;
1922
+ white-space: nowrap;
1923
+ text-overflow: ellipsis;
1924
+ font-size: 13px;
1925
+ display: block;
1926
+ font-weight: 400;
1927
+ }
1928
+
1929
+ .czr-module-back {
1930
+ display: block;
1931
+ float: left;
1932
+ width: 48px;
1933
+ height: 74px;
1934
+ padding: 0 24px 0 0;
1935
+ margin: 0;
1936
+ background: #fff;
1937
+ border: none;
1938
+ border-right: 1px solid #ddd;
1939
+ -webkit-box-shadow: none;
1940
+ box-shadow: none;
1941
+ cursor: pointer;
1942
+ -webkit-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1943
+ -moz-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1944
+ -ms-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1945
+ -o-transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1946
+ transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
1947
+ }
1948
+
1949
+ .czr-module-back:hover,
1950
+ .czr-module-back:focus {
1951
+ color: #23282d;
1952
+ background: #f5f5f5;
1953
+ outline: none;
1954
+ -webkit-box-shadow: none;
1955
+ box-shadow: none;
1956
+ }
1957
+
1958
+ .czr-module-back:before {
1959
+ font: normal 20px/72px dashicons;
1960
+ content: "\f341";
1961
+ position: relative;
1962
+ left: 13px;
1963
+ }
1964
+
1965
+
1966
+ .czr-module-back:hover {
1967
+ color: #23282d;
1968
+ background: #f5f5f5;
1969
+ outline: none;
1970
+ -webkit-box-shadow: none;
1971
+ box-shadow: none;
1972
+ }
1973
+
1974
+
1975
+
1976
+
1977
+
1978
+
1979
+
1980
+ /* DRAGULA */
1981
+ .gu-mirror {
1982
+ position: fixed !important;
1983
+ margin: 0 !important;
1984
+ z-index: 999999 !important;
1985
+ opacity: 0.8;
1986
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
1987
+ filter: alpha(opacity=80);
1988
+ }
1989
+
1990
+ .gu-hide {
1991
+ display: none !important;
1992
+ }
1993
+ .gu-unselectable {
1994
+ -webkit-user-select: none !important;
1995
+ -moz-user-select: none !important;
1996
+ -ms-user-select: none !important;
1997
+ user-select: none !important;
1998
+ }
1999
+ .gu-transit {
2000
+ opacity: 0.2;
2001
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
2002
+ filter: alpha(opacity=20);
2003
+ }
2004
+
2005
+ /* CUSTOM FOR DRAGULA */
2006
+ .gu-unselectable .czr-module-collection-wrapper {
2007
+ width: 98%;
2008
+ border: 1px dotted green;
2009
+ background: #d1ffe0;
2010
+ min-height: 31px;
2011
+ }
2012
+ li.czr-single-module.gu-mirror, li.czr-module-candidate.gu-mirror {
2013
+ list-style: none;
2014
+ }
2015
+ /*.czr-dragula-fake-container {
2016
+ display: none;
2017
+ float: left;
2018
+ height: 60px;
2019
+ width: 96%;
2020
+ margin: 2%;
2021
+ border: 2px dotted #aaa;
2022
+ text-align: center;
2023
+ line-height: 30px;
2024
+ }
2025
+ .czr-show-fake-container .czr-dragula-fake-container {
2026
+ display: block;
2027
+ }*/
2028
+
2029
+
2030
+
2031
+
2032
+
2033
+
2034
+
2035
+
2036
+
2037
+
2038
+
2039
+
2040
+
2041
+
2042
+ /* MODULES LIST PANEL */
2043
+ #czr-module-list-panel {
2044
+ position: absolute;
2045
+ top: 0;
2046
+ bottom: 0;
2047
+ left: -301px;
2048
+ /*visibility: hidden;*/
2049
+ opacity: 0;
2050
+ overflow-x: hidden;
2051
+ overflow-y: auto;
2052
+ margin: 0;
2053
+ z-index: 4;
2054
+ background: rgba(0, 0, 0, 0.47);
2055
+ -webkit-transition: all .18s;
2056
+ -moz-transition: all .18s;
2057
+ -ms-transition: all .18s;
2058
+ -o-transition: all .18s;
2059
+ transition: all .18s;
2060
+ border-right: 1px solid #ddd;
2061
+ }
2062
+ #czr-module-list-panel, #czr-available-modules-filter {
2063
+ width: 45%;
2064
+ min-width: 300px;
2065
+ }
2066
+ body.czr-adding-module #czr-module-list-panel {
2067
+ left: 0;
2068
+ visibility: visible;
2069
+ opacity: 1;
2070
+ }
2071
+
2072
+ /*body.czr-adding-module .wp-full-overlay-main {
2073
+ left: 300px;
2074
+ }*/
2075
+
2076
+ body.czr-adding-module #customize-preview {
2077
+ opacity: 0.7;
2078
+ }
2079
+
2080
+
2081
+ .add-new-module:before {
2082
+ content: "\f132";
2083
+ display: inline-block;
2084
+ position: relative;
2085
+ left: -2px;
2086
+ top: -1px;
2087
+ font: normal 20px/1 dashicons;
2088
+ vertical-align: middle;
2089
+ -webkit-transition: all .2s;
2090
+ -moz-transition: all .2s;
2091
+ -ms-transition: all .2s;
2092
+ -o-transition: all .2s;
2093
+ transition: all .2s;
2094
+ -webkit-font-smoothing: antialiased;
2095
+ -moz-osx-font-smoothing: grayscale;
2096
+ }
2097
+
2098
+ .czr-column .add-new-module {
2099
+ margin: 1%;
2100
+ float: right;
2101
+ }
2102
+
2103
+ body.czr-adding-module .add-new-module,
2104
+ body.czr-adding-module .add-new-module:hover {
2105
+ background: #eee;
2106
+ border-color: #929793;
2107
+ color: #32373c;
2108
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
2109
+ box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
2110
+ }
2111
+
2112
+ body.czr-adding-module .add-new-module:before {
2113
+ -webkit-transform: rotate(45deg);
2114
+ -ms-transform: rotate(45deg);
2115
+ transform: rotate(45deg);
2116
+ }
2117
+
2118
+
2119
+ #czr-available-modules-list {
2120
+ top: 60px;
2121
+ position: absolute;
2122
+ overflow: auto;
2123
+ bottom: 0;
2124
+ width: 100%;
2125
+ }
2126
+
2127
+ #czr-available-modules-filter {
2128
+ position: fixed;
2129
+ top: 0;
2130
+ z-index: 1;
2131
+ background: rgba(0, 0, 0, 0.47);
2132
+ border-bottom: 1px solid #e5e5e5;
2133
+ }
2134
+
2135
+ /* search field container */
2136
+ #czr-available-modules-filter {
2137
+ padding: 12px 15px;
2138
+ -webkit-box-sizing: border-box;
2139
+ -moz-box-sizing: border-box;
2140
+ box-sizing: border-box;
2141
+ }
2142
+
2143
+ #czr-available-modules-filter input {
2144
+ padding: 6px 10px;
2145
+ width: 100%;
2146
+ }
2147
+
2148
+ #czr-available-modules-list .czr-module-candidate {
2149
+ position: relative;
2150
+ /*padding: 1%;*/
2151
+ border-bottom: 1px solid #e5e5e5;
2152
+ }
2153
+
2154
+ #czr-available-modules-list .czr-module-candidate h3 {
2155
+ color: #fff;
2156
+ padding: 0px;
2157
+ margin: 0;
2158
+ }
2159
+ #czr-available-modules-list .czr-mod-drag-handler {
2160
+ position: relative;
2161
+ left: 0%;
2162
+ padding: 1%;
2163
+ margin: 2% 4%;
2164
+ color: inherit;
2165
+ cursor: move;
2166
+ cursor: grab;
2167
+ cursor: -moz-grab;
2168
+ cursor: -webkit-grab;
2169
+ }
2170
+
2171
+
2172
+
2173
+
2174
+
2175
+
2176
+ /* SEKTION SETTINGS PANEL */
2177
+ #czr-sektion-settings-panel {
2178
+ position: absolute;
2179
+ top: 0;
2180
+ bottom: 0;
2181
+ width: 45%;
2182
+ min-width: 300px;
2183
+ left: -301px;
2184
+ /*visibility: hidden;*/
2185
+ opacity: 0;
2186
+ overflow-x: hidden;
2187
+ overflow-y: auto;
2188
+ margin: 0;
2189
+ z-index: 4;
2190
+ background: rgba(0, 0, 0, 0.47);
2191
+ -webkit-transition: all .18s;
2192
+ -moz-transition: all .18s;
2193
+ -ms-transition: all .18s;
2194
+ -o-transition: all .18s;
2195
+ transition: all .18s;
2196
+ border-right: 1px solid #ddd;
2197
+ color: #fff;
2198
+ }
2199
+ #czr-sektion-settings-panel h3 {
2200
+ color: #fff;
2201
+ }
2202
+ body.czr-editing-sektion #czr-sektion-settings-panel {
2203
+ left: 0;
2204
+ visibility: visible;
2205
+ opacity: 1;
2206
+ }
2207
+
2208
+ /*body.czr-editing-sektion .wp-full-overlay-main {
2209
+ left: 300px;
2210
+ }*/
2211
+
2212
+ body.czr-editing-sektion #customize-preview {
2213
+ opacity: 0.7;
2214
  }/* WP SAVE BUTTON */
2215
  .czr-api-dirty input#save {
2216
  background-color: #FFBD2E;
addons/assets/czr/css/czr-control.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:440px}i.czr-notice,span.czr-notice{display:block;clear:both}.wp-customizer .wp-full-overlay.expanded{margin-left:440px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-440px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-440px}.accordion-sub-container.control-panel-content{left:440px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:440px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-440px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-440px}.rtl .accordion-sub-container.control-panel-content{right:440px}.customize-section-description-container+#customize-control-custom_css:last-child{margin:0;width:100%}li#customize-control-custom_css textarea{font-size:13px;background:#394143;color:#95ff0c;min-height:300px}@media screen and (max-width:1400px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:380px}.wp-customizer .wp-full-overlay.expanded{margin-left:380px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-380px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-380px}.accordion-sub-container.control-panel-content{left:380px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:380px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-380px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-380px}.rtl .accordion-sub-container.control-panel-content{right:380px}}@media screen and (max-width:979px){.rtl.wp-customizer .wp-full-overlay-sidebar,.wp-customizer .wp-full-overlay-sidebar{width:300px}.wp-customizer .wp-full-overlay.expanded{margin-left:300px}.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-300px}.accordion-sub-container.control-panel-content{left:300px}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:300px;margin-left:0}.rtl.wp-customizer .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px;margin-left:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title{right:-300px}.rtl .accordion-sub-container.control-panel-content{right:300px}}@media screen and (max-width:640px){.wp-customizer .customize-controls-preview-toggle{height:46px;border-bottom:1px solid #ddd;left:87px}.wp-customizer .wp-full-overlay.expanded{margin-left:0}#customize-theme-controls .control-section.current-panel>h3.accordion-section-title{left:-100%}.accordion-sub-container.control-panel-content{left:100%}.rtl.wp-customizer .wp-full-overlay.expanded{margin-right:0}.rtl #customize-theme-controls .control-section.current-panel>h3.accordion-section-title,.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}.rtl .accordion-sub-container.control-panel-content{right:100%}}.wp-customizer .control-section.control-panel .accordion-section-title .panel-title{font-size:24px;font-weight:inherit;line-height:30px}.wp-core-ui h3{color:#555}.accordion-section-title:after,.control-section.control-panel>.accordion-section-title:after,.handlediv,.item-edit,.sidebar-name-arrow,.widget-action,.wp-customizer #available-menu-items .menu-item-handle:hover .item-add,.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus,.wp-customizer #customize-controls .customize-info .customize-help-toggle:hover,.wp-customizer #customize-controls .customize-info.open .customize-help-toggle,.wp-customizer .menu-item-handle:hover,.wp-customizer .menu-item-handle:hover .item-edit,.wp-customizer .menu-item-handle:hover .item-type{color:#00a0d2}.accordion-section-content{padding:10px 10px 15px 20px}.customize-control-title{line-height:19px}.wp-customizer #customize-theme-controls .accordion-section-content{background:#fff}.wp-customizer #customize-controls .customize-info .customize-help-toggle:focus:before,.wp-customizer .customize-screen-options-toggle:focus:before{-webkit-box-shadow:0 0 0 1px #00a0d2;box-shadow:0 0 0 1px #00a0d2;-webkit-border-radius:100%;border-radius:100%}#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:active,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:focus,#customize-controls .customize-info.open.active-menu-screen-options .customize-help-toggle:hover,.active-menu-screen-options .customize-screen-options-toggle,.customize-screen-options-toggle:active,.customize-screen-options-toggle:focus,.customize-screen-options-toggle:hover{color:#00a0d2!important}.customize-control input[type=text]{line-height:23px}li[id*=customize-control-]{padding:2%;width:96%;border:1px solid #ddd;box-shadow:1px 1px 2px 1px rgba(204,204,204,.4);-webkit-box-shadow:1px 1px 2px 1px rgba(204,204,204,.4);margin:8px 0}.control-section .accordion-section-content{overflow-y:auto}.wp-customizer .control-section h3.accordion-section-title{padding:10px 25px 11px 14px}.wp-customizer #customize-controls h3{font-size:15px;font-weight:400}.control-section .accordion-section-title:after{top:7px}.control-section.control-panel .accordion-section-title:after{top:11px;-webkit-transition:right .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:right .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:right .3s ease-in-out,opacity .3s ease-in-out;-o-transition:right .3s ease-in-out,opacity .3s ease-in-out;transition:right .3s ease-in-out,opacity .3s ease-in-out;right:10px;opacity:.7}.rtl .control-section.control-panel .accordion-section-title:after{-webkit-transition:left .3s ease-in-out,opacity .3s ease-in-out;-moz-transition:left .3s ease-in-out,opacity .3s ease-in-out;-ms-transition:left .3s ease-in-out,opacity .3s ease-in-out;-o-transition:left .3s ease-in-out,opacity .3s ease-in-out;transition:left .3s ease-in-out,opacity .3s ease-in-out;left:10px;right:initial}#customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{right:8px;opacity:1;color:#666!important}.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:focus:after,.rtl #customize-theme-controls .control-section.control-panel h3.accordion-section-title:hover:after{left:6px;right:initial}#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:focus:after,#customize-theme-controls .control-section.control-panel>h3.accordion-section-title:hover:after,.control-section.control-panel>.accordion-section-title:after{background:0 0!important;border:none!important}#customize-theme-controls h3.accordion-section-title{-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.customize-control-checkbox label,.customize-control-nav_menu_auto_add label,.customize-control-radio label{line-height:16px;margin-left:0}input::-webkit-input-placeholder{color:#9A9A9A;font-style:italic}input:-moz-placeholder{color:#9A9A9A;font-style:italic}input::-moz-placeholder{color:#9A9A9A;font-style:italic}input:-ms-input-placeholder{color:#9A9A9A;font-style:italic}.czr-customizr-title{text-transform:uppercase;margin:1em 0 5px;font-size:15px!important;border-bottom:1px dotted #00a0d2;padding-bottom:5px;text-align:center}h3.czr-customizr-title::before{content:'\00b7';padding-right:3px}h3.czr-customizr-title::after{content:'\00b7';padding-left:3px}.czr-after-button{border-color:#fff;margin-top:15px}.czr-emphasize{line-height:1.2em;color:#2E2E2E}span.czr-notice{color:#313131;font-size:12px;font-style:italic;line-height:18px}.czr-customizer-separator-invisible{border:none;margin-top:15px}.czr-skin-gen-label{float:left}.czr-skin-gen-color-picker{float:right}.czr-number-label{float:left}.czr-number-input{float:right}.czr-check-label{float:left;max-width:85%}.rtl .czr-check-label{float:right}input[type=checkbox],input[type=radio]{float:right;min-height:18px}.czr-font-select{float:left}li#customize-control-tc_theme_options-tc_custom_css textarea{font-size:14px;background:#394143;color:#E2E728;min-height:300px}.customize-control .czr-navigate-to-post-list{color:#00a0d2;font-weight:700;float:left;clear:both;width:100%;margin-bottom:8px}.czr-sub-control{padding-left:13%;max-width:87%;position:relative}.czr-sub-control:before{content:'';height:116%;background:#00a0d2;width:2%;position:absolute;left:7%}.customize-control-tc_cropped_image .upload-button{float:right}.customize-control-tc_cropped_image .remove-button{float:left;margin-right:3px}.customize-control-tc_cropped_image .actions{margin-bottom:32px}.customize-control-tc_cropped_image .current{margin-bottom:8px}.customize-control-tc_cropped_image .remove-button,.customize-control-tc_cropped_image .upload-button{white-space:normal;width:48%;height:auto}.czr-main-title,.czr-module-title h3{white-space:nowrap;text-overflow:ellipsis}.customize-control-tc_cropped_image .current .container{min-height:40px;overflow:hidden;border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image img{width:100%;-webkit-border-radius:2px;border-radius:2px}.customize-control-tc_cropped_image .inner{line-height:20px;top:10px}.rtl .customize-control-tc_cropped_image .upload-button{float:left}.rtl .customize-control-tc_cropped_image .remove-button{float:right;margin-left:3px}.czr-layout-img{height:26px;padding-top:2px;border:1px solid #FFF}.czr-layout-title{padding:0 0 18px 12px;display:inline-block;line-height:0;vertical-align:middle}.customize-control-czr_multi_input{width:96%;border:1px solid #ccc;padding:2%}.czr-multi-input-wrapper{width:95%;padding:0 0 0 5%}.czr-multi-input-wrapper [data-input-type=color] .czr-input{float:left;clear:both}#customize-theme-controls #accordion-panel-czr-footer-panel{border-bottom:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{margin-top:10px}#customize-theme-controls #accordion-panel-hu-advanced-panel,#customize-theme-controls #accordion-panel-hu-header-panel,#customize-theme-controls #accordion-panel-nav_menus,#customize-theme-controls .control-panel-widgets{border-top:1px solid #ddd}#customize-theme-controls #accordion-panel-hu-general-panel,#customize-theme-controls #accordion-section-static_front_page{margin-bottom:10px}#customize-header-actions .customize-controls-close{left:45px}.customize-controls-close,.customize-controls-home{top:-1px}.customize-controls-home{display:block;position:absolute;left:0;width:45px;height:41px;padding:0 2px 0 0;background:#eee;border:none;border-top:4px solid #eee;border-right:1px solid #ddd;border-bottom:1px solid #ddd;color:#444;text-align:left;cursor:pointer;text-decoration:none;-webkit-transition:color .15s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;transition:color .1s ease-in-out,border-color .15s ease-in-out,background .15s ease-in-out;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.customize-controls-home:before{font-size:17px;line-height:45px;position:relative;top:-4px;left:14px}.customize-controls-home:hover{background:#fff;color:#0073aa;border-top-color:#0073aa;outline:0;-webkit-box-shadow:none;box-shadow:none}.control-panel-content .hu-menu-notice{margin-left:3%}span.czr-panel-subtitle{display:block;font-size:12px;font-style:italic}.czr-open-pre-add-new{display:block;float:left;margin:2% 2% 0;width:99%;padding:2%;background:#3b8dbd;opacity:1;color:#fff;font-size:16px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;-webkit-border-radius:3px;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-open-pre-add-new.active{background:#646464;opacity:.5;border-radius:3px 3px 0 0}.czr-adding-new .czr-items-wrapper,.czr-items-wrapper .inactive{opacity:.6}.czr-single-item{padding:0;border:1px solid #ccc;margin:1% 0 0 2%;float:left;width:98%;-webkit-border-radius:3px;border-radius:3px;-webkit-transition:opacity 1s ease-in-out;-moz-transition:opacity 1s ease-in-out;-ms-transition:opacity 1s ease-in-out;-o-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}.czr-single-item .czr-item-content input,.czr-sub-set{margin-bottom:0}#customize-theme-controls .czr-single-item.open{border:1px solid #00a0d2}#customize-theme-controls .mono-item-mod .czr-single-item{border:1px solid #ccc}.czr-single-item .czr-item-content,.czr-single-item .czr-item-header{padding:1%}.czr-items-wrapper .czr-single-item .czr-builtin-model{background:#E1DFDF;color:#555}.czr-item-sort-handle{cursor:move}.czr-single-item .czr-item-header{position:relative;background:#dfdfdf;color:#fff;float:left;width:98%;-webkit-transition:background .1s ease-in-out;-moz-transition:background .1s ease-in-out;-ms-transition:background .1s ease-in-out;-o-transition:background .1s ease-in-out;transition:background .1s ease-in-out}.czr_widget_areas_module .czr-single-item .czr-custom-model{background:#3b8dbd}. .czr-single-item .czr-custom-model:hover{background:#aaa}.czr-items-wrapper .czr-single-item .czr-builtin-model:hover,.czr-single-item .czr-item-header:hover{background:#ccc}.czr-move-icon{position:absolute;top:-2px;left:3px;font-size:10px;color:#999}.czr-item-title{float:left;font-size:17px;color:#000;padding:7px;width:67%}.czr-inactive-alert{font-size:12px;font-style:italic}.czr_widget_areas_module .czr-item-title{color:#fff}.czr-builtin-model .czr-item-title{color:#23282d}.czr-item-title h4{margin:0}.czr-item-title .fa:before{padding-right:2px}.czr-item-btns{float:right}.czr-item-btns a{font-size:17px;padding:7px 5px;color:#777;-webkit-transition:color .1s ease-in-out;-moz-transition:color .1s ease-in-out;-ms-transition:color .1s ease-in-out;-o-transition:color .1s ease-in-out;transition:color .1s ease-in-out}.czr-item-btns a:active,.czr-item-btns a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.czr_widget_areas_module .czr-item-btns a{color:#fff}.czr-builtin-model .czr-item-btns a{color:#555}.czr-builtin-model .czr-item-btns .czr-edit-view.active,.czr-builtin-model .czr-item-btns .czr-edit-view:hover,.czr-item-btns .czr-edit-view.active,.czr-item-btns .czr-edit-view:hover{color:#00a0d2}.czr_widget_areas_module .czr-edit-view:hover,.czr_widget_areas_module .czr-item-btns .czr-edit-view.active{color:#000}.czr_widget_areas_module .czr-builtin-model .czr-edit-view.active,.czr_widget_areas_module .czr-builtin-model .czr-edit-view:hover{color:#00a0d2}.czr-item-btns .czr-display-alert.active,.czr-item-btns .czr-display-alert:hover{color:#23282d}.czr-single-item .czr-item-content{display:none;clear:both;width:96%;padding:2%}.czr-sub-set{display:block;float:left;width:100%;padding:1% 0;position:relative}.czr-sub-set .czr-input{float:right;width:60%}.width-100 .czr-input{width:100%}.czr-sub-set .customize-control-title{float:left;width:40%;padding:1px 0;font-size:13px}.czr-item-title .fa{font-size:18px}.czr-remove-alert-wrapper{display:none;clear:both;float:left;padding:2%;width:95%;margin:10px 0;text-shadow:0 1px 0 rgba(255,255,255,.5);background-color:#EEE;color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.czr-remove-alert-wrapper p{padding:5px;margin:0}.czr-pre-add-wrapper{position:relative;float:left;width:100%}.czr-pre-add-view-content{display:none;padding:3%;border:1px solid #00a0d2;border-top:none;margin:0 0 0 2%;float:left;width:92%;background:#eee;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;position:relative;opacity:1;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-ms-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear}.czr-model-added .czr-pre-add-view-content{opacity:.2}.czr-pre-add-wrapper .czr-add-new{background:#3b8dbd;color:#fff;-webkit-transition:background .5s linear;-moz-transition:background .5s linear;-ms-transition:background .5s linear;-o-transition:background .5s linear;transition:background .5s linear;float:right;border:none}.czr-add-success{width:100%;margin:0 0 0 2%;position:absolute;top:0;left:0;font-size:25px;text-align:center;opacity:0;-webkit-transition:opacity .1s linear;-moz-transition:opacity .1s linear;-ms-transition:opacity .1s linear;-o-transition:opacity .1s linear;transition:opacity .1s linear}.czr-model-added .czr-add-success{opacity:1}.czr-unavailable-location,body.czr-editing-modopt #customize-preview{opacity:.7}.czr-add-success p{vertical-align:middle;display:inline-block;line-height:35px;margin:0;font-size:25px;color:#82b965;padding:0 3%}.control-section-widget_zones_management{margin:10px 0;z-index:1}.czr-zone-infos{width:96%;padding:0 2%;font-size:12px;float:left;font-style:italic}.czr-location-alert{float:left;width:100%;padding:1% 0;margin:1% 0;text-align:center;border:1px solid orange;background:#FEE5B6;color:#000;font-size:11px;font-style:italic}.czr-toggle-modopt{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;right:0;padding-left:3px;font-size:25px;line-height:24px}.czr-modopt-visible .czr-toggle-modopt,.czr-toggle-modopt:hover{color:#3b8dbd}body #customize-controls{-webkit-transition:opacity .4s ease-in-out;-moz-transition:opacity .4s ease-in-out;-ms-transition:opacity .4s ease-in-out;-o-transition:opacity .4s ease-in-out;transition:opacity .4s ease-in-out}body.czr-editing-modopt #customize-controls{opacity:.4}.czr-mod-opt-wrapper{position:absolute;top:0;bottom:0;left:-301px;opacity:0;overflow-x:hidden;overflow-y:auto;margin:0;z-index:4;background:rgba(0,0,0,.47);-webkit-transition:all .18s ease-in-out;-moz-transition:all .18s ease-in-out;-ms-transition:all .18s ease-in-out;-o-transition:all .18s ease-in-out;transition:all .18s ease-in-out;border-right:1px solid #4c4c4c;width:45%;min-width:300px;padding:6%;color:#fff}body.czr-editing-modopt .czr-mod-opt-wrapper{left:0;visibility:visible;opacity:1}.czr-close-modopt{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}.czr-mod-opt-wrapper .czr-sub-set{border:1px dotted #ccc;background:rgba(238,238,238,.18);padding:3%;width:94%;margin:5px 0}.czr-mod-opt-wrapper .czr-notice{color:#fff}.czr-mod-opt-wrapper .mod-opt-title{color:#fff;border-bottom:1px solid #fff;padding:5% 0;text-align:center}.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-450px;height:0}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-450px}@media screen and (max-width:1400px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-380px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-380px}}@media screen and (max-width:979px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-300px}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-300px}}@media screen and (max-width:640px){.in-sub-panel #czr-donate-customizer,.in-sub-panel .czr-cta-wrap{left:-100%}.rtl .in-sub-panel #czr-donate-customizer,.rtl .in-sub-panel .czr-cta-wrap{right:-100%;left:auto}}@media screen and (min-width:980px){.wp-customizer .expanded #customize-footer-actions{width:380px}}@media screen and (min-width:1401px){.wp-customizer .expanded #customize-footer-actions{width:440px}}.selecter-element{position:absolute;opacity:0}.selecter{display:block;float:right;margin:2px 0;position:relative;width:100%;z-index:100}.selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) right center no-repeat #F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;padding:4px 4.6%;position:relative;text-overflow:clip;z-index:49;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);height:auto;line-height:18px;width:90%}.selecter .selecter-options{border:1px solid #ccc;border-width:0 1px 1px;background-color:#fefefe;border-radius:0 0 3px 3px;box-shadow:0 1px 4px rgba(0,0,0,.15);display:none;left:0;margin:0;max-height:260px;overflow:auto;overflow-x:hidden;padding:0;position:relative;top:100%;width:99%;z-index:50}.selecter .selecter-group{background:#F9F9F9;border-bottom:1px solid #e3e3e3;color:#999;display:block;font-size:11px;padding:5px 10px 4px;text-transform:uppercase}.selecter .selecter-item{background:#fff;border-bottom:1px solid #e3e3e3;color:#333;cursor:pointer;display:block;font-size:13px;margin:0;overflow:hidden;text-overflow:ellipsis;width:86%;height:auto;line-height:14px;padding:8px 24px 8px 10px}.selecter.disabled .selecter-group,.selecter.disabled .selecter-item,.selecter.disabled .selecter-selected{cursor:default;color:#ccc;border-color:#eee}.selecter .selecter-item.selected{background:#F9F9F9}.selecter .selecter-item.disabled{color:#999;cursor:default}.selecter .selecter-item:first-child{border-radius:0}.selecter .selecter-item:last-child{border-radius:0 0 2px 2px;border-bottom:0}.rtl .selecter .selecter-selected{background:url(img/jquery.fs.selecter-arrow.png) 4% center no-repeat #F9F9F9}@media screen and (min-width:980px){.selecter .selecter-item.selected:hover,.selecter .selecter-item:hover{background-color:#f3f3f3}.selecter .selecter-item.disabled:hover,.selecter:hover .selecter-selected{background-color:#fff}.selecter.disabled .selecter-item:hover{background:#fff}}.selecter.open{z-index:101}.selecter.open .selecter-selected{border-radius:3px 3px 0 0;z-index:51}.selecter.focus .selecter-selected,.selecter.open .selecter-selected{background-color:#fff;box-shadow:0 0 5px rgba(0,0,0,.1)}.selecter.cover .selecter-options{border-radius:3px;border-width:1px;top:0}.selecter.cover .selecter-options .selecter-item.first{border-radius:3px 3px 0 0}.selecter.cover.open .selecter-selected{border-radius:3px 3px 0 0;z-index:49}.selecter.bottom .selecter-options{border-width:1px 1px 0;bottom:100%;top:auto}.selecter.bottom .selecter-item:last-child{border:none}.selecter.bottom.open .selecter-selected{border-radius:0 0 3px 3px}.selecter.bottom.open .selecter-options{border-radius:3px 3px 0 0}.selecter.bottom.cover.open .selecter-options,.selecter.bottom.cover.open .selecter-selected,.stepper{border-radius:3px}.selecter.bottom.cover .selecter-options{bottom:0;top:auto}.selecter.multiple .selecter-options{border-radius:3px;border-width:1px;box-shadow:none;display:block;position:static;width:100%}.selecter.disabled .selecter-selected{background:#fff}.selecter.disabled .selecter-options{background:#fff;border-color:#eee}.selecter.disabled .selecter-item.selected{background:#fafafa}.selecter .selecter-options.scroller{overflow:hidden}.selecter .selecter-options.scroller .scroller-content{max-height:260px;padding:0}@media screen and (max-width:740px){.selecter{max-width:100%}}@media screen and (max-width:500px){.selecter{max-width:100%}}.stepper{margin:0 0 10px;overflow:hidden;position:relative;width:35%;float:left;clear:both}.stepper .stepper-input{background:#F9F9F9;border:1px solid #ccc;border-radius:3px;color:#333;font-size:13px;line-height:1.2;margin:0;overflow:hidden;padding:5px 10px!important;width:100%!important;z-index:49;-moz-appearance:textfield;max-width:none!important}.stepper .stepper-input::-webkit-inner-spin-button,.stepper .stepper-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.stepper .stepper-input:focus{background-color:#fff}.stepper .stepper-arrow{background:url(img/jquery.fs.stepper-arrows.png) no-repeat #eee;border:1px solid #ccc;cursor:pointer;display:block;height:46%;position:absolute;right:0;text-indent:-99999px;width:20px;z-index:50}.stepper .stepper-arrow.up{background-position:center top;border-bottom:none;top:0}.stepper .stepper-arrow.down{background-position:center bottom;bottom:0}.rtl .stepper .stepper-input{text-align:left}@media screen and (min-width:740px){.stepper:hover .stepper-input{background-color:#fff}.stepper .stepper-step:hover{background-color:#F9F9F9}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}}.stepper.disabled .stepper-input{background:#fff;border-color:#eee;color:#ccc}.stepper.disabled .stepper-arrow{background:#fff;border-color:#eee;cursor:default}.icheckbox_flat-green,.icheckbox_flat-grey,.iradio_flat-green,.iradio_flat-grey{display:inline-block;margin:0;padding:0;width:20px;height:20px;border:none;top:4px;vertical-align:middle}.icheckbox_flat-green,.iradio_flat-green{background:url(img/green.png) no-repeat;cursor:pointer;float:right}.rtl .icheckbox_flat-green{float:left}.icheckbox_flat-green{background-position:0 0}.icheckbox_flat-green.checked{background-position:-22px 0}.icheckbox_flat-green.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-green.checked.disabled{background-position:-66px 0}.iradio_flat-green{background-position:-88px 0}.iradio_flat-green.checked{background-position:-110px 0}.iradio_flat-green.disabled{background-position:-132px 0;cursor:default}.iradio_flat-green.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-green,.iradio_flat-green{background-image:url(img/green@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.icheckbox_flat-grey,.iradio_flat-grey{background:url(img/grey.png) no-repeat;cursor:pointer;float:right}.icheckbox_flat-grey{background-position:0 0}.icheckbox_flat-grey.checked{background-position:-22px 0}.icheckbox_flat-grey.disabled{background-position:-44px 0;cursor:default}.icheckbox_flat-grey.checked.disabled{background-position:-66px 0}.iradio_flat-grey{background-position:-88px 0}.iradio_flat-grey.checked{background-position:-110px 0}.iradio_flat-grey.disabled{background-position:-132px 0;cursor:default}.iradio_flat-grey.checked.disabled{background-position:-154px 0}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (-moz-min-device-pixel-ratio:1.5),only screen and (-o-min-device-pixel-ratio:3/2),only screen and (min-device-pixel-ratio:1.5){.icheckbox_flat-grey,.iradio_flat-grey{background-image:url(img/grey@2x.png);-webkit-background-size:176px 22px;background-size:176px 22px}}.czr-sub-set .icheckbox_flat-green,.iradio_flat-green{float:left}body .select2-container{z-index:1000000;width:100%!important}.customize-control-czr_layouts .select2-selection--single{height:33px}.customize-control-czr_layouts .select2-container--default .select2-selection--single .select2-selection__arrow{height:30px}.customize-control-czr_layouts .select2-selection--single:focus,.select2-selection__rendered:focus{outline:0}body .select2-container,span.select2-results{font-size:14px}.select2-container--default .select2-selection--multiple{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;width:99%;min-height:36px;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.07);box-shadow:inset 0 1px 2px rgba(0,0,0,.07)}.select2-container--default.select2-container--focus .select2-selection--multiple{border-color:#00a0d2!important;-webkit-box-shadow:0 0 2px rgba(26,188,156,.8)!important;box-shadow:0 0 2px rgba(26,188,156,.8)!important}.select2-results__options li{margin-bottom:0}.select2-container--default .select2-selection--multiple .select2-selection__choice{padding:2px;font-size:13px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;margin-bottom:0}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#00a0d2}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{font-size:17px;position:relative;top:2px;color:#23282d}.customize-control-czr_socials .select2-container--default .select2-selection--single .select2-selection__rendered{padding:5px;line-height:16px}#czr-customize-content_editor-pane{border-top:solid 1px #ddd;position:absolute;height:300px;bottom:-301px;right:0;left:0;z-index:20;background:#f1f1f1;display:block;-webkit-transition:all .2s;transition:all .2s;visibility:hidden}body.czr-customize-content_editor-pane-resize #customize-preview,body.czr-customize-content_editor-pane-resize #czr-customize-content_editor-pane{-webkit-transition:none;transition:none}body.mce-fullscreen.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{top:0}body.czr-customize-content_editor-pane-open #czr-customize-content_editor-pane{bottom:0;visibility:inherit}#czr-customize-content_editor-pane .wp-editor-tools{padding-top:5px;padding-right:10px}#czr-customize-content_editor-pane .wp-media-buttons{padding-left:5px}#customize-preview{height:auto}body.czr-customize-content_editor-pane-open #customize-preview{bottom:300px}body.mce-fullscreen #customize-preview{bottom:0}body.mce-fullscreen.czr-customize-content_editor-pane-open div.mce-fullscreen{position:relative;left:0}#wp-czr-customize-content_editor-container{border-left:0}#czr-customize-content_editor-dragbar{top:0;cursor:row-resize;display:block;height:4px;position:absolute;width:100%;z-index:21}body.czr-customize-content_editor-pane-resize #customize-preview:before{top:0;right:0;bottom:0;left:0;position:absolute;height:100%;width:100%;z-index:999999}.wp-customizer .ui-autocomplete.wplink-autocomplete{z-index:500110}.wp-customizer #wp-link-wrap{z-index:500105}.wp-customizer #wp_editbtns,.wp-customizer #wp_gallerybtns{z-index:500020}.wp-customizer #TB_overlay,.wp-customizer #TB_window{z-index:500050}.wp-customizer .mce-panel,.wp-customizer .mce-tooltip{z-index:500100!important}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-customize-content_editor-pane-open .wp-full-overlay.collapsed .collapse-sidebar{bottom:308px}.czr-customize-content_editor-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.czr-customize-content_editor-pane-resize .wp-full-overlay.collapsed .collapse-sidebar{-webkit-transition:none;transition:none}.czr-customize-content_editor-pane-open.mce-fullscreen .wp-full-overlay.collapsed .collapse-sidebar{bottom:8px!important}.czr-sub-set[data-input-type=content_picker] .customize-control-title,.czr-sub-set[data-input-type=content_picker] .czr-input{width:100%}.content-item-bar{line-height:1.5em}.czr-sub-set[data-input-type=content_picker] span.item-title{display:block;float:left;max-width:80%}.czr-sub-set[data-input-type=content_picker] span.item-type{display:inline-block;padding:0 10px 0 0;float:right}.rangeslider,.rangeslider__fill{display:block;-moz-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.3);box-shadow:inset 0 1px 3px rgba(0,0,0,.3);-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}.rangeslider{background:#e6e6e6;position:relative}.rangeslider--horizontal{height:20px;width:100%}.rangeslider--vertical{width:20px;min-height:150px;max-height:100%}.rangeslider--disabled{filter:alpha(Opacity=40);opacity:.4}.rangeslider__fill{background:#0f0;position:absolute}.rangeslider--horizontal .rangeslider__fill{top:0;height:100%}.rangeslider--vertical .rangeslider__fill{bottom:0;width:100%}.rangeslider__handle{background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjAiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g) #fff;border:1px solid #ccc;cursor:pointer;display:inline-block;width:40px;height:40px;position:absolute;background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(0,0,0,.1)));background-image:-moz-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:-webkit-linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));background-image:linear-gradient(rgba(255,255,255,0),rgba(0,0,0,.1));-moz-box-shadow:0 0 8px rgba(0,0,0,.3);-webkit-box-shadow:0 0 8px rgba(0,0,0,.3);box-shadow:0 0 8px rgba(0,0,0,.3);-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;line-height:42px;text-align:center;color:#404040;font-size:15px}.rangeslider__handle:after{content:"";display:block;width:18px;height:18px;margin:auto;position:absolute;top:0;right:0;bottom:0;left:0;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEzIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.13)),color-stop(100%,rgba(255,255,255,0)));background-image:-moz-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:-webkit-linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));background-image:linear-gradient(rgba(0,0,0,.13),rgba(255,255,255,0));-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%}.rangeslider--active .rangeslider__handle,.rangeslider__handle:active{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjEiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMC4xMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==);background-size:100%;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,rgba(0,0,0,.12)));background-image:-moz-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:-webkit-linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12));background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.12))}.rangeslider--horizontal .rangeslider__handle{top:-10px;touch-action:pan-y;-ms-touch-action:pan-y}.rangeslider--vertical .rangeslider__handle{left:-10px;touch-action:pan-x;-ms-touch-action:pan-x}input[type=range]:focus+.rangeslider .rangeslider__handle{-moz-box-shadow:0 0 8px rgba(255,0,255,.9);-webkit-box-shadow:0 0 8px rgba(255,0,255,.9);box-shadow:0 0 8px rgba(255,0,255,.9)}.czr-sektion-buttons{position:absolute;right:0}.czr-column{width:99%;margin-bottom:1%;float:left;padding:2% 0;border:2px dotted #aaa;text-align:center}.czr-column-header{position:relative}.czr-col-drag-handler{position:absolute;left:0;padding:1%;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-module-collection-wrapper{width:100%;min-height:5px;float:left}.czr-single-module{width:98%;float:left;min-height:20px;margin:1px 1%;border:1px solid #ccc}.czr-single-module textarea{max-width:100%}#customize-theme-controls .czr-single-module .czr-single-item{width:96%}.czr-mod-header{background:#eee;float:left;width:100%}.czr-mod-title{position:relative}.czr-mod-title>h4{float:left;width:70%;margin:2% 0}.czr-mod-drag-handler{position:absolute;left:0;padding:1%;margin:2% 0;color:#999;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}.czr-mod-buttons{float:right;width:30%;margin:2% 0}.czr-mod-content{position:absolute;top:0;left:100%;float:left;width:100%;background:#d5e9cc;display:none}.czr-module-open #customize-info,.czr-module-open #customize-theme-controls{left:-200%}.czr-module-open #customize-theme-controls .accordion-section-content{overflow:visible}.czr-module-description-container{margin-bottom:15px}.czr-module-title{border-bottom:1px solid #ddd;background:#fff}.czr-module-title h3{padding:10px 10px 12px 14px;margin:0;color:#555;font-size:20px;font-weight:200;line-height:26px;display:block;overflow:hidden}#customize-controls .czr-module-title span.customize-action{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:13px;display:block;font-weight:400}.czr-module-back{display:block;float:left;width:48px;height:74px;padding:0 24px 0 0;margin:0;background:#fff;border:none;border-right:1px solid #ddd;-webkit-box-shadow:none;box-shadow:none;cursor:pointer;-webkit-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-moz-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-ms-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;-o-transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out;transition:left .18s ease-in-out,color .1s ease-in-out,background .1s ease-in-out}.czr-module-back:focus,.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.czr-module-back:before{font:400 20px/72px dashicons;content:"\f341";position:relative;left:13px}.czr-module-back:hover{color:#23282d;background:#f5f5f5;outline:0;-webkit-box-shadow:none;box-shadow:none}.gu-mirror{position:fixed!important;margin:0!important;z-index:999999!important;opacity:.8;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";filter:alpha(opacity=80)}#czr-module-list-panel,#czr-sektion-settings-panel{left:-301px;overflow-x:hidden;overflow-y:auto;z-index:4;bottom:0}.gu-hide{display:none!important}.gu-unselectable{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.gu-transit{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter:alpha(opacity=20)}.gu-unselectable .czr-module-collection-wrapper{width:98%;border:1px dotted green;background:#d1ffe0;min-height:31px}li.czr-module-candidate.gu-mirror,li.czr-single-module.gu-mirror{list-style:none}#czr-module-list-panel{position:absolute;top:0;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd}#czr-available-modules-filter,#czr-module-list-panel{width:45%;min-width:300px}body.czr-adding-module #czr-module-list-panel{left:0;visibility:visible;opacity:1}body.czr-adding-module #customize-preview{opacity:.7}.add-new-module:before{content:"\f132";display:inline-block;position:relative;left:-2px;top:-1px;font:400 20px/1 dashicons;vertical-align:middle;-webkit-transition:all .2s;-moz-transition:all .2s;-ms-transition:all .2s;-o-transition:all .2s;transition:all .2s;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.czr-column .add-new-module{margin:1%;float:right}body.czr-adding-module .add-new-module,body.czr-adding-module .add-new-module:hover{background:#eee;border-color:#929793;color:#32373c;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5)}body.czr-adding-module .add-new-module:before{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#czr-available-modules-list{top:60px;position:absolute;overflow:auto;bottom:0;width:100%}#czr-available-modules-filter{position:fixed;top:0;z-index:1;background:rgba(0,0,0,.47);border-bottom:1px solid #e5e5e5;padding:12px 15px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#czr-available-modules-filter input{padding:6px 10px;width:100%}#czr-available-modules-list .czr-module-candidate{position:relative;border-bottom:1px solid #e5e5e5}#czr-available-modules-list .czr-module-candidate h3{color:#fff;padding:0;margin:0}#czr-available-modules-list .czr-mod-drag-handler{position:relative;left:0;padding:1%;margin:2% 4%;color:inherit;cursor:move;cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}#czr-sektion-settings-panel{position:absolute;top:0;width:45%;min-width:300px;opacity:0;margin:0;background:rgba(0,0,0,.47);-webkit-transition:all .18s;-moz-transition:all .18s;-ms-transition:all .18s;-o-transition:all .18s;transition:all .18s;border-right:1px solid #ddd;color:#fff}#czr-sektion-settings-panel h3{color:#fff}body.czr-editing-sektion #czr-sektion-settings-panel{left:0;visibility:visible;opacity:1}body.czr-editing-sektion #customize-preview{opacity:.7}.czr-api-dirty input#save{background-color:#FFBD2E;border-color:#d99400;color:#000;text-shadow:none;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:background-color .2s ease-in-out;-moz-transition:background-color .2s ease-in-out;-ms-transition:background-color .2s ease-in-out;-o-transition:background-color .2s ease-in-out;transition:background-color .2s ease-in-out}.czr-api-dirty input#save:hover{background-color:#fcad06}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-header{height:185px}.czr-skop-on .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{top:185px}.wp-customizer .in-sub-panel .wp-full-overlay-sidebar .wp-full-overlay-header{padding:0 15px}.customize-controls-close{border-bottom:1px solid #ddd}.wp-customizer #customize-header-actions{border-bottom:0}.czr-scope-switcher{width:100%;float:right;position:absolute;left:0;bottom:0;overflow:hidden}.czr-scope-switcher .czr-skp-permanent-title{position:relative;color:#5f5f5f}#customize-header-actions .czr-scope-switcher .spinner{float:none;display:none;margin:0;left:-26px;top:0;position:absolute;visibility:visible}#czr-top-note,.czr-spinner-wrapper{visibility:hidden}h2.czr-current-skope-title{font-size:13px;line-height:21px;margin:6px 0 4px;text-align:center;height:63px;font-weight:400;overflow:hidden}.czr-main-title{max-height:24px;overflow:hidden;display:inline-block;width:95%}.czr-skope-title{display:block;font-size:17px;font-style:italic;line-height:25px}.czr-toggle-title-notice{cursor:pointer;font-size:14px;color:#777}.czr-skope-inherits-from{display:inline-block;opacity:0;width:90%;font-size:12px;line-height:18px;color:#357315;top:-6px;position:relative}.notice-visible .czr-toggle-title-notice{color:#357315}.notice-visible .czr-skope-inherits-from{opacity:1;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope,.czr-scope-switcher .button{-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;float:left}.czr-scope-switcher .button{width:40%;text-align:center;margin:0 2%;opacity:.7;transition:opacity .3s ease-in-out}.czr-scope-switcher .button.active{font-weight:700;opacity:1}.czr-scope-switcher .active,.czr-scope-switcher .czr-scope:hover{opacity:1}.czr-skopes-wrapper{overflow:hidden;position:relative}.czr-scope-switcher .active:after,.czr-scope.active:before{position:absolute;content:'';top:0}.czr-scope.active:before{height:101%;float:left;z-index:1;-webkit-box-shadow:-4px 0 15px 0 rgba(119,119,119,.58);box-shadow:-4px 0 15px 0 rgba(119,119,119,.58)}.czr-scope-switcher .active:after{height:100%;-webkit-box-shadow:4px 0 15px 0 rgba(119,119,119,.58);box-shadow:4px 0 15px 0 rgba(119,119,119,.58);z-index:3}.czr-skopes-wrapper .active-collection.local:after{right:0}.czr-scope-switcher .czr-scope:last-child:after{-webkit-box-shadow:none;box-shadow:none;right:0}.czr-scope-switcher .czr-scope:first-child:after{left:0}.czr-scope{width:30.5%;background:#fff;border-top:1px solid #ccc;overflow:hidden;opacity:.65;transition:opacity .3s ease-in-out}.czr-scope-switcher .width-100,.czr-scope.width-100.active:after,.czr-scope.width-100.active:before{width:100%}.czr-scope-switcher .width-50,.czr-scope.width-50.active:after,.czr-scope.width-50.active:before{width:50%}.czr-scope-switcher .width-33,.czr-scope.width-33.active:after,.czr-scope.width-33.active:before{width:33.33%}.czr-scope-switcher .width-25,.czr-scope.width-25.active:after,.czr-scope.width-25.active:before{width:25%}.czr-scope-footer,.czr-scope-header{width:100%;min-height:16px;position:relative;z-index:5}.inactive .czr-scope-footer:after{content:'';width:100%;position:absolute;height:5px;bottom:-7px;left:0;-webkit-box-shadow:0 0 13px 4px rgba(119,119,119,.85);box-shadow:0 0 13px 4px rgba(119,119,119,.85)}.czr-scope-content{height:35px;padding:0 3%;width:94%;line-height:35px;text-align:center;clear:both;color:#000;overflow:hidden}.czr-scope-content h4{margin:0;display:inline-block;text-align:center;font-size:14px;line-height:18px;font-weight:400;text-shadow:1px 1px 0 #dedede}.czr-reset-fail,.czr-reset-success,.czr-scope-force{display:none}.czr-scope .fa{font-size:10px;padding:2%;color:#585858;cursor:pointer;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-ms-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.czr-scope .czr-scope-footer .info{cursor:inherit}.czr-scope-header .czr-scope-switch{font-size:22px;padding:0 2px 0 0;text-shadow:1px 1px 2px #fff}.czr-skp-switch-link{cursor:pointer}.czr-skp-switch-link:hover{text-decoration:underline}.czr-pull-left{float:left}.czr-pull-right{float:right}.active .czr-scope-switch{color:#52ff3f;cursor:inherit}.czr-scope .czr-scope-reset{display:none;font-size:13px;text-shadow:1px 1px 0 #dedede}.has-db-val .czr-scope-reset{color:#00a0d2}.dirty .czr-scope-reset{color:#FFBD2E!important}.is_winner .czr-scope-winner{color:#52ff3f;font-size:14px;position:absolute;bottom:2px;left:2px}.czr-scope-switcher .czr-skope-switch,.czr-skope-notice .czr-skope-switch{cursor:pointer;text-decoration:underline}.czr-spinner{background:url(img/czr-spinner.gif) no-repeat;-webkit-background-size:32px 32px;background-size:32px 32px;display:inline-block;float:right;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:32px;height:32px;margin:4px 10px 0}.customize-control span.customize-control-title:first-child{padding-left:16px;-webkit-transition:left,right,.15s ease-in-out;-moz-transition:left,right,.15s ease-in-out;-ms-transition:left,right,.15s ease-in-out;-o-transition:left,right,.15s ease-in-out;transition:left,right,.15s ease-in-out;position:relative}.wp-customizer .customize-control.czr-not-skoped .customize-control-title{padding-left:0}#czr-skope-pane,#czr-top-note{padding:2%;z-index:20;text-align:center;position:absolute}.czr-setting-reset{color:#eee;-webkit-transition:color .4s;transition:color .4s;position:absolute;left:0;line-height:21px;display:none;text-shadow:1px 1px 0 #a0a0a0}#czr-top-note,.czr-resetting-control .czr-remove-alert-wrapper{-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out}.czr-global-skope-level .is-wp-authorized-setting.has-db-val .czr-setting-reset{color:#eee}.has-db-val .czr-setting-reset{color:#00a0d2}.is-dirty .czr-setting-reset{color:#FFBD2E!important}.czr-ctrl-reset-warning .czr-spinner{display:none}#czr-top-note,.czr-resetting-control .czr-ctrl-reset-warning .czr-spinner{display:block}.is-dirty .czr-remove-alert-wrapper{background-color:rgba(255,189,46,.54)!important;border:1px solid #FFBD2E!important;text-shadow:none;color:#000}.has-db-val .czr-remove-alert-wrapper{background-color:rgba(0,160,210,.45);border:1px solid #00a0d2;text-shadow:none;color:#000}#czr-skope-pane,#czr-skope-pane h2,#czr-top-note,#czr-top-note a{color:#fff}.czr-resetting-control .czr-remove-alert-wrapper{-webkit-transition:all,.3s ease-in-out;transition:all,.3s ease-in-out}body.czr-skop-loading #czr-skope-pane{top:0}body.czr-skop-loading #customize-preview{opacity:0!important}@-webkit-keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes czr-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.czr-css-loader{width:50px;height:50px;position:absolute;-webkit-transform:translate3d(-50%,-50%,0);-ms-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);top:50%;left:50%;display:block}.czr-mr-loader>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.czr-mr-loader>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.czr-mr-loader>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.czr-mr-loader>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.czr-mr-loader>div{position:absolute;top:-4%;left:-4%;width:100%;height:100%;border-radius:100%;border:2px solid #fff;-webkit-animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:czr-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}#czr-top-note{top:-100%;right:0;left:0;-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out;background:rgba(0,0,0,.8)}#czr-top-note h2{color:#fff;font-size:25px}#czr-top-note .czr-top-note-close{position:absolute;top:10px;right:25px;font-size:31px;cursor:pointer}#czr-top-note .fa-arrow-left{position:absolute;bottom:10px;left:25px;font-size:40px}#czr-top-note .czr-note-content{display:inline-block;line-height:20px;width:80%}#czr-top-note .czr-note-message{font-size:16px;line-height:20px}body.czr-top-note-open #czr-top-note{top:0;visibility:inherit}#czr-skope-pane{min-height:100%;top:-100%;right:0;left:0;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;visibility:hidden}#czr-skope-pane.dirty-reset{background:rgba(252,173,6,.23)}#czr-skope-pane.db-reset{background:rgba(0,160,210,.3)}.czr-reset-content{display:inline-block;line-height:20px;width:80%;padding:5%;background:rgba(0,0,0,.63)}body.czr-skope-pane-open #czr-skope-pane{top:0;visibility:inherit;min-height:100%}body.czr-skope-pane-open #customize-preview,body.czr-skope-pane-open .wp-full-overlay-sidebar{opacity:.5}body.czr-resetting-skope #czr-skope-pane .czr-spinner-wrapper{visibility:visible}.czr-skope-pane-open .wp-full-overlay.collapsed .wp-full-overlay-sidebar{z-index:30}.czr-skope-pane-open .wp-full-overlay.expanded .collapse-sidebar{bottom:0!important}.customize-control .czr-skope-notice{color:#357315}.czr-toggle-notice{color:#95a5a6;text-shadow:1px 1px 0 #fff;-webkit-transition:color .4s;transition:color .4s;position:absolute;padding-left:3px;line-height:21px;display:none}.czr-notice-visible .czr-toggle-notice,.czr-toggle-notice:hover{color:#357315}.wp-full-overlay-header,.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{-webkit-transition:height,top,.4s ease-in-out;-moz-transition:height,top,.4s ease-in-out;-ms-transition:height,top,.4s ease-in-out;-o-transition:height,top,.4s ease-in-out;transition:height,top,.4s ease-in-out}.czr-server-notice{width:calc(96% - 2px);bottom:75px;text-align:center;background:rgba(0,156,0,.18);color:#000;display:none;position:absolute;font-size:12px;line-height:13px;padding:2%;overflow:hidden}.czr-server-notice.czr-server-error{color:#000;background:rgba(255,0,0,.24)}.czr-dismiss-notification{position:absolute;right:5px;top:5px;cursor:pointer}.wp-customizer .icheckbox_flat-grey,.wp-customizer .iradio_flat-grey{border:1px solid #fff;-webkit-border-radius:5px;border-radius:5px;background-color:#fff}.czr-painted{-webkit-transition:background .3s ease-in-out!important;-moz-transition:background .3s ease-in-out!important;-ms-transition:background .3s ease-in-out!important;-o-transition:background .3s ease-in-out!important;transition:background .3s ease-in-out!important}
{assets → addons/assets}/czr/css/img/czr-spinner.gif RENAMED
File without changes
{assets → addons/assets}/czr/css/img/fs-sprite.png RENAMED
File without changes
{assets → addons/assets}/czr/css/img/green.png RENAMED
File without changes
{assets → addons/assets}/czr/css/img/green@2x.png RENAMED
File without changes
{assets → addons/assets}/czr/css/img/grey.png RENAMED
File without changes
{assets → addons/assets}/czr/css/img/grey@2x.png RENAMED
File without changes
{assets → addons/assets}/czr/css/img/jquery.fs.selecter-arrow.png RENAMED
File without changes
{assets → addons/assets}/czr/css/img/jquery.fs.stepper-arrows.png RENAMED
File without changes
{assets → addons/assets}/czr/css/lib/select2.css RENAMED
File without changes
{assets → addons/assets}/czr/css/lib/select2.min.css RENAMED
File without changes
addons/assets/czr/img/slide-placeholder.png ADDED
Binary file
addons/assets/czr/js/czr-control-base.js ADDED
@@ -0,0 +1,9939 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! addEventListener Polyfill ie9- http://stackoverflow.com/a/27790212*/
2
+ window.addEventListener=window.addEventListener||function(a,b){window.attachEvent("on"+a,b)},/*! Datenow Polyfill ie9- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now */
3
+ Date.now||(Date.now=function(){return(new Date).getTime()}),/*! Object.create monkey patch ie8 http://stackoverflow.com/a/18020326 */
4
+ Object.create||(Object.create=function(a,b){function c(){}if("undefined"!=typeof b)throw"The multiple-argument version of Object.create is not provided by this browser and cannot be shimmed.";return c.prototype=a,new c}),/*! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter */
5
+ Array.prototype.filter||(Array.prototype.filter=function(a){"use strict";if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;f<c;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),/*! map was added to the ECMA-262 standard in the 5th edition */
6
+ Array.prototype.map||(Array.prototype.map=function(a,b){var c,d,e;if(null===this)throw new TypeError(" this is null or not defined");var f=Object(this),g=f.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=new Array(g),e=0;e<g;){var h,i;e in f&&(h=f[e],i=a.call(c,h,e,f),d[e]=i),e++}return d}),/*! Array.from was added to the ECMA-262 standard in the 6th edition (ES2015) */
7
+ Array.from||(Array.from=function(){var a=Object.prototype.toString,b=function(b){return"function"==typeof b||"[object Function]"===a.call(b)},c=function(a){var b=Number(a);return isNaN(b)?0:0!==b&&isFinite(b)?(b>0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k<i;)h=d[k],g?j[k]="undefined"==typeof f?g(h,k):g.call(f,h,k):j[k]=h,k+=1;return j.length=i,j}}());/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
8
+ if ( 'function' != typeof(jQuery.fn.iCheck) ) {
9
+ !function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"==b?!1:"keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A),void 0)}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto);
10
+ }
11
+ if ( 'function' != typeof(jQuery.fn.selecter) ) {
12
+ !function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{{var f=c.html();c.data("value")}b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window);
13
+ }
14
+ if ( 'function' != typeof(jQuery.fn.stepper) ) {
15
+ !function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0===typeof e||isNaN(e)?!1:e,max:void 0===typeof f||isNaN(f)?!1:f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this);
16
+ }/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
17
+ if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
18
+ },e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});/*! rangeslider.js - v2.3.0 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
19
+ !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||a.open===!1)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){"undefined"!=typeof a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty("display","block","important"):d[i].style.cssText+=";display: block !important",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier="js-"+k+"-"+l++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return"number"==typeof a&&a!==a};var k="rangeslider",l=0,m=b(),n={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},o={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute("min"),0),this.max=h(this.$element[0].getAttribute("max"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute("step"),1)),this.handleDimension=g(this.$handle[0],"offset"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],"offset"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),!((" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=d+"px",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return"undefined"!=typeof a.originalEvent["client"+b]?d=a.originalEvent["client"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&"undefined"!=typeof a.originalEvent.touches[0]["client"+b]?d=a.originalEvent.touches[0]["client"+b]:a.currentPoint&&"undefined"!=typeof a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b,c;return b=(a-this.min)/(this.max-this.min),c=Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&""!==this.$element[0].value||this.$element.val(a).trigger("input",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data("plugin_"+k);e||d.data("plugin_"+k,e=new j(this,b)),"string"==typeof b&&e[b].apply(e,c)})},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"});var czr_debug = {
20
+ log: function(o) {debug.queue.push(['log', arguments, debug.stack.slice(0)]); if (window.console && typeof window.console.log == 'function') {window.console.log(o);}},
21
+ error: function(o) {debug.queue.push(['error', arguments, debug.stack.slice(0)]); if (window.console && typeof window.console.error == 'function') {window.console.error(o);}},
22
+ queue: [],
23
+ stack: []
24
+ };
25
+ ( function ( api, $, _ ) {
26
+ var _prettyPrintLog = function( args ) {
27
+ var _defaults = {
28
+ bgCol : '#5ed1f5',
29
+ textCol : '#000',
30
+ consoleArguments : []
31
+ };
32
+ args = _.extend( _defaults, args );
33
+
34
+ var _toArr = Array.from( args.consoleArguments ),
35
+ _truncate = function( string ){
36
+ if ( ! _.isString( string ) )
37
+ return '';
38
+ return string.length > 150 ? string.substr( 0, 149 ) : string;
39
+ };
40
+ if ( ! _.isEmpty( _.filter( _toArr, function( it ) { return ! _.isString( it ); } ) ) ) {
41
+ _toArr = JSON.stringify( _toArr );
42
+ } else {
43
+ _toArr = _toArr.join(' ');
44
+ }
45
+ return [
46
+ '%c ' + _truncate( _toArr ),
47
+ [ 'background:' + args.bgCol, 'color:' + args.textCol, 'display: block;' ].join(';')
48
+ ];
49
+ };
50
+ api.consoleLog = function() {
51
+ if ( ! serverControlParams.isDevMode )
52
+ return;
53
+ if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
54
+ return;
55
+
56
+ console.log.apply( console, _prettyPrintLog( { consoleArguments : arguments } ) );
57
+ };
58
+
59
+ api.errorLog = function() {
60
+ if ( ( _.isUndefined( console ) && typeof window.console.log != 'function' ) )
61
+ return;
62
+
63
+ console.log.apply( console, _prettyPrintLog( { bgCol : '#ffd5a0', textCol : '#000', consoleArguments : arguments } ) );
64
+ };
65
+
66
+ api.czr_isSkopOn = function() {
67
+ return serverControlParams.isSkopOn && _.has( api, 'czr_skopeBase' );
68
+ };
69
+
70
+ api.czr_isChangeSetOn = function() {
71
+ return serverControlParams.isChangeSetOn && true === true;//&& true === true is just there to hackily cast the returned value as boolean.
72
+ };
73
+ api.czr_activeSectionId = new api.Value('');
74
+ api.czr_activePanelId = new api.Value('');
75
+ if ( 'function' === typeof api.Section ) {
76
+ api.control.bind( 'add', function( _ctrl ) {
77
+ if ( _ctrl.params.ubq_section && _ctrl.params.ubq_section.section ) {
78
+ _ctrl.params.original_priority = _ctrl.params.priority;
79
+ _ctrl.params.original_section = _ctrl.params.section;
80
+
81
+ api.section.when( _ctrl.params.ubq_section.section, function( _section_instance ) {
82
+ _section_instance.expanded.bind( function( expanded ) {
83
+ if ( expanded ) {
84
+ if ( _ctrl.params.ubq_section.priority ) {
85
+ _ctrl.priority( _ctrl.params.ubq_section.priority );
86
+ }
87
+ _ctrl.section( _ctrl.params.ubq_section.section );
88
+ }
89
+ else {
90
+ _ctrl.priority( _ctrl.params.original_priority );
91
+ _ctrl.section( _ctrl.params.original_section );
92
+ }
93
+ });
94
+
95
+ } );
96
+ }
97
+ });
98
+ }
99
+ var _closeModOpt = function() {
100
+ if ( ! _.has( api, 'czr_ModOptVisible') )
101
+ return;
102
+ api.czr_ModOptVisible(false);
103
+ };
104
+ api.czr_activeSectionId.bind( _closeModOpt );
105
+ api.czr_activePanelId.bind( _closeModOpt );
106
+ api.bind('ready', function() {
107
+ if ( 'function' != typeof api.Section ) {
108
+ throw new Error( 'Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.' );
109
+ }
110
+ var _storeCurrentSection = function( expanded, section_id ) {
111
+ api.czr_activeSectionId( expanded ? section_id : '' );
112
+ };
113
+ api.section.each( function( _sec ) {
114
+ _sec.expanded.bind( function( expanded ) { _storeCurrentSection( expanded, _sec.id ); } );
115
+ });
116
+ api.section.bind( 'add', function( section_instance ) {
117
+ api.trigger('czr-paint', { active_panel_id : section_instance.panel() } );
118
+ section_instance.expanded.bind( function( expanded ) { _storeCurrentSection( expanded, section_instance.id ); } );
119
+ });
120
+
121
+ var _storeCurrentPanel = function( expanded, panel_id ) {
122
+ api.czr_activePanelId( expanded ? panel_id : '' );
123
+ if ( _.isEmpty( api.czr_activePanelId() ) ) {
124
+ api.czr_activeSectionId( '' );
125
+ }
126
+ };
127
+ api.panel.each( function( _panel ) {
128
+ _panel.expanded.bind( function( expanded ) { _storeCurrentPanel( expanded, _panel.id ); } );
129
+ });
130
+ api.panel.bind( 'add', function( panel_instance ) {
131
+ panel_instance.expanded.bind( function( expanded ) { _storeCurrentPanel( expanded, panel_instance.id ); } );
132
+ });
133
+ });
134
+ api.bind('ready', function() {
135
+ var _do = function() {
136
+ api.section('themes').active.bind( function( active ) {
137
+ if ( ! _.has( serverControlParams, 'isThemeSwitchOn' ) || ! _.isEmpty( serverControlParams.isThemeSwitchOn ) )
138
+ return;
139
+ api.section('themes').active( serverControlParams.isThemeSwitchOn );
140
+ api.section('themes').active.callbacks = $.Callbacks();
141
+ });
142
+ };
143
+ if ( api.section.has( 'themes') )
144
+ _do();
145
+ else
146
+ api.section.when( 'themes', function( _s ) {
147
+ _do();
148
+ });
149
+ });
150
+ api.czr_skopeReady = $.Deferred();
151
+ api.bind( 'ready' , function() {
152
+ if ( serverControlParams.isSkopOn ) {
153
+ api.czr_isLoadingSkope = new api.Value( false );
154
+ api.czr_isLoadingSkope.bind( function( loading ) {
155
+ toggleSkopeLoadPane( loading );
156
+ });
157
+ api.czr_skopeBase = new api.CZR_skopeBase();
158
+ api.czr_skopeSave = new api.CZR_skopeSave();
159
+ api.czr_skopeReset = new api.CZR_skopeReset();
160
+
161
+ api.trigger('czr-skope-started');
162
+
163
+ api.czr_skopeReady
164
+ .done( function() {
165
+ api.trigger('czr-skope-ready');
166
+ })
167
+ .fail( function( error ) {
168
+ api.errorLog( 'Skope could not be instantiated : ' + error );
169
+ serverControlParams.isSkopOn = false;
170
+ api.czr_isLoadingSkope( false );
171
+ });
172
+ if ( 'rejected' != api.czr_skopeReady.state() ) {
173
+ setTimeout( function() {
174
+ if ( 'pending' == api.czr_skopeReady.state() ) {
175
+ api.czr_skopeBase.toggleTopNote( true, {
176
+ title : serverControlParams.i18n.skope['There was a problem when trying to load the customizer.'],
177
+ message : [
178
+ serverControlParams.i18n.skope['Please open your'],
179
+ '<a href="http://docs.presscustomizr.com/article/272-inspect-your-webpages-in-your-browser-with-the-development-tools" target="_blank">',
180
+ serverControlParams.i18n.skope['browser debug tool'],
181
+ '</a>',
182
+ ',',
183
+ serverControlParams.i18n.skope['and report any error message (in red) printed in the javascript console in the'],
184
+ '<a href="https://wordpress.org/support/theme/hueman" target="_blank">',
185
+ serverControlParams.i18n.skope['Hueman theme forum'],
186
+ '</a>.'
187
+ ].join(' '),
188
+ selfCloseAfter : 40000
189
+ });
190
+
191
+ api.czr_isLoadingSkope( false );
192
+ }
193
+ }, 30000);
194
+ }
195
+ }
196
+ if ( serverControlParams.isChangeSetOn ) {
197
+ api.settings.timeouts.changesetAutoSave = 10000;
198
+ }
199
+ } );
200
+ if ( ! _.has( api, '_latestRevision') ) {
201
+ api._latestRevision = 0;
202
+ api._latestSettingRevisions = {};
203
+ api.bind( 'change', function incrementChangedSettingRevision( setting ) {
204
+ api._latestRevision += 1;
205
+ api._latestSettingRevisions[ setting.id ] = api._latestRevision;
206
+ } );
207
+ api.bind( 'ready', function() {
208
+ api.bind( 'add', function incrementCreatedSettingRevision( setting ) {
209
+ if ( setting._dirty ) {
210
+ api._latestRevision += 1;
211
+ api._latestSettingRevisions[ setting.id ] = api._latestRevision;
212
+ }
213
+ } );
214
+ } );
215
+ }
216
+ var toggleSkopeLoadPane = function( loading ) {
217
+ loading = _.isUndefined( loading ) ? true : loading;
218
+ var self = this, $skopeLoadingPanel,
219
+ _render = function() {
220
+ var dfd = $.Deferred();
221
+ try {
222
+ _tmpl = wp.template( 'czr-skope-pane' )({ is_skope_loading : true });
223
+ } catch( er ) {
224
+ api.errorLog( 'In toggleSkopeLoadPane : error when parsing the the reset skope template : ' + er );
225
+ dfd.resolve( false );
226
+ }
227
+ $.when( $('#customize-preview').after( $( _tmpl ) ) )
228
+ .always( function() {
229
+ dfd.resolve( $( '#czr-skope-pane' ) );
230
+ });
231
+
232
+ return dfd.promise();
233
+ },
234
+ _destroy = function() {
235
+ _.delay( function() {
236
+ $.when( $('body').removeClass('czr-skope-pane-open') ).done( function() {
237
+ _.delay( function() {
238
+ $.when( $('body').removeClass('czr-skop-loading') ).done( function() {
239
+ if ( false !== $( '#czr-skope-pane' ).length ) {
240
+ setTimeout( function() {
241
+ $( '#czr-skope-pane' ).remove();
242
+ }, 400 );
243
+ }
244
+ });
245
+ }, 200);
246
+ });
247
+ }, 50);
248
+ };
249
+ if ( 'pending' == api.czr_skopeReady.state() && loading ) {
250
+ $('body').addClass('czr-skop-loading');
251
+ _render()
252
+ .done( function( $_el ) {
253
+ $skopeLoadingPanel = $_el;
254
+ })
255
+ .then( function() {
256
+ if ( ! $skopeLoadingPanel.length )
257
+ return;
258
+
259
+ _.delay( function() {
260
+ var _height = $('#customize-preview').height();
261
+ $skopeLoadingPanel.css( 'line-height', _height +'px' ).css( 'height', _height + 'px' );
262
+ $('body').addClass('czr-skope-pane-open');
263
+ }, 50 );
264
+ });
265
+ }
266
+
267
+ api.czr_skopeReady.done( function() {
268
+ _destroy();
269
+ });
270
+ if ( ! loading ) {
271
+ _destroy();
272
+ }
273
+ };//toggleSkopeLoadPane
274
+ })( wp.customize , jQuery, _);
275
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
276
+ (function ( api, $, _ ) {
277
+ $.extend( CZRSkopeBaseMths, {
278
+
279
+ globalSettingVal : {},//will store the global setting val. Populated on init.
280
+
281
+ initialize: function() {
282
+ var self = this;
283
+ self.skope_colors = {
284
+ global : 'rgb(255, 255, 255)',
285
+ special_group : 'rgba(173, 213, 247, 0.55)',
286
+ group : 'rgba(173, 213, 247, 0.55)',
287
+ local : 'rgba(78, 122, 199, 0.35)'
288
+ };
289
+ api.czr_isPreviewerSkopeAware = $.Deferred();
290
+ api.czr_initialSkopeCollectionPopulated = $.Deferred();
291
+ self.skopeWrapperEmbedded = $.Deferred();
292
+ api.czr_skope = new api.Values();
293
+ api.czr_skopeCollection = new api.Value([]);//all available skope, including the current skopes
294
+ api.czr_currentSkopesCollection = new api.Value([]);
295
+ api.czr_activeSkopeId = new api.Value();
296
+ api.czr_dirtyness = new api.Value( false );
297
+ api.czr_isResettingSkope = new api.Value( false );
298
+ api.state.create('switching-skope')( false );
299
+ api.czr_dirtyness.callbacks.add( function() { return self.apiDirtynessReact.apply(self, arguments ); } );
300
+ api.czr_isLoadingSkope( true );
301
+ self.bindAPISettings();
302
+ api.state.bind( 'change', function() {
303
+ self.setSaveButtonStates();
304
+ });
305
+ api.czr_skopeReady.then( function() {
306
+ if ( 'pending' == self.skopeWrapperEmbedded.state() ) {
307
+ $.when( self.embedSkopeWrapper() ).done( function() {
308
+ self.skopeWrapperEmbedded.resolve();
309
+ });
310
+ }
311
+ });
312
+ api.previewer.bind( 'czr-skopes-synced', function( data ) {
313
+ if ( ! serverControlParams.isSkopOn || 'rejected' == api.czr_skopeReady.state() )
314
+ return;
315
+ var preview = this,
316
+ previousSkopeCollection = api.czr_currentSkopesCollection();
317
+ if ( ! _.has( data, 'czr_skopes') ) {
318
+ api.errorLog( "On 'czr-skopes-synced' : missing skopes in the server data" );
319
+ return;
320
+ }
321
+ try {
322
+ api.czr_skopeBase.updateSkopeCollection( data.czr_skopes , preview.channel() );
323
+ } catch ( er ) {
324
+ api.czr_skopeReady.reject( er );
325
+ return;
326
+ }
327
+ api.czr_initialSkopeCollectionPopulated.then( function() {
328
+ var refreshActiveSkope = _.isUndefined( _.findWhere( api.czr_currentSkopesCollection(), {id : api.czr_activeSkopeId() } ) );
329
+ api.czr_skopeBase.reactWhenSkopeSyncedDone( data ).done( function() {
330
+ if ( refreshActiveSkope ) {
331
+ try {
332
+ api.czr_activeSkopeId( self.getActiveSkopeId() )
333
+ .done( function() {
334
+ if ( 'resolved' != api.czr_skopeReady.state() ) {
335
+ api.czr_skopeReady.resolve( self.getActiveSkopeId() );
336
+ }
337
+ self._writeCurrentSkopeTitle();
338
+ })
339
+ .fail( function() {
340
+ throw new Error( 'Error when trying to set the active skope after skope synced.' );
341
+ });
342
+ } catch ( er ) {
343
+ api.errorLog( 'In reactWhenSkopeSyncedDone => api.czr_activeSkopeId() : ' + er );
344
+ }
345
+ } else if ( ! _.isEmpty( previousSkopeCollection ) ) { //Rewrite the title when the local skope has changed
346
+ var _prevLoc = _.findWhere( previousSkopeCollection , { skope : 'local' } ).opt_name,
347
+ _newLoc =_.findWhere( data.czr_skopes, { skope : 'local' } ).opt_name;
348
+
349
+ if ( _newLoc !== _prevLoc && 'resolved' == api.czr_skopeReady.state() ) {
350
+ self._writeCurrentSkopeTitle();
351
+ }
352
+ }
353
+ });
354
+ });
355
+ });
356
+ api.czr_currentSkopesCollection.bind( function( to, from ) {
357
+ return self.currentSkopesCollectionReact( to, from );
358
+ }, { deferred : true });
359
+ api.czr_initialSkopeCollectionPopulated.done( function() {
360
+ api.czr_activeSkopeId.bind( function( to, from ) {
361
+ if ( _.has( api, 'czr_ModOptVisible') ) {
362
+ api.czr_ModOptVisible( false );
363
+ }
364
+ return self.activeSkopeReact( to, from ).then( function( _updatedSetIds ) {
365
+ api.trigger( 'skope-switched-done',
366
+ {
367
+ current_skope_id : to,
368
+ previous_skope_id : from,
369
+ updated_setting_ids : _updatedSetIds || []
370
+ }
371
+ );
372
+ });
373
+ }, { deferred : true } );
374
+ api.czr_activeSectionId.callbacks.add( function() { return self.activeSectionReact.apply(self, arguments ); } );
375
+ api.czr_activePanelId.callbacks.add( function() { return self.activePanelReact.apply(self, arguments ); } );
376
+ });
377
+ api.bind( 'skope-switched-done', function( args ) {
378
+ args = _.extend(
379
+ {
380
+ current_skope_id : '',
381
+ previous_skope_id : '',
382
+ updated_setting_ids : []
383
+ },
384
+ args
385
+ );
386
+ return self.skopeSwitchedDoneReact( args );
387
+ });
388
+ api.czr_serverNotification = new api.Value( {status : 'success', message : '', expanded : true} );
389
+ api.czr_serverNotification.bind( function( to, from ) {
390
+ self.toggleServerNotice( to );
391
+ });
392
+ api.czr_topNoteVisible = new api.Value( false );
393
+ api.czr_skopeReady.then( function() {
394
+ api.czr_topNoteVisible.bind( function( visible ) {
395
+ var noteParams = {},
396
+ _defaultParams = {
397
+ title : '',
398
+ message : '',
399
+ actions : '',
400
+ selfCloseAfter : 20000
401
+ };
402
+ noteParams = $.extend( _defaultParams , serverControlParams.topNoteParams );
403
+ noteParams.actions = function() {
404
+ var _query = $.extend(
405
+ api.previewer.query(),
406
+ { nonce: api.previewer.nonce.save }
407
+ );
408
+ wp.ajax.post( 'czr_dismiss_top_note' , _query )
409
+ .always( function () {})
410
+ .fail( function ( response ) { api.consoleLog( 'czr_dismiss_top_note failed', _query, response ); })
411
+ .done( function( response ) {});
412
+ };
413
+
414
+ self.toggleTopNote( visible, noteParams );
415
+ });
416
+ _.delay( function() {
417
+ api.czr_topNoteVisible( ! _.isEmpty( serverControlParams.isTopNoteOn ) || 1 == serverControlParams.isTopNoteOn );
418
+ }, 2000 );
419
+ });
420
+ self.scopeSwitcherEventMap = [
421
+ {
422
+ trigger : 'click keydown',
423
+ selector : '.czr-dismiss-notification',
424
+ name : 'dismiss-notification',
425
+ actions : function() {
426
+ api.czr_serverNotification( { expanded : false } );
427
+ }
428
+ },
429
+ {
430
+ trigger : 'click keydown',
431
+ selector : '.czr-toggle-title-notice',
432
+ name : 'toggle-title-notice',
433
+ actions : function( params ) {
434
+ if ( _.isUndefined( self.skopeTitleNoticeVisible ) ) {
435
+ self.skopeTitleNoticeVisible = new api.Value( false );
436
+ self.skopeTitleNoticeVisible.bind( function( to ) {
437
+ params.dom_el.find( '.czr-skope-title')
438
+ .toggleClass( 'notice-visible', to );
439
+ });
440
+ }
441
+
442
+ self.skopeTitleNoticeVisible( ! self.skopeTitleNoticeVisible() );
443
+ }
444
+ }
445
+ ];
446
+ self.skopeWrapperEmbedded.then( function() {
447
+ api.CZR_Helpers.setupDOMListeners( self.scopeSwitcherEventMap , { dom_el : $('.czr-scope-switcher') }, self );
448
+ });
449
+ self.refreshedControls = [ 'czr_cropped_image'];// [ 'czr_cropped_image', 'czr_multi_module', 'czr_module' ];
450
+ self.initWidgetSidebarSpecifics();
451
+ api.bind( 'czr-paint', function( params ) {
452
+ api.czr_skopeReady.then( function() {
453
+ self.wash( params ).paint( params );
454
+ });
455
+ });
456
+ },//initialize
457
+ embedSkopeWrapper : function() {
458
+ var self = this;
459
+ $('#customize-header-actions').append( $('<div/>', {class:'czr-scope-switcher', html:'<div class="czr-skopes-wrapper"></div>'}) );
460
+ $('body').addClass('czr-skop-on');
461
+ var _eventMap = [
462
+ {
463
+ trigger : 'click keydown',
464
+ selector : '.czr-skope-switch',
465
+ name : 'control_skope_switch',
466
+ actions : function( params ) {
467
+ var _skopeIdToSwithTo = $( params.dom_event.currentTarget, params.dom_el ).attr('data-skope-id');
468
+ if ( ! _.isEmpty( _skopeIdToSwithTo ) && api.czr_skope.has( _skopeIdToSwithTo ) )
469
+ api.czr_activeSkopeId( _skopeIdToSwithTo );
470
+ }
471
+ }
472
+ ];
473
+ api.CZR_Helpers.setupDOMListeners( _eventMap , { dom_el : $('.czr-scope-switcher') }, self );
474
+ },
475
+ apiDirtynessReact : function( is_dirty ) {
476
+ $('body').toggleClass('czr-api-dirty', is_dirty );
477
+ api.state( 'saved')( ! is_dirty );
478
+ },
479
+ setSaveButtonStates : function() {
480
+ if ( ! api.state.has('saving') ) {
481
+ api.state.create('saving');
482
+ api.state('saving').bind( function( isSaving ) {
483
+ $( document.body ).toggleClass( 'saving', isSaving );
484
+ } );
485
+ }
486
+ var saveBtn = $( '#save' ),
487
+ closeBtn = $( '.customize-controls-close' ),
488
+ saved = api.state( 'saved'),
489
+ saving = api.state( 'saving'),
490
+ activated = api.state( 'activated' ),
491
+ changesetStatus = api.state.has('changesetStatus' ) ? api.state( 'changesetStatus' )() : 'auto-draft';
492
+
493
+ if ( api.czr_dirtyness() || ! saved() ) {
494
+ saveBtn.val( api.l10n.save );
495
+ closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel );
496
+ } else {
497
+ saveBtn.val( api.l10n.saved );
498
+ closeBtn.find( '.screen-reader-text' ).text( api.l10n.close );
499
+ }
500
+ var canSave = ! saving() && ( ! activated() || ! saved() ) && 'publish' !== changesetStatus;
501
+ saveBtn.prop( 'disabled', ! canSave );
502
+ },
503
+ skopeSwitchedDoneReact : function( args ) {
504
+ var self = this,
505
+ _doWhenSkopeReady = function() {
506
+ api.czr_CrtlDependenciesReady.then( function() {
507
+ if ( ! _.isUndefined( api.czr_activeSectionId() ) && ! _.isEmpty( api.czr_activeSectionId() ) ) {
508
+ try {
509
+ api.czr_ctrlDependencies.setServiDependencies( api.czr_activeSectionId(), null, true );//target sec id, source sec id, refresh
510
+ } catch( er ) {
511
+ api.errorLog( 'On skope-switched-done : ' + er );
512
+ }
513
+ }
514
+ });
515
+ self.updateCtrlSkpNot( api.CZR_Helpers.getSectionControlIds() );
516
+ if ( api.czr_skope.has( args.previous_skope_id ) ) {
517
+ $( '#customize-controls' ).removeClass( [ 'czr-', api.czr_skope( args.previous_skope_id )().skope, '-skope-level'].join('') );
518
+ }
519
+ if ( api.czr_skope.has( args.current_skope_id ) ) {
520
+ $( '#customize-controls' ).addClass( [ 'czr-', api.czr_skope( args.current_skope_id )().skope, '-skope-level'].join('') );
521
+ }
522
+ var _setupSectionControlDialogs = function() {
523
+ if ( _.isUndefined( api.czr_activeSectionId() ) || _.isEmpty( api.czr_activeSectionId() ) )
524
+ return;
525
+ var ctrls = api.CZR_Helpers.getSectionControlIds( api.czr_activeSectionId() );
526
+ _.each( ctrls, function( ctrlId ) {
527
+ api.control.when( ctrlId, function() {
528
+ var ctrl = api.control( ctrlId );
529
+ if ( ! _.has( ctrl, 'czr_states' ) )
530
+ return;
531
+
532
+ ctrl.deferred.embedded.then( function() {
533
+ ctrl.czr_states( 'noticeVisible' )( self.isCtrlNoticeVisible( ctrlId ) );
534
+ ctrl.czr_states( 'resetVisible' )( false );
535
+ });
536
+ });
537
+ });
538
+ };
539
+ _.delay( function() {
540
+ _setupSectionControlDialogs();
541
+ }, 500 );
542
+ };
543
+ api.czr_skopeReady.then( function() {
544
+ _doWhenSkopeReady();
545
+ });
546
+ }
547
+ });//$.extend()
548
+ })( wp.customize , jQuery, _);
549
+
550
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
551
+ (function ( api, $, _ ) {
552
+ $.extend( CZRSkopeBaseMths, {
553
+ toggleServerNotice : function( notice ) {
554
+ notice = _.isObject( notice ) ? notice : {};
555
+ notice = _.extend( {
556
+ status : 'success',
557
+ expanded : true,
558
+ message : '',
559
+ auto_collapse : false
560
+ }, notice );
561
+ if ( 'changeset_already_published' == notice.message )
562
+ return;
563
+ if ( ! serverControlParams.isDevMode )
564
+ return;
565
+
566
+ this.serverNoticeEmbedded = this.serverNoticeEmbedded || $.Deferred();
567
+
568
+ var self = this,
569
+ _embed = function() {
570
+ $('.czr-scope-switcher').prepend(
571
+ $( '<div/>', {
572
+ class:'czr-server-notice',
573
+ html:'<span class="czr-server-message"></span><span class="fa fa-times-circle czr-dismiss-notification"></span>'
574
+ } )
575
+ );
576
+ },
577
+ _toggleNotice = function() {
578
+ var $notif_wrap = $( '.czr-server-notice', '.czr-scope-switcher' ),
579
+ $header = $('.wp-full-overlay-header'),
580
+ $sidebar = $('.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content'),
581
+ _header_height,
582
+ _notif_wrap_height,
583
+ _set_height = function( _h ) {
584
+ return true;
585
+ };
586
+ if ( self.skopeTitleNoticeVisible )
587
+ self.skopeTitleNoticeVisible( false );
588
+
589
+ if ( ! notice.expanded ) {
590
+ $notif_wrap
591
+ .fadeOut( {
592
+ duration : 200,
593
+ complete : function() {
594
+ } } );
595
+ setTimeout( function() {
596
+ _set_height();
597
+ } , 200 );
598
+
599
+ } else {
600
+ $notif_wrap.toggleClass( 'czr-server-error', 'error' == notice.status );
601
+ if ( 'error' == notice.status ) {
602
+ $('.czr-server-message', $notif_wrap )
603
+ .html( _.isEmpty( notice.message ) ? 'Server Problem.' : notice.message );
604
+ } else {
605
+ $('.czr-server-message', $notif_wrap )
606
+ .html( _.isEmpty( notice.message ) ? 'Success.' : notice.message );
607
+ }
608
+ _notif_wrap_height = $( '.czr-server-notice', '.czr-scope-switcher' ).outerHeight();
609
+ _header_height = $header.outerHeight() + _notif_wrap_height;
610
+
611
+ setTimeout( function() {
612
+ $.when( _set_height( _header_height ) ).done( function() {
613
+ $notif_wrap
614
+ .fadeIn( {
615
+ duration : 200,
616
+ complete : function() {
617
+ $( this ).css( 'height', 'auto' );
618
+ } } );
619
+ } );
620
+ }, 400 );
621
+ }
622
+ };
623
+ if ( 'pending' == self.serverNoticeEmbedded.state() ) {
624
+ $.when( _embed() ).done( function() {
625
+ setTimeout( function() {
626
+ self.serverNoticeEmbedded.resolve();
627
+ _toggleNotice();
628
+ }, 200 );
629
+ });
630
+ } else {
631
+ _toggleNotice();
632
+ }
633
+ _.delay( function() {
634
+ api.czr_serverNotification( { expanded : false } );
635
+ },
636
+ ( 'success' == notice.status || false !== notice.auto_collapse ) ? 4000 : 5000
637
+ );
638
+ },
639
+ buildServerResponse : function( _r ) {
640
+ var resp = false;
641
+ if ( _.isObject( _r ) ) {
642
+ if ( _.has( _r, 'responseJSON') && ! _.isUndefined( _r.responseJSON.data ) && ! _.isEmpty( _r.responseJSON.data ) ) {
643
+ resp = _r.responseJSON.data;
644
+ }
645
+ else if ( _.has( _r , 'statusText' ) && ! _.isEmpty( _r.statusText ) ) {
646
+ resp = _r.statusText;
647
+ }
648
+ }
649
+ if ( _.isObject( _r ) && ! resp ) {
650
+ try {
651
+ JSON.stringify( _r );
652
+ } catch( e ) {
653
+ resp = 'Server Error';
654
+ }
655
+ } else if ( ! resp ) {
656
+ resp = '0' === _r ? 'Not logged in.' : _r;
657
+ } else if ( '-1' === _r ) {
658
+ resp = 'Identification issue detected, please refresh your page.';
659
+ }
660
+ return resp;
661
+ }
662
+ });//$.extend()
663
+ })( wp.customize , jQuery, _);
664
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
665
+ (function ( api, $, _ ) {
666
+ $.extend( CZRSkopeBaseMths, {
667
+ toggleTopNote : function( visible, noteParams ) {
668
+ noteParams = _.isObject( noteParams ) ? noteParams : {};
669
+ var self = this,
670
+ _defaultParams = {
671
+ title : '',
672
+ message : '',
673
+ actions : '',
674
+ selfCloseAfter : 20000
675
+ },
676
+ _renderAndSetup = function() {
677
+ $.when( self.renderTopNoteTmpl( noteParams ) ).done( function( $_el ) {
678
+ self.welcomeNote = $_el;
679
+ _.delay( function() {
680
+ $('body').addClass('czr-top-note-open');
681
+ }, 200 );
682
+ api.CZR_Helpers.setupDOMListeners(
683
+ [ {
684
+ trigger : 'click keydown',
685
+ selector : '.czr-top-note-close',
686
+ name : 'close-top-note',
687
+ actions : function() {
688
+ _destroy().done( function() {
689
+ if ( _.isFunction( noteParams.actions ) ) {
690
+ noteParams.actions();
691
+ }
692
+ });
693
+ }
694
+ } ] ,
695
+ { dom_el : self.welcomeNote },
696
+ self
697
+ );
698
+ });
699
+ },
700
+ _destroy = function() {
701
+ var dfd = $.Deferred();
702
+ $('body').removeClass('czr-top-note-open');
703
+ if ( self.welcomeNote.length ) {
704
+ _.delay( function() {
705
+ self.welcomeNote.remove();
706
+ dfd.resolve();
707
+ }, 300 );
708
+ } else {
709
+ dfd.resolve();
710
+ }
711
+ return dfd.promise();
712
+ };
713
+
714
+ noteParams = $.extend( _defaultParams , noteParams);
715
+
716
+ if ( visible ) {
717
+ _renderAndSetup();
718
+ } else {
719
+ _destroy();
720
+ }
721
+ _.delay( function() {
722
+ _destroy();
723
+ },
724
+ noteParams.selfCloseAfter || 20000
725
+ );
726
+ },
727
+ renderTopNoteTmpl : function( params ) {
728
+ if ( $( '#czr-top-note' ).length )
729
+ return $( '#czr-top-note' );
730
+
731
+ var self = this,
732
+ _tmpl = '',
733
+ _title = params.title || '',
734
+ _message = params.message || '';
735
+
736
+ try {
737
+ _tmpl = wp.template( 'czr-top-note' )( { title : _title } );
738
+ } catch( er ) {
739
+ api.errorLog( 'Error when parsing the the top note template : ' + er );
740
+ return false;
741
+ }
742
+ $('#customize-preview').after( $( _tmpl ) );
743
+ $('.czr-note-message', '#czr-top-note').html( _message );
744
+ return $( '#czr-top-note' );
745
+ }
746
+ });//$.extend()
747
+ })( wp.customize , jQuery, _);
748
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
749
+ (function ( api, $, _ ) {
750
+ $.extend( CZRSkopeBaseMths, {
751
+ bindAPISettings : function( requestedSetId ) {
752
+ var self = this,
753
+ _settingChangeReact = function( new_val, old_val, o ) {
754
+ var setId = this.id,
755
+ skope_id;
756
+ if ( ! serverControlParams.isSkopOn )
757
+ return;
758
+
759
+ if ( ! _.has( api, 'czr_activeSkopeId') || _.isUndefined( api.czr_activeSkopeId() ) ) {
760
+ api.errorLog( 'The api.czr_activeSkopeId() is undefined in the api.czr_skopeBase.bindAPISettings method.');
761
+ }
762
+ if ( api( setId )._dirty ) {
763
+ skope_id = self.isSettingSkopeEligible( setId ) ? api.czr_activeSkopeId() : self.getGlobalSkopeId();
764
+ api.czr_skope( skope_id ).updateSkopeDirties( setId, new_val );
765
+ }
766
+ if ( _.has( api.control(setId), 'czr_states' ) && ! api.control(setId).czr_states( 'isResetting' )() ) {
767
+ api.control( setId ).czr_states( 'resetVisible' )( false );
768
+ }
769
+ if ( self.isSettingSkopeEligible( setId ) ) {
770
+ self.updateCtrlSkpNot( setId );
771
+ }
772
+ };//_settingChangeReact()
773
+ if ( ! _.isUndefined( requestedSetId ) ) {
774
+ api( requestedSetId ).bind( _settingChangeReact );
775
+ }
776
+ else {
777
+ api.each( function ( _setting ) {
778
+ _setting.bind( _settingChangeReact );
779
+ });
780
+ }
781
+ var _dynamicallyAddedSettingsReact = function( setting_instance ) {
782
+ if ( setting_instance.callbacks.has( _settingChangeReact ) )
783
+ return;
784
+ setting_instance.bind( _settingChangeReact );
785
+ };
786
+
787
+ if ( ! api.topics.change.has( _dynamicallyAddedSettingsReact ) ) {
788
+ api.bind( 'change', _dynamicallyAddedSettingsReact );
789
+ }
790
+ }
791
+ });//$.extend()
792
+ })( wp.customize , jQuery, _ );
793
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
794
+ ( function ( api, $, _ ) {
795
+ $.extend( CZRSkopeBaseMths, {
796
+ reactWhenSkopeSyncedDone : function( server_params ) {
797
+ var self = this, dfd = $.Deferred();
798
+ if ( ! _.has( server_params, 'czr_skopes' ) || _.isEmpty( server_params.czr_skopes ) ) {
799
+ api.errorLog( 'Missing skope data after refresh', server_params );
800
+ return dfd.resolve().promise();
801
+ }
802
+ if ( ! api.czr_dirtyness() ) {
803
+ api.czr_dirtyness( _.isBoolean( server_params.isChangesetDirty ) ? server_params.isChangesetDirty : false );
804
+ }
805
+
806
+ var _sentSkopeCollection = server_params.czr_skopes;
807
+ _.each( api.czr_skopeCollection(), function( _skp ) {
808
+ var _sent_skope = _.findWhere( _sentSkopeCollection, { opt_name : _skp.opt_name } );
809
+ if ( _.isUndefined( _sent_skope ) )
810
+ return;
811
+ var _changeset_candidate = _.isEmpty( _sent_skope.changeset || {} ) ? {} : _sent_skope.changeset,
812
+ _api_ready_chgset = {};
813
+ _.each( _changeset_candidate, function( _val, _setId ) {
814
+ if ( ! api.has( _setId ) ) {
815
+ api.consoleLog( 'In reactWhenSkopeSyncedDone : attempting to update the changeset with a non registered setting : ' + _setId );
816
+ }
817
+ _api_ready_chgset[_setId] = _val;
818
+ });
819
+ api.czr_skope( _skp.id ).changesetValues( _api_ready_chgset );
820
+ });
821
+ _.each( api.czr_skopeCollection(), function( _skp ) {
822
+ var _sent_skope = _.findWhere( _sentSkopeCollection, { opt_name : _skp.opt_name } );
823
+ if ( _.isUndefined( _sent_skope ) )
824
+ return;
825
+ var _current_db_vals = $.extend( true, {}, api.czr_skope( _skp.id ).dbValues() ),
826
+ _dbVals_candidate = $.extend( _current_db_vals , _sent_skope.db || {} ),
827
+ _api_ready_dbvals = {};
828
+ _.each( _dbVals_candidate, function( _val, _setId ) {
829
+ if ( ! api.has( _setId ) ) {
830
+ api.consoleLog( 'In reactWhenSkopeSyncedDone : attempting to update the db values with a non registered setting : ' + _setId );
831
+ }
832
+ _api_ready_dbvals[_setId] = _val;
833
+ });
834
+
835
+
836
+ api.czr_skope( _skp.id ).dbValues( _api_ready_dbvals );
837
+ });
838
+ _.delay( function() {
839
+ dfd.resolve();
840
+ }, 500 );
841
+ return dfd.promise();
842
+ }
843
+ });//$.extend()
844
+ })( wp.customize , jQuery, _ );
845
+
846
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
847
+ ( function ( api, $, _ ) {
848
+ $.extend( CZRSkopeBaseMths, {
849
+ _maybeSetupAssignedMenuLocations : function( active_section ) {
850
+ if ( _.isUndefined( active_section ) || _.isEmpty( active_section ) || ! api.section.has( active_section.id ) ) {
851
+ api.consoleLog( 'In _maybeSetupAssignedMenuLocations : no valid section_id provided.');
852
+ }
853
+ var self = this;
854
+ if ( ! active_section.assignedLocations )
855
+ return;
856
+ var _assignedLocReact = function( locations ) {};
857
+
858
+ if ( ! active_section.assignedLocations.callbacks.has( _assignedLocReact ) ) {
859
+ active_section.assignedLocations.bind( _assignedLocReact );
860
+ }
861
+ },
862
+ activeSectionReact : function( active_sec_id , previous_sec_id ) {
863
+ if ( 'add_menu' != active_sec_id ) {
864
+ api.trigger('czr-paint', { active_section_id : active_sec_id } );
865
+ }
866
+
867
+ var self = this,
868
+ _doReactPrevious = function( previous_sec_id ) {
869
+ var controls = api.CZR_Helpers.getSectionControlIds( previous_sec_id );
870
+ _.each( controls, function( ctrlId ) {
871
+ if ( ! api.has( ctrlId ) || _.isUndefined( api.control( ctrlId ) ) )
872
+ return;
873
+ var ctrl = api.control( ctrlId );
874
+ if ( ! _.has( ctrl, 'czr_states' ) )
875
+ return;
876
+
877
+ ctrl.czr_states( 'resetVisible' )( false );
878
+ });
879
+ },
880
+ _doReactActive = function( active_section, active_sec_id ) {
881
+ self.setupActiveSkopedControls( {
882
+ section_id : active_sec_id
883
+ });
884
+ self.processSilentUpdates( { section_id : active_sec_id } )
885
+ .fail( function() {
886
+ throw new Error( 'Fail to process silent updates after initial skope collection has been populated' );
887
+ })
888
+ .done( function() {
889
+ var _setupSectionCtrlNotices = function() {
890
+ var controls = api.CZR_Helpers.getSectionControlIds( active_sec_id );
891
+ _.each( controls, function( ctrlId ) {
892
+ if ( ! api.has( ctrlId ) || _.isUndefined( api.control( ctrlId ) ) )
893
+ return;
894
+ var ctrl = api.control( ctrlId );
895
+ if ( ! _.has( ctrl, 'czr_states' ) )
896
+ return;
897
+ ctrl.czr_states( 'noticeVisible' )( self.isCtrlNoticeVisible( ctrlId ) );
898
+ });
899
+ };
900
+ _.delay( function() {
901
+ _setupSectionCtrlNotices();
902
+ }, 700 );
903
+ if ( ! self.isExcludedSidebarsWidgets() ) {
904
+ self.forceSidebarDirtyRefresh( active_sec_id , api.czr_activeSkopeId() );
905
+ }
906
+ });
907
+ if ( ! _.has( api.topics, 'active-section-setup' ) ) {
908
+ api.bind( 'active-section-setup', function( params ) {
909
+ var defaults = {
910
+ controls : [],
911
+ section_id : ''
912
+ };
913
+ params = _.extend( defaults, params );
914
+ self._maybeSetupAssignedMenuLocations( params );
915
+ });
916
+ }
917
+ api.czr_skopeReady.then( function() {
918
+ var _switchBack = function( _title ) {
919
+ api.czr_serverNotification({
920
+ status:'success',
921
+ message : [ _title, serverControlParams.i18n.skope['can only be customized sitewide.'] ].join(' ')
922
+ });
923
+ api.czr_activeSkopeId( self.getGlobalSkopeId() );
924
+ };
925
+ if ( 'global' != api.czr_skope( api.czr_activeSkopeId() )().skope ) {
926
+ if (
927
+ self.isExcludedWPCustomCss() &&
928
+ ( 'custom_css' == active_sec_id || 'admin_sec' == active_sec_id )
929
+ ) {
930
+ _switchBack( api.section( active_sec_id ).params.title );
931
+ }
932
+
933
+ if ( 'nav_menu[' == active_sec_id.substring( 0, 'nav_menu['.length ) || 'add_menu' == active_sec_id ) {
934
+ api.czr_serverNotification({
935
+ status:'success',
936
+ message : [
937
+ serverControlParams.i18n.skope['Menus are created sitewide.']
938
+ ].join(' ')
939
+ });
940
+ }
941
+ }
942
+ });
943
+ api.trigger('active-section-setup', active_section );
944
+ };
945
+ api.czr_initialSkopeCollectionPopulated.then( function() {
946
+ api.section.when( active_sec_id , function( active_section ) {
947
+ active_section.deferred.embedded.then( function() {
948
+ try { _doReactActive( active_section, active_sec_id ); } catch( er ) {
949
+ api.errorLog( 'activeSectionReact => _doReactActive : ' + er );
950
+ }
951
+
952
+ });
953
+ });
954
+ if ( ! _.isEmpty( previous_sec_id ) && api.section.has( previous_sec_id ) ) {
955
+ _doReactPrevious( previous_sec_id );
956
+ }
957
+ });
958
+ },
959
+ activePanelReact : function( active_panel_id , previous_panel_id ) {
960
+ var self = this;
961
+ api.czr_initialSkopeCollectionPopulated.then( function() {
962
+ api.trigger('czr-paint', { active_panel_id : active_panel_id } );
963
+ var _switchBack = function( _title ) {
964
+ api.czr_serverNotification({
965
+ status:'success',
966
+ message : [ _title, serverControlParams.i18n.skope['can only be customized sitewide.'] ].join(' ')
967
+ });
968
+ api.czr_activeSkopeId( self.getGlobalSkopeId() );
969
+ };
970
+ api.czr_skopeReady.then( function() {
971
+ if ( 'global' != api.czr_skope( api.czr_activeSkopeId() )().skope ) {
972
+ if ( self.isExcludedSidebarsWidgets() && 'widgets' == active_panel_id ) {
973
+ api.czr_serverNotification({
974
+ status:'success',
975
+ message : [
976
+ serverControlParams.i18n.skope['Widgets are created sitewide.']
977
+ ].join(' ')
978
+ });
979
+ }
980
+ }
981
+ });
982
+ api.czr_skopeReady.then( function() {
983
+ if ( 'nav_menus' == active_panel_id ) {
984
+ _.each( api.panel( active_panel_id ).sections(), function( _sec ) {
985
+ self.processSilentUpdates( { section_id : _sec.id, awake_if_not_active : true } );
986
+ });
987
+ }
988
+ });
989
+ });
990
+ }
991
+ });//$.extend()
992
+ })( wp.customize , jQuery, _ );
993
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
994
+ ( function ( api, $, _ ) {
995
+ $.extend( CZRSkopeBaseMths, {
996
+ wash : function( params ) {
997
+ var self = this,
998
+ _do_wash = function( element ) {
999
+ if ( ! _.has( element, 'el') || ! element.el.length )
1000
+ return;
1001
+ $.when( element.el.removeClass('czr-painted') ).done( function() {
1002
+ $(this).css( 'background', '' ).css('color', '');
1003
+ });
1004
+ };
1005
+ if ( api.czr_skopeBase.paintedElements ) {
1006
+ _.each( api.czr_skopeBase.paintedElements(), function( _el ) { _do_wash( _el ); } );
1007
+ api.czr_skopeBase.paintedElements( [] );
1008
+ }
1009
+ return this;
1010
+ },
1011
+ paint : function( params ) {
1012
+ var _bgColor = 'inherit',
1013
+ defaults = {
1014
+ active_panel_id : api.czr_activePanelId(),
1015
+ active_section_id : api.czr_activeSectionId(),
1016
+ is_skope_switch : false
1017
+ },
1018
+ _paint_candidates = [];
1019
+ params = $.extend( defaults, params );
1020
+
1021
+ if ( ! _.isUndefined( api.czr_activeSkopeId() ) && api.czr_skope.has( api.czr_activeSkopeId() ) ) {
1022
+ _bgColor = api.czr_skope( api.czr_activeSkopeId() ).color;
1023
+ }
1024
+ var _do_paint = function( element ) {
1025
+ if ( ! _.has( element, 'el') || ! element.el.length )
1026
+ return;
1027
+ if ( params.is_skope_switch ) {
1028
+ $.when( element.el.addClass('czr-painted') ).done( function() {
1029
+ $(this).css( 'background', element.bgColor || _bgColor );
1030
+ });
1031
+ } else {
1032
+ element.el.css( 'background', element.bgColor || _bgColor );
1033
+ }
1034
+ if ( 'global' != api.czr_skope( api.czr_activeSkopeId() )().skope ) {
1035
+ element.el.css( 'color', '#000');
1036
+ }
1037
+
1038
+ };
1039
+
1040
+ api.czr_skopeBase.paintedElements = api.czr_skopeBase.paintedElements || new api.Value( [] );
1041
+ if ( _.isEmpty( params.active_panel_id ) && _.isEmpty( params.active_section_id ) ) {
1042
+ _paint_candidates.push( {
1043
+ el : $( '#customize-info' ).find('.accordion-section-title').first()
1044
+ });
1045
+ api.panel.each( function( _panel ) {
1046
+ _paint_candidates.push( {
1047
+ el : _panel.container.find( '.accordion-section-title').first()
1048
+ });
1049
+ });
1050
+ api.section.each( function( _section ) {
1051
+ if ( ! _.isEmpty( _section.panel() ) )
1052
+ return;
1053
+ _paint_candidates.push( {
1054
+ el : _section.container.find( '.accordion-section-title').first()
1055
+ });
1056
+ });
1057
+ }
1058
+ if ( ! _.isEmpty( params.active_panel_id ) && _.isEmpty( params.active_section_id ) ) {
1059
+ api.panel.when( params.active_panel_id , function( active_panel ) {
1060
+ active_panel.deferred.embedded.then( function() {
1061
+ _paint_candidates.push( {
1062
+ el : active_panel.container.find( '.accordion-section-title, .customize-panel-back' )
1063
+ });
1064
+ });
1065
+ });
1066
+ }
1067
+ if ( ! _.isEmpty( params.active_section_id ) ) {
1068
+ api.section.when( params.active_section_id , function( active_section ) {
1069
+ active_section.deferred.embedded.then( function() {
1070
+ _paint_candidates.push(
1071
+ {
1072
+ el : active_section.container.find( '.customize-section-title, .customize-section-back' ),
1073
+ bgColor : 'inherit'
1074
+ },
1075
+ {
1076
+ el : active_section.container
1077
+ }
1078
+ );
1079
+ if ( ! api.czr_isChangeSetOn() ) {
1080
+ _paint_candidates.push(
1081
+ {
1082
+ el : active_section.container.find('.accordion-section-content')
1083
+ }
1084
+ );
1085
+ }
1086
+ });
1087
+ });
1088
+ }
1089
+ _.each( _paint_candidates, function( _el ) { _do_paint( _el ); } );
1090
+ api.czr_skopeBase.paintedElements( _paint_candidates );
1091
+ return this;
1092
+ }
1093
+ });//$.extend()
1094
+ })( wp.customize , jQuery, _ );
1095
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1096
+ ( function ( api, $, _ ) {
1097
+ $.extend( CZRSkopeBaseMths, {
1098
+ isSkopeRegisteredInCollection : function( skope_id, collection ) {
1099
+ var self = this;
1100
+ collection = collection || api.czr_skopeCollection();
1101
+ return ! _.isUndefined( _.findWhere( collection, { id : skope_id } ) );
1102
+ },
1103
+ isSkopeRegisteredInCurrentCollection : function( skope_id, collection ) {
1104
+ var self = this;
1105
+ collection = collection || api.czr_currentSkopesCollection();
1106
+ return ! _.isUndefined( _.findWhere( collection, { id : skope_id } ) );
1107
+ },
1108
+ isGlobalSkopeRegistered : function() {
1109
+ var _model = _.findWhere( api.czr_currentSkopesCollection(), { skope : 'global'} );
1110
+ return _.isObject( _model ) && _.has( _model, 'id' );
1111
+ },
1112
+ getGlobalSkopeId : function() {
1113
+ if ( ! _.has(api, 'czr_skope') )
1114
+ return '';
1115
+ var id = '';
1116
+ api.czr_skope.each( function(skp){
1117
+ if ( 'global' == skp().skope )
1118
+ id = skp().id;
1119
+ });
1120
+ return id;
1121
+ },
1122
+ getChangedGlobalDBSettingValues : function( serverGlobalDBValues ) {
1123
+ var _changedDbVal = {};
1124
+
1125
+ _.each( serverGlobalDBValues, function( _val, _setId ){
1126
+ _wpSetId = api.CZR_Helpers.build_setId( _setId);
1127
+
1128
+ if ( ! _.has( api.settings.settings, _wpSetId ) )
1129
+ return;
1130
+ if ( _.isEqual( _val , api.settings.settings[ _wpSetId ].value ) )
1131
+ return;
1132
+ _changedDbVal[_setId] = _val;
1133
+ });
1134
+ return _changedDbVal;
1135
+ },
1136
+ getActiveSkopeId : function( _current_skope_collection ) {
1137
+ _current_skope_collection = _current_skope_collection || api.czr_currentSkopesCollection();
1138
+
1139
+ var _currentSkopeLevel = ( ! _.isEmpty( api.czr_activeSkopeId() ) && api.czr_skope.has( api.czr_activeSkopeId() ) ) ? api.czr_skope( api.czr_activeSkopeId() )().skope : serverControlParams.isLocalSkope ? 'local' : 'global',
1140
+ _newSkopeCandidate = _.findWhere( _current_skope_collection, { skope : _currentSkopeLevel } );
1141
+
1142
+ _skpId = ! _.isUndefined( _newSkopeCandidate ) ? _newSkopeCandidate.id : _.findWhere( _current_skope_collection, { skope : 'global' } ).id;
1143
+
1144
+ if ( _.isUndefined( _skpId ) ) {
1145
+ throw new Error( 'No default skope was found in getActiveSkopeId ', _current_skope_collection );
1146
+ }
1147
+ return _skpId;
1148
+ },
1149
+ getActiveSkopeName : function() {
1150
+ if ( ! api.czr_skope.has( api.czr_activeSkopeId() ) )
1151
+ return 'global';
1152
+ return api.czr_skope( api.czr_activeSkopeId() )().skope;
1153
+ },
1154
+ isSettingSkopeEligible : function( setId ) {
1155
+ var self = this,
1156
+ shortSetId = api.CZR_Helpers.getOptionName( setId );
1157
+
1158
+ if( _.isUndefined( setId ) || ! api.has( setId ) ) {
1159
+ api.consoleLog( 'THE SETTING ' + setId + ' IS NOT ELIGIBLE TO SKOPE BECAUSE UNDEFINED OR NOT REGISTERED IN THE API.' );
1160
+ return false;
1161
+ }
1162
+ if ( self.isExcludedWPBuiltinSetting( setId ) )
1163
+ return false;
1164
+ if ( _.contains( serverControlParams.skopeExcludedSettings, shortSetId ) ) {
1165
+ return false;
1166
+ } else if ( self.isThemeSetting( setId ) ) {
1167
+ return true;
1168
+ } else
1169
+ return true;
1170
+ },
1171
+ isSettingResetEligible : function( setId ) {
1172
+ var self = this,
1173
+ shortSetId = api.CZR_Helpers.getOptionName( setId );
1174
+
1175
+ if( _.isUndefined( setId ) || ! api.has( setId ) ) {
1176
+ api.consoleLog( 'THE SETTING ' + setId + ' IS NOT ELIGIBLE TO RESET BECAUSE UNDEFINED OR NOT REGISTERED IN THE API.' );
1177
+ return;
1178
+ }
1179
+ if ( self.isExcludedWPBuiltinSetting( setId ) )
1180
+ return;
1181
+ if ( ! self.isThemeSetting( setId ) && ! self.isWPAuthorizedSetting( setId ) ) {
1182
+ api.consoleLog( 'THE SETTING ' + setId + ' IS NOT ELIGIBLE TO RESET BECAUSE NOT PART OF THE THEME OPTIONS AND NOT WP AUTHORIZED BUILT IN OPTIONS' );
1183
+ } else
1184
+ return true;
1185
+ },
1186
+ isThemeSetting : function( setId ) {
1187
+ return _.isString( setId ) && -1 !== setId.indexOf( serverControlParams.themeOptions );
1188
+ },
1189
+ isWPAuthorizedSetting : function( setId ) {
1190
+ return _.isString( setId ) && _.contains( serverControlParams.wpBuiltinSettings, setId );
1191
+ },
1192
+ isExcludedWPBuiltinSetting : function( setId ) {
1193
+ var self = this;
1194
+ if ( _.isUndefined(setId) )
1195
+ return true;
1196
+ if ( 'active_theme' == setId )
1197
+ return true;
1198
+ if ( _.contains( serverControlParams.wpBuiltinSettings, setId ) )
1199
+ return false;
1200
+ var _patterns = [ 'widget_', 'nav_menu', 'sidebars_', 'custom_css', 'nav_menu[', 'nav_menu_item', 'nav_menus_created_posts', 'nav_menu_locations' ],
1201
+ _isExcld = false;
1202
+ _.each( _patterns, function( _ptrn ) {
1203
+ switch( _ptrn ) {
1204
+ case 'widget_' :
1205
+ case 'sidebars_' :
1206
+ if ( _ptrn == setId.substring( 0, _ptrn.length ) ) {
1207
+ _isExcld = self.isExcludedSidebarsWidgets();
1208
+ }
1209
+ break;
1210
+
1211
+ case 'nav_menu[' :
1212
+ case 'nav_menu_item' :
1213
+ case 'nav_menus_created_posts' :
1214
+ if ( _ptrn == setId.substring( 0, _ptrn.length ) ) {
1215
+ _isExcld = true;
1216
+ }
1217
+ break;
1218
+
1219
+ case 'nav_menu_locations' :
1220
+ if ( _ptrn == setId.substring( 0, _ptrn.length ) ) {
1221
+ _isExcld = self.isExcludedNavMenuLocations();
1222
+ }
1223
+ break;
1224
+
1225
+ case 'custom_css' :
1226
+ if ( _ptrn == setId.substring( 0, _ptrn.length ) ) {
1227
+ _isExcld = self.isExcludedWPCustomCss();
1228
+ }
1229
+ break;
1230
+
1231
+
1232
+ }
1233
+ });
1234
+ return _isExcld;
1235
+ },
1236
+ isExcludedSidebarsWidgets : function() {
1237
+ var _servParam = serverControlParams.isSidebarsWigetsSkoped;//can be a boolean or a string "" for false, "1" for true
1238
+ return ! ( ! _.isUndefined( _servParam ) && ! _.isEmpty( _servParam ) && false !== _servParam );
1239
+ },
1240
+ isExcludedNavMenuLocations : function() {
1241
+ if ( ! api.czr_isChangeSetOn() )
1242
+ return true;
1243
+ var _servParam = serverControlParams.isNavMenuLocationsSkoped;//can be a boolean or a string "" for false, "1" for true
1244
+ return ! ( ! _.isUndefined( _servParam ) && ! _.isEmpty( _servParam ) && false !== _servParam );
1245
+ },
1246
+ isExcludedWPCustomCss : function() {
1247
+ var _servParam = serverControlParams.isWPCustomCssSkoped;//can be a boolean or a string "" for false, "1" for true
1248
+ return ! ( ! _.isUndefined( _servParam ) && ! _.isEmpty( _servParam ) && false !== _servParam );
1249
+ },
1250
+ _getDBSettingVal : function( setId, skope_id ) {
1251
+ var shortSetId = api.CZR_Helpers.getOptionName(setId),
1252
+ wpSetId = api.CZR_Helpers.build_setId(setId);
1253
+ if ( ! api.czr_skope.has( skope_id ) ) {
1254
+ api.consoleLog( '_getDBSettingVal : the requested skope id is not registered : ' + skope_id );
1255
+ return '_no_db_val';
1256
+ }
1257
+ if ( _.has( api.czr_skope( skope_id ).dbValues(), wpSetId ) ) {
1258
+ return api.czr_skope( skope_id ).dbValues()[wpSetId];
1259
+ } else if ( _.has( api.czr_skope( skope_id ).dbValues(), shortSetId ) ) {
1260
+ return api.czr_skope( skope_id ).dbValues()[shortSetId];
1261
+ } else {
1262
+ return '_no_db_val';
1263
+ }
1264
+ },
1265
+ getSkopeDirties : function( skope_id, options ) {
1266
+ if ( ! api.czr_skope.has( skope_id ) )
1267
+ return {};
1268
+ options = options || {};
1269
+ options = _.extend( { unsaved : true }, options );
1270
+
1271
+ var values = {};
1272
+ _.each( api.czr_skope( skope_id ).dirtyValues(), function( _val, _setId ) {
1273
+ var settingRevision;
1274
+ if ( api.czr_isChangeSetOn() ) {
1275
+ settingRevision = api._latestSettingRevisions[ _setId ];
1276
+ if ( api.state( 'changesetStatus' ).get() && ( options && options.unsaved ) && ( _.isUndefined( settingRevision ) || settingRevision <= api._lastSavedRevision ) ) {
1277
+ return;
1278
+ }
1279
+ }
1280
+ values[ _setId ] = _val;
1281
+ } );
1282
+ return values;
1283
+ },
1284
+
1285
+ getSkopeExcludedDirties : function() {
1286
+ var self = this,
1287
+ _wpDirties = {};
1288
+ api.each( function ( value, setId ) {
1289
+ if ( value._dirty ) {
1290
+ _wpDirties[ setId ] = value();
1291
+ }
1292
+ } );
1293
+ var _globalSkopeId = self.getGlobalSkopeId(),
1294
+ _globalSkpDirties = self.getSkopeDirties( _globalSkopeId );
1295
+ return _.omit( _wpDirties, function( _value, setId ) {
1296
+ return self.isSettingSkopeEligible( setId );
1297
+ } );
1298
+ },
1299
+ parseWidgetId : function( widgetId, prefixToRemove ) {
1300
+ var matches, parsed = {
1301
+ number: null,
1302
+ id_base: null
1303
+ };
1304
+
1305
+ matches = widgetId.match( /^(.+)-(\d+)$/ );
1306
+ if ( matches ) {
1307
+ parsed.id_base = matches[1];
1308
+ parsed.number = parseInt( matches[2], 10 );
1309
+ } else {
1310
+ parsed.id_base = widgetId;
1311
+ }
1312
+
1313
+ if ( ! _.isUndefined( prefixToRemove ) )
1314
+ parsed.id_base = parsed.id_base.replace( prefixToRemove , '');
1315
+ return parsed;
1316
+ },
1317
+ widgetIdToSettingId: function( widgetId , prefixToRemove ) {
1318
+ var parsed = this.parseWidgetId( widgetId, prefixToRemove ), settingId;
1319
+
1320
+ settingId = parsed.id_base;
1321
+ if ( parsed.number ) {
1322
+ settingId += '[' + parsed.number + ']';
1323
+ }
1324
+ return settingId;
1325
+ },
1326
+
1327
+
1328
+
1329
+
1330
+ isWidgetRegisteredGlobally : function( widgetId ) {
1331
+ var self = this;
1332
+ registered = false;
1333
+ _.each( _wpCustomizeWidgetsSettings.registeredWidgets, function( _val, _short_id ) {
1334
+ if ( ! registered && 'widget_' + self.widgetIdToSettingId(_short_id) == widgetId )
1335
+ registered = true;
1336
+ } );
1337
+ return registered;
1338
+ }
1339
+ });//$.extend
1340
+ })( wp.customize , jQuery, _ );
1341
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1342
+ ( function ( api, $, _ ) {
1343
+ $.extend( CZRSkopeBaseMths, {
1344
+
1345
+ getAppliedPrioritySkopeId : function( setId, skope_id ) {
1346
+ if ( ! api.has( api.CZR_Helpers.build_setId(setId) ) ) {
1347
+ api.errorLog( 'getAppliedPrioritySkopeId : the requested setting id does not exist in the api : ' + api.CZR_Helpers.build_setId(setId) );
1348
+ return skope_id;
1349
+ }
1350
+ if ( ! api.czr_skope.has( skope_id ) ) {
1351
+ api.errorLog( 'getAppliedPrioritySkopeId : the requested skope id is not registered : ' + skope_id );
1352
+ return skope_id;
1353
+ }
1354
+ var self = this,
1355
+ _local_skope_id = _.findWhere( api.czr_currentSkopesCollection(), { skope : 'local' } ).id;
1356
+
1357
+ if ( _.isUndefined( _local_skope_id ) || skope_id == _local_skope_id )
1358
+ return skope_id;
1359
+ var _salmonToMatch = function( _skp_id ) {
1360
+ var wpSetId = api.CZR_Helpers.build_setId( setId ),
1361
+ val_candidate = '___',
1362
+ skope_model = api.czr_skope( _skp_id )(),
1363
+ initial_val;
1364
+
1365
+ if ( _skp_id == skope_id )
1366
+ return skope_id;
1367
+ if ( api.czr_skope( _skp_id ).getSkopeSettingAPIDirtyness( wpSetId ) )
1368
+ return skope_model.id;
1369
+ if ( api.czr_isChangeSetOn() ) {
1370
+ if ( api.czr_skope( _skp_id ).getSkopeSettingChangesetDirtyness( wpSetId ) )
1371
+ return skope_model.id;
1372
+ }
1373
+ var _skope_db_val = self._getDBSettingVal( setId, _skp_id);
1374
+ if ( _skope_db_val != '_no_db_val' ) {
1375
+ return skope_model.id;
1376
+ }
1377
+ else if( 'global' == skope_model.skope ) {
1378
+ return skope_model.id;
1379
+ }
1380
+ else {
1381
+ return '___' != val_candidate ? skope_model.title : _salmonToMatch( self._getParentSkopeId( skope_model ) );
1382
+ }
1383
+ };
1384
+ return _salmonToMatch( _local_skope_id );
1385
+ },
1386
+ getOverridenSkopeTitles : function() {
1387
+ var skope_id = skope_id || api.czr_activeSkopeId();
1388
+ if ( ! api.czr_skope.has( skope_id ) ) {
1389
+ api.errorLog( 'getInheritedSkopeTitles : the requested skope id is not registered : ' + skope_id );
1390
+ return '';
1391
+ }
1392
+ var self = this,
1393
+ _local_skope_id = _.findWhere( api.czr_currentSkopesCollection(), { skope : 'local' } ).id;
1394
+
1395
+ if ( _.isUndefined( _local_skope_id ) || skope_id == _local_skope_id )
1396
+ return '';
1397
+ var _salmonToMatch = function( _skp_id, _skp_ids ) {
1398
+ _skp_ids = _skp_ids || [];
1399
+ var skope_model = api.czr_skope( _skp_id )();
1400
+
1401
+ if ( _skp_id == skope_id )
1402
+ return _skp_ids;
1403
+ _skp_ids.unshift( _skp_id );
1404
+ return _salmonToMatch( self._getParentSkopeId( skope_model ), _skp_ids );
1405
+ };
1406
+
1407
+ return _.map( _salmonToMatch( _local_skope_id ), function( id ) {
1408
+ return self.buildSkopeLink( id );
1409
+ }).join( ' ' + serverControlParams.i18n.skope['and'] + ' ' );
1410
+ },
1411
+ getInheritedSkopeId : function( setId, skope_id ) {
1412
+ if ( ! api.has( api.CZR_Helpers.build_setId(setId) ) ) {
1413
+ api.errorLog( 'getInheritedSkopeId : the requested setting id does not exist in the api : ' + api.CZR_Helpers.build_setId(setId) );
1414
+ return skope_id;
1415
+ }
1416
+ if ( ! api.czr_skope.has( skope_id ) ) {
1417
+ api.errorLog( 'getInheritedSkopeId : the requested skope id is not registered : ' + skope_id );
1418
+ return skope_id;
1419
+ }
1420
+
1421
+ var self = this,
1422
+ wpSetId = api.CZR_Helpers.build_setId( setId ),
1423
+ val_candidate = '___',
1424
+ skope_model = api.czr_skope( skope_id )(),
1425
+ initial_val;
1426
+ if ( _.has( api.settings.settings, wpSetId ) )
1427
+ initial_val = api.settings.settings[wpSetId].value;
1428
+ else
1429
+ initial_val = null;
1430
+ if ( api.czr_skope( skope_id ).getSkopeSettingAPIDirtyness( wpSetId ) )
1431
+ return skope_id;
1432
+ if ( api.czr_isChangeSetOn() ) {
1433
+ if ( api.czr_skope( skope_id ).getSkopeSettingChangesetDirtyness( wpSetId ) )
1434
+ return skope_id;
1435
+ }
1436
+ var _skope_db_val = self._getDBSettingVal( setId, skope_id );
1437
+ if ( _skope_db_val != '_no_db_val' )
1438
+ return skope_id;
1439
+ else if( 'global' == skope_model.skope ) {
1440
+ return skope_id;
1441
+ }
1442
+ else
1443
+ return '___' != val_candidate ?skope_id : self.getInheritedSkopeId( setId, self._getParentSkopeId( skope_model ) );
1444
+ },
1445
+ getInheritedSkopeTitles : function( skope_id, skope_ids ) {
1446
+ skope_id = skope_id || api.czr_activeSkopeId();
1447
+ if ( ! api.czr_skope.has( skope_id ) ) {
1448
+ api.errorLog( 'getInheritedSkopeTitles : the requested skope id is not registered : ' + skope_id );
1449
+ return '';
1450
+ }
1451
+ skope_ids = skope_ids || [];
1452
+ var self = this,
1453
+ skope_model = api.czr_skope( skope_id )();
1454
+
1455
+ if ( skope_id !== api.czr_activeSkopeId() )
1456
+ skope_ids.unshift( skope_id );
1457
+
1458
+ if ( 'global' !== skope_model.skope )
1459
+ return self.getInheritedSkopeTitles( self._getParentSkopeId( skope_model ), skope_ids );
1460
+
1461
+ return _.map( skope_ids, function( id ) {
1462
+ return self.buildSkopeLink( id );
1463
+ }).join(' ' + serverControlParams.i18n.skope['and'] + ' ');
1464
+ },
1465
+ buildSkopeLink : function( skope_id ) {
1466
+ if ( ! api.czr_skope.has( skope_id ) ) {
1467
+ api.errorLog( 'buildSkopeLink : the requested skope id is not registered : ' + skope_id );
1468
+ return '';
1469
+ }
1470
+ var _link_title = [ serverControlParams.i18n.skope['Switch to scope'], api.czr_skope( skope_id )().title ].join(' : ');
1471
+ return [
1472
+ '<span class="czr-skope-switch" title=" ' + _link_title + '" data-skope-id="' + skope_id + '">',
1473
+ api.czr_skope( skope_id )().title,
1474
+ '</span>'
1475
+ ].join( '' );
1476
+ },
1477
+ getSkopeSettingVal : function( setId, skope_id ) {
1478
+ if ( ! api.has( api.CZR_Helpers.build_setId(setId) ) ) {
1479
+ api.errorLog( 'getSkopeSettingVal : the requested setting id does not exist in the api : ' + api.CZR_Helpers.build_setId(setId) );
1480
+ return null;
1481
+ }
1482
+ if ( ! api.czr_skope.has( skope_id ) ) {
1483
+ api.errorLog( 'getSkopeSettingVal : the requested skope id is not registered : ' + skope_id );
1484
+ return null;
1485
+ }
1486
+
1487
+ var self = this,
1488
+ wpSetId = api.CZR_Helpers.build_setId( setId ),
1489
+ val_candidate = '___',
1490
+ skope_model = api.czr_skope( skope_id )(),
1491
+ initial_val;
1492
+ if ( _.has( api.settings.settings, wpSetId ) )
1493
+ initial_val = api.settings.settings[wpSetId].value;
1494
+ else
1495
+ initial_val = null;
1496
+ if ( api.czr_skope( skope_id ).getSkopeSettingAPIDirtyness( wpSetId ) )
1497
+ return api.czr_skope( skope_id ).dirtyValues()[ wpSetId ];
1498
+ if ( api.czr_isChangeSetOn() ) {
1499
+ if ( api.czr_skope( skope_id ).getSkopeSettingChangesetDirtyness( wpSetId ) )
1500
+ return api.czr_skope( skope_id ).changesetValues()[ wpSetId ];
1501
+ }
1502
+ var _skope_db_val = self._getDBSettingVal( setId, skope_id );
1503
+ if ( _skope_db_val != '_no_db_val' )
1504
+ return _skope_db_val;
1505
+ else if( 'global' == skope_model.skope ) {
1506
+ return '___' == val_candidate ? initial_val : val_candidate;
1507
+ }
1508
+ else
1509
+ return '___' != val_candidate ? val_candidate : self.getSkopeSettingVal( setId, self._getParentSkopeId( skope_model ) );
1510
+ },
1511
+ applyDirtyCustomizedInheritance : function( dirtyCustomized, skope_id ) {
1512
+ skope_id = skope_id || api.czr_activeSkopeId() || api.czr_skopeBase.getGlobalSkopeId();
1513
+ dirtyCustomized = dirtyCustomized || {};
1514
+
1515
+ var self = this,
1516
+ skope_model = api.czr_skope( skope_id )();
1517
+
1518
+ if ( 'global' == skope_model.skope )
1519
+ return dirtyCustomized;
1520
+
1521
+ var parent_skope_id = self._getParentSkopeId( skope_model ),
1522
+ parent_dirties = api.czr_skope( parent_skope_id ).dirtyValues();
1523
+ _.each( parent_dirties, function( _val, wpSetId ){
1524
+ var shortSetId = api.CZR_Helpers.getOptionName( wpSetId );
1525
+ if ( _.isUndefined( dirtyCustomized[wpSetId] ) && _.isUndefined( api.czr_skope( skope_model.id ).dbValues()[shortSetId] ) )
1526
+ dirtyCustomized[wpSetId] = _val;
1527
+ });
1528
+ return 'global' == api.czr_skope( parent_skope_id )().skope ? dirtyCustomized : self.applyDirtyCustomizedInheritance( dirtyCustomized, parent_skope_id );
1529
+ },
1530
+ _getParentSkopeId : function( skope_model, _index ) {
1531
+ var self = this,
1532
+ hierark = ['local', 'group', 'special_group', 'global'],
1533
+ parent_skope_ind = _index || ( _.findIndex( hierark, function( _skp ) { return skope_model.skope == _skp; } ) + 1 ) * 1,
1534
+ parent_skope_skope = hierark[ parent_skope_ind ];
1535
+
1536
+ if ( _.isUndefined( parent_skope_skope ) ) {
1537
+ return _.findWhere( api.czr_currentSkopesCollection(), { skope : 'global' } ).id;
1538
+ }
1539
+ if ( _.isUndefined( _.findWhere( api.czr_currentSkopesCollection(), { skope : parent_skope_skope } ) ) ) {
1540
+ return self._getParentSkopeId( skope_model, parent_skope_ind + 1 );
1541
+ }
1542
+ return _.findWhere( api.czr_currentSkopesCollection(), { skope : parent_skope_skope } ).id;
1543
+ },
1544
+ _getChildSkopeId : function( skope_model, _index ) {
1545
+ var self = this,
1546
+ hierark = ['local', 'group', 'special_group', 'global'],
1547
+ child_skope_ind = _index || ( _.findIndex( hierark, function( _skp ) { return skope_model.skope == _skp; } ) - 1 ) * 1,
1548
+ child_skope_skope = hierark[ child_skope_ind ];
1549
+
1550
+ if ( _.isUndefined( child_skope_skope ) ) {
1551
+ return _.findWhere( api.czr_currentSkopesCollection(), { skope : 'local' } ).id;
1552
+ }
1553
+ if ( _.isUndefined( _.findWhere( api.czr_currentSkopesCollection(), { skope : child_skope_skope } ) ) ) {
1554
+ return self._getParentSkopeId( skope_model, child_skope_ind - 1 );
1555
+ }
1556
+ return _.findWhere( api.czr_currentSkopesCollection(), { skope : child_skope_skope } ).id;
1557
+ }
1558
+
1559
+ });//$.extend
1560
+ })( wp.customize , jQuery, _ );
1561
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1562
+ ( function ( api, $, _ ) {
1563
+ $.extend( CZRSkopeBaseMths, {
1564
+ updateSkopeCollection : function( sent_collection, sent_channel ) {
1565
+ var self = this;
1566
+ _api_ready_collection = [];
1567
+ _.each( sent_collection, function( _skope, _key ) {
1568
+ var skope_candidate = $.extend( true, {}, _skope );//deep clone to avoid any shared references
1569
+ _api_ready_collection.push( self.prepareSkopeForAPI( skope_candidate ) );
1570
+ });
1571
+ if ( self.isGlobalSkopeRegistered() ) {
1572
+ var _updated_api_ready_collection = [],
1573
+ _global_skp_model = $.extend( true, {}, api.czr_skope( self.getGlobalSkopeId() )() );
1574
+
1575
+ _.each( _api_ready_collection, function( _skp, _k ) {
1576
+ if ( 'global' == _skp.skope )
1577
+ _updated_api_ready_collection.push( _global_skp_model );
1578
+ else
1579
+ _updated_api_ready_collection.push( _skp );
1580
+ });
1581
+ _api_ready_collection = _updated_api_ready_collection;
1582
+ }
1583
+ api.czr_currentSkopesCollection( _api_ready_collection );
1584
+ },
1585
+ prepareSkopeForAPI : function( skope_candidate ) {
1586
+ if ( ! _.isObject( skope_candidate ) ) {
1587
+ throw new Error('prepareSkopeForAPI : a skope must be an object to be API ready');
1588
+ }
1589
+ var self = this,
1590
+ api_ready_skope = {};
1591
+
1592
+ _.each( serverControlParams.defaultSkopeModel , function( _value, _key ) {
1593
+ var _candidate_val = skope_candidate[_key];
1594
+ switch( _key ) {
1595
+ case 'title' :
1596
+ if ( ! _.isString( _candidate_val ) ) {
1597
+ throw new Error('prepareSkopeForAPI : a skope title property must a string');
1598
+ }
1599
+ api_ready_skope[_key] = _candidate_val;
1600
+ break;
1601
+ case 'long_title' :
1602
+ if ( ! _.isString( _candidate_val ) ) {
1603
+ throw new Error('prepareSkopeForAPI : a skope title property must a string');
1604
+ }
1605
+ api_ready_skope[_key] = _candidate_val;
1606
+ break;
1607
+ case 'ctx_title' :
1608
+ if ( ! _.isString( _candidate_val ) ) {
1609
+ throw new Error('prepareSkopeForAPI : a skope context title property must a string');
1610
+ }
1611
+ api_ready_skope[_key] = _candidate_val;
1612
+ break;
1613
+ case 'skope' :
1614
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
1615
+ throw new Error('prepareSkopeForAPI : a skope "skope" property must a string not empty');
1616
+ }
1617
+ api_ready_skope[_key] = _candidate_val;
1618
+ break;
1619
+ case 'level' :
1620
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
1621
+ throw new Error('prepareSkopeForAPI : a skope level must a string not empty for skope ' + _candidate_val.skope );
1622
+ }
1623
+ api_ready_skope[_key] = _candidate_val;
1624
+ break;
1625
+ case 'dyn_type' :
1626
+ if ( ! _.isString( _candidate_val ) || ! _.contains( serverControlParams.skopeDynTypes, _candidate_val ) ) {
1627
+ throw new Error('prepareSkopeForAPI : missing or invalid dyn type for skope ' + skope_candidate );
1628
+ }
1629
+ api_ready_skope[_key] = _candidate_val;
1630
+ break;
1631
+ case 'opt_name' :
1632
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
1633
+ throw new Error('prepareSkopeForAPI : invalid "opt_name" property for skope ' + _candidate_val.skope );
1634
+ }
1635
+ api_ready_skope[_key] = _candidate_val;
1636
+ break;
1637
+ case 'obj_id' :
1638
+ if ( ! _.isString( _candidate_val ) ) {
1639
+ throw new Error('prepareSkopeForAPI : invalid "obj_id" for skope ' + _candidate_val.skope );
1640
+ }
1641
+ api_ready_skope[_key] = _candidate_val;
1642
+ break;
1643
+ case 'is_winner' :
1644
+ if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
1645
+ throw new Error('prepareSkopeForAPI : skope property "is_winner" must be a boolean');
1646
+ }
1647
+ api_ready_skope[_key] = _candidate_val;
1648
+ break;
1649
+ case 'is_forced' :
1650
+ if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
1651
+ throw new Error('prepareSkopeForAPI : skope property "is_primary" must be a boolean');
1652
+ }
1653
+ api_ready_skope[_key] = _candidate_val;
1654
+ break;
1655
+ case 'db' :
1656
+ if ( _.isArray( _candidate_val ) || _.isEmpty( _candidate_val ) )
1657
+ _candidate_val = {};
1658
+ if ( _.isUndefined( _candidate_val) || ! _.isObject( _candidate_val ) ) {
1659
+ throw new Error('prepareSkopeForAPI : skope property "db" must be an object');
1660
+ }
1661
+ api_ready_skope[_key] = _candidate_val;
1662
+ break;
1663
+ case 'changeset' :
1664
+ if ( _.isArray( _candidate_val ) || _.isEmpty( _candidate_val ) )
1665
+ _candidate_val = {};
1666
+ if ( _.isUndefined( _candidate_val) || ! _.isObject( _candidate_val ) ) {
1667
+ throw new Error('prepareSkopeForAPI : skope property "changeset" must be an object');
1668
+ }
1669
+ api_ready_skope[_key] = _candidate_val;
1670
+ break;
1671
+ case 'has_db_val' :
1672
+ if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
1673
+ throw new Error('prepareSkopeForAPI : skope property "has_db_val" must be a boolean');
1674
+ }
1675
+ api_ready_skope[_key] = _candidate_val;
1676
+ break;
1677
+ }//switch
1678
+ });
1679
+ api_ready_skope.color = self.skope_colors[ api_ready_skope.skope ] || 'rgb(255, 255, 255)';
1680
+ api_ready_skope.id = api_ready_skope.skope + '_' + api_ready_skope.level;
1681
+ if ( ! _.isString( api_ready_skope.id ) || _.isEmpty( api_ready_skope.id ) ) {
1682
+ throw new Error('prepareSkopeForAPI : a skope id must a string not empty');
1683
+ }
1684
+ if ( ! _.isString( api_ready_skope.title ) || _.isEmpty( api_ready_skope.title ) ) {
1685
+ api_ready_skope.title = id;
1686
+ api_ready_skope.long_title = id;
1687
+ }
1688
+ return api_ready_skope;
1689
+ },
1690
+ currentSkopesCollectionReact : function( to, from ) {
1691
+ var self = this,
1692
+ _new_collection = $.extend( true, [], to ) || [],
1693
+ _old_collection = $.extend( true, [], from ) || [],
1694
+ dfd = $.Deferred();
1695
+ var _to_instantiate = [];
1696
+ _to_remove = [];
1697
+ _to_update = [];
1698
+ _instantiateAndEmbed = function( _candidates_ ) {
1699
+ _.each( _candidates_, function( _skope ) {
1700
+ _skope = $.extend( true, {}, _skope );//use a cloned skop to instantiate : @todo : do we still need that ?
1701
+ api.czr_skope.add( _skope.id , new api.CZR_skope( _skope.id , _skope ) );
1702
+ });
1703
+ _.each( _candidates_, function( _skope ) {
1704
+ if ( ! api.czr_skope.has( _skope.id ) ) {
1705
+ throw new Error( 'Skope id : ' + _skope.id + ' has not been instantiated.');
1706
+ }
1707
+ if ( 'pending' == api.czr_skope( _skope.id ).isReady.state() ) {
1708
+ api.czr_skope( _skope.id ).ready();
1709
+ }
1710
+ });
1711
+ };
1712
+ _.each( _new_collection, function( _sent_skope ) {
1713
+ if ( ! api.czr_skope.has( _sent_skope.id ) )
1714
+ _to_instantiate.push( _sent_skope );
1715
+ });
1716
+ try {
1717
+ _instantiateAndEmbed( _to_instantiate );
1718
+ } catch( er ) {
1719
+ api.errorLog( "currentSkopesCollectionReact : " + er );
1720
+ return dfd.resolve().promise();
1721
+ }
1722
+ var _setActiveAndLayout = function() {
1723
+ var _activeSkopeNum = _.size( _new_collection ),
1724
+ _setLayoutClass = function( _skp_instance ) {
1725
+ var _newClasses = _skp_instance.container.attr('class').split(' ');
1726
+ _.each( _skp_instance.container.attr('class').split(' '), function( _c ) {
1727
+ if ( 'width-' == _c.substring( 0, 6) ) {
1728
+ _newClasses = _.without( _newClasses, _c );
1729
+ }
1730
+ });
1731
+ $.when( _skp_instance.container.attr('class', _newClasses.join(' ') ) )
1732
+ .done( function() {
1733
+ _skp_instance.container.addClass( 'width-' + ( Math.round( 100 / _activeSkopeNum ) ) );
1734
+ });
1735
+ };
1736
+ api.czr_skope.each( function( _skp_instance ) {
1737
+ if ( _.isUndefined( _.findWhere( _new_collection, { id : _skp_instance().id } ) ) ) {
1738
+ _skp_instance.visible( false );
1739
+ _skp_instance.isReady.then( function() {
1740
+ _skp_instance.container.toggleClass( 'active-collection', false );
1741
+ });
1742
+ }
1743
+ else {
1744
+ _skp_instance.visible( true );
1745
+ var _activeSkpDomPostProcess = function() {
1746
+ _setLayoutClass( _skp_instance );
1747
+ _skp_instance.container.toggleClass( 'active-collection', true );
1748
+ };
1749
+ if ( 'pending' == _skp_instance.isReady.state() ) {
1750
+ _skp_instance.isReady.then( function() {
1751
+ _activeSkpDomPostProcess();
1752
+ });
1753
+ } else {
1754
+ _activeSkpDomPostProcess();
1755
+ }
1756
+ }
1757
+ } );
1758
+ };
1759
+ self.skopeWrapperEmbedded.then( function() {
1760
+ _setActiveAndLayout();
1761
+ });
1762
+ if ( _.isEmpty( from ) && ! _.isEmpty( to ) )
1763
+ api.czr_initialSkopeCollectionPopulated.resolve();
1764
+ self.maybeSynchronizeGlobalSkope();
1765
+
1766
+ return dfd.resolve( 'changed' ).promise();
1767
+ },//listenToSkopeCollection()
1768
+ maybeSynchronizeGlobalSkope : function( args ) {
1769
+ args = args || {};
1770
+ if ( ! _.isObject( args ) ) {
1771
+ throw new Error('maybeSynchronizeGlobalSkope : args must be an object');
1772
+ }
1773
+ var self = this,
1774
+ dfd = $.Deferred(),
1775
+ defaults = _.extend({
1776
+ isGlobalReset : false,
1777
+ isSetting : false,
1778
+ settingIdToReset : '',
1779
+ isSkope : false,
1780
+ skopeIdToReset : ''
1781
+ },
1782
+ args
1783
+ ),
1784
+ _setIdToReset,
1785
+ shortSetId,
1786
+ defaultVal;
1787
+
1788
+ if ( self.isGlobalSkopeRegistered() ) {
1789
+ var _global_skp_db_values = api.czr_skope( self.getGlobalSkopeId() ).dbValues();
1790
+ _.each( _global_skp_db_values, function( _val, setId ){
1791
+ if ( api.has( setId ) && ! _.isEqual( api.settings.settings[setId].value, _val ) ) {
1792
+ api.settings.settings[setId].value = _val;
1793
+ }
1794
+ });
1795
+ if ( args.isGlobalReset && args.isSetting ) {
1796
+ _setIdToReset = args.settingIdToReset;
1797
+ shortSetId = api.CZR_Helpers.getOptionName( _setIdToReset );
1798
+ defaultVal = serverControlParams.defaultOptionsValues[ shortSetId ];
1799
+
1800
+ if ( _.isUndefined( api.settings.settings[ _setIdToReset ] ) || _.isUndefined( defaultVal ) )
1801
+ return;
1802
+ if ( defaultVal != api.settings.settings[ _setIdToReset ].value ) {
1803
+ api.settings.settings[ _setIdToReset ].value = defaultVal;
1804
+ }
1805
+ }
1806
+ if ( args.isGlobalReset && args.isSkope ) {
1807
+ _.each( api.settings.settings, function( _params, _setId ) {
1808
+ if ( ! self.isThemeSetting( _setId ) )
1809
+ return;
1810
+
1811
+ shortSetId = api.CZR_Helpers.getOptionName( _setId );
1812
+ if ( ! _.has( serverControlParams.defaultOptionsValues, shortSetId ) )
1813
+ return;
1814
+ api.settings.settings[_setId].value = serverControlParams.defaultOptionsValues[ shortSetId ];
1815
+ });
1816
+ }
1817
+ }
1818
+ return dfd.resolve().promise();
1819
+ }
1820
+ });//$.extend
1821
+ })( wp.customize , jQuery, _ );
1822
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1823
+ ( function ( api, $, _ ) {
1824
+ $.extend( CZRSkopeBaseMths, {
1825
+ activeSkopeReact : function( to, from ) {
1826
+ var self = this, dfd = $.Deferred();
1827
+ if ( ! _.isUndefined(from) && api.czr_skope.has(from) )
1828
+ api.czr_skope(from).active(false);
1829
+ else if ( ! _.isUndefined(from) )
1830
+ throw new Error('listenToActiveSkope : previous scope does not exist in the collection', from );
1831
+
1832
+ if ( ! _.isUndefined(to) && api.czr_skope.has(to) )
1833
+ api.czr_skope(to).active(true);
1834
+ else
1835
+ throw new Error('listenToActiveSkope : requested scope ' + to + ' does not exist in the collection');
1836
+ var _switchBack = function( _title ) {
1837
+ api.czr_activeSkopeId( self.getGlobalSkopeId() );
1838
+ api.czr_serverNotification({
1839
+ status:'success',
1840
+ message : [ _title , 'can only be customized sitewide.' ].join(' ')
1841
+ });
1842
+ return dfd.resolve().promise();
1843
+ };
1844
+ if ( self.isExcludedSidebarsWidgets() && 'widgets' == api.czr_activePanelId() && to != self.getGlobalSkopeId() ) {
1845
+ api.czr_serverNotification({
1846
+ status:'success',
1847
+ message : [
1848
+ serverControlParams.i18n.skope['Widgets are created sitewide.']
1849
+ ].join(' ')
1850
+ });
1851
+ }
1852
+ if ( self.isExcludedWPCustomCss() && 'custom_css' == api.czr_activeSectionId() && to != self.getGlobalSkopeId() ) {
1853
+ return _switchBack( api.section( api.czr_activeSectionId() ).params.title );
1854
+ }
1855
+ if ( 'admin_sec' == api.czr_activeSectionId() && to != self.getGlobalSkopeId() ) {
1856
+ return _switchBack( api.section( api.czr_activeSectionId() ).params.title );
1857
+ }
1858
+ if ( ( 'nav_menu' == api.czr_activeSectionId().substring( 0, 'nav_menu'.length ) || 'add_menu' == api.czr_activeSectionId() ) && to != self.getGlobalSkopeId() ) {
1859
+ api.czr_serverNotification({
1860
+ status:'success',
1861
+ message : [
1862
+ serverControlParams.i18n.skope['Menus are created sitewide.']
1863
+ ].join(' ')
1864
+ });
1865
+ }
1866
+ if ( 'nav_menus' == api.czr_activePanelId() ) {
1867
+ _.each( api.panel( api.czr_activePanelId() ).sections(), function( _sec ) {
1868
+ self.processSilentUpdates( { section_id : _sec.id, awake_if_not_active : true } );
1869
+ });
1870
+ }
1871
+ api.state('switching-skope')( true );
1872
+ self._writeCurrentSkopeTitle( to );
1873
+ api.trigger( 'czr-paint', { is_skope_switch : true } );
1874
+ if ( _.isUndefined( api.czr_activeSectionId() ) ) {
1875
+ api.state('switching-skope')( false );
1876
+ api.previewer.refresh();
1877
+ return dfd.resolve().promise();
1878
+ }
1879
+ if ( _.has( api, 'czrModulePanelState') )
1880
+ api.czrModulePanelState(false);
1881
+ var _silentUpdateCands = self._getSilentUpdateCandidates();
1882
+ if ( ! _.isUndefined( from ) ) {
1883
+ _.each( api.czr_skope( from ).dirtyValues(), function( val, _setId ) {
1884
+ if ( ! _.contains( _silentUpdateCands, _setId ) )
1885
+ _silentUpdateCands.push( _setId );
1886
+ } );
1887
+ }
1888
+ if ( ! _.isUndefined( to ) ) {
1889
+ _.each( api.czr_skope( to ).dirtyValues(), function( val, _setId ) {
1890
+ if ( ! _.contains( _silentUpdateCands, _setId ) )
1891
+ _silentUpdateCands.push( _setId );
1892
+ } );
1893
+ }
1894
+ var _debouncedProcessSilentUpdates = function() {
1895
+ self.processSilentUpdates( {
1896
+ candidates : _silentUpdateCands,
1897
+ section_id : null,
1898
+ refresh : false//will be done on done()
1899
+ })
1900
+ .fail( function() {
1901
+ dfd.reject();
1902
+ api.state('switching-skope')( false );
1903
+ throw new Error( 'Fail to process silent updates in _debouncedProcessSilentUpdates');
1904
+ })
1905
+ .done( function( _updatedSetIds ) {
1906
+ api.previewer.refresh()
1907
+ .always( function() {
1908
+ dfd.resolve( _updatedSetIds );
1909
+ api.state( 'switching-skope' )( false );
1910
+ });
1911
+ });
1912
+ };
1913
+ if ( _.has(api, 'czr_isModuleExpanded') && false !== api.czr_isModuleExpanded() ) {
1914
+ api.czr_isModuleExpanded().setupModuleViewStateListeners(false);
1915
+ _debouncedProcessSilentUpdates = _.debounce( _debouncedProcessSilentUpdates, 400 );
1916
+ _debouncedProcessSilentUpdates();
1917
+ } else {
1918
+ _debouncedProcessSilentUpdates();
1919
+ }
1920
+ return dfd.promise();
1921
+ },//activeSkopeReact
1922
+ _writeCurrentSkopeTitle : function( skope_id ) {
1923
+ var self = this,
1924
+ current_title = api.czr_skope( skope_id || api.czr_activeSkopeId() )().long_title,
1925
+ _buildTitleHtml = function() {
1926
+ var _inheritedFrom = self.getInheritedSkopeTitles(),
1927
+ _overrides = self.getOverridenSkopeTitles();
1928
+
1929
+ return $.trim( [
1930
+ '<span class="czr-main-title"><span class="czr-toggle-title-notice fa fa-info-circle"></span>',
1931
+ 'global' == api.czr_skope( skope_id || api.czr_activeSkopeId() )().skope ? current_title : ['Customizing', current_title ].join(' '),
1932
+ '</span>',
1933
+ '<span class="czr-skope-inherits-from">',
1934
+ serverControlParams.i18n.skope['In this context :'],
1935
+ _.isEmpty( _inheritedFrom ) ? ' ' : serverControlParams.i18n.skope['inherits from'],
1936
+ _inheritedFrom,
1937
+ _.isEmpty( _inheritedFrom ) ? '' : _.isEmpty( _overrides ) ? '.' : [',' , serverControlParams.i18n.skope['and'] ].join(' '),
1938
+ _.isEmpty( _overrides ) ? ' ' : serverControlParams.i18n.skope['overridden by'],
1939
+ _overrides,
1940
+ _.isEmpty( _overrides ) ? '' : '.',
1941
+ '</span>'
1942
+ ].join(' ') );
1943
+ },
1944
+ _toggle_spinner = function( visible ) {
1945
+ if ( visible ) {
1946
+ $('.czr-scope-switcher').find('.spinner').fadeIn();
1947
+ } else {
1948
+ $('.czr-scope-switcher').find('.spinner').fadeOut();
1949
+ }
1950
+ };
1951
+ self.skopeWrapperEmbedded
1952
+ .then( function() {
1953
+ if ( ! $('.czr-scope-switcher').find('.czr-current-skope-title').length ) {
1954
+ $('.czr-scope-switcher').prepend(
1955
+ $( '<h2/>', {
1956
+ class : 'czr-current-skope-title',
1957
+ html : [
1958
+ '<span class="czr-skope-title">',
1959
+ '<span class="spinner">',
1960
+ _buildTitleHtml(),
1961
+ '</span>',
1962
+ '</span>'
1963
+ ].join('')
1964
+ })
1965
+ );
1966
+ } else {
1967
+ $.when( $('.czr-scope-switcher').find('.czr-skope-title').fadeOut(200) ).done( function() {
1968
+ $(this)
1969
+ .html( _buildTitleHtml() )
1970
+ .fadeIn(200);
1971
+ });
1972
+ }
1973
+
1974
+ if ( _.isUndefined( api.state( 'switching-skope' ).isBound ) ) {
1975
+ api.state('switching-skope').bind( _toggle_spinner );
1976
+ api.state( 'switching-skope' ).isBound = true;
1977
+ }
1978
+ });
1979
+ }
1980
+ });//$.extend
1981
+ })( wp.customize , jQuery, _ );
1982
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
1983
+ ( function ( api, $, _ ) {
1984
+ $.extend( CZRSkopeBaseMths, {
1985
+ processSilentUpdates : function( params ) {
1986
+ if ( _.isString( params ) )
1987
+ params = { candidates : [ params ] };
1988
+ else
1989
+ params = params || {};
1990
+
1991
+ var self = this,
1992
+ defaultParams = {
1993
+ candidates : [],
1994
+ section_id : api.czr_activeSectionId(),
1995
+ refresh : true,
1996
+ awake_if_not_active : false
1997
+ },
1998
+ dfd = $.Deferred();
1999
+
2000
+ params = $.extend( defaultParams, params );
2001
+ if ( _.isString( params.candidates ) ) {
2002
+ params.candidates = [ params.candidates ];
2003
+ }
2004
+ if ( _.isEmpty( params.candidates ) )
2005
+ params.candidates = self._getSilentUpdateCandidates( params.section_id, params.awake_if_not_active );
2006
+ if ( ! _.isArray( params.candidates ) ) {
2007
+ throw new Error('processSilentUpdates : the update candidates must be an array.');
2008
+ }
2009
+ if ( _.isEmpty( params.candidates ) )
2010
+ return dfd.resolve( [] ).promise();
2011
+
2012
+
2013
+ var _enjoyTheSilence = function() {
2014
+ self.silentlyUpdateSettings( params.candidates, params.refresh )
2015
+ .fail( function() {
2016
+ dfd.reject();
2017
+ })
2018
+ .done( function( updated_settings ) {
2019
+ _.delay( function() {
2020
+ self.setupActiveSkopedControls( {
2021
+ section_id : params.section_id
2022
+ });
2023
+ }, 1000 );
2024
+ dfd.resolve( updated_settings );
2025
+ });
2026
+ };
2027
+ if ( 'resolved' != api.czr_skopeReady.state() ) {
2028
+ dfd.resolve( [] );
2029
+ api.czr_skopeReady.done( function() {
2030
+ _enjoyTheSilence();
2031
+ });
2032
+ } else {
2033
+ _enjoyTheSilence();
2034
+ }
2035
+
2036
+ return dfd.promise();
2037
+ },
2038
+ silentlyUpdateSettings : function( _silentUpdateCands, refresh ) {
2039
+ if ( ! api.state.has( 'silent-update-processing') )
2040
+ api.state.create( 'silent-update-processing' )( false );
2041
+
2042
+ api.state( 'silent-update-processing' )(true);
2043
+ var self = this,
2044
+ _silentUpdatePromises = {},
2045
+ dfd = $.Deferred();
2046
+
2047
+ refresh = _.isUndefined( refresh ) ? true : refresh;
2048
+
2049
+ if ( _.isUndefined( _silentUpdateCands ) || _.isEmpty( _silentUpdateCands ) ) {
2050
+ _silentUpdateCands = self._getSilentUpdateCandidates();
2051
+ }
2052
+
2053
+ if ( _.isString( _silentUpdateCands ) ) {
2054
+ _silentUpdateCands = [ _silentUpdateCands ];
2055
+ }
2056
+ _.each( _silentUpdateCands, function( setId ) {
2057
+ if ( api.control.has( setId ) && 'czr_multi_module' == api.control(setId).params.type )
2058
+ return;
2059
+ _silentUpdatePromises[setId] = self.getSettingUpdatePromise( setId );
2060
+ });
2061
+
2062
+
2063
+ var _deferred = [],
2064
+ _updatedSetIds = [];
2065
+ _.each( _silentUpdatePromises, function( _promise_ , setId ) {
2066
+ _promise_.done( function( _new_setting_val_ ) {
2067
+ var wpSetId = api.CZR_Helpers.build_setId( setId ),
2068
+ _skopeDirtyness = api.czr_skope( api.czr_activeSkopeId() ).getSkopeSettingDirtyness( setId );
2069
+ if ( ! _.isEqual( api( wpSetId )(), _new_setting_val_ ) ) {
2070
+ _updatedSetIds.push( setId );
2071
+ }
2072
+ api( wpSetId ).silent_set( _new_setting_val_ , _skopeDirtyness );
2073
+ });
2074
+
2075
+ _deferred.push( _promise_ );
2076
+ });
2077
+ $.when.apply( null, _deferred )
2078
+ .fail( function() {
2079
+ dfd.reject();
2080
+ throw new Error( 'silentlyUpdateSettings FAILED. Candidates : ' + _silentUpdateCands );
2081
+ })
2082
+ .always( function() {
2083
+ api.state( 'silent-update-processing' )( false );
2084
+ })
2085
+ .then( function() {
2086
+ _.each( _deferred, function( prom ){
2087
+ if ( _.isObject( prom ) && 'resolved' !== prom.state() ) {
2088
+ throw new Error( 'a silent update promise is unresolved : ' + _silentUpdateCands );
2089
+ }
2090
+ });
2091
+ if ( refresh && ! _.isEmpty( _updatedSetIds ) ) {
2092
+ api.previewer.refresh()
2093
+ .always( function() {
2094
+ dfd.resolve( _updatedSetIds );
2095
+ });
2096
+ } else {
2097
+ dfd.resolve( _updatedSetIds );
2098
+ }
2099
+ });
2100
+ return dfd.promise();
2101
+ },
2102
+ getSettingUpdatePromise : function( setId ) {
2103
+ if ( _.isUndefined( setId ) ) {
2104
+ throw new Error('getSettingUpdatePromise : the provided setId is not defined');
2105
+ }
2106
+ if ( ! api.has( api.CZR_Helpers.build_setId( setId ) ) ) {
2107
+ throw new Error('getSettingUpdatePromise : the provided wpSetId is not registered : ' + api.CZR_Helpers.build_setId( setId ) );
2108
+ }
2109
+
2110
+ var self = this,
2111
+ wpSetId = api.CZR_Helpers.build_setId( setId ),
2112
+ current_setting_val = api( wpSetId )(),//typically the previous skope val
2113
+ dfd = $.Deferred(),
2114
+ _promise = false,
2115
+ skope_id = api.czr_activeSkopeId(),
2116
+ val = api.czr_skopeBase.getSkopeSettingVal( setId, skope_id );
2117
+ if ( _.isEqual( current_setting_val, val ) ) {
2118
+ return dfd.resolve( val ).promise();
2119
+ }
2120
+ if ( api.control.has( wpSetId ) ) {
2121
+ var control_type = api.control( wpSetId ).params.type,
2122
+ _control_data = api.settings.controls[wpSetId],
2123
+ _constructor;
2124
+
2125
+ switch ( control_type ) {
2126
+ case 'czr_cropped_image' :
2127
+ _promise = self._getCzrCroppedImagePromise( wpSetId, _control_data );
2128
+ break;
2129
+
2130
+ case 'czr_module' :
2131
+ self._processCzrModuleSilentActions( wpSetId, control_type, skope_id , _control_data);
2132
+ break;
2133
+ }//switch
2134
+ }//end if api.control.has( wpSetId )
2135
+ if ( _.has(api.settings.controls, 'header_image') && 'header_image' == wpSetId ) {
2136
+ _promise = self._getHeaderImagePromise( wpSetId, skope_id );
2137
+ }
2138
+ if ( ! _promise || ! _.isObject( _promise ) ) {
2139
+ dfd.resolve( val );
2140
+ } else {
2141
+ _promise.always( function() {
2142
+ dfd.resolve( val );
2143
+ });
2144
+ }
2145
+
2146
+ return dfd.promise();
2147
+ },//getSettingUpdatePromise()
2148
+ _getSilentUpdateCandidates : function( section_id, awake_if_not_active ) {
2149
+ var self = this,
2150
+ SilentUpdateCands = [];
2151
+ section_id = ( _.isUndefined( section_id ) || _.isNull( section_id ) ) ? api.czr_activeSectionId() : section_id;
2152
+ if ( _.isEmpty( api.czr_activeSectionId() ) && ! awake_if_not_active ) {
2153
+ return [];
2154
+ }
2155
+ if ( _.isUndefined( section_id ) ) {
2156
+ api.consoleLog( '_getSilentUpdateCandidates : No active section provided');
2157
+ return [];
2158
+ }
2159
+ if ( ! api.section.has( section_id ) ) {
2160
+ throw new Error( '_getSilentUpdateCandidates : The section ' + section_id + ' is not registered in the API.');
2161
+ }
2162
+ var section_settings = api.CZR_Helpers.getSectionSettingIds( section_id );
2163
+ section_settings = _.filter( section_settings, function( setId ) {
2164
+ return self.isSettingSkopeEligible( setId );
2165
+ });
2166
+ _.each( section_settings, function( setId ) {
2167
+ SilentUpdateCands.push( setId );
2168
+ });
2169
+
2170
+ return SilentUpdateCands;
2171
+ }
2172
+
2173
+ });//$.extend
2174
+ })( wp.customize , jQuery, _ );
2175
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2176
+ ( function ( api, $, _ ) {
2177
+ $.extend( CZRSkopeBaseMths, {
2178
+ _processCzrModuleSilentActions : function( wpSetId, control_type, skope_id, _control_data) {
2179
+ var _synced_control_id, _synced_control_val, _synced_control_data, _synced_control_constructor, _syncSektionModuleId,
2180
+ _synced_short_id = _.has( api.control( wpSetId ).params, 'syncCollection' ) ? api.control( wpSetId ).params.syncCollection : '',
2181
+ _shortSetId = api.CZR_Helpers.build_setId(wpSetId),
2182
+ _val = api.czr_skopeBase.getSkopeSettingVal( _shortSetId, skope_id ),
2183
+ current_skope_instance = api.czr_skope( api.czr_activeSkopeId() );
2184
+ if ( ! _.isEmpty( _synced_short_id ) && ! _.isUndefined( _synced_short_id ) ) {
2185
+ _synced_control_id = api.CZR_Helpers.build_setId( _synced_short_id );
2186
+ _synced_control_val = api.czr_skopeBase.getSkopeSettingVal( _synced_control_id, skope_id );
2187
+ _synced_control_data = api.settings.controls[_synced_control_id];
2188
+ _synced_control_constructor = api.controlConstructor.czr_multi_module;
2189
+ _syncSektionModuleId = api.control( _synced_control_id ).syncSektionModule()().id;
2190
+ api.control( _synced_control_id ).container.remove();
2191
+ api.control.remove(_synced_control_id );
2192
+ api( _synced_control_id ).silent_set( _synced_control_val, current_skope_instance.getSkopeSettingDirtyness( _synced_control_id ) );
2193
+ $.extend( _synced_control_data, { czr_skope : skope_id });
2194
+ api.control.add( _synced_control_id, new _synced_control_constructor( _synced_control_id, { params : _synced_control_data, previewer : api.previewer }) );
2195
+ }
2196
+
2197
+ _constructor = api.controlConstructor[control_type];
2198
+ api.control( wpSetId ).container.remove();
2199
+ api.control.remove( wpSetId );
2200
+ api( wpSetId ).silent_set( _val, current_skope_instance.getSkopeSettingDirtyness( _shortSetId ) );
2201
+ $.extend( _control_data, { czr_skope : skope_id });
2202
+ api.control.add( wpSetId, new _constructor( wpSetId, { params : _control_data, previewer : api.previewer }) );
2203
+ if ( ! _.isEmpty( _synced_short_id ) && ! _.isUndefined( _synced_short_id ) ) {
2204
+ api.consoleLog('FIRE SEKTION MODULE?', _syncSektionModuleId, api.control( wpSetId ).czr_Module( _syncSektionModuleId ).isReady.state() );
2205
+ api.control( wpSetId ).czr_Module( _syncSektionModuleId ).fireSektionModule();
2206
+ }
2207
+ },
2208
+ _getCzrCroppedImagePromise : function( wpSetId, _control_data ) {
2209
+ var _constructor = api.controlConstructor.czr_cropped_image, dfd = $.Deferred(),
2210
+ val = api.has(wpSetId) ? api(wpSetId)() : null;
2211
+ val = null === val ? "" : val;
2212
+ wp.media.attachment( val ).fetch().done( function() {
2213
+ api.control( wpSetId ).container.remove();
2214
+ api.control.remove( wpSetId );
2215
+ _control_data.attachment = this.attributes;
2216
+ api.control.add( wpSetId, new _constructor( wpSetId, { params : _control_data, previewer : api.previewer }) );
2217
+ dfd.resolve();
2218
+ } ).fail( function() {
2219
+ api.control( wpSetId ).container.remove();
2220
+ api.control.remove( wpSetId );
2221
+ _control_data = _.omit( _control_data, 'attachment' );
2222
+ api.control.add( wpSetId, new _constructor( wpSetId, { params : _control_data, previewer : api.previewer }) );
2223
+ dfd.reject();
2224
+ });
2225
+ return dfd.promise();
2226
+ },
2227
+ _getHeaderImagePromise : function( wpSetId, skope_id ) {
2228
+ var dfd = $.Deferred();
2229
+ if ( ! _.has(api.settings.controls, 'header_image') || 'header_image' != wpSetId ) {
2230
+ return dfd.resolve().promise();
2231
+ }
2232
+
2233
+ var _header_constructor = api.controlConstructor.header,
2234
+ _header_control_data = $.extend( true, {}, api.settings.controls.header_image );
2235
+ header_image_data = null === api.czr_skopeBase.getSkopeSettingVal( 'header_image_data', skope_id ) ? "" : api.czr_skopeBase.getSkopeSettingVal( 'header_image_data', skope_id );
2236
+
2237
+ var attachment_id;
2238
+ var _reset_header_image_crtl = function( _updated_header_control_data ) {
2239
+ _updated_header_control_data = _updated_header_control_data || _header_control_data;
2240
+ api.control( 'header_image' ).container.remove();
2241
+ api.control.remove( 'header_image' );
2242
+ api.HeaderTool.UploadsList = api.czr_HeaderTool.UploadsList;
2243
+ api.HeaderTool.DefaultsList = api.czr_HeaderTool.DefaultsList;
2244
+ api.HeaderTool.CombinedList = api.czr_HeaderTool.CombinedList;
2245
+ var _render_control = function() {
2246
+ api.control.add( 'header_image', new _header_constructor( 'header_image', { params : _updated_header_control_data, previewer : api.previewer }) );
2247
+ };
2248
+ _render_control = _.debounce( _render_control, 800 );
2249
+ _render_control();
2250
+ };
2251
+
2252
+
2253
+ if ( ! _.has( header_image_data, 'attachment_id' ) ) {
2254
+ _reset_header_image_crtl();
2255
+ dfd.resolve();
2256
+ } else {
2257
+ attachment_id = header_image_data.attachment_id;
2258
+ wp.media.attachment( attachment_id ).fetch().done( function() {
2259
+ _header_control_data.attachment = this.attributes;
2260
+ _reset_header_image_crtl( _header_control_data );
2261
+ dfd.resolve();
2262
+ } ).fail( function() {
2263
+ _header_control_data = _.omit( _header_control_data, 'attachment' );
2264
+ api.control( 'header_image' ).container.remove();
2265
+ api.control.remove( 'header_image' );
2266
+ api.HeaderTool.UploadsList = api.czr_HeaderTool.UploadsList;
2267
+ api.HeaderTool.DefaultsList = api.czr_HeaderTool.DefaultsList;
2268
+ api.HeaderTool.CombinedList = api.czr_HeaderTool.CombinedList;
2269
+ api.control.add( 'header_image', new _header_constructor( 'header_image', { params : _header_control_data, previewer : api.previewer }) );
2270
+ dfd.reject();
2271
+ });
2272
+ }//else
2273
+ return dfd.promise();
2274
+ }
2275
+ });//$.extend
2276
+ })( wp.customize , jQuery, _ );
2277
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2278
+ ( function ( api, $, _ ) {
2279
+ $.extend( CZRSkopeBaseMths, {
2280
+ setupActiveSkopedControls : function( obj ) {
2281
+ var self = this, section_id, controls, setupParams, eligibleCtrls, dfd = $.Deferred();
2282
+ defaultSetupParams = {
2283
+ controls : [],
2284
+ section_id : api.czr_activeSectionId()
2285
+ };
2286
+ setupParams = $.extend( defaultSetupParams, obj );
2287
+
2288
+ if ( ! _.isObject( setupParams ) || ! _.has( setupParams, 'controls' ) || ! _.has( setupParams, 'section_id' ) ) {
2289
+ throw new Error( 'setupActiveSkopedControls : the setupParams param must be an object with properties controls and section_id.');
2290
+ }
2291
+
2292
+ section_id = setupParams.section_id;
2293
+ controls = setupParams.controls;
2294
+ eligibleCtrls = [];
2295
+
2296
+ if ( _.isEmpty( section_id ) || ! _.isString( section_id ) ) {
2297
+ section_id = api.czr_activeSectionId();
2298
+ }
2299
+ if ( _.isEmpty( controls ) ) {
2300
+ controls = api.CZR_Helpers.getSectionControlIds( section_id );
2301
+ }
2302
+
2303
+ controls = _.isString( controls ) ? [controls] : controls;
2304
+ eligibleCtrls = _.filter( controls, function( ctrlId ) {
2305
+ var setId = api.CZR_Helpers.getControlSettingId( ctrlId );
2306
+ if ( setId && ! self.isSettingSkopeEligible( setId ) ) {
2307
+ api.control( ctrlId ).container.addClass('czr-not-skoped');
2308
+ }
2309
+ if ( setId && self.isWPAuthorizedSetting( setId ) ) {
2310
+ api.control( ctrlId ).container.addClass('is-wp-authorized-setting');
2311
+ }
2312
+ return setId && self.isSettingSkopeEligible( setId );
2313
+ });
2314
+ if ( 'nav_menu[' == section_id.substring( 0, 'nav_menu['.length ) )
2315
+ return dfd.resolve().promise();
2316
+ if ( ! _.isEmpty( controls ) ) {
2317
+ api.czr_skopeReady.then( function() {
2318
+ $.when( self.renderControlsSingleReset( eligibleCtrls ) ).done( function() {
2319
+ _.each( controls, function( ctrlId ) {
2320
+ self.listenSkopedControl( ctrlId );
2321
+ } );
2322
+ dfd.resolve();
2323
+ });
2324
+ });
2325
+ if ( 'rejected' == api.czr_skopeReady.state() )
2326
+ dfd.resolve();
2327
+ }
2328
+ self.renderCtrlSkpNotIcon( controls );
2329
+ return dfd.promise();
2330
+ },//setupActiveSkopedControls
2331
+ listenSkopedControl : function( ctrlId ) {
2332
+ var self = this;
2333
+
2334
+ if ( ! api.has( ctrlId ) || _.isUndefined( api.control( ctrlId ) ) )
2335
+ return;
2336
+
2337
+ var ctrl = api.control( ctrlId ),
2338
+ setId = api.CZR_Helpers.getControlSettingId( ctrlId ),
2339
+ shortSetId = api.CZR_Helpers.getOptionName( setId ),
2340
+ defaults = {
2341
+ hasDBVal : false,
2342
+ isDirty : false,
2343
+ noticeVisible : false,
2344
+ resetVisible : false,
2345
+ isResetting : false
2346
+ },
2347
+ initial_states = {};
2348
+ if ( ! _.has( ctrl, 'czr_states' ) ) {
2349
+ ctrl.czr_states = new api.Values();
2350
+ _.each( defaults, function( _state_val, _state_name ) {
2351
+ ctrl.czr_states.create( _state_name );
2352
+ ctrl.czr_states( _state_name )( _state_val );
2353
+ });
2354
+ try { self.bindControlStates( ctrl ); } catch( er ) {
2355
+ api.errorLog( 'bindControlStates : ' + er );
2356
+ }
2357
+ }
2358
+ ctrl.czr_states( 'hasDBVal' )( api.czr_skope( api.czr_activeSkopeId() ).hasSkopeSettingDBValues( setId ) );
2359
+ ctrl.czr_states( 'isDirty' )( api.czr_skope( api.czr_activeSkopeId() ).getSkopeSettingDirtyness( setId ) );
2360
+
2361
+
2362
+ if ( ! _.has( ctrl, 'userEventMap' ) ) {
2363
+ ctrl.userEventMap = [
2364
+ {
2365
+ trigger : 'click keydown',
2366
+ selector : '.czr-setting-reset, .czr-cancel-button',
2367
+ name : 'control_reset_warning',
2368
+ actions : function() {
2369
+ if ( ! ctrl.czr_states('isDirty')() && ! ctrl.czr_states( 'hasDBVal' )() )
2370
+ return;
2371
+ _.each( _.without( api.CZR_Helpers.getSectionControlIds( ctrl.section() ), ctrlId ) , function( _id ) {
2372
+ if ( _.has( api.control(_id), 'czr_states') ) {
2373
+ api.control(_id).czr_states( 'resetVisible' )( false );
2374
+ }
2375
+ });
2376
+ ctrl.czr_states( 'resetVisible' )( ! ctrl.czr_states( 'resetVisible' )() );
2377
+ ctrl.czr_states( 'noticeVisible' )( ! ctrl.czr_states( 'resetVisible' )() );
2378
+ }
2379
+ },
2380
+ {
2381
+ trigger : 'click keydown',
2382
+ selector : '.czr-control-do-reset',
2383
+ name : 'control_do_reset',
2384
+ actions : function() {
2385
+ self.doResetSetting( ctrlId );
2386
+ }
2387
+ },
2388
+ {
2389
+ trigger : 'click keydown',
2390
+ selector : '.czr-skope-switch',
2391
+ name : 'control_skope_switch',
2392
+ actions : function( params ) {
2393
+ var _skopeIdToSwithTo = $( params.dom_event.currentTarget, params.dom_el ).attr('data-skope-id');
2394
+ if ( ! _.isEmpty( _skopeIdToSwithTo ) && api.czr_skope.has( _skopeIdToSwithTo ) )
2395
+ api.czr_activeSkopeId( _skopeIdToSwithTo );
2396
+ }
2397
+ },
2398
+ {
2399
+ trigger : 'click keydown',
2400
+ selector : '.czr-toggle-notice',
2401
+ name : 'control_toggle_notice',
2402
+ actions : function( params ) {
2403
+ ctrl.czr_states( 'noticeVisible' )( ! ctrl.czr_states( 'noticeVisible' )() );
2404
+ if ( ctrl.czr_states( 'noticeVisible' )() ) {
2405
+ ctrl.czr_states( 'resetVisible' )( false );
2406
+ }
2407
+ }
2408
+ }
2409
+ ];
2410
+ api.CZR_Helpers.setupDOMListeners( ctrl.userEventMap , { dom_el : ctrl.container }, self );
2411
+ }
2412
+ },
2413
+ bindControlStates : function( ctrl ) {
2414
+ if ( ! api.control.has( ctrl.id ) ) {
2415
+ throw new Error( 'in bindControlStates, the provided ctrl id is not registered in the api : ' + ctrl.id );
2416
+ }
2417
+ var self = this,
2418
+ setId = api.CZR_Helpers.getControlSettingId( ctrl.id );
2419
+ ctrl.czr_states( 'hasDBVal' ).bind( function( bool ) {
2420
+ ctrl.container.toggleClass( 'has-db-val', bool );
2421
+ if ( bool ) {
2422
+ _title = serverControlParams.i18n.skope['Reset your customized ( and published ) value'];
2423
+ } else if ( ctrl.czr_states('isDirty')() ) {
2424
+ _title = serverControlParams.i18n.skope['Reset your customized ( but not yet published ) value'];
2425
+ } else {
2426
+ _title = serverControlParams.i18n.skope['Not customized yet, nothing to reset'];
2427
+ }
2428
+ ctrl.container.find('.czr-setting-reset').attr( 'title', _title );
2429
+ });
2430
+ ctrl.czr_states( 'isDirty' ).bind( function( bool ) {
2431
+ ctrl.container.toggleClass( 'is-dirty', bool );
2432
+ var _title;
2433
+ if ( bool ) {
2434
+ _title = serverControlParams.i18n.skope['Reset your customized ( but not yet published ) value'];
2435
+ } else if ( ctrl.czr_states('hasDBVal')() ) {
2436
+ _title = serverControlParams.i18n.skope['Reset your customized ( and published ) value'];
2437
+ } else {
2438
+ _title = serverControlParams.i18n.skope['Not customized yet, nothing to reset'];
2439
+ }
2440
+ ctrl.container.find('.czr-setting-reset').attr( 'title', _title );
2441
+ });
2442
+ ctrl.czr_states( 'noticeVisible' ).bind( function( visible ) {
2443
+ ctrl.container.toggleClass( 'czr-notice-visible', visible );
2444
+ var $noticeContainer = ctrl.getNotificationsContainerElement();
2445
+ if ( false !== $noticeContainer && false !== $noticeContainer.length ) {
2446
+ if ( ! visible ) {
2447
+ $.when( $noticeContainer
2448
+ .stop()
2449
+ .slideUp( 'fast', null, function() {
2450
+ $( this ).css( 'height', 'auto' );
2451
+ } ) ).done( function() {
2452
+ self.removeCtrlSkpNot( ctrl.id );
2453
+ });
2454
+ } else {
2455
+ self.updateCtrlSkpNot( ctrl.id, true );//<= True for visible
2456
+ $noticeContainer
2457
+ .stop()
2458
+ .slideDown( 'fast', null, function() {
2459
+ $( this ).css( 'height', 'auto' );
2460
+ } );
2461
+ }
2462
+ }
2463
+ });
2464
+ ctrl.czr_states( 'resetVisible' ).bind( function( visible ) {
2465
+ var section_id = ctrl.section() || api.czr_activeSectionId();
2466
+ if ( visible ) {
2467
+ $.when( self.renderControlResetWarningTmpl( ctrl.id ) ).done( function( _params ) {
2468
+ if ( _.isEmpty( _params ) )
2469
+ return;
2470
+ ctrl.czr_resetDialogContainer = _params.container;
2471
+ _params.container.slideToggle('fast');
2472
+ if ( ! _params.is_authorized ) {
2473
+ _.delay( function() {
2474
+ $.when( ctrl.czr_resetDialogContainer.slideToggle('fast') ).done( function() {
2475
+ ctrl.czr_resetDialogContainer.remove();
2476
+ });
2477
+ }, 3000 );
2478
+ }
2479
+ });
2480
+ } else {
2481
+ if ( _.has( ctrl, 'czr_resetDialogContainer' ) && ctrl.czr_resetDialogContainer.length )
2482
+ $.when( ctrl.czr_resetDialogContainer.slideToggle('fast') ).done( function() {
2483
+ ctrl.czr_resetDialogContainer.remove();
2484
+ });
2485
+ }
2486
+ });
2487
+ }
2488
+ });//$.extend()
2489
+ })( wp.customize , jQuery, _ );
2490
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2491
+ ( function ( api, $, _ ) {
2492
+ $.extend( CZRSkopeBaseMths, {
2493
+ renderControlsSingleReset : function( controls ) {
2494
+ var self = this, dfd = $.Deferred();
2495
+ if ( _.isUndefined( controls ) || _.isEmpty( controls ) ) {
2496
+ controls = api.CZR_Helpers.getSectionControlIds( api.czr_activeSectionId() );
2497
+ controls = _.filter( controls, function( _id ) {
2498
+ var setId = api.CZR_Helpers.getControlSettingId( _id );
2499
+ return setId && self.isSettingSkopeEligible( setId );
2500
+ });
2501
+ }
2502
+
2503
+ var controlIds = _.isArray(controls) ? controls : [controls],
2504
+ render_reset_icons = function( ctrlIds ) {
2505
+ if ( _.isEmpty( ctrlIds ) ) {
2506
+ dfd.resolve();
2507
+ return;
2508
+ }
2509
+ _.each( ctrlIds, function( _id ) {
2510
+ api.control.when( _id, function() {
2511
+ var ctrl = api.control( _id ),
2512
+ setId = api.CZR_Helpers.getControlSettingId( _id );
2513
+
2514
+ if( $('.czr-setting-reset', ctrl.container ).length ) {
2515
+ dfd.resolve();
2516
+ return;
2517
+ }
2518
+
2519
+ ctrl.deferred.embedded.then( function() {
2520
+ $.when(
2521
+ ctrl.container
2522
+ .find('.customize-control-title').first()//was.find('.customize-control-title')
2523
+ .prepend( $( '<span/>', {
2524
+ class : 'czr-setting-reset fa fa-refresh',
2525
+ title : ''
2526
+ } ) ) )
2527
+ .done( function(){
2528
+ ctrl.container.addClass('czr-skoped');
2529
+ $('.czr-setting-reset', ctrl.container).fadeIn( 400 );
2530
+ dfd.resolve();
2531
+ });
2532
+ });//then()
2533
+ });//when()
2534
+ });//_each
2535
+ };
2536
+ render_reset_icons = _.debounce( render_reset_icons , 200 );
2537
+ render_reset_icons( controlIds );
2538
+ return dfd.promise();
2539
+ },
2540
+ renderControlResetWarningTmpl : function( ctrlId ) {
2541
+ if ( ! api.control.has( ctrlId ) )
2542
+ return {};
2543
+
2544
+ var self = this,
2545
+ ctrl = api.control( ctrlId ),
2546
+ setId = api.CZR_Helpers.getControlSettingId( ctrlId ),
2547
+ _tmpl = '',
2548
+ warning_message,
2549
+ success_message,
2550
+ isWPSetting = ( function() {
2551
+ if ( _.contains( serverControlParams.wpBuiltinSettings, api.CZR_Helpers.getOptionName( setId ) ) )
2552
+ return true;
2553
+ if ( ! _.contains( serverControlParams.themeSettingList, api.CZR_Helpers.getOptionName( setId ) ) )
2554
+ return true;
2555
+ return false;
2556
+ })(),
2557
+ _currentSkopeModel = api.czr_skope( api.czr_activeSkopeId() )();
2558
+
2559
+ if ( ctrl.czr_states( 'isDirty' )() ) {
2560
+ warning_message = [
2561
+ 'global' == _currentSkopeModel.skope ? serverControlParams.i18n.skope['Please confirm that you want to reset your current customizations for this option'] : serverControlParams.i18n.skope['Please confirm that you want to reset your current customizations for this option in'],
2562
+ 'global' == _currentSkopeModel.skope ? serverControlParams.i18n.skope['sitewide'] : _currentSkopeModel.ctx_title
2563
+ ].join(' ');
2564
+ success_message = serverControlParams.i18n.skope['Your customizations have been reset'];
2565
+ } else {
2566
+ if ( isWPSetting && 'global' == _currentSkopeModel.skope ) {
2567
+ warning_message = serverControlParams.i18n.skope['This WordPress setting can not be reset sitewide'];
2568
+ } else {
2569
+ warning_message = [
2570
+ 'global' == _currentSkopeModel.skope ? serverControlParams.i18n.skope['Please confirm that you want to reset this option'] : serverControlParams.i18n.skope['Please confirm that you want to reset this option in'],
2571
+ 'global' == _currentSkopeModel.skope ? serverControlParams.i18n.skope['sitewide'] : _currentSkopeModel.ctx_title
2572
+ ].join(' ');
2573
+ success_message = serverControlParams.i18n.skope['The option has been reset'];
2574
+ }
2575
+ }
2576
+ var is_authorized = ! ( isWPSetting && 'global' == api.czr_skope( api.czr_activeSkopeId() )().skope && ! ctrl.czr_states( 'isDirty' )() ),
2577
+ _tmpl_data = {
2578
+ warning_message : warning_message + '.',
2579
+ success_message : success_message + '.',
2580
+ is_authorized : is_authorized
2581
+ };
2582
+ try {
2583
+ _tmpl = wp.template('czr-reset-control')( _tmpl_data );
2584
+ } catch( er ) {
2585
+ api.errorLog( 'Error when parsing the the reset control template : ' + er );
2586
+ return { container : false, is_authorized : false };
2587
+ }
2588
+
2589
+ $('.customize-control-title', ctrl.container).first().after( $( _tmpl ) );
2590
+
2591
+ return { container : $( '.czr-ctrl-reset-warning', ctrl.container ), is_authorized : is_authorized };
2592
+ },
2593
+ doResetSetting : function( ctrlId ) {
2594
+ var self = this,
2595
+ setId = api.CZR_Helpers.getControlSettingId( ctrlId ),
2596
+ ctrl = api.control( ctrlId ),
2597
+ skope_id = api.czr_activeSkopeId(),
2598
+ reset_method = ctrl.czr_states( 'isDirty' )() ? '_resetControlDirtyness' : '_resetControlAPIVal',
2599
+ _setResetDialogVisibility = function() {
2600
+ var ctrl = this;//<= fired with .call( ctrlInstance )
2601
+ ctrl.czr_states( 'resetVisible' )( false );
2602
+ ctrl.czr_states( 'isResetting' )( false);
2603
+ ctrl.container.removeClass('czr-resetting-control');
2604
+ },
2605
+ _updateAPI = function( ctrlId ) {
2606
+ var _silentUpdate = function() {
2607
+ api.czr_skopeBase.processSilentUpdates( { candidates : ctrlId, refresh : false } )
2608
+ .fail( function() { api.consoleLog( 'Silent update failed after resetting control : ' + ctrlId ); } )
2609
+ .done( function() {
2610
+ api.control.when( ctrlId, function() {
2611
+ var ctrl = api.control( ctrlId );
2612
+ $.when( $('.czr-crtl-reset-dialog', ctrl.container ).fadeOut('300') ).done( function() {
2613
+ $.when( $('.czr-reset-success', ctrl.container ).fadeIn('300') ).done( function( $_el ) {
2614
+ _.delay( function() {
2615
+ $.when( $_el.fadeOut('300') ).done( function() {
2616
+ self.setupActiveSkopedControls( { controls : [ ctrlId ] } ).done( function() {
2617
+ if ( ctrl.czr_states ) {
2618
+ _setResetDialogVisibility.call( ctrl );
2619
+ ctrl.czr_states( 'noticeVisible' )( self.isCtrlNoticeVisible( ctrlId ) );
2620
+ }
2621
+ });
2622
+ });
2623
+ }, 500 );
2624
+ });
2625
+ });
2626
+ });
2627
+ });//done()
2628
+ };//_silentUpdate
2629
+ self[reset_method](ctrlId)
2630
+ .done( function() {
2631
+ api.consoleLog('REFRESH AFTER A SETTING RESET');
2632
+ api.previewer.refresh()
2633
+ .fail( function( refresh_data ) {
2634
+ api.errorLog('Setting reset refresh failed.', refresh_data );
2635
+ })
2636
+ .done( function( refresh_data ) {
2637
+ if ( 'global' == api.czr_skope( skope_id )().skope && '_resetControlAPIVal' == reset_method ) {
2638
+ var _sentSkopeCollection,
2639
+ _serverGlobalDbValues = {},
2640
+ _skope_opt_name = api.czr_skope( skope_id )().opt_name;
2641
+
2642
+ if ( ! _.isUndefined( refresh_data.skopesServerData ) && _.has( refresh_data.skopesServerData, 'czr_skopes' ) ) {
2643
+ _sentSkopeCollection = refresh_data.skopesServerData.czr_skopes;
2644
+ if ( _.isUndefined( _.findWhere( _sentSkopeCollection, { opt_name : _skope_opt_name } ) ) ) {
2645
+ _serverGlobalDbValues = _.findWhere( _sentSkopeCollection, { opt_name : _skope_opt_name } ).db || {};
2646
+ }
2647
+ }
2648
+ api.czr_skopeBase.maybeSynchronizeGlobalSkope( { isGlobalReset : true, isSetting : true, settingIdToReset : setId } )
2649
+ .done( function() {
2650
+ _silentUpdate();
2651
+ });
2652
+ } else {
2653
+ _silentUpdate();
2654
+ }
2655
+ });
2656
+ });
2657
+ };//_updateAPI
2658
+
2659
+
2660
+ ctrl.czr_states( 'isResetting' )( true );
2661
+ ctrl.container.addClass('czr-resetting-control');
2662
+
2663
+ api.czr_skopeReset[ ctrl.czr_states( 'isDirty' )() ? 'resetChangeset' : 'resetPublished' ](
2664
+ { skope_id : skope_id, setId : setId, is_setting : true } )
2665
+ .done( function( r ) {
2666
+ _updateAPI( ctrlId );
2667
+ })
2668
+ .fail( function( r ) {
2669
+ api.errorLog( 'Reset failed', r );
2670
+ $.when( $('.czr-crtl-reset-dialog', ctrl.container ).fadeOut('300') ).done( function() {
2671
+ $.when( $('.czr-reset-fail', ctrl.container ).fadeIn('300') ).done( function() {
2672
+ $('.czr-reset-fail', ctrl.container ).append('<p>' + r + '</p>');
2673
+ _.delay( function() {
2674
+ _setResetDialogVisibility.call( ctrl );
2675
+ self.setupActiveSkopedControls( { controls : [ ctrlId ] } );
2676
+ }, 2000 );
2677
+ });
2678
+ });
2679
+ });
2680
+
2681
+ },
2682
+ _resetControlDirtyness : function( ctrlId ) {
2683
+ var setId = api.CZR_Helpers.getControlSettingId( ctrlId ),
2684
+ skope_instance = api.czr_skope( api.czr_activeSkopeId() ),
2685
+ current_dirties = $.extend( true, {}, skope_instance.dirtyValues() ),
2686
+ new_dirties = {},
2687
+ current_changeset = $.extend( true, {}, skope_instance.changesetValues() ),
2688
+ new_changeset = {},
2689
+ dfd = $.Deferred();
2690
+
2691
+ new_dirties = _.omit( current_dirties, setId );
2692
+ new_changeset = _.omit( current_changeset, setId );
2693
+ skope_instance.dirtyValues( new_dirties );
2694
+ skope_instance.changesetValues( new_dirties );
2695
+
2696
+ return dfd.resolve().promise();
2697
+ },
2698
+ _resetControlAPIVal : function( ctrlId ) {
2699
+ var setId = api.CZR_Helpers.getControlSettingId( ctrlId ),
2700
+ current_skope_db = api.czr_skope( api.czr_activeSkopeId() ).dbValues(),
2701
+ new_skope_db = $.extend( true, {}, current_skope_db ),
2702
+ dfd = $.Deferred();
2703
+
2704
+ if ( _.has( api.control( ctrlId ), 'czr_states') ) {
2705
+ api.control(ctrlId).czr_states( 'hasDBVal' )( false );
2706
+ api.czr_skope( api.czr_activeSkopeId() ).dbValues( _.omit( new_skope_db, setId ) );
2707
+ }
2708
+ return dfd.resolve().promise();
2709
+ }
2710
+ });//$.extend()
2711
+ })( wp.customize , jQuery, _ );
2712
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
2713
+ ( function ( api, $, _ ) {
2714
+ $.extend( CZRSkopeBaseMths, {
2715
+ renderCtrlSkpNotIcon : function( controlIdCandidates ) {
2716
+ var self = this,
2717
+ controlIds = _.isArray(controlIdCandidates) ? controlIdCandidates : [controlIdCandidates];
2718
+
2719
+ _.each( controlIds, function( _id ) {
2720
+ api.control.when( _id, function() {
2721
+ var ctrl = api.control( _id );
2722
+ ctrl.deferred.embedded.then( function() {
2723
+ if( $('.czr-toggle-notice', ctrl.container ).length )
2724
+ return;
2725
+
2726
+ $.when( ctrl.container
2727
+ .find('.customize-control-title').first()//was.find('.customize-control-title')
2728
+ .append( $( '<span/>', {
2729
+ class : 'czr-toggle-notice fa fa-info-circle',
2730
+ title : serverControlParams.i18n.skope['Display informations about the scope of this option.']
2731
+ } ) ) )
2732
+ .done( function(){
2733
+ $('.czr-toggle-notice', ctrl.container).fadeIn( 400 );
2734
+ });
2735
+ });
2736
+
2737
+ });
2738
+
2739
+ });
2740
+ },
2741
+ updateCtrlSkpNot : function( controlIdCandidates, visible ) {
2742
+ var self = this,
2743
+ controlIds = _.isArray(controlIdCandidates) ? controlIdCandidates : [controlIdCandidates],
2744
+ _isSkoped = function( setId ) {
2745
+ return setId && self.isSettingSkopeEligible( setId );
2746
+ },//filter only eligible ctrlIds
2747
+ _generateControlNotice = function( setId, _localSkopeId ) {
2748
+ var _currentSkopeId = api.czr_activeSkopeId(),
2749
+ _inheritedFromSkopeId = self.getInheritedSkopeId( setId, _currentSkopeId ),
2750
+ _overridedBySkopeId = self.getAppliedPrioritySkopeId( setId, _currentSkopeId ),
2751
+ _html = [],
2752
+ _isCustomized,
2753
+ _hasDBVal;
2754
+ if ( ! _isSkoped( setId ) ) {
2755
+ _html.push( [
2756
+ serverControlParams.i18n.skope['This option is always customized sitewide and cannot be reset.']
2757
+ ].join(' ') );
2758
+ return _html.join(' | ');
2759
+ }
2760
+ if ( _inheritedFromSkopeId == _overridedBySkopeId && api.czr_skope.has( _inheritedFromSkopeId ) && _currentSkopeId == _inheritedFromSkopeId ) {
2761
+ _isCustomized = ! _.isUndefined( api.czr_skope( _currentSkopeId ).dirtyValues()[setId] );
2762
+ _hasDBVal = ! _.isUndefined( api.czr_skope( _currentSkopeId ).dbValues()[setId] );
2763
+
2764
+ if ( _isCustomized ) {
2765
+ if ( 'global' == api.czr_skope( _inheritedFromSkopeId )().skope ) {
2766
+ _html.push( [
2767
+ serverControlParams.i18n.skope['Customized. Will be applied sitewide once published.'],
2768
+ ].join(' ') );
2769
+ } else {
2770
+ _html.push( [
2771
+ serverControlParams.i18n.skope['Customized. Will be applied to'],
2772
+ '<strong>' + api.czr_skope( _inheritedFromSkopeId )().ctx_title + '</strong>',
2773
+ serverControlParams.i18n.skope['once published.']
2774
+ ].join(' ') );
2775
+ }
2776
+ } else {
2777
+ if ( _hasDBVal ) {
2778
+ if ( 'global' == api.czr_skope( _inheritedFromSkopeId )().skope ) {
2779
+ _html.push( [
2780
+ serverControlParams.i18n.skope['Customized and applied sitewide.'],
2781
+ ].join(' ') );
2782
+ } else {
2783
+ _html.push( [
2784
+ serverControlParams.i18n.skope['Customized and applied to'],
2785
+ '<strong>' + api.czr_skope( _inheritedFromSkopeId )().ctx_title + '.' + '</strong>'
2786
+ ].join(' ') );
2787
+ }
2788
+ } else {
2789
+ _html.push( serverControlParams.i18n.skope['Default website value applied sitewide.'] );
2790
+ }
2791
+ }
2792
+ }
2793
+ if ( _inheritedFromSkopeId !== _currentSkopeId && api.czr_skope.has( _inheritedFromSkopeId ) ) {
2794
+ _isCustomized = ! _.isUndefined( api.czr_skope( _inheritedFromSkopeId ).dirtyValues()[setId] );
2795
+ _hasDBVal = ! _.isUndefined( api.czr_skope( _inheritedFromSkopeId ).dbValues()[setId] );
2796
+ if ( ! _isCustomized && ! _hasDBVal ) {
2797
+ _html.push(
2798
+ [
2799
+ serverControlParams.i18n.skope['Default website value.'],
2800
+ serverControlParams.i18n.skope['You can customize this specifically for'],
2801
+ '<strong>' + api.czr_skope( _currentSkopeId )().ctx_title + '.' + '</strong>'
2802
+ ].join(' ')
2803
+ );
2804
+ } else {
2805
+ _html.push(
2806
+ [
2807
+ serverControlParams.i18n.skope['Currently inherited from'],
2808
+ self.buildSkopeLink( _inheritedFromSkopeId ) + '.',
2809
+ serverControlParams.i18n.skope['You can customize this specifically for'],
2810
+ '<strong>' + api.czr_skope( _currentSkopeId )().ctx_title + '.' + '</strong>'
2811
+ ].join(' ')
2812
+ );
2813
+ }
2814
+ }
2815
+ if ( _overridedBySkopeId !== _currentSkopeId && api.czr_skope.has( _overridedBySkopeId ) ) {
2816
+ _isCustomized = ! _.isUndefined( api.czr_skope( _overridedBySkopeId ).dirtyValues()[setId] );
2817
+
2818
+ _html.push( [
2819
+ ! _isCustomized ? serverControlParams.i18n.skope['The value currently applied to'] : serverControlParams.i18n.skope['The value that will be applied to'],
2820
+ '<strong>' + api.czr_skope( _localSkopeId )().ctx_title + '</strong>',
2821
+ ! _isCustomized ? serverControlParams.i18n.skope['is set in'] : serverControlParams.i18n.skope['is customized in'],
2822
+ self.buildSkopeLink( _overridedBySkopeId ),
2823
+ serverControlParams.i18n.skope['which has a higher priority than the current option scope'],
2824
+ '<strong>( ' + api.czr_skope( _currentSkopeId )().title + ' ).</strong>'
2825
+ ].join(' ') );
2826
+ }
2827
+
2828
+ return _html.join(' | ');
2829
+ };//_generateControlNotice
2830
+
2831
+
2832
+ _.each( controlIds, function( _id ) {
2833
+ api.control.when( _id, function() {
2834
+ var ctrl = api.control( _id ),
2835
+ setId = api.CZR_Helpers.getControlSettingId( _id ),//get the relevant setting_id for this control
2836
+ _visible = _.isUndefined( visible ) ? ( ctrl.czr_states && ctrl.czr_states( 'noticeVisible' )() ) : visible;
2837
+ if ( ! _visible )
2838
+ return;
2839
+
2840
+ ctrl.deferred.embedded.then( function() {
2841
+ var _localSkopeId = _.findWhere( api.czr_currentSkopesCollection(), { skope : 'local' } ).id,
2842
+ $noticeContainer = ctrl.getNotificationsContainerElement();
2843
+
2844
+ if ( ! $noticeContainer || ! $noticeContainer.length || _.isUndefined( _localSkopeId ) )
2845
+ return;
2846
+
2847
+ try {
2848
+ _html = _generateControlNotice( setId, _localSkopeId );
2849
+ } catch ( er ) {
2850
+ api.errorLog( '_generateControlNotice : ' + er );
2851
+ }
2852
+
2853
+
2854
+ var $skopeNoticeEl = $( '.czr-skope-notice', $noticeContainer );
2855
+ if ( $skopeNoticeEl.length ) {
2856
+ $skopeNoticeEl.html( _html );
2857
+ } else {
2858
+ $noticeContainer.append(
2859
+ [ '<span class="czr-notice czr-skope-notice">', _html ,'</span>' ].join('')
2860
+ );
2861
+ }
2862
+ });
2863
+ });
2864
+ });
2865
+ },//updateCtrlSkpNot
2866
+ isCtrlNoticeVisible : function( ctrlId ) {
2867
+ if ( ! api.control.has( ctrlId ) )
2868
+ return false;
2869
+
2870
+ var self = this,
2871
+ setId = api.CZR_Helpers.getControlSettingId( ctrlId ),//get the relevant setting_id for this control
2872
+ _currentSkopeId = api.czr_activeSkopeId(),
2873
+ _overridedBySkopeId = self.getAppliedPrioritySkopeId( setId, _currentSkopeId ),
2874
+ _isSkoped = function( setId ) {
2875
+ return setId && self.isSettingSkopeEligible( setId );
2876
+ };//filter only eligible ctrlIds
2877
+
2878
+ if ( 'global' != api.czr_skope( _currentSkopeId )().skope ) {
2879
+ return true;
2880
+ } else if ( _overridedBySkopeId !== _currentSkopeId && api.czr_skope.has( _overridedBySkopeId ) ) {
2881
+ return true;
2882
+ }
2883
+ return false;
2884
+ },
2885
+ removeCtrlSkpNot : function( controlIdCandidates ) {
2886
+ var self = this,
2887
+ controlIds = _.isArray(controlIdCandidates) ? controlIdCandidates : [controlIdCandidates];
2888
+
2889
+ _.each( controlIds, function( _id ) {
2890
+ api.control.when( _id, function() {
2891
+ var ctrl = api.control( _id );
2892
+
2893
+ ctrl.deferred.embedded.then( function() {
2894
+ var $noticeContainer = ctrl.getNotificationsContainerElement();
2895
+
2896
+ if ( ! $noticeContainer || ! $noticeContainer.length )
2897
+ return;
2898
+
2899
+ var $skopeNoticeEl = $( '.czr-skope-notice', $noticeContainer );
2900
+ if ( $skopeNoticeEl.length )
2901
+ $skopeNoticeEl.remove();
2902
+ });
2903
+ });
2904
+ });
2905
+ }
2906
+ });//$.extend()
2907
+ })( wp.customize , jQuery, _ );
2908
+ var CZRSkopeSaveMths = CZRSkopeSaveMths || {};
2909
+ ( function ( api, $, _ ) {
2910
+ $.extend( CZRSkopeSaveMths, {
2911
+ initialize: function() {
2912
+ var self = this;
2913
+ this.changesetStatus = 'publish';
2914
+ this.saveBtn = $( '#save' );
2915
+ },
2916
+
2917
+
2918
+ save: function( args ) {
2919
+ var self = this,
2920
+ processing = api.state( 'processing' ),
2921
+ submitWhenDoneProcessing,
2922
+ parent = new api.Messenger({
2923
+ url: api.settings.url.parent,
2924
+ channel: 'loader',
2925
+ });//this has to be reinstantiated because not accessible from core
2926
+ self.globalSaveDeferred = $.Deferred();
2927
+ self.previewer = api.previewer;
2928
+ self.globalSkopeId = api.czr_skopeBase.getGlobalSkopeId();
2929
+ self.saveArgs = args;
2930
+
2931
+ if ( args && args.status ) {
2932
+ self.changesetStatus = args.status;
2933
+ }
2934
+
2935
+ if ( api.state( 'saving' )() ) {
2936
+ self.globalSaveDeferred.reject( 'already_saving' );
2937
+ }
2938
+ var alwaysAfterSubmission = function( response, state ) {
2939
+ api.state( 'saving' )( false );
2940
+ api.state( 'processing' ).set( 0 );
2941
+ self.saveBtn.prop( 'disabled', false );
2942
+ if ( ! _.isUndefined( response ) && response.setting_validities ) {
2943
+ api._handleSettingValidities( {
2944
+ settingValidities: response.setting_validities,
2945
+ focusInvalidControl: true
2946
+ } );
2947
+ }
2948
+ if ( 'pending' == state ) {
2949
+ api.czr_serverNotification( { message: response, status : 'error' } );
2950
+ } else {
2951
+ }
2952
+ },
2953
+ resolveSave = function( params ) {
2954
+ var response, resolveSaveDfd = $.Deferred();
2955
+ api.state( 'saving' )( true );
2956
+ self.fireAllSubmission( params )
2957
+ .always( function( _response_ ) {
2958
+ response = _response_.response;
2959
+ alwaysAfterSubmission( response , this.state() );
2960
+ })
2961
+ .fail( function( _response_ ) {
2962
+ response = _response_.response;
2963
+ api.consoleLog('ALL SUBMISSIONS FAILED', response );
2964
+ self.globalSaveDeferred.reject( response );
2965
+ api.trigger( 'error', response );
2966
+ resolveSaveDfd.resolve( _response_.hasNewMenu );
2967
+ })
2968
+ .done( function( _response_ ) {
2969
+ response = _response_.response;
2970
+ api.previewer.refresh( { waitSkopeSynced : true } )
2971
+ .fail( function( refresh_data ) {
2972
+ self.globalSaveDeferred.reject( self.previewer, [ response ] );
2973
+ api.consoleLog('SAVE REFRESH FAIL', refresh_data );
2974
+ })
2975
+ .done( function( refresh_data ) {
2976
+ api.previewer.send( 'saved', response );
2977
+ response = _.extend( { changeset_status : 'publish' }, response || {} );
2978
+ if ( api.czr_isChangeSetOn() ) {
2979
+ var latestRevision = api._latestRevision;
2980
+ api.state( 'changesetStatus' ).set( response.changeset_status );
2981
+ if ( 'publish' === response.changeset_status ) {
2982
+ api.each( function( setting ) {
2983
+ if ( setting._dirty && ( _.isUndefined( api._latestSettingRevisions[ setting.id ] ) || api._latestSettingRevisions[ setting.id ] <= latestRevision ) ) {
2984
+ setting._dirty = false;
2985
+ }
2986
+ } );
2987
+
2988
+ api.state( 'changesetStatus' ).set( '' );
2989
+ api.settings.changeset.uuid = response.next_changeset_uuid;
2990
+ parent.send( 'changeset-uuid', api.settings.changeset.uuid );
2991
+ }
2992
+ } else {
2993
+ api.each( function ( value ) {
2994
+ value._dirty = false;
2995
+ } );
2996
+ }
2997
+ refresh_data = _.extend( {
2998
+ previewer : refresh_data.previewer || self.previewer,
2999
+ skopesServerData : refresh_data.skopesServerData || {},
3000
+ },
3001
+ refresh_data
3002
+ );
3003
+ self.reactWhenSaveDone( refresh_data.skopesServerData );
3004
+ self.globalSaveDeferred.resolveWith( self.previewer, [ response ] );
3005
+
3006
+ api.trigger( 'saved', response || {} );
3007
+ resolveSaveDfd.resolve( _response_.hasNewMenu );
3008
+ });
3009
+ });
3010
+ return resolveSaveDfd.promise();
3011
+ };//resolveSave
3012
+
3013
+ if ( 0 === processing() ) {
3014
+ resolveSave().done( function( hasNewMenu ) {
3015
+ if ( hasNewMenu ) {
3016
+ resolveSave( { saveGlobal :false, saveSkopes : true } );
3017
+ }
3018
+ } );
3019
+ } else {
3020
+ submitWhenDoneProcessing = function () {
3021
+ if ( 0 === processing() ) {
3022
+ api.state.unbind( 'change', submitWhenDoneProcessing );
3023
+ resolveSave();
3024
+ }
3025
+ };
3026
+ api.state.bind( 'change', submitWhenDoneProcessing );
3027
+ }
3028
+ return self.globalSaveDeferred.promise();
3029
+ }//save
3030
+ });//$.extend
3031
+ })( wp.customize , jQuery, _ );
3032
+ var CZRSkopeSaveMths = CZRSkopeSaveMths || {};
3033
+ ( function ( api, $, _ ) {
3034
+ $.extend( CZRSkopeSaveMths, {
3035
+ getSubmitPromise : function( skope_id ) {
3036
+ var self = this,
3037
+ dfd = $.Deferred(),
3038
+ submittedChanges = {};
3039
+
3040
+ if ( _.isEmpty( skope_id ) || ! api.czr_skope.has( skope_id ) ) {
3041
+ api.consoleLog( 'getSubmitPromise : no skope id requested OR skope_id not registered : ' + skope_id );
3042
+ return dfd.resolve().promise();
3043
+ }
3044
+
3045
+ var skopeObjectToSubmit = api.czr_skope( skope_id )();
3046
+ if ( ! api.czr_skope( skope_id ).dirtyness() && skope_id !== self.globalSkopeId ) {
3047
+ return dfd.resolve().promise();
3048
+ }
3049
+ _.each( api.czr_skopeBase.getSkopeDirties( skope_id ) , function( dirtyValue, settingId ) {
3050
+ submittedChanges[ settingId ] = _.extend(
3051
+ { value: dirtyValue }
3052
+ );
3053
+ } );
3054
+
3055
+ this.submit(
3056
+ {
3057
+ skope_id : skope_id,
3058
+ customize_changeset_data : submittedChanges,//{}
3059
+ dyn_type : skopeObjectToSubmit.dyn_type
3060
+ })
3061
+ .done( function(_resp) {
3062
+ dfd.resolve( _resp );
3063
+ } )
3064
+ .fail( function( _resp ) {
3065
+ api.consoleLog('GETSUBMIT FAILED PROMISE FOR SKOPE : ', skope_id, _resp );
3066
+ dfd.reject( _resp );
3067
+ } );
3068
+
3069
+ return dfd.promise();
3070
+ },//getSubmitPromise
3071
+
3072
+
3073
+
3074
+
3075
+ submit : function( params ) {
3076
+ var self = this,
3077
+ default_params = {
3078
+ skope_id : null,
3079
+ the_dirties : {},
3080
+ customize_changeset_data : {},
3081
+ dyn_type : null,
3082
+ opt_name : null
3083
+ },
3084
+ invalidSettings = [],
3085
+ modifiedWhileSaving = {},
3086
+ invalidControls,
3087
+ submit_dfd = $.Deferred();
3088
+
3089
+
3090
+ params = $.extend( default_params, params );
3091
+
3092
+ if ( _.isNull( params.skope_id ) ) {
3093
+ throw new Error( 'OVERRIDEN SAVE::submit : MISSING skope_id');
3094
+ }
3095
+ if ( _.isNull( params.the_dirties ) ) {
3096
+ throw new Error( 'OVERRIDEN SAVE::submit : MISSING the_dirties');
3097
+ }
3098
+ if ( _.has( api, 'Notification') ) {
3099
+ api.each( function( setting ) {
3100
+ setting.notifications.each( function( notification ) {
3101
+ if ( 'error' === notification.type ) {
3102
+ api.consoleLog('NOTIFICATION ERROR on SUBMIT SAVE' , notification );
3103
+ }
3104
+ if ( 'error' === notification.type && ( ! notification.data || ! notification.data.from_server ) ) {
3105
+ invalidSettings.push( setting.id );
3106
+ if ( ! settingInvalidities[ setting.id ] ) {
3107
+ settingInvalidities[ setting.id ] = {};
3108
+ }
3109
+ settingInvalidities[ setting.id ][ notification.code ] = notification;
3110
+ }
3111
+ } );
3112
+ } );
3113
+ invalidControls = api.findControlsForSettings( invalidSettings );
3114
+ if ( ! _.isEmpty( invalidControls ) ) {
3115
+ _.values( invalidControls )[0][0].focus();
3116
+ return submit_dfd.rejectWith( self.previewer, [
3117
+ { setting_invalidities: settingInvalidities }
3118
+ ] ).promise();
3119
+ }
3120
+ }
3121
+ var query_params = {
3122
+ skope_id : params.skope_id,
3123
+ action : 'save',
3124
+ the_dirties : params.the_dirties,
3125
+ dyn_type : params.dyn_type,
3126
+ opt_name : params.opt_name
3127
+ };
3128
+ if ( api.czr_isChangeSetOn() ) {
3129
+ $.extend( query_params, { excludeCustomizedSaved: false } );
3130
+ }
3131
+ var query = $.extend( self.previewer.query( query_params ), {
3132
+ nonce: self.previewer.nonce.save,
3133
+ customize_changeset_status: self.changesetStatus,
3134
+ customize_changeset_data : JSON.stringify( params.customize_changeset_data )
3135
+ } );
3136
+ if ( api.czr_isChangeSetOn() ) {
3137
+ if ( self.saveArgs && self.saveArgs.date ) {
3138
+ query.customize_changeset_date = self.saveArgs.date;
3139
+ }
3140
+ if ( self.saveArgs && self.saveArgs.title ) {
3141
+ query.customize_changeset_title = self.saveArgs.title;
3142
+ }
3143
+ }
3144
+ var request = wp.ajax.post(
3145
+ 'global' !== query.skope ? 'customize_skope_changeset_save' : 'customize_save',
3146
+ query
3147
+ );
3148
+ self.saveBtn.prop( 'disabled', true );
3149
+
3150
+ api.trigger( 'save', request );
3151
+
3152
+ request.fail( function ( response ) {
3153
+ api.consoleLog('SUBMIT REQUEST FAIL', params.skope_id, response );
3154
+ if ( '0' === response ) {
3155
+ response = 'not_logged_in';
3156
+ } else if ( '-1' === response ) {
3157
+ response = 'invalid_nonce';
3158
+ }
3159
+
3160
+ if ( 'invalid_nonce' === response ) {
3161
+ self.previewer.cheatin();
3162
+ } else if ( 'not_logged_in' === response ) {
3163
+ self.previewer.preview.iframe.hide();
3164
+ self.previewer.login().done( function() {
3165
+ self.previewer.save();
3166
+ self.previewer.preview.iframe.show();
3167
+ } );
3168
+ }
3169
+ api.trigger( 'error', response );
3170
+ submit_dfd.reject( response );
3171
+ } );
3172
+
3173
+ request.done( function( response ) {
3174
+ submit_dfd.resolve( response );
3175
+ } );
3176
+ return submit_dfd.promise();
3177
+ }//submit()
3178
+ });//$.extend
3179
+ })( wp.customize , jQuery, _ );
3180
+ var CZRSkopeSaveMths = CZRSkopeSaveMths || {};
3181
+ ( function ( api, $, _ ) {
3182
+ $.extend( CZRSkopeSaveMths, {
3183
+ fireAllSubmission : function( params ) {
3184
+ var self = this,
3185
+ dfd = $.Deferred(),
3186
+ skopesToSave = [],
3187
+ _recursiveCallDeferred = $.Deferred(),
3188
+ _responses_ = {},
3189
+ _promises = [],
3190
+ failedPromises = [],
3191
+ _defaultParams = {
3192
+ saveGlobal : true,
3193
+ saveSkopes : true
3194
+ };
3195
+ params = $.extend( _defaultParams, params );
3196
+ _.each( api.czr_skopeCollection(), function( _skp_ ) {
3197
+ if ( 'global' !== _skp_.skope ) {
3198
+ skopesToSave.push( _skp_.id );
3199
+ }
3200
+ });
3201
+
3202
+ var _mayBeresolve = function( _index ) {
3203
+ if ( ! _.isUndefined( skopesToSave[ _index + 1 ] ) || _promises.length != skopesToSave.length )
3204
+ return;
3205
+
3206
+ if ( _.isEmpty( failedPromises ) ) {
3207
+ _recursiveCallDeferred.resolve( _responses_ );
3208
+ } else {
3209
+ var _buildResponse = function() {
3210
+ var _failedResponse = [];
3211
+ _.each( failedPromises, function( _r ) {
3212
+ _failedResponse.push( api.czr_skopeBase.buildServerResponse( _r ) );
3213
+ } );
3214
+ return $.trim( _failedResponse.join( ' | ') );
3215
+ };
3216
+ _recursiveCallDeferred.reject( _buildResponse() );
3217
+ }
3218
+ return true;
3219
+ };
3220
+ var recursiveCall = function( _index ) {
3221
+ _index = _index || 0;
3222
+ if ( _.isUndefined( skopesToSave[_index] ) ) {
3223
+ api.consoleLog( 'Undefined Skope in Save recursive call ', _index, _skopesToUpdate, _skopesToUpdate[_index] );
3224
+ _recursiveCallDeferred.resolve( _responses_ );
3225
+ }
3226
+ self.getSubmitPromise( skopesToSave[ _index ] )
3227
+ .always( function() { _promises.push( _index ); } )
3228
+ .fail( function( response ) {
3229
+ failedPromises.push( response );
3230
+ api.consoleLog('RECURSIVE PUSH FAIL FOR SKOPE : ', skopesToSave[_index] );
3231
+ if ( ! _mayBeresolve( _index ) )
3232
+ recursiveCall( _index + 1 );
3233
+ } )
3234
+ .done( function( response ) {
3235
+ response = response || {};
3236
+ if ( _.isEmpty( _responses_ ) ) {
3237
+ _responses_ = response || {};
3238
+ } else {
3239
+ _responses_ = $.extend( _responses_ , response );
3240
+ }
3241
+ if ( ! _mayBeresolve( _index ) )
3242
+ recursiveCall( _index + 1 );
3243
+ } );
3244
+
3245
+ return _recursiveCallDeferred.promise();
3246
+ };
3247
+ var _globalHasNewMenu = false;
3248
+ _.each( api.czr_skope('global__all_').dirtyValues(), function( _setDirtVal , _setId ) {
3249
+ if ( 'nav_menu[' != _setId.substring( 0, 'nav_menu['.length ) )
3250
+ return;
3251
+ _globalHasNewMenu = true;
3252
+ } );
3253
+
3254
+ var _submitGlobal = function() {
3255
+ self.getSubmitPromise( self.globalSkopeId )
3256
+ .fail( function( r ) {
3257
+ api.consoleLog('GLOBAL SAVE SUBMIT FAIL', r );
3258
+ r = api.czr_skopeBase.buildServerResponse( r );
3259
+ dfd.reject( r );
3260
+ })
3261
+ .done( function( r ) {
3262
+ if ( _.isEmpty( _responses_ ) ) {
3263
+ _responses_ = r || {};
3264
+ } else {
3265
+ _responses_ = $.extend( _responses_ , r );
3266
+ }
3267
+ dfd.resolve( { response : _responses_, hasNewMenu : _globalHasNewMenu } );
3268
+ });
3269
+ };
3270
+
3271
+
3272
+ if ( _globalHasNewMenu && params.saveGlobal ) {
3273
+ _submitGlobal();
3274
+ } else {
3275
+ if ( params.saveGlobal && params.saveSkopes ) {
3276
+ recursiveCall()
3277
+ .fail( function( r ) {
3278
+ api.consoleLog('RECURSIVE SAVE CALL FAIL', r );
3279
+ dfd.reject( r );
3280
+ })
3281
+ .done( function( r ) {
3282
+ self.cleanSkopeChangesetMetas().always( function() { _submitGlobal(); } );
3283
+ });
3284
+ } else if ( params.saveGlobal && ! params.saveSkopes ) {
3285
+ _submitGlobal();
3286
+ } else if ( ! params.saveGlobal && params.saveSkopes ) {
3287
+ recursiveCall()
3288
+ .fail( function( r ) {
3289
+ api.consoleLog('RECURSIVE SAVE CALL FAIL', r );
3290
+ dfd.reject( r );
3291
+ })
3292
+ .done( function( r ) {
3293
+ if ( _.isEmpty( _responses_ ) ) {
3294
+ _responses_ = r || {};
3295
+ } else {
3296
+ _responses_ = $.extend( _responses_ , r );
3297
+ }
3298
+ self.cleanSkopeChangesetMetas().always( function() {
3299
+ dfd.resolve( { response : _responses_, hasNewMenu : _globalHasNewMenu } );
3300
+ });
3301
+ });
3302
+ }
3303
+ }//else
3304
+
3305
+ return dfd.promise();
3306
+ },//fireAllSubmissions
3307
+ cleanSkopeChangesetMetas : function() {
3308
+ var self = this,
3309
+ dfd = $.Deferred();
3310
+ _query = $.extend(
3311
+ api.previewer.query(),
3312
+ { nonce: api.previewer.nonce.save }
3313
+ );
3314
+ wp.ajax.post( 'czr_clean_skope_changeset_metas_after_publish' , _query )
3315
+ .always( function () { dfd.resolve(); })
3316
+ .fail( function ( response ) { api.consoleLog( 'cleanSkopeChangesetMetas failed', _query, response ); })
3317
+ .done( function( response ) { api.consoleLog( 'cleanSkopeChangesetMetas done', _query, response ); });
3318
+
3319
+ return dfd.promise();
3320
+ }
3321
+ });//$.extend
3322
+ })( wp.customize , jQuery, _ );
3323
+ var CZRSkopeSaveMths = CZRSkopeSaveMths || {};
3324
+ ( function ( api, $, _ ) {
3325
+ $.extend( CZRSkopeSaveMths, {
3326
+ reactWhenSaveDone : function( skopesServerData ) {
3327
+ var saved_dirties = {};
3328
+ skopesServerData = _.extend(
3329
+ {
3330
+ czr_skopes : [],
3331
+ isChangesetDirty : false
3332
+ },
3333
+ skopesServerData
3334
+ );
3335
+ _.each( api.czr_skopeCollection(), function( _skp_ ) {
3336
+ saved_dirties[ _skp_.opt_name ] = api.czr_skopeBase.getSkopeDirties( _skp_.id );
3337
+ api.czr_skope( _skp_.id ).dirtyValues( {} );
3338
+ api.czr_skope( _skp_.id ).changesetValues( {} );
3339
+ });
3340
+ var _notSyncedSettings = [],
3341
+ _sentSkopeCollection = skopesServerData.czr_skopes;
3342
+
3343
+ api.consoleLog('REACT WHEN SAVE DONE', saved_dirties, _sentSkopeCollection );
3344
+
3345
+ _.each( saved_dirties, function( skp_data, _saved_opt_name ) {
3346
+ _.each( skp_data, function( _val, _setId ) {
3347
+ if ( _.isUndefined( _.findWhere( _sentSkopeCollection, { opt_name : _saved_opt_name } ) ) )
3348
+ return;
3349
+ if ( ! api.czr_skopeBase.isSettingSkopeEligible( _setId ) )
3350
+ return;
3351
+
3352
+ var sent_skope_db_values = _.findWhere( _sentSkopeCollection, { opt_name : _saved_opt_name } ).db,
3353
+ sent_skope_level = _.findWhere( _sentSkopeCollection, { opt_name : _saved_opt_name } ).skope,
3354
+ wpSetId = api.CZR_Helpers.build_setId( _setId ),
3355
+ shortSetId = api.CZR_Helpers.getOptionName( _setId ),
3356
+ sent_set_val = sent_skope_db_values[wpSetId];
3357
+ if ( _.isUndefined( sent_set_val ) && 'global' == sent_skope_level && _val === serverControlParams.defaultOptionsValues[shortSetId] )
3358
+ return;
3359
+
3360
+ if ( _.isUndefined( sent_set_val ) || ! _.isEqual( sent_set_val, _val ) ) {
3361
+ _notSyncedSettings.push( { opt_name : _saved_opt_name, setId : wpSetId, server_val : sent_set_val, api_val : _val } );
3362
+ }
3363
+ });
3364
+ });
3365
+
3366
+ if ( ! _.isEmpty( _notSyncedSettings ) ) {
3367
+ api.consoleLog('SOME SETTINGS HAVE NOT BEEN PROPERLY SAVED : ', _notSyncedSettings );
3368
+ } else {
3369
+ api.consoleLog('ALL RIGHT, SERVER AND API ARE SYNCHRONIZED AFTER SAVE' );
3370
+ }
3371
+ api.czr_skopeBase.maybeSynchronizeGlobalSkope();
3372
+ api.czr_skopeBase.updateCtrlSkpNot( api.CZR_Helpers.getSectionControlIds() );
3373
+ var _setupSectionCtrlNotices = function() {
3374
+ var sectionCtrls = api.CZR_Helpers.getSectionControlIds( api.czr_activeSectionId() );
3375
+ _.each( sectionCtrls, function( ctrlId ) {
3376
+ if ( ! api.has( ctrlId ) || _.isUndefined( api.control( ctrlId ) ) )
3377
+ return;
3378
+ var ctrl = api.control( ctrlId );
3379
+ if ( ! _.has( ctrl, 'czr_states' ) )
3380
+ return;
3381
+ ctrl.czr_states( 'noticeVisible' )( api.czr_skopeBase.isCtrlNoticeVisible( ctrlId ) );
3382
+ });
3383
+ };
3384
+ }
3385
+ });//$.extend
3386
+ })( wp.customize , jQuery, _ );
3387
+ var CZRSkopeResetMths = CZRSkopeResetMths || {};
3388
+ ( function ( api, $, _ ) {
3389
+ $.extend( CZRSkopeResetMths, {
3390
+ initialize: function() {
3391
+ var self = this;
3392
+ self.previewer = api.previewer;
3393
+ api.state.create('czr-resetting')(false);
3394
+ api.state('czr-resetting').bind( function( state ) {
3395
+ $( document.body ).toggleClass( 'czr-resetting', false !== state );
3396
+ });
3397
+ },
3398
+ resetChangeset : function( args ) {
3399
+ var dfd = $.Deferred(),
3400
+ self = this,
3401
+ processing = api.state( 'processing' ),
3402
+ submitWhenPossible,
3403
+ submit_reset,
3404
+ request,
3405
+ requestAjaxAction,
3406
+ query_params,
3407
+ query,
3408
+ defaults = {
3409
+ is_setting : false,
3410
+ is_skope : false,
3411
+ skope_id : api.czr_activeSkopeId() || '',
3412
+ setId : ''
3413
+ };
3414
+
3415
+ args = _.extend( defaults, args );
3416
+ var skope_id = args.skope_id,
3417
+ setId = args.setId;
3418
+
3419
+ if( ! api.czr_isChangeSetOn() )
3420
+ return dfd.resolve().promise();
3421
+ submit_reset = function( skope_id, setId ) {
3422
+ if ( _.isUndefined( skope_id ) ) {
3423
+ throw new Error( 'RESET: MISSING skope_id');
3424
+ }
3425
+ api.state( 'czr-resetting' )( true );
3426
+ query_params = {
3427
+ skope_id : skope_id,
3428
+ action : 'reset'
3429
+ };
3430
+ query = $.extend(
3431
+ self.previewer.query( query_params ),
3432
+ { nonce: self.previewer.nonce.save }
3433
+ );
3434
+ if ( args.is_setting ) {
3435
+ $.extend( query , { setting_id : setId } );
3436
+ requestAjaxAction = 'czr_changeset_setting_reset';
3437
+ } else if ( args.is_skope ) {
3438
+ requestAjaxAction = 'czr_changeset_skope_reset';
3439
+ } else {
3440
+ return dfd.reject( 'reset_ajax_action_not_specified' ).promise();
3441
+ }
3442
+
3443
+ wp.ajax.post( requestAjaxAction , query )
3444
+ .always( function () {
3445
+ api.state( 'czr-resetting' )( false );
3446
+ })
3447
+ .fail( function ( response ) {
3448
+ if ( '0' === response ) {
3449
+ response = 'not_logged_in';
3450
+ } else if ( '-1' === response ) {
3451
+ response = 'invalid_nonce';
3452
+ }
3453
+
3454
+ if ( 'invalid_nonce' === response ) {
3455
+ self.previewer.cheatin();
3456
+ } else if ( 'not_logged_in' === response ) {
3457
+ self.previewer.preview.iframe.hide();
3458
+ self.previewer.login().done( function() {
3459
+ self.resetChangeset( args );
3460
+ self.previewer.preview.iframe.show();
3461
+ } );
3462
+ }
3463
+ api.consoleLog( requestAjaxAction + ' failed ', query, response );
3464
+ response = api.czr_skopeBase.buildServerResponse( response );
3465
+ api.trigger( 'error', response );
3466
+
3467
+ api.czr_serverNotification( { message: response, status : 'error' } );
3468
+ dfd.reject( response );
3469
+ })
3470
+ .done( function( response ) {
3471
+ dfd.resolve( response );
3472
+ });
3473
+ };//submit_reset()
3474
+
3475
+ if ( 0 === processing() && false === api.state( 'czr-resetting' )() ) {
3476
+ submit_reset( skope_id, setId );
3477
+ } else {
3478
+ submitWhenPossible = function () {
3479
+ if ( 0 === processing() && false === api.state( 'czr-resetting' )() ) {
3480
+ api.state.unbind( 'change', submitWhenPossible );
3481
+ submit_reset( skope_id, setId );
3482
+ }
3483
+ };
3484
+ api.state.bind( 'change', submitWhenPossible );
3485
+ }
3486
+
3487
+ return dfd.promise();
3488
+ },
3489
+ resetPublished : function( args ) {
3490
+ var dfd = $.Deferred(),
3491
+ self = this,
3492
+ processing = api.state( 'processing' ),
3493
+ submitWhenPossible,
3494
+ submit_reset,
3495
+ request,
3496
+ requestAjaxAction,
3497
+ query_params,
3498
+ query,
3499
+ defaults = {
3500
+ is_setting : false,
3501
+ is_skope : false,
3502
+ skope_id : api.czr_activeSkopeId() || '',
3503
+ setId : ''
3504
+ };
3505
+
3506
+ args = _.extend( defaults, args );
3507
+ var skope_id = args.skope_id,
3508
+ setId = args.setId;
3509
+ submit_reset = function( skope_id, setId ) {
3510
+ if ( _.isUndefined( skope_id ) ) {
3511
+ throw new Error( 'RESET: MISSING skope_id');
3512
+ }
3513
+ api.state( 'czr-resetting' )( true );
3514
+ query_params = {
3515
+ skope_id : skope_id,
3516
+ action : 'reset'
3517
+ };
3518
+ query = $.extend(
3519
+ self.previewer.query( query_params ),
3520
+ { nonce: self.previewer.nonce.save }
3521
+ );
3522
+ if ( args.is_setting ) {
3523
+ $.extend( query , { setting_id : setId } );
3524
+ requestAjaxAction = 'czr_published_setting_reset';
3525
+ } else if ( args.is_skope ) {
3526
+ requestAjaxAction = 'czr_published_skope_reset';
3527
+ } else {
3528
+ return dfd.reject( 'reset_ajax_action_not_specified' ).promise();
3529
+ }
3530
+
3531
+ api.consoleLog('in czr_reset submit : ', skope_id, query );
3532
+
3533
+ wp.ajax.post( requestAjaxAction , query )
3534
+ .always( function () {
3535
+ api.state( 'czr-resetting' )( false );
3536
+ })
3537
+ .fail( function ( response ) {
3538
+ if ( '0' === response ) {
3539
+ response = 'not_logged_in';
3540
+ } else if ( '-1' === response ) {
3541
+ response = 'invalid_nonce';
3542
+ }
3543
+
3544
+ if ( 'invalid_nonce' === response ) {
3545
+ self.previewer.cheatin();
3546
+ } else if ( 'not_logged_in' === response ) {
3547
+ self.previewer.preview.iframe.hide();
3548
+ self.previewer.login().done( function() {
3549
+ self.resetChangeset( args );
3550
+ self.previewer.preview.iframe.show();
3551
+ } );
3552
+ }
3553
+ api.consoleLog( requestAjaxAction + ' failed ', query, response );
3554
+ response = api.czr_skopeBase.buildServerResponse( response );
3555
+ api.trigger( 'error', response );
3556
+
3557
+ api.czr_serverNotification( { message: response, status : 'error' } );
3558
+ dfd.reject( response );
3559
+ })
3560
+ .done( function( response ) {
3561
+ dfd.resolve( response );
3562
+ });
3563
+
3564
+ };//submit_reset()
3565
+
3566
+ if ( 0 === processing() && false === api.state( 'czr-resetting' )() ) {
3567
+ submit_reset( skope_id, setId );
3568
+ } else {
3569
+ submitWhenPossible = function () {
3570
+ if ( 0 === processing() && false === api.state( 'czr-resetting' )() ) {
3571
+ api.state.unbind( 'change', submitWhenPossible );
3572
+ submit_reset( skope_id, setId );
3573
+ }
3574
+ };
3575
+ api.state.bind( 'change', submitWhenPossible );
3576
+ }
3577
+
3578
+ return dfd.promise();
3579
+ }
3580
+ });//$.extend
3581
+ })( wp.customize , jQuery, _ );
3582
+
3583
+ var CZRSkopeBaseMths = CZRSkopeBaseMths || {};
3584
+ ( function ( api, $, _ ) {
3585
+ $.extend( CZRSkopeBaseMths, {
3586
+ initWidgetSidebarSpecifics : function() {
3587
+ var self = this;
3588
+ if ( ! self.isExcludedSidebarsWidgets() ) {
3589
+ api.czr_activeSkopeId.bind( function( active_skope ) {
3590
+ self.forceSidebarDirtyRefresh( api.czr_activeSectionId(), active_skope );
3591
+ });
3592
+ }
3593
+ $( document ).bind( 'widget-added', function( e, $o ) {
3594
+ if ( self.isExcludedSidebarsWidgets() )
3595
+ return;
3596
+
3597
+ var wgtIdAttr = $o.closest('.customize-control').attr('id'),
3598
+ wdgtSetId = api.czr_skopeBase.widgetIdToSettingId( wgtIdAttr, 'customize-control-' );
3599
+ if ( ! api.has( wdgtSetId ) ) {
3600
+ throw new Error( 'AN ADDED WIDGET COULD NOT BE BOUND IN SKOPE. ' + wdgtSetId);
3601
+ } else {
3602
+ self.listenAPISettings( wdgtSetId );
3603
+ }
3604
+ });
3605
+ },
3606
+
3607
+
3608
+ forceSidebarDirtyRefresh : function( active_section, active_skope ) {
3609
+ var self = this;
3610
+ if ( self.isExcludedSidebarsWidgets() )
3611
+ return;
3612
+ var _save_state = api.state('saved')();
3613
+ var _debounced = function() {
3614
+ if ( api.section.has( active_section ) && "sidebar" == api.section(active_section).params.type ) {
3615
+ var active_skope = active_skope || api.czr_activeSkopeId(),
3616
+ related_setting_name = 'sidebars_widgets[' + api.section(active_section).params.sidebarId + ']',
3617
+ related_setting_val = self.getSkopeSettingVal( related_setting_name, active_skope );
3618
+ api.czr_skope( active_skope ).updateSkopeDirties( related_setting_name, related_setting_val );
3619
+
3620
+ api.previewer.refresh( { the_dirties : api.czr_skope( active_skope ).dirtyValues() } )
3621
+ .done( function() {
3622
+ api.state('saved')( _save_state );
3623
+ });
3624
+ }
3625
+ };
3626
+ _debounced = _.debounce( _debounced, 500 );
3627
+ _debounced();
3628
+ }
3629
+ } );//$.extend
3630
+ })( wp.customize , jQuery, _ );
3631
+
3632
+ var CZRSkopeMths = CZRSkopeMths || {};
3633
+ ( function ( api, $, _ ) {
3634
+ $.extend( CZRSkopeMths, {
3635
+ initialize: function( skope_id, constructor_options ) {
3636
+ var skope = this;
3637
+ api.Value.prototype.initialize.call( skope, null, constructor_options );
3638
+
3639
+ skope.isReady = $.Deferred();
3640
+ skope.embedded = $.Deferred();
3641
+ skope.el = 'czr-scope-' + skope_id;//@todo replace with a css selector based on the scope name
3642
+ $.extend( skope, constructor_options || {} );
3643
+ skope.visible = new api.Value( true );
3644
+ skope.winner = new api.Value( false ); //is this skope the one that will be applied on front end in the current context?
3645
+ skope.priority = new api.Value(); //shall this skope always win or respect the default skopes priority
3646
+ skope.active = new api.Value( false ); //active, inactive. Are we currently customizing this skope ?
3647
+ skope.dirtyness = new api.Value( false ); //true or false : has this skope been customized ?
3648
+ skope.skopeResetDialogVisibility = new api.Value( false );
3649
+ skope.hasDBValues = new api.Value( false );
3650
+ skope.dirtyValues = new api.Value({});//stores the current customized value.
3651
+ skope.dbValues = new api.Value({});//stores the latest db values => will be updated on each skope synced event
3652
+ skope.changesetValues = new api.Value({});//stores the latest changeset values => will be updated on each skope synced eventsynced event
3653
+ skope.userEventMap = new api.Value( [
3654
+ {
3655
+ trigger : 'click keydown',
3656
+ selector : '.czr-scope-switch, .czr-skp-switch-link',
3657
+ name : 'skope_switch',
3658
+ actions : function() {
3659
+ api.czr_activeSkopeId( skope().id );
3660
+ }
3661
+ },
3662
+ {
3663
+ trigger : 'click keydown',
3664
+ selector : '.czr-scope-reset',
3665
+ name : 'skope_reset_warning',
3666
+ actions : 'reactOnSkopeResetUserRequest'
3667
+ }
3668
+ ]);//module.userEventMap
3669
+ skope.skopeResetDialogVisibility.bind( function( to, from ) {
3670
+ return skope.skopeResetDialogReact( to );
3671
+ }, { deferred : true } );
3672
+ skope.dirtyValues.callbacks.add(function() { return skope.dirtyValuesReact.apply(skope, arguments ); } );
3673
+ skope.changesetValues.callbacks.add(function() { return skope.changesetValuesReact.apply(skope, arguments ); } );
3674
+ skope.dbValues.callbacks.add(function() { return skope.dbValuesReact.apply(skope, arguments ); } );
3675
+ skope.callbacks.add(function() { return skope.skopeReact.apply( skope, arguments ); } );
3676
+ skope.set( _.omit( constructor_options, function( _v, _key ) {
3677
+ return _.contains( [ 'db', 'changeset', 'has_db_val' ], _key );
3678
+ } ) );
3679
+ skope.setupObservableViewValuesCallbacks();
3680
+ skope.dirtyness( ! _.isEmpty( constructor_options.changeset ) );
3681
+ skope.hasDBValues( ! _.isEmpty( constructor_options.db ) );
3682
+ skope.winner( constructor_options.is_winner );
3683
+ skope.embedded
3684
+ .fail( function() {
3685
+ throw new Error('The container of skope ' + skope().id + ' has not been embededd');
3686
+ })
3687
+ .done( function() {
3688
+ skope.setupDOMListeners( skope.userEventMap() , { dom_el : skope.container } );
3689
+
3690
+ skope.isReady.resolve();
3691
+ });
3692
+
3693
+ },//initialize
3694
+ ready : function() {
3695
+ var skope = this;
3696
+ api.czr_skopeBase.skopeWrapperEmbedded.done( function() {
3697
+ try {
3698
+ $.when( skope.embedSkopeDialogBox() ).done( function( $_container ){
3699
+ if ( false !== $_container.length ) {
3700
+ $_container.css('background-color', skope.color );
3701
+ skope.container = $_container;
3702
+ skope.embedded.resolve( $_container );
3703
+ } else {
3704
+ skope.embedded.reject();
3705
+ }
3706
+ });
3707
+ } catch( er ) {
3708
+ api.errorLog( "In skope base : " + er );
3709
+ skope.embedded.reject();
3710
+ }
3711
+ });
3712
+ },
3713
+ dirtyValuesReact : function( to, from ) {
3714
+ var skope = this;
3715
+ skope.dirtyness( ! _.isEmpty( to ) );
3716
+ api.czr_dirtyness( ! _.isEmpty(to) );
3717
+ var ctrlIdDirtynessToClean = [];
3718
+ _.each( from, function( _val, _id ) {
3719
+ if ( _.has( to, _id ) )
3720
+ return;
3721
+ ctrlIdDirtynessToClean.push( _id );
3722
+ });
3723
+ if ( skope().id == api.czr_activeSkopeId() ) {
3724
+ _.each( ctrlIdDirtynessToClean , function( setId ) {
3725
+ if ( ! _.has( api.control( setId ), 'czr_states') )
3726
+ return;
3727
+ api.control( setId ).czr_states( 'isDirty' )( false );
3728
+ });
3729
+ _.each( to, function( _val, _setId ) {
3730
+ if ( ! _.has( api.control( _setId ), 'czr_states') )
3731
+ return;
3732
+ api.control( _setId ).czr_states( 'isDirty' )( true );
3733
+ });
3734
+ }
3735
+ },
3736
+ changesetValuesReact : function( to, from ) {
3737
+ var skope = this,
3738
+ _currentServerDirties = $.extend( true, {}, skope.dirtyValues() );
3739
+ skope.dirtyValues( $.extend( _currentServerDirties, to ) );
3740
+ },
3741
+ dbValuesReact : function( to, from ) {
3742
+ var skope = this;
3743
+ skope.hasDBValues(
3744
+ ! _.isEmpty(
3745
+ 'global' != skope().skope ?
3746
+ to :
3747
+ _.omit( to, function( _val, _id ) {
3748
+ return ! api.czr_skopeBase.isThemeSetting( _id );
3749
+ })
3750
+ )
3751
+ );
3752
+ var ctrlIdDbToReset = [];
3753
+ _.each( from, function( _val, _id ) {
3754
+ if ( _.has( to, _id ) )
3755
+ return;
3756
+ ctrlIdDbToReset.push( _id );
3757
+ });
3758
+ if ( skope().id == api.czr_activeSkopeId() ) {
3759
+ _.each( ctrlIdDbToReset , function( setId ) {
3760
+ if ( ! _.has( api.control( setId ), 'czr_states') )
3761
+ return;
3762
+ api.control( setId ).czr_states( 'hasDBVal' )( false );
3763
+ });
3764
+ _.each( to, function( _val, _setId ) {
3765
+ if ( ! _.has( api.control( _setId ), 'czr_states') )
3766
+ return;
3767
+
3768
+ api.control( _setId ).czr_states( 'hasDBVal' )( true );
3769
+ });
3770
+ }
3771
+ },
3772
+ skopeReact : function( to, from ) {
3773
+ var skope = this,
3774
+ _current_collection = [],
3775
+ _new_collection = [];
3776
+ if ( ! api.czr_skopeBase.isSkopeRegisteredInCollection( to.id ) ) {
3777
+ _current_collection = $.extend( true, [], api.czr_skopeCollection() );
3778
+ _current_collection.push( to );
3779
+ api.czr_skopeCollection( _current_collection );
3780
+ }
3781
+ else {
3782
+ _current_collection = $.extend( true, [], api.czr_skopeCollection() );
3783
+ _new_collection = _current_collection;
3784
+ _.each( _current_collection, function( _skope, _key ) {
3785
+ if ( _skope.id != skope().id )
3786
+ return;
3787
+ _new_collection[_key] = to;
3788
+ });
3789
+ api.czr_skopeCollection( _new_collection );
3790
+ }
3791
+ },
3792
+ setupObservableViewValuesCallbacks : function() {
3793
+ var skope = this;
3794
+ skope.visible.bind( function( is_visible ){
3795
+ if ( 'pending' == skope.embedded.state() ) {
3796
+ skope.embedded.done( function() {
3797
+ skope.container.toggle( is_visible );
3798
+ });
3799
+ } else {
3800
+ skope.container.toggle( is_visible );
3801
+ }
3802
+
3803
+ });
3804
+ skope.active.bind( function() {
3805
+ if ( 'pending' == skope.embedded.state() ) {
3806
+ skope.embedded.done( function() {
3807
+ skope.activeStateReact.apply( skope, arguments );
3808
+ });
3809
+ } else {
3810
+ skope.activeStateReact.apply( skope, arguments );
3811
+ }
3812
+ });
3813
+
3814
+ skope.dirtyness.bind( function() {
3815
+ if ( 'pending' == skope.embedded.state() ) {
3816
+ skope.embedded.done( function() {
3817
+ skope.dirtynessReact.apply( skope, arguments );
3818
+ });
3819
+ } else {
3820
+ skope.dirtynessReact.apply( skope, arguments );
3821
+ }
3822
+ });
3823
+
3824
+ skope.hasDBValues.bind( function() {
3825
+ if ( 'pending' == skope.embedded.state() ) {
3826
+ skope.embedded.done( function() {
3827
+ skope.hasDBValuesReact.apply( skope, arguments );
3828
+ });
3829
+ } else {
3830
+ skope.hasDBValuesReact.apply( skope, arguments );
3831
+ }
3832
+ });
3833
+
3834
+ skope.winner.bind( function() {
3835
+ if ( 'pending' == skope.embedded.state() ) {
3836
+ skope.embedded.done( function() {
3837
+ skope.winnerReact.apply( skope, arguments );
3838
+ });
3839
+ } else {
3840
+ skope.winnerReact.apply( skope, arguments );
3841
+ }
3842
+ });
3843
+ },//setupObservableViewValuesCallbacks
3844
+ activeStateReact : function( to, from ){
3845
+ var skope = this;
3846
+ skope.container.toggleClass('inactive', ! to ).toggleClass( 'active', to );
3847
+ $('.czr-scope-switch', skope.container).toggleClass('fa-toggle-on', to).toggleClass('fa-toggle-off', !to);
3848
+ },
3849
+ dirtynessReact : function( to, from ) {
3850
+ var skope = this;
3851
+ $.when( this.container.toggleClass( 'dirty', to ) ).done( function() {
3852
+ if ( to )
3853
+ $( '.czr-scope-reset', skope.container).fadeIn('slow').attr('title', [ serverControlParams.i18n.skope['Reset the current customizations for'], skope().title ].join(' ') );
3854
+ else if ( ! skope.hasDBValues() )
3855
+ $( '.czr-scope-reset', skope.container).fadeOut('fast');
3856
+ });
3857
+ },
3858
+ hasDBValuesReact : function( to, from ) {
3859
+ var skope = this;
3860
+ $.when( skope.container.toggleClass('has-db-val', to ) ).done( function() {
3861
+ if ( to ) {
3862
+ $( '.czr-scope-reset', skope.container)
3863
+ .fadeIn( 'slow')
3864
+ .attr( 'title', [
3865
+ 'global' == skope().skope ? serverControlParams.i18n.skope['Reset the theme options published sitewide'] : serverControlParams.i18n.skope['Reset your website published options for'],
3866
+ 'global' == skope().skope ? '' : skope().title
3867
+ ].join(' ') );
3868
+ }
3869
+ else if ( ! skope.dirtyness() ) {
3870
+ $( '.czr-scope-reset', skope.container ).fadeOut('fast');
3871
+ }
3872
+ });
3873
+ },
3874
+ winnerReact : function( is_winner ) {
3875
+ var skope = this;
3876
+ this.container.toggleClass('is_winner', is_winner );
3877
+
3878
+ if ( is_winner ) {
3879
+ _.each( api.czr_currentSkopesCollection(), function( _skope ) {
3880
+ if ( _skope.id == skope().id )
3881
+ return;
3882
+ var _current_model = $.extend( true, {}, _skope );
3883
+ $.extend( _current_model, { is_winner : false } );
3884
+ api.czr_skope( _skope.id )( _current_model );
3885
+ });
3886
+ }
3887
+ },
3888
+ updateSkopeDirties : function( setId, new_val ) {
3889
+ var skope = this,
3890
+ shortSetId = api.CZR_Helpers.getOptionName( setId );
3891
+ if ( ! api.czr_skopeBase.isSettingSkopeEligible( setId ) && 'global' != skope().skope )
3892
+ return api.czr_skope( api.czr_skopeBase.getGlobalSkopeId() ).updateSkopeDirties( setId, new_val );
3893
+
3894
+ var current_dirties = $.extend( true, {}, skope.dirtyValues() ),
3895
+ _dirtyCustomized = {};
3896
+
3897
+ _dirtyCustomized[ setId ] = new_val;
3898
+ skope.dirtyValues.set( $.extend( current_dirties , _dirtyCustomized ) );
3899
+ return skope.dirtyValues();
3900
+ },
3901
+ getSkopeSettingDirtyness : function( setId ) {
3902
+ var skope = this;
3903
+ return skope.getSkopeSettingAPIDirtyness( setId ) || skope.getSkopeSettingChangesetDirtyness( setId );
3904
+ },
3905
+ getSkopeSettingAPIDirtyness : function( setId ) {
3906
+ var skope = this;
3907
+ return _.has( skope.dirtyValues(), api.CZR_Helpers.build_setId( setId ) );
3908
+ },
3909
+ getSkopeSettingChangesetDirtyness : function( setId ) {
3910
+ var skope = this;
3911
+ if ( ! api.czr_isChangeSetOn() )
3912
+ return skope.getSkopeSettingAPIDirtyness( setId );
3913
+ return _.has( skope.changesetValues(), api.CZR_Helpers.build_setId( setId ) );
3914
+ },
3915
+ hasSkopeSettingDBValues : function( setId ) {
3916
+ var skope = this,
3917
+ _setId = api.CZR_Helpers.build_setId(setId);
3918
+
3919
+ return ! _.isUndefined( api.czr_skope( api.czr_activeSkopeId() ).dbValues()[_setId] );
3920
+ }
3921
+ });//$.extend(
3922
+ })( wp.customize , jQuery, _ );
3923
+ var CZRSkopeMths = CZRSkopeMths || {};
3924
+ ( function ( api, $, _ ) {
3925
+ $.extend( CZRSkopeMths, {
3926
+ embedSkopeDialogBox : function() {
3927
+ var skope = this,
3928
+ skope_model = $.extend( true, {}, skope() ),
3929
+ _tmpl = '';
3930
+ if ( ! $('#customize-header-actions').find('.czr-scope-switcher').length ) {
3931
+ throw new Error('The skope switcher wrapper is not printed, the skope can not be embedded.');
3932
+ }
3933
+ try {
3934
+ _tmpl = wp.template('czr-skope')( _.extend( skope_model, { el : skope.el } ) );
3935
+ } catch( er ) {
3936
+ api.errorLog( 'Error when parsing the template of a skope' + er );
3937
+ return false;
3938
+ }
3939
+
3940
+ $('.czr-skopes-wrapper', '#customize-header-actions').append( $( _tmpl ) );
3941
+ return $( '.' + skope.el , '.czr-skopes-wrapper' );
3942
+ },
3943
+ renderResetWarningTmpl : function() {
3944
+ var skope = this,
3945
+ skope_model = $.extend( true, {}, skope() ),
3946
+ _tmpl = '',
3947
+ warning_message,
3948
+ success_message;
3949
+
3950
+ if ( skope.dirtyness() ) {
3951
+ warning_message = [
3952
+ serverControlParams.i18n.skope['Please confirm that you want to reset your current ( not published ) customizations for'],
3953
+ skope().ctx_title
3954
+ ].join(' ');
3955
+ success_message = [
3956
+ serverControlParams.i18n.skope['Your customizations have been reset for'],
3957
+ skope().ctx_title
3958
+ ].join(' ');
3959
+ } else {
3960
+ warning_message = [
3961
+ 'global' == skope().skope ? serverControlParams.i18n.skope['Please confirm that you want to reset your sitewide published customizations. Note : this will not reset the customizations made in other option scopes'] : serverControlParams.i18n.skope['Please confirm that you want to reset your published customizations for'],
3962
+ 'global' == skope().skope ? '' : skope().ctx_title
3963
+ ].join(' ');
3964
+ success_message = [
3965
+ serverControlParams.i18n.skope['Your published customizations have been reset for'],
3966
+ skope().title
3967
+ ].join(' ');
3968
+ }
3969
+
3970
+ try {
3971
+ _tmpl = wp.template( 'czr-skope-pane' )(
3972
+ _.extend( skope_model, {
3973
+ el : skope.el,
3974
+ warning_message : warning_message + '.',
3975
+ success_message : success_message + '.'
3976
+ } )
3977
+ );
3978
+ } catch( er ) {
3979
+ api.errorLog( 'Error when parsing the the reset skope template : ' + er );
3980
+ return false;
3981
+ }
3982
+
3983
+ $('#customize-preview').after( $( _tmpl ) );
3984
+
3985
+ return $( '#czr-skope-pane' );
3986
+ },
3987
+ getEl : function() {
3988
+ var skope = this;
3989
+ return $( skope.el, '#customize-header-actions');
3990
+ }
3991
+ });//$.extend()
3992
+ })( wp.customize , jQuery, _ );
3993
+
3994
+ var CZRSkopeMths = CZRSkopeMths || {};
3995
+ ( function ( api, $, _ ) {
3996
+ $.extend( CZRSkopeMths, {
3997
+ reactOnSkopeResetUserRequest : function() {
3998
+ var skope = this,
3999
+ _fireReaction = function() {
4000
+ api.state( 'czr-resetting')( true );
4001
+ if ( api.czr_activeSkopeId() != skope().id ) {
4002
+ api.czr_activeSkopeId( skope().id )
4003
+ .done( function() {
4004
+ skope.skopeResetDialogVisibility( ! skope.skopeResetDialogVisibility() ).done( function() {
4005
+ api.state( 'czr-resetting')( false );
4006
+ });
4007
+
4008
+ });
4009
+ } else {
4010
+ skope.skopeResetDialogVisibility( ! skope.skopeResetDialogVisibility() ).done( function() {
4011
+ api.state( 'czr-resetting')( false );
4012
+ });
4013
+ }
4014
+ };
4015
+ if ( ( api.state( 'czr-resetting')() || 0 !== api.state( 'processing' )() ) ) {
4016
+ api.czr_serverNotification( {
4017
+ message: 'Slow down, you move too fast !',
4018
+ status : 'success',
4019
+ auto_collapse : true
4020
+ });
4021
+ return;
4022
+ }
4023
+ if ( api.czr_activeSkopeId() != skope().id && api.czr_skope( api.czr_activeSkopeId() ).skopeResetDialogVisibility() ) {
4024
+ api.czr_skope( api.czr_activeSkopeId() ).skopeResetDialogVisibility( false ).done( function() {
4025
+ _fireReaction();
4026
+ });
4027
+ } else {
4028
+ _fireReaction();
4029
+ }
4030
+ },
4031
+ skopeResetDialogReact : function( visible ) {
4032
+ var skope = this, dfd = $.Deferred();
4033
+ skope.userResetEventMap = skope.userResetEventMap || new api.Value( [
4034
+ {
4035
+ trigger : 'click keydown',
4036
+ selector : '.czr-scope-reset-cancel',
4037
+ name : 'skope_reset_cancel',
4038
+ actions : function() {
4039
+ skope.skopeResetDialogVisibility( ! skope.skopeResetDialogVisibility() );
4040
+ }
4041
+ },
4042
+ {
4043
+ trigger : 'click keydown',
4044
+ selector : '.czr-scope-do-reset',
4045
+ name : 'skope_do_reset',
4046
+ actions : 'doResetSkopeValues'
4047
+ }
4048
+ ]
4049
+ );
4050
+
4051
+ if ( visible ) {
4052
+ api.czr_isResettingSkope( skope().id );
4053
+ $.when( skope.renderResetWarningTmpl() ).done( function( $_container ) {
4054
+ skope.resetPanel = $_container;
4055
+ skope.resetPanel.addClass( skope.dirtyness() ? 'dirty-reset' : 'db-reset' );
4056
+ skope.setupDOMListeners( skope.userResetEventMap() , { dom_el : skope.resetPanel } );
4057
+ }).then( function() {
4058
+ setTimeout( function() {
4059
+ var _height = $('#customize-preview').height();
4060
+ skope.resetPanel.css( 'line-height', _height +'px' ).css( 'height', _height + 'px' );
4061
+ $('body').addClass('czr-skope-pane-open');
4062
+ }, 50 );
4063
+ });
4064
+ } else {
4065
+ $.when( $('body').removeClass('czr-skope-pane-open') ).done( function() {
4066
+ if ( _.has( skope, 'resetPanel') && false !== skope.resetPanel.length ) {
4067
+ setTimeout( function() {
4068
+ skope.resetPanel.remove();
4069
+ api.czr_isResettingSkope( false );
4070
+ }, 300 );
4071
+ }
4072
+ });
4073
+ }
4074
+ _.delay( function() { dfd.resolve(); }, 350 );
4075
+
4076
+ return dfd.promise();
4077
+ },
4078
+ doResetSkopeValues : function() {
4079
+ var skope = this,
4080
+ skope_id = skope().id,
4081
+ reset_method = skope.dirtyness() ? '_resetSkopeDirties' : '_resetSkopeAPIValues',
4082
+ _updateAPI = function() {
4083
+ var _silentUpdate = function() {
4084
+ api.czr_skopeBase.processSilentUpdates( { refresh : false } )
4085
+ .fail( function() { api.consoleLog( 'Silent update failed after resetting skope : ' + skope_id ); } )
4086
+ .done( function() {
4087
+ $.when( $('.czr-reset-warning', skope.resetPanel ).fadeOut('300') ).done( function() {
4088
+ $.when( $('.czr-reset-success', skope.resetPanel ).fadeIn('300') ).done( function() {
4089
+ _.delay( function() {
4090
+ api.czr_isResettingSkope( false );
4091
+ skope.skopeResetDialogVisibility( false );
4092
+ }, 2000 );
4093
+ });
4094
+ });
4095
+ });
4096
+ };
4097
+
4098
+ skope[reset_method]()
4099
+ .done( function() {
4100
+ api.previewer.refresh()
4101
+ .fail( function( refresh_data ) {
4102
+ api.consoleLog('SKOPE RESET REFRESH FAILED', refresh_data );
4103
+ })
4104
+ .done( function( refresh_data ) {
4105
+ if ( 'global' == api.czr_skope( skope_id )().skope && '_resetSkopeAPIValues' == reset_method ) {
4106
+ var _sentSkopeCollection,
4107
+ _serverGlobalDbValues = {},
4108
+ _skope_opt_name = api.czr_skope( skope_id )().opt_name;
4109
+
4110
+ if ( ! _.isUndefined( refresh_data.skopesServerData ) && _.has( refresh_data.skopesServerData, 'czr_skopes' ) ) {
4111
+ _sentSkopeCollection = refresh_data.skopesServerData.czr_skopes;
4112
+ if ( _.isUndefined( _.findWhere( _sentSkopeCollection, { opt_name : _skope_opt_name } ) ) ) {
4113
+ _serverGlobalDbValues = _.findWhere( _sentSkopeCollection, { opt_name : _skope_opt_name } ).db || {};
4114
+ }
4115
+ }
4116
+ api.czr_skopeBase.maybeSynchronizeGlobalSkope( { isGlobalReset : true, isSkope : true, skopeIdToReset : skope_id } )
4117
+ .done( function() {
4118
+ _silentUpdate();
4119
+ });
4120
+ } else {
4121
+ _silentUpdate();
4122
+ }
4123
+ });
4124
+
4125
+ });
4126
+ };//_updateAPI
4127
+
4128
+ $('body').addClass('czr-resetting-skope');
4129
+ api.czr_skopeReset[ skope.dirtyness() ? 'resetChangeset' : 'resetPublished' ](
4130
+ { skope_id : skope().id, is_skope : true } )
4131
+ .always( function() {
4132
+ $('body').removeClass('czr-resetting-skope');//hides the spinner
4133
+ })
4134
+ .done( function( r ) {
4135
+ _updateAPI();
4136
+ })
4137
+ .fail( function( r ) {
4138
+ skope.skopeResetDialogVisibility( false );
4139
+ api.consoleLog('Skope reset failed', r );
4140
+ });
4141
+ },
4142
+ _resetSkopeDirties : function() {
4143
+ var skope = this, dfd = $.Deferred();
4144
+ skope.dirtyValues({});
4145
+ skope.changesetValues({});
4146
+ return dfd.resolve().promise();
4147
+ },
4148
+ _resetSkopeAPIValues : function() {
4149
+ var skope = this, dfd = $.Deferred();
4150
+ skope.dbValues( {} );
4151
+ return dfd.resolve().promise();
4152
+ }
4153
+ });//$.extend(
4154
+ })( wp.customize , jQuery, _ );
4155
+ ( function ( api, $, _ ) {
4156
+ api.Value.prototype.set = function( to, o ) {
4157
+ var from = this._value, dfd = $.Deferred(), self = this, _promises = [];
4158
+
4159
+ to = this._setter.apply( this, arguments );
4160
+ to = this.validate( to );
4161
+ args = _.extend( { silent : false }, _.isObject( o ) ? o : {} );
4162
+ if ( null === to || _.isEqual( from, to ) ) {
4163
+ return dfd.resolveWith( self, [ to, from, o ] ).promise();
4164
+ }
4165
+
4166
+ this._value = to;
4167
+ this._dirty = true;
4168
+ if ( true === args.silent ) {
4169
+ return dfd.resolveWith( self, [ to, from, o ] ).promise();
4170
+ }
4171
+
4172
+ if ( this._deferreds ) {
4173
+ _.each( self._deferreds, function( _prom ) {
4174
+ _promises.push( _prom.apply( null, [ to, from, o ] ) );
4175
+ });
4176
+
4177
+ $.when.apply( null, _promises )
4178
+ .fail( function() { api.errorLog( 'A deferred callback failed in api.Value::set()'); })
4179
+ .then( function() {
4180
+ self.callbacks.fireWith( self, [ to, from, o ] );
4181
+ dfd.resolveWith( self, [ to, from, o ] );
4182
+ });
4183
+ } else {
4184
+ this.callbacks.fireWith( this, [ to, from, o ] );
4185
+ return dfd.resolveWith( self, [ to, from, o ] ).promise( self );
4186
+ }
4187
+ return dfd.promise( self );
4188
+ };
4189
+ api.Value.prototype.bind = function() {
4190
+ var self = this,
4191
+ _isDeferred = false,
4192
+ _cbs = [];
4193
+
4194
+ $.each( arguments, function( _key, _arg ) {
4195
+ if ( ! _isDeferred )
4196
+ _isDeferred = _.isObject( _arg ) && _arg.deferred;
4197
+ if ( _.isFunction( _arg ) )
4198
+ _cbs.push( _arg );
4199
+ });
4200
+
4201
+ if ( _isDeferred ) {
4202
+ self._deferreds = self._deferreds || [];
4203
+ _.each( _cbs, function( _cb ) {
4204
+ if ( ! _.contains( _cb, self._deferreds ) )
4205
+ self._deferreds.push( _cb );
4206
+ });
4207
+ } else {
4208
+ self.callbacks.add.apply( self.callbacks, arguments );
4209
+ }
4210
+ return this;
4211
+ };
4212
+ api.Setting.prototype.silent_set =function( to, dirtyness ) {
4213
+ var from = this._value,
4214
+ _save_state = api.state('saved')();
4215
+
4216
+ to = this._setter.apply( this, arguments );
4217
+ to = this.validate( to );
4218
+ if ( null === to || _.isEqual( from, to ) ) {
4219
+ return this;
4220
+ }
4221
+
4222
+ this._value = to;
4223
+ this._dirty = ( _.isUndefined( dirtyness ) || ! _.isBoolean( dirtyness ) ) ? this._dirty : dirtyness;
4224
+
4225
+ this.callbacks.fireWith( this, [ to, from, { silent : true } ] );
4226
+ api.state('saved')( _save_state );
4227
+ return this;
4228
+ };
4229
+ })( wp.customize , jQuery, _ );
4230
+ ( function ( api, $, _ ) {
4231
+ api.bind('ready', function() {
4232
+ if ( ! serverControlParams.isSkopOn )
4233
+ return;
4234
+ var _coreQuery = api.previewer.query;
4235
+ api.previewer.query = function( queryVars ) {
4236
+ if ( ! serverControlParams.isSkopOn ) {
4237
+ return _coreQuery.apply( this );
4238
+ }
4239
+ if ( ! _.has( api, 'czr_skope') ) {
4240
+ api.consoleLog('QUERY : SKOPE IS NOT FULLY READY YEY. FALLING BACK ON CORE QUERY');
4241
+ return _coreQuery.apply( this );
4242
+ }
4243
+ if ( 'pending' == api.czr_initialSkopeCollectionPopulated.state() ) {
4244
+ api.consoleLog('QUERY : INITIAL SKOPE COLLECTION NOT POPULATED YET. FALLING BACK ON CORE QUERY');
4245
+ return _coreQuery.apply( this );
4246
+ }
4247
+ if ( 'pending' == api.czr_isPreviewerSkopeAware.state() ) {
4248
+ api.czr_isPreviewerSkopeAware.resolve();
4249
+ }
4250
+ if ( ! _.isObject( queryVars ) && 'resolved' == api.czr_initialSkopeCollectionPopulated.state() && 'resolved' == api.czr_initialSkopeCollectionPopulated.state() ) {
4251
+ return _coreQuery.apply( this );
4252
+ }
4253
+ if ( _.isUndefined( queryVars.skope_id ) || ! _.isString( queryVars.skope_id ) ) {
4254
+ queryVars.skope_id = api.czr_activeSkopeId() || api.czr_skopeBase.getGlobalSkopeId();
4255
+ }
4256
+
4257
+ var globalCustomized = {},
4258
+ skopeCustomized = {},
4259
+ _defaults = {
4260
+ skope_id : null,
4261
+ action : null,
4262
+ the_dirties : {},
4263
+ dyn_type : null,
4264
+ opt_name : null
4265
+ },
4266
+ _to_return;
4267
+
4268
+ queryVars = $.extend( _defaults, queryVars );
4269
+ if ( ! _.isObject( queryVars.the_dirties ) ) {
4270
+ api.consoleLog('QUERY PARAMS : ', queryVars );
4271
+ throw new Error( 'QUERY DIRTIES MUST BE AN OBJECT. Requested action : ' + queryVars.action );
4272
+ }
4273
+ if ( 'pending' != api.czr_isPreviewerSkopeAware.state() && _.isNull( queryVars.skope_id ) ) {
4274
+ api.consoleLog('QUERY PARAMS : ', queryVars );
4275
+ throw new Error( 'OVERRIDEN QUERY : NO SKOPE ID. FALLING BACK ON CORE QUERY. Requested action : ' + queryVars.action );
4276
+ }
4277
+ if ( ! _.contains( [ null, 'refresh', 'save', 'reset', 'changeset_update' ], queryVars.action ) ) {
4278
+ api.consoleLog('QUERY PARAMS : ', queryVars );
4279
+ throw new Error( 'A REQUESTED QUERY HAS NO AUTHORIZED ACTION. Requested action : ' + queryVars.action );
4280
+ }
4281
+ var _getSkopesCustomized = function() {
4282
+ if ( 'pending' == api.czr_initialSkopeCollectionPopulated.state() )
4283
+ return {};
4284
+ var _skpCust = {};
4285
+ _.each( api.czr_currentSkopesCollection(), function( _skp ) {
4286
+ if ( 'global' == _skp.skope )
4287
+ return;
4288
+ _skpCust[_skp.id] = api.czr_skopeBase.getSkopeDirties( _skp.id );
4289
+ } );
4290
+ return _skpCust;
4291
+ };
4292
+ if ( _.isNull( queryVars.the_dirties ) || _.isEmpty( queryVars.the_dirties ) ) {
4293
+ globalCustomized = api.dirtyValues( { unsaved: queryVars.excludeCustomizedSaved || false } );
4294
+ skopeCustomized = _getSkopesCustomized();
4295
+ } else {
4296
+ if ( 'global' == api.czr_skopeBase.getActiveSkopeName() )
4297
+ globalCustomized = queryVars.the_dirties;
4298
+ else
4299
+ skopeCustomized[ api.czr_activeSkopeId() ] = queryVars.the_dirties;
4300
+ }
4301
+ switch( queryVars.action ) {
4302
+ case null :
4303
+ case 'refresh' :
4304
+ break;
4305
+
4306
+ case 'changeset_update' :
4307
+ if ( _.isUndefined( queryVars.opt_name ) ) {
4308
+ throw new Error('Missing opt_name param in the changeset_update query for skope : ' + queryVars.skope_id );
4309
+ }
4310
+ break;
4311
+
4312
+
4313
+ case 'save' :
4314
+ if ( _.isNull( queryVars.dyn_type ) )
4315
+ queryVars.dyn_type = api.czr_skope( queryVars.skope_id )().dyn_type;//post_meta, term_meta, user_meta, trans, option
4316
+ if ( _.isNull( queryVars.dyn_type ) || _.isUndefined( queryVars.dyn_type ) ) {
4317
+ throw new Error( 'QUERY : A SAVE QUERY MUST HAVE A VALID DYN TYPE.' + queryVars.skope_id );
4318
+ }
4319
+ break;
4320
+
4321
+ case 'reset' :
4322
+ if ( _.isNull( queryVars.dyn_type ) )
4323
+ queryVars.dyn_type = api.czr_skope( queryVars.skope_id )().dyn_type;//post_meta, term_meta, user_meta, trans, option
4324
+ if ( _.isNull( queryVars.dyn_type ) || _.isUndefined( queryVars.dyn_type ) ) {
4325
+ throw new Error( 'QUERY : A RESET QUERY MUST HAVE A VALID DYN TYPE.' + queryVars.skope_id );
4326
+ }
4327
+ break;
4328
+ }
4329
+ var _current_skopes = {};
4330
+ _.each( api.czr_currentSkopesCollection(), function( _skp ) {
4331
+ _current_skopes[_skp.skope] = { id : _skp.id, opt_name : _skp.opt_name };
4332
+ });
4333
+ _to_return = {
4334
+ wp_customize: 'on',
4335
+ customized: '{}' == JSON.stringify( globalCustomized ) ? '{\"__not_customized__\"}' : JSON.stringify( globalCustomized ),
4336
+ skopeCustomized: JSON.stringify( skopeCustomized ),
4337
+ nonce: this.nonce.preview,
4338
+ skope: api.czr_skope( queryVars.skope_id )().skope,
4339
+ level_id: api.czr_skope( queryVars.skope_id )().level,
4340
+ skope_id: queryVars.skope_id,
4341
+ dyn_type: queryVars.dyn_type,
4342
+ opt_name: ! _.isNull( queryVars.opt_name ) ? queryVars.opt_name : api.czr_skope( queryVars.skope_id )().opt_name,
4343
+ obj_id: api.czr_skope( queryVars.skope_id )().obj_id,
4344
+ current_skopes: JSON.stringify( _current_skopes ) || {},
4345
+ channel: this.channel(),
4346
+ revisionIndex: api._latestRevision
4347
+ };
4348
+ if ( api.czr_isChangeSetOn() ) {
4349
+ _to_return = $.extend( _to_return , {
4350
+ customize_theme: api.settings.theme.stylesheet,
4351
+ customize_changeset_uuid: api.settings.changeset.uuid
4352
+ });
4353
+ }
4354
+ else {
4355
+ _to_return = $.extend( _to_return , {
4356
+ theme: api.settings.theme.stylesheet
4357
+ });
4358
+ }
4359
+ return _to_return;
4360
+
4361
+ };//api.previewer.query
4362
+ });//api.bind('ready')
4363
+ })( wp.customize , jQuery, _ );
4364
+ ( function ( api, $, _ ) {
4365
+ api.bind( 'czr-skope-started', function() {
4366
+ api.previewer.save = function( args ) {
4367
+ return api.czr_skopeSave.save();
4368
+ };
4369
+ });//api.bind('ready')
4370
+ })( wp.customize , jQuery, _ );
4371
+ (function (api, $, _) {
4372
+ if ( ! serverControlParams.isSkopOn )
4373
+ return;
4374
+ api.Element.synchronizer.checkbox.update = function( to ) {
4375
+ this.element.prop( 'checked', to );
4376
+ this.element.iCheck('update');
4377
+ };
4378
+
4379
+ var _original = api.Element.synchronizer.val.update;
4380
+ api.Element.synchronizer.val.update = function(to) {
4381
+ var self = this,
4382
+ _modifySynchronizer = function() {
4383
+ if ( self.element.is('select') ) {
4384
+ self.element.val(to).trigger('change');
4385
+ } else if ( self.element.hasClass('wp-color-picker') ) {
4386
+ self.element.val(to).trigger('change');
4387
+ }
4388
+ else {
4389
+ self.element.val( to );
4390
+ }
4391
+ };
4392
+ if ( serverControlParams.isSkopOn ) {
4393
+ if ( 'resolved' != api.czr_skopeReady.state() ) {
4394
+ return _original.call( self, to );
4395
+ } else {
4396
+ api.czr_skopeReady.then( function () {
4397
+ _modifySynchronizer();
4398
+ });
4399
+ }
4400
+ } else {
4401
+ _modifySynchronizer();
4402
+ }
4403
+ };
4404
+
4405
+ api.Element.synchronizer.val.refresh = function() {
4406
+ var syncApiInstance = this;
4407
+ if ( this.element.is('select') && _.isNull( this.element.val() ) ) {
4408
+ if ( _.isArray( syncApiInstance() ) )
4409
+ return [];
4410
+ else if ( _.isObject( syncApiInstance() ) )
4411
+ return {};
4412
+ else
4413
+ return '';
4414
+ } else {
4415
+ return this.element.val();
4416
+ }
4417
+ };
4418
+ })( wp.customize , jQuery, _ );
4419
+ ( function ( api, $, _ ) {
4420
+ var coreRefresh = api.Previewer.prototype.refresh;
4421
+ var _new_refresh = function( params ) {
4422
+ params = _.extend({
4423
+ waitSkopeSynced : true,
4424
+ the_dirties : {}
4425
+ },
4426
+ params
4427
+ );
4428
+
4429
+ var previewer = this, dfd = $.Deferred();
4430
+ if ( ! serverControlParams.isSkopOn ) {
4431
+ return dfd.resolve().promise();
4432
+ }
4433
+
4434
+ if ( ! _.has( api, 'czr_activeSkopeId') || _.isUndefined( api.czr_activeSkopeId() ) ) {
4435
+ api.consoleLog( 'The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method.');
4436
+ }
4437
+ if ( ! _.has( api, 'czr_activeSkopeId') ) {
4438
+ if ( 'resolved' != api.czr_skopeReady.state() ) {
4439
+ api.czr_skopeReady.done( function() {
4440
+ _new_refresh.apply( api.previewer, params );
4441
+ });
4442
+ coreRefresh.apply( previewer );
4443
+ return dfd.resolve().promise();
4444
+ }
4445
+ }
4446
+ previewer.send( 'loading-initiated' );
4447
+
4448
+ previewer.abort();
4449
+
4450
+ var query_params = api.czr_getSkopeQueryParams({
4451
+ skope_id : api.czr_activeSkopeId(),
4452
+ action : 'refresh',
4453
+ the_dirties : params.the_dirties || {}
4454
+ });
4455
+
4456
+ previewer.loading = new api.PreviewFrame({
4457
+ url: previewer.url(),
4458
+ previewUrl: previewer.previewUrl(),
4459
+ query: previewer.query( query_params ) || {},
4460
+ container: previewer.container,
4461
+ signature: 'WP_CUSTOMIZER_SIGNATURE'//will be deprecated in 4.7
4462
+ });
4463
+
4464
+
4465
+ previewer.settingsModifiedWhileLoading = {};
4466
+ onSettingChange = function( setting ) {
4467
+ previewer.settingsModifiedWhileLoading[ setting.id ] = true;
4468
+ };
4469
+ api.bind( 'change', onSettingChange );
4470
+
4471
+ previewer.loading.always( function() {
4472
+ api.unbind( 'change', onSettingChange );
4473
+ } );
4474
+ if ( ! api.czr_isChangeSetOn() ) {
4475
+ previewer._previousPreview = previewer._previousPreview || previewer.preview;
4476
+ }
4477
+
4478
+ previewer.loading.done( function( readyData ) {
4479
+ var loadingFrame = this, onceSynced;
4480
+
4481
+ previewer.preview = loadingFrame;
4482
+ previewer.targetWindow( loadingFrame.targetWindow() );
4483
+ previewer.channel( loadingFrame.channel() );
4484
+ onceSynced = function( skopesServerData ) {
4485
+ loadingFrame.unbind( 'synced', onceSynced );
4486
+ loadingFrame.unbind( 'czr-skopes-synced', onceSynced );
4487
+
4488
+ if ( previewer._previousPreview ) {
4489
+ previewer._previousPreview.destroy();
4490
+ } //before WP 4.7
4491
+ else {
4492
+ if ( previewer.preview )
4493
+ previewer.preview.destroy();
4494
+ }
4495
+
4496
+ previewer._previousPreview = previewer.preview;
4497
+ previewer.deferred.active.resolve();
4498
+ delete previewer.loading;
4499
+
4500
+ api.trigger( 'pre_refresh_done', { previewer : previewer, skopesServerData : skopesServerData || {} } );
4501
+ dfd.resolve( { previewer : previewer, skopesServerData : skopesServerData || {} } );
4502
+ };
4503
+ if ( ! api.czr_isChangeSetOn() ) {
4504
+ previewer.send( 'sync', {
4505
+ scroll: previewer.scroll,
4506
+ settings: api.get()
4507
+ });
4508
+ }
4509
+
4510
+ if ( params.waitSkopeSynced ) {
4511
+ loadingFrame.bind( 'czr-skopes-synced', onceSynced );
4512
+ } else {
4513
+ loadingFrame.bind( 'synced', onceSynced );
4514
+ }
4515
+ previewer.trigger( 'ready', readyData );
4516
+ });
4517
+ previewer.loading.fail( function( reason, location ) {
4518
+ api.consoleLog('LOADING FAILED : ' , arguments );
4519
+ previewer.send( 'loading-failed' );
4520
+ if ( ! api.czr_isChangeSetOn() ) {
4521
+ if ( 'redirect' === reason && location ) {
4522
+ previewer.previewUrl( location );
4523
+ }
4524
+ }
4525
+
4526
+ if ( 'logged out' === reason ) {
4527
+ if ( previewer.preview ) {
4528
+ previewer.preview.destroy();
4529
+ delete previewer.preview;
4530
+ }
4531
+
4532
+ previewer.login().done( previewer.refresh );
4533
+ }
4534
+
4535
+ if ( 'cheatin' === reason ) {
4536
+ previewer.cheatin();
4537
+ }
4538
+ dfd.reject( reason );
4539
+ });
4540
+
4541
+ return dfd.promise();
4542
+ };//_new_refresh()
4543
+ api.bind( 'czr-skope-started' , function() {
4544
+ czr_override_refresh_for_skope();
4545
+ api.Previewer.prototype.refresh = _new_refresh;
4546
+ });
4547
+ api.czr_getSkopeQueryParams = function( params ) {
4548
+ if ( ! api.czr_isChangeSetOn() )
4549
+ return params;
4550
+ params = ! _.isObject(params) ? {} : params;
4551
+ var _action = params.action || 'refresh';
4552
+ switch( _action ) {
4553
+ case 'refresh' :
4554
+ params = $.extend( params, { excludeCustomizedSaved: true } );
4555
+ break;
4556
+ }
4557
+ return params;
4558
+ };
4559
+ czr_override_refresh_for_skope = function() {
4560
+ if ( ! serverControlParams.isSkopOn )
4561
+ return;
4562
+ api.previewer.refresh = function( _params_ ) {
4563
+ var dfd = $.Deferred();
4564
+ var _refresh_ = function( params ) {
4565
+ var refreshOnceProcessingComplete,
4566
+ isProcessingComplete = function() {
4567
+ return 0 === api.state( 'processing' ).get();
4568
+ },
4569
+ resolveRefresh = function() {
4570
+ _new_refresh.call( api.previewer, params ).done( function( refresh_data ) {
4571
+ dfd.resolve( refresh_data );
4572
+ });
4573
+ };
4574
+ if ( isProcessingComplete() ) {
4575
+ resolveRefresh();
4576
+ } else {
4577
+ refreshOnceProcessingComplete = function() {
4578
+ if ( isProcessingComplete() ) {
4579
+ resolveRefresh();
4580
+ api.state( 'processing' ).unbind( refreshOnceProcessingComplete );
4581
+ }
4582
+ };
4583
+ api.state( 'processing' ).bind( refreshOnceProcessingComplete );
4584
+ }
4585
+ };
4586
+ _refresh_ = _.debounce( _refresh_, api.previewer.refreshBuffer );
4587
+ _refresh_( _params_ );
4588
+ return dfd.promise();
4589
+ };
4590
+ };//czr_override_refresh_for_skope
4591
+ })( wp.customize , jQuery, _ );
4592
+ ( function ( api, $, _ ) {
4593
+ if ( ! serverControlParams.isSkopOn )
4594
+ return;
4595
+ api.dirtyValues = function dirtyValues( options ) {
4596
+ return api.czr_skopeBase.getSkopeDirties( api.czr_skopeBase.getGlobalSkopeId(), options );
4597
+ };
4598
+
4599
+ })( wp.customize , jQuery, _ );
4600
+ ( function ( api, $, _ ) {
4601
+ if ( ! serverControlParams.isSkopOn || ! api.czr_isChangeSetOn() )
4602
+ return;
4603
+ var _original_requestChangesetUpdate = api.requestChangesetUpdate;
4604
+ api.requestChangesetUpdate = function( changes ) {
4605
+ var self = this,
4606
+ dfd = $.Deferred(),
4607
+ data,
4608
+ _skopesToUpdate = [],
4609
+ _promises = [],
4610
+ _global_skope_changes = changes || {},
4611
+ failedPromises = [],
4612
+ _all_skopes_data_ = [],
4613
+ _recursiveCallDeferred = $.Deferred();
4614
+ if ( ! serverControlParams.isSkopOn ) {
4615
+ return _original_requestChangesetUpdate();
4616
+ }
4617
+ if ( 0 === api._lastSavedRevision || _.isEmpty( api.state( 'changesetStatus' )() ) ) {
4618
+ _global_skope_changes = _.extend( _global_skope_changes, {
4619
+ blogname : { dummy_change : 'dummy_change' }
4620
+ } );
4621
+ }
4622
+ _.each( api.czr_currentSkopesCollection(), function( _skp ) {
4623
+ if ( 'global' == _skp.skope )
4624
+ return;
4625
+ _skopesToUpdate.push( _skp.id );
4626
+ } );
4627
+
4628
+ var _mayBeresolve = function( _index ) {
4629
+ if ( ! _.isUndefined( _skopesToUpdate[ _index + 1 ] ) || _promises.length != _skopesToUpdate.length )
4630
+ return;
4631
+
4632
+ if ( _.isEmpty( failedPromises ) ) {
4633
+ _recursiveCallDeferred.resolve( _all_skopes_data_ );
4634
+ } else {
4635
+ var _buildResponse = function() {
4636
+ var _failedResponse = [];
4637
+ _.each( failedPromises, function( _r ) {
4638
+ _failedResponse.push( api.czr_skopeBase.buildServerResponse( _r ) );
4639
+ } );
4640
+ return $.trim( _failedResponse.join( ' | ') );
4641
+ };
4642
+ _recursiveCallDeferred.reject( _buildResponse() );
4643
+ }
4644
+ return true;
4645
+ };
4646
+ var recursiveCall = function( _index ) {
4647
+ if ( _.isUndefined( _index ) || ( ( 0 * 0 ) == _index ) ) {
4648
+ api.state( 'processing' ).set( 1 );
4649
+ }
4650
+
4651
+ _index = _index || 0;
4652
+ if ( _.isUndefined( _skopesToUpdate[_index] ) ) {
4653
+ api.consoleLog( 'Undefined Skope in changeset recursive call ', _index, _skopesToUpdate, _skopesToUpdate[_index] );
4654
+ return _recursiveCallDeferred.resolve( _all_skopes_data_ ).promise();
4655
+ }
4656
+ api._requestSkopeChangetsetUpdate( changes, _skopesToUpdate[_index] )
4657
+ .always( function() { _promises.push( _index ); } )
4658
+ .fail( function( response ) {
4659
+ failedPromises.push( response );
4660
+ api.consoleLog('CHANGESET UPDATE RECURSIVE FAIL FOR SKOPE : ', _skopesToUpdate[_index] );
4661
+ if ( ! _mayBeresolve( _index ) )
4662
+ recursiveCall( _index + 1 );
4663
+ } )
4664
+ .done( function( _skope_data_ ) {
4665
+ _all_skopes_data_.push( _skope_data_ );
4666
+ if ( ! _mayBeresolve( _index ) )
4667
+ recursiveCall( _index + 1 );
4668
+ } );
4669
+
4670
+ return _recursiveCallDeferred.promise();
4671
+ };
4672
+ var _lastSavedRevisionBefore = api._lastSavedRevision;
4673
+ _original_requestChangesetUpdate( _global_skope_changes )
4674
+ .fail( function( r ) {
4675
+ api.consoleLog( 'WP requestChangesetUpdateFail', r, api.czr_skopeBase.buildServerResponse(r) );
4676
+ api._lastSavedRevision = Math.max( api._latestRevision, api._lastSavedRevision );
4677
+ api.state( 'processing' ).set( 0 );
4678
+
4679
+ dfd.reject( r );
4680
+ r = api.czr_skopeBase.buildServerResponse(r);
4681
+ api.czr_serverNotification( { message: r, status : 'error' } );
4682
+ })
4683
+ .done( function( wp_original_response ) {
4684
+ if ( 'pending' == api.czr_initialSkopeCollectionPopulated.state() )
4685
+ dfd.resolve( wp_original_response );
4686
+
4687
+ api._lastSavedRevision = _lastSavedRevisionBefore;
4688
+ recursiveCall()
4689
+ .always( function() {
4690
+ api._lastSavedRevision = Math.max( api._latestRevision, api._lastSavedRevision );
4691
+ api.state( 'processing' ).set( 0 );
4692
+ })
4693
+ .fail( function( r ) {
4694
+ dfd.reject( r );
4695
+ api.consoleLog( 'CHANGESET UPDATE RECURSIVE PUSH FAIL', r , _all_skopes_data_ );
4696
+ api.trigger( 'changeset-error', r );
4697
+ api.czr_serverNotification( { message: r, status : 'error' } );
4698
+ } )
4699
+ .done( function() {
4700
+ dfd.resolve( wp_original_response );
4701
+ });
4702
+ });
4703
+
4704
+ return dfd.promise();
4705
+ };
4706
+ api._requestSkopeChangetsetUpdate = function( changes, skope_id ) {
4707
+ if ( _.isUndefined( skope_id ) || ! api.czr_skope.has( skope_id ) ) {
4708
+ throw new Error( 'In api._requestSkopeChangetsetUpdate() : a valid and registered skope_id must be provided' );
4709
+ }
4710
+
4711
+ var deferred = new $.Deferred(),
4712
+ request,
4713
+ submittedChanges = {},
4714
+ data;
4715
+ skope_id = skope_id || api.czr_activeSkopeId();
4716
+
4717
+ if ( changes ) {
4718
+ _.extend( submittedChanges, changes );
4719
+ }
4720
+ _.each( api.czr_skopeBase.getSkopeDirties( skope_id ) , function( dirtyValue, settingId ) {
4721
+ if ( ! changes || null !== changes[ settingId ] ) {
4722
+ submittedChanges[ settingId ] = _.extend(
4723
+ {},
4724
+ submittedChanges[ settingId ] || {},
4725
+ { value: dirtyValue }
4726
+ );
4727
+ }
4728
+ } );
4729
+ if ( _.isEmpty( submittedChanges ) ) {
4730
+ deferred.resolve( {} );
4731
+ return deferred.promise();
4732
+ }
4733
+
4734
+ if ( api._latestRevision <= api._lastSavedRevision ) {
4735
+ deferred.resolve( {} );
4736
+ return deferred.promise();
4737
+ }
4738
+ api.trigger( 'skope-changeset-save', submittedChanges );
4739
+
4740
+ var queryVars = {
4741
+ skope_id : skope_id,
4742
+ action : 'changeset_update',
4743
+ opt_name : api.czr_skope( skope_id ).opt_name
4744
+ };
4745
+ data = api.previewer.query( _.extend( queryVars, { excludeCustomizedSaved: true } ) );
4746
+ delete data.customized; // Being sent in customize_changeset_data instead.
4747
+ _.extend( data, {
4748
+ nonce: api.settings.nonce.save,
4749
+ customize_changeset_data: JSON.stringify( submittedChanges )
4750
+ } );
4751
+ wp.ajax.post( 'customize_skope_changeset_save', data )
4752
+ .done( function requestChangesetUpdateDone( _data_ ) {
4753
+ deferred.resolve( _data_ );
4754
+ } )
4755
+ .fail( function requestChangesetUpdateFail( _data_ ) {
4756
+ api.consoleLog('SKOPE CHANGESET FAIL FOR SKOPE ' + _data_.skope_id, _data_ );
4757
+ deferred.reject( _data_ );
4758
+ } )
4759
+ .always( function( _data_ ) {
4760
+ if ( _data_.setting_validities ) {
4761
+ api._handleSettingValidities( {
4762
+ settingValidities: _data_.setting_validities
4763
+ } );
4764
+ }
4765
+ } );
4766
+
4767
+ return deferred.promise();
4768
+ };
4769
+ })( wp.customize , jQuery, _ );
4770
+ ( function ( api, $, _ ) {
4771
+ api.Setting.prototype.initialize = function( id, value, options ) {
4772
+ var setting = this;
4773
+ api.Value.prototype.initialize.call( setting, value, options );
4774
+
4775
+ setting.id = id;
4776
+ setting.transport = setting.transport || 'refresh';
4777
+ setting._dirty = options.dirty || false;
4778
+ setting.notifications = new api.Values({ defaultConstructor: api.Notification });
4779
+ setting.bind( setting.preview );
4780
+ };
4781
+ api.Setting.prototype.preview = function( to, from , data ) {
4782
+ var setting = this, transport, dfd = $.Deferred();
4783
+
4784
+ transport = setting.transport;
4785
+
4786
+ if ( serverControlParams.isSkopOn && api.czr_isPreviewerSkopeAware && 'pending' == api.czr_isPreviewerSkopeAware.state() ) {
4787
+ this.previewer.refresh();
4788
+ return dfd.resolve( arguments ).promise();
4789
+ }
4790
+ if ( ! _.isUndefined( from ) && ! _.isEmpty( from ) && ! _.isNull( from ) ) {
4791
+ if ( _.isObject( data ) && true === data.not_preview_sent ) {
4792
+ return dfd.resolve( arguments ).promise();
4793
+ }
4794
+ }
4795
+ if ( _.has( data, 'silent' ) && false !== data.silent )
4796
+ return dfd.resolve( arguments ).promise();
4797
+ if ( 'postMessage' === transport && ! api.state( 'previewerAlive' ).get() ) {
4798
+ transport = 'refresh';
4799
+ }
4800
+
4801
+ if ( 'postMessage' === transport ) {
4802
+ setting.previewer.send( 'pre_setting', {
4803
+ set_id : setting.id,
4804
+ data : data,//<= { module_id : 'string', module : {} } which typically includes the module_id and the module model ( items, mod options )
4805
+ value : to
4806
+ });
4807
+ setting.previewer.send( 'setting', [ setting.id, setting() ] );
4808
+
4809
+ dfd.resolve( arguments );
4810
+
4811
+ } else if ( 'refresh' === transport ) {
4812
+ if ( serverControlParams.isSkopOn ) {
4813
+ setting.previewer.refresh().always( function() {
4814
+ dfd.resolve( arguments );
4815
+ });
4816
+ } else {
4817
+ setting.previewer.refresh();
4818
+ dfd.resolve( arguments );
4819
+ }
4820
+ }
4821
+
4822
+ return dfd.promise();
4823
+ };//api.Setting.prototype.preview
4824
+ })( wp.customize , jQuery, _ );
4825
+ ( function ( api, $, _ ) {
4826
+ if ( 'function' == typeof api.Section ) {
4827
+ var _original_section_initialize = api.Section.prototype.initialize;
4828
+ api.Section.prototype.initialize = function( id, options ) {
4829
+ _original_section_initialize.apply( this, [id, options] );
4830
+ var section = this;
4831
+
4832
+ this.expanded.callbacks.add( function( _expanded ) {
4833
+ if ( ! _expanded )
4834
+ return;
4835
+
4836
+ var container = section.container.closest( '.wp-full-overlay-sidebar-content' ),
4837
+ content = section.container.find( '.accordion-section-content' );
4838
+ _resizeContentHeight = function() {
4839
+ content.css( 'height', container.innerHeight() );
4840
+ };
4841
+ _resizeContentHeight();
4842
+ $( window ).on( 'resize.customizer-section', _.debounce( _resizeContentHeight, 110 ) );
4843
+ });
4844
+ };
4845
+ }
4846
+ })( wp.customize , jQuery, _ );
4847
+ (function (api, $, _) {
4848
+ api.CZR_Helpers = api.CZR_Helpers || {};
4849
+ api.CZR_Helpers = $.extend( api.CZR_Helpers, {
4850
+ getControlSettingId : function( control_id, setting_type ) {
4851
+ setting_type = 'default' || setting_type;
4852
+ if ( ! api.control.has( control_id ) ) {
4853
+ api.consoleLog( 'getControlSettingId : The requested control_id is not registered in the api yet : ' + control_id );
4854
+ return control_id;
4855
+ }
4856
+ if ( ! _.has( api.control( control_id ), 'settings' ) || _.isEmpty( api.control( control_id ).settings ) )
4857
+ return control_id;
4858
+
4859
+ if ( ! _.has( api.control( control_id ).settings, setting_type ) ) {
4860
+ api.consoleLog( 'getControlSettingId : The requested control_id does not have the requested setting type : ' + control_id + ' , ' + setting_type );
4861
+ return control_id;
4862
+ }
4863
+ if ( _.isUndefined( api.control( control_id ).settings[setting_type].id ) ) {
4864
+ api.consoleLog( 'getControlSettingId : The requested control_id has no setting id assigned : ' + control_id );
4865
+ return control_id;
4866
+ }
4867
+ return api.control( control_id ).settings[setting_type].id;
4868
+ },
4869
+
4870
+
4871
+
4872
+ getDocSearchLink : function( text ) {
4873
+ text = ! _.isString(text) ? '' : text;
4874
+ var _searchtext = text.replace( / /g, '+'),
4875
+ _url = [ serverControlParams.docURL, 'search?query=', _searchtext ].join('');
4876
+ return [
4877
+ '<a href="' + _url + '" title="' + serverControlParams.i18n.readDocumentation + '" target="_blank">',
4878
+ ' ',
4879
+ '<span class="fa fa-question-circle-o"></span>'
4880
+ ].join('');
4881
+ },
4882
+ build_setId : function ( setId ) {
4883
+ if ( _.contains( serverControlParams.wpBuiltinSettings, setId ) )
4884
+ return setId;
4885
+ if ( ! _.contains( serverControlParams.themeSettingList, setId ) )
4886
+ return setId;
4887
+
4888
+ return -1 == setId.indexOf( serverControlParams.themeOptions ) ? [ serverControlParams.themeOptions +'[' , setId , ']' ].join('') : setId;
4889
+ },
4890
+ getOptionName : function(name) {
4891
+ var self = this;
4892
+ if ( -1 == name.indexOf(serverControlParams.themeOptions) )
4893
+ return name;
4894
+ return name.replace(/\[|\]/g, '').replace(serverControlParams.themeOptions, '');
4895
+ },
4896
+ hasPartRefresh : function( setId ) {
4897
+ if ( ! _.has( api, 'czr_partials') )
4898
+ return;
4899
+ return _.contains( _.map( api.czr_partials(), function( partial, key ) {
4900
+ return _.contains( partial.settings, setId );
4901
+ }), true );
4902
+ },
4903
+ getSectionControlIds : function( section_id ) {
4904
+ section_id = section_id || api.czr_activeSectionId();
4905
+ return ! api.section.has( section_id ) ?
4906
+ [] :
4907
+ _.map( api.section( section_id ).controls(), function( _ctrl ) {
4908
+ return _ctrl.id;
4909
+ });
4910
+ },
4911
+ getSectionSettingIds : function( section_id ) {
4912
+ section_id = section_id || api.czr_activeSectionId();
4913
+ if ( ! api.section.has( section_id) )
4914
+ return;
4915
+ var self = this,
4916
+ _sec_settings = [],
4917
+ _sec_controls = self.getSectionControlIds( section_id );
4918
+
4919
+ _.each( _sec_controls, function( ctrlId ) {
4920
+ _.each( api.control(ctrlId).settings, function( _instance, _k ) {
4921
+ _sec_settings.push( _instance.id );
4922
+ });
4923
+ });
4924
+ return _sec_settings;
4925
+ },
4926
+ capitalize : function( string ) {
4927
+ if( ! _.isString(string) )
4928
+ return string;
4929
+ return string.charAt(0).toUpperCase() + string.slice(1);
4930
+ },
4931
+
4932
+ truncate : function( string, n, useWordBoundary ){
4933
+ if ( ! _.isString( string ) )
4934
+ return '';
4935
+ n = n || 20;
4936
+ var isTooLong = string.length > n,
4937
+ s_ = isTooLong ? string.substr(0,n-1) : string;
4938
+ s_ = (useWordBoundary && isTooLong) ? s_.substr(0,s_.lastIndexOf(' ')) : s_;
4939
+ return isTooLong ? s_ + '...' : s_;
4940
+ },
4941
+ isMultiItemModule : function( module_type, moduleInst ) {
4942
+ if ( _.isUndefined( module_type ) && ! _.isObject( moduleInst ) )
4943
+ return;
4944
+ if ( _.isObject( moduleInst ) && _.has( moduleInst, 'module_type' ) )
4945
+ module_type = moduleInst.module_type;
4946
+ else if ( _.isUndefined( module_type ) || _.isNull( module_type ) )
4947
+ return;
4948
+ if ( ! _.has( api.czrModuleMap, module_type ) )
4949
+ return;
4950
+
4951
+ return api.czrModuleMap[module_type].crud || api.czrModuleMap[module_type].multi_item || false;
4952
+ },
4953
+ isCrudModule : function( module_type, moduleInst ) {
4954
+ if ( _.isUndefined( module_type ) && ! _.isObject( moduleInst ) )
4955
+ return;
4956
+ if ( _.isObject( moduleInst ) && _.has( moduleInst, 'module_type' ) )
4957
+ module_type = moduleInst.module_type;
4958
+ else if ( _.isUndefined( module_type ) || _.isNull( module_type ) )
4959
+ return;
4960
+ if ( ! _.has( api.czrModuleMap, module_type ) )
4961
+ return;
4962
+
4963
+ return api.czrModuleMap[module_type].crud || false;
4964
+ },
4965
+ hasModuleModOpt : function( module_type, moduleInst ) {
4966
+ if ( _.isUndefined( module_type ) && ! _.isObject( moduleInst ) )
4967
+ return;
4968
+ if ( _.isObject( moduleInst ) && _.has( moduleInst, 'module_type' ) )
4969
+ module_type = moduleInst.module_type;
4970
+ else if ( _.isUndefined( module_type ) || _.isNull( module_type ) )
4971
+ return;
4972
+ if ( ! _.has( api.czrModuleMap, module_type ) )
4973
+ return;
4974
+
4975
+ return api.czrModuleMap[module_type].has_mod_opt || false;
4976
+ },
4977
+ setupInputCollectionFromDOM : function() {
4978
+ var inputParentInst = this;//<= because fired with .call( inputParentInst )
4979
+ if ( ! _.isFunction( inputParentInst ) ) {
4980
+ throw new Error( 'setupInputCollectionFromDOM : inputParentInst is not valid.' );
4981
+ }
4982
+ var module = inputParentInst.module,
4983
+ is_mod_opt = _.has( inputParentInst() , 'is_mod_opt' );
4984
+ if ( _.has( inputParentInst, 'czr_Input') && ! _.isEmpty( inputParentInst.inputCollection() ) )
4985
+ return;
4986
+ inputParentInst.czr_Input = new api.Values();
4987
+ inputParentInst.inputConstructor = is_mod_opt ? module.inputModOptConstructor : module.inputConstructor;
4988
+
4989
+ var _defaultInputParentModel = is_mod_opt ? inputParentInst.defaultModOptModel : inputParentInst.defaultItemModel;
4990
+
4991
+ if ( _.isEmpty( _defaultInputParentModel ) || _.isUndefined( _defaultInputParentModel ) ) {
4992
+ throw new Error( 'No default model found in item or mod opt ' + inputParentInst.id + '.' );
4993
+ }
4994
+ var inputParentInst_model = $.extend( true, {}, inputParentInst() );
4995
+
4996
+ if ( ! _.isObject( inputParentInst_model ) )
4997
+ inputParentInst_model = _defaultInputParentModel;
4998
+ else
4999
+ inputParentInst_model = $.extend( _defaultInputParentModel, inputParentInst_model );
5000
+
5001
+ var dom_inputParentInst_model = {};
5002
+ $( '.' + module.control.css_attr.sub_set_wrapper, inputParentInst.container).each( function( _index ) {
5003
+ var _id = $(this).find('[data-type]').attr( 'data-type' ),
5004
+ _value = _.has( inputParentInst_model, _id ) ? inputParentInst_model[ _id ] : '';
5005
+ if ( _.isUndefined( _id ) || _.isEmpty( _id ) ) {
5006
+ api.consoleLog( 'setupInputCollectionFromDOM : missing data-type for ' + module.id );
5007
+ return;
5008
+ }
5009
+ if ( ! _.has( inputParentInst_model, _id ) ) {
5010
+ throw new Error('The item or mod opt property : ' + _id + ' has been found in the DOM but not in the item or mod opt model : '+ inputParentInst.id + '. The input can not be instantiated.');
5011
+ }
5012
+ var _inputType = $(this).attr( 'data-input-type' ),
5013
+ _inputTransport = $(this).attr( 'data-transport' ) || 'inherit',//<= if no specific transport ( refresh or postMessage ) has been defined in the template, inherits the control transport
5014
+ _inputOptions = _.has( module.inputOptions, _inputType ) ? module.inputOptions[ _inputType ] : {};
5015
+ inputParentInst.czr_Input.add( _id, new inputParentInst.inputConstructor( _id, {
5016
+ id : _id,
5017
+ type : _inputType,
5018
+ transport : _inputTransport,
5019
+ input_value : _value,
5020
+ input_options : _inputOptions,//<= a module can define a specific set of option
5021
+ container : $(this),
5022
+ input_parent : inputParentInst,
5023
+ is_mod_opt : is_mod_opt,
5024
+ module : module
5025
+ } ) );
5026
+ inputParentInst.czr_Input( _id ).ready();
5027
+ dom_inputParentInst_model[ _id ] = _value;
5028
+ });//each
5029
+ inputParentInst.inputCollection( dom_inputParentInst_model );
5030
+ return inputParentInst;
5031
+ },
5032
+ removeInputCollection : function() {
5033
+ var inputParentInst = this;//<= because fired with .call( inputParentInst )
5034
+ if ( ! _.isFunction( inputParentInst ) ) {
5035
+ throw new Error( 'removeInputCollection : inputParentInst is not valid.' );
5036
+ }
5037
+ if ( ! _.has( inputParentInst, 'czr_Input') )
5038
+ return;
5039
+ inputParentInst.czr_Input.each( function( _input ) {
5040
+ inputParentInst.czr_Input.remove( _input.id );
5041
+ });
5042
+ inputParentInst.inputCollection({});
5043
+ },
5044
+ refreshModuleControl : function( wpSetId ) {
5045
+ var _constructor = api.controlConstructor.czr_module,
5046
+ _control_type = api.control( wpSetId ).params.type,
5047
+ _control_data = api.settings.controls[wpSetId];
5048
+ $.when( api.control( wpSetId ).container.remove() ).done( function() {
5049
+ api.control.remove( wpSetId );
5050
+ api.control.add( wpSetId, new _constructor( wpSetId, { params : _control_data, previewer : api.previewer }) );
5051
+ });
5052
+
5053
+ },
5054
+ hexToRgb : function( hex ) {
5055
+ var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
5056
+ try {
5057
+ hex = hex.replace(shorthandRegex, function(m, r, g, b) {
5058
+ return r + r + g + g + b + b;
5059
+ });
5060
+ } catch( er ) {
5061
+ api.errorLog( 'Error in Helpers::hexToRgb : ' + er );
5062
+ return hex;
5063
+ }
5064
+
5065
+ var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec( hex );
5066
+ result = result ? [
5067
+ parseInt(result[1], 16),//r
5068
+ parseInt(result[2], 16),//g
5069
+ parseInt(result[3], 16)//b
5070
+ ] : [];
5071
+ return 'rgb(' + result.join(',') + ')';
5072
+ },
5073
+
5074
+ rgbToHex : function ( r, g, b ) {
5075
+ var componentToHex = function(c) {
5076
+ var hex = c.toString(16);
5077
+ return hex.length == 1 ? "0" + hex : hex;
5078
+ };
5079
+ return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
5080
+ }
5081
+
5082
+ });//$.extend
5083
+ })( wp.customize , jQuery, _);
5084
+ (function (api, $, _) {
5085
+ api.CZR_Helpers = api.CZR_Helpers || {};
5086
+ api.CZR_Helpers = $.extend( api.CZR_Helpers, {
5087
+ addActions : function( event_map, new_events, instance ) {
5088
+ var control = this;
5089
+ instance = instance || control;
5090
+ instance[event_map] = instance[event_map] || [];
5091
+ new_event_map = _.clone( instance[event_map] );
5092
+ instance[event_map] = _.union( new_event_map, ! _.isArray(new_events) ? [new_events] : new_events );
5093
+ },
5094
+
5095
+ doActions : function( action, $dom_el, obj ) {
5096
+ $dom_el.trigger( action, obj );
5097
+ },
5098
+ setupDOMListeners : function( event_map , args, instance ) {
5099
+ var control = this,
5100
+ _defaultArgs = {
5101
+ model : {},
5102
+ dom_el : {}
5103
+ };
5104
+
5105
+ instance = instance || control;
5106
+ if ( ! _.isArray( event_map ) ) {
5107
+ api.errorLog( 'setupDomListeners : event_map should be an array', args );
5108
+ return;
5109
+ }
5110
+ if ( ! _.isObject( args ) ) {
5111
+ api.errorLog( 'setupDomListeners : args should be an object', event_map );
5112
+ return;
5113
+ }
5114
+
5115
+ args = _.extend( _defaultArgs, args );
5116
+ if ( ! args.dom_el instanceof jQuery || 1 != args.dom_el.length ) {
5117
+ api.errorLog( 'setupDomListeners : dom element should be an existing dom element', args );
5118
+ return;
5119
+ }
5120
+ _.map( event_map , function( _event ) {
5121
+ if ( ! _.isString( _event.selector ) || _.isEmpty( _event.selector ) ) {
5122
+ api.errorLog( 'setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : ' + _event.actions.join(',') );
5123
+ return;
5124
+ }
5125
+ if ( ! _.isString( _event.selector ) || _.isEmpty( _event.selector ) ) {
5126
+ api.errorLog( 'setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : ' + _event.actions.join(',') );
5127
+ return;
5128
+ }
5129
+ args.dom_el.on( _event.trigger , _event.selector, function( e, event_params ) {
5130
+ e.stopPropagation();
5131
+ if ( api.utils.isKeydownButNotEnterEvent( e ) ) {
5132
+ return;
5133
+ }
5134
+ e.preventDefault(); // Keep this AFTER the key filter above
5135
+ var actionsParams = $.extend( true, {}, args );
5136
+ if ( _.has( actionsParams, 'model') && _.has( actionsParams.model, 'id') ) {
5137
+ if ( _.has( instance, 'get' ) )
5138
+ actionsParams.model = instance();
5139
+ else
5140
+ actionsParams.model = instance.getModel( actionsParams.model.id );
5141
+ }
5142
+ $.extend( actionsParams, { event : _event, dom_event : e } );
5143
+ $.extend( actionsParams, event_params );
5144
+ if ( ! _.has( actionsParams, 'event' ) || ! _.has( actionsParams.event, 'actions' ) ) {
5145
+ api.errorLog( 'executeEventActionChain : missing obj.event or obj.event.actions' );
5146
+ return;
5147
+ }
5148
+ try { control.executeEventActionChain( actionsParams, instance ); } catch( er ) {
5149
+ api.errorLog( 'In setupDOMListeners : problem when trying to fire actions : ' + actionsParams.event.actions );
5150
+ api.errorLog( 'Error : ' + er );
5151
+ }
5152
+ });//.on()
5153
+ });//_.map()
5154
+ },//setupDomListeners
5155
+ executeEventActionChain : function( args, instance ) {
5156
+ var control = this;
5157
+ if ( 'function' === typeof( args.event.actions ) )
5158
+ return args.event.actions.call( instance, args );
5159
+ if ( ! _.isArray( args.event.actions ) )
5160
+ args.event.actions = [ args.event.actions ];
5161
+ var _break = false;
5162
+ _.map( args.event.actions, function( _cb ) {
5163
+ if ( _break )
5164
+ return;
5165
+
5166
+ if ( 'function' != typeof( instance[ _cb ] ) ) {
5167
+ throw new Error( 'executeEventActionChain : the action : ' + _cb + ' has not been found when firing event : ' + args.event.selector );
5168
+ }
5169
+ var $_dom_el = ( _.has(args, 'dom_el') && -1 != args.dom_el.length ) ? args.dom_el : control.container;
5170
+
5171
+ $_dom_el.trigger( 'before_' + _cb, _.omit( args, 'event' ) );
5172
+ var _cb_return = instance[ _cb ].call( instance, args );
5173
+ if ( false === _cb_return )
5174
+ _break = true;
5175
+ $_dom_el.trigger( 'after_' + _cb, _.omit( args, 'event' ) );
5176
+ });//_.map
5177
+ }
5178
+ });//$.extend
5179
+ })( wp.customize , jQuery, _);
5180
+ (function (api, $, _) {
5181
+
5182
+ api.czr_wpQueryDataReady = $.Deferred();
5183
+ api.czr_wpQueryInfos = api.czr_wpQueryInfos || new api.Value();
5184
+ api.czr_partials = api.czr_partials || new api.Value();
5185
+ api.bind( 'ready', function() {
5186
+ api.previewer.bind('houston-widget-settings', function(data) {
5187
+ var _candidates = _.filter( data.registeredSidebars, function( sb ) {
5188
+ return ! _.findWhere( _wpCustomizeWidgetsSettings.registeredSidebars, { id: sb.id } );
5189
+ });
5190
+
5191
+ var _inactives = _.filter( data.registeredSidebars, function( sb ) {
5192
+ return ! _.has( data.renderedSidebars, sb.id );
5193
+ });
5194
+
5195
+ _inactives = _.map( _inactives, function(obj) {
5196
+ return obj.id;
5197
+ });
5198
+
5199
+ var _registered = _.map( data.registeredSidebars, function(obj) {
5200
+ return obj.id;
5201
+ });
5202
+ api.czr_widgetZoneSettings = api.czr_widgetZoneSettings || new api.Value();//will store all widget zones data sent by preview as an observable object
5203
+ api.czr_widgetZoneSettings.set( {
5204
+ actives : data.renderedSidebars,
5205
+ inactives : _inactives,
5206
+ registered : _registered,
5207
+ candidates : _candidates,
5208
+ available_locations : data.availableWidgetLocations//built server side
5209
+ } );
5210
+
5211
+ });
5212
+ api.previewer.bind( 'czr-query-data-ready', function( data ) {
5213
+ api.czr_wpQueryInfos( data );
5214
+ if ( 'pending' == api.czr_wpQueryDataReady.state() ) {
5215
+ api.czr_wpQueryDataReady.resolve( data );
5216
+ }
5217
+ });
5218
+ api.previewer.bind( 'czr-partial-refresh-data', function( data ) {
5219
+ api.czr_partials.set( data );
5220
+ });
5221
+ api.previewer.bind( 'czr-partial-refresh-done', function( data ) {
5222
+ if ( ! _.has( data, 'set_id' ) )
5223
+ return;
5224
+ var setId = api.CZR_Helpers.build_setId( data.set_id );
5225
+ if ( ! api.has( setId ) )
5226
+ return;
5227
+ var ctrlId = api.CZR_Helpers.getControlSettingId( setId );
5228
+ if ( ! api.control.has( ctrlId ) )
5229
+ return;
5230
+ api.control( ctrlId ).trigger( 'czr-partial-refresh-done' );
5231
+ });
5232
+ });//api.bind('ready')
5233
+ })( wp.customize , jQuery, _ );var CZRInputMths = CZRInputMths || {};
5234
+ ( function ( api, $, _ ) {
5235
+ $.extend( CZRInputMths , {
5236
+ initialize: function( name, options ) {
5237
+ if ( _.isUndefined( options.input_parent ) || _.isEmpty(options.input_parent) ) {
5238
+ throw new Error('No input_parent assigned to input ' + options.id + '. Aborting');
5239
+ }
5240
+ if ( _.isUndefined(options.module ) ) {
5241
+ throw new Error('No module assigned to input ' + options.id + '. Aborting');
5242
+ }
5243
+
5244
+ api.Value.prototype.initialize.call( this, null, options );
5245
+
5246
+ var input = this;
5247
+ $.extend( input, options || {} );
5248
+ input.isReady = $.Deferred();
5249
+ if ( ! _.isUndefined(options.input_value) ) {
5250
+ input.set( options.input_value );
5251
+ }
5252
+ if ( api.czrInputMap && _.has( api.czrInputMap, input.type ) ) {
5253
+ var _meth = api.czrInputMap[ input.type ];
5254
+ if ( _.isFunction( input[_meth]) ) {
5255
+ input[_meth]( options.input_options || null );
5256
+ }
5257
+ } else {
5258
+ api.consoleLog('Warning an input : ' + input.id + ' has no corresponding method defined in api.czrInputMap.');
5259
+ }
5260
+
5261
+ var trigger_map = {
5262
+ text : 'keyup',
5263
+ textarea : 'keyup',
5264
+ password : 'keyup',
5265
+ color : 'colorpickerchange',
5266
+ range : 'input propertychange'
5267
+ };
5268
+ input.input_event_map = [
5269
+ {
5270
+ trigger : $.trim( ['change', trigger_map[input.type] || '' ].join(' ') ),//was 'propertychange change click keyup input',//colorpickerchange is a custom colorpicker event @see method setupColorPicker => otherwise we don't
5271
+ selector : 'input[data-type], select[data-type], textarea[data-type]',
5272
+ name : 'set_input_value',
5273
+ actions : function( obj ) {
5274
+ if ( ! _.has( input.input_parent, 'syncElements') || ! _.has( input.input_parent.syncElements, input.id ) ) {
5275
+ throw new Error('WARNING : THE INPUT ' + input.id + ' HAS NO SYNCED ELEMENT.');
5276
+ }
5277
+ }//was 'updateInput'
5278
+ }
5279
+ ];
5280
+ input.visible = new api.Value( true );
5281
+ input.isReady.done( function() {
5282
+ input.visible.bind( function( visible ) {
5283
+ if ( visible )
5284
+ input.container.stop( true, true ).slideDown( 200 );
5285
+ else
5286
+ input.container.stop( true, true ).slideUp( 200 );
5287
+ });
5288
+ });
5289
+
5290
+ },
5291
+ ready : function() {
5292
+ var input = this;
5293
+ input.setupDOMListeners( input.input_event_map , { dom_el : input.container }, input );
5294
+ input.callbacks.add( function() { return input.inputReact.apply( input, arguments ); } );
5295
+ $.when( input.setupSynchronizer() ).done( function() {
5296
+ input.isReady.resolve( input );
5297
+ } );
5298
+
5299
+ },
5300
+ setupSynchronizer: function() {
5301
+ var input = this,
5302
+ input_parent = input.input_parent,
5303
+ $_input_el = input.container.find('[data-type]'),
5304
+ is_textarea = input.container.find('[data-type]').is('textarea');
5305
+ if ( is_textarea ) {
5306
+ throw new Error('TO DO : THE TEXTAREA INPUT ARE NOT READY IN THE SYNCHRONIZER!');
5307
+ }
5308
+
5309
+ var syncElement = new api.Element( $_input_el );
5310
+ input_parent.syncElements = input_parent.syncElements || {};
5311
+ input_parent.syncElements[input.id] = syncElement;//adds the input syncElement to the collection
5312
+ syncElement.sync( input );//sync with the input instance
5313
+ syncElement.set( input() );
5314
+ },
5315
+ inputReact : function( to, from, data ) {
5316
+ var input = this,
5317
+ _current_input_parent = input.input_parent(),
5318
+ _new_model = _.clone( _current_input_parent ),//initialize it to the current value
5319
+ _isPreItemInput = input.is_preItemInput;
5320
+ _new_model = ( ! _.isObject(_new_model) || _.isEmpty(_new_model) ) ? {} : _new_model;
5321
+ _new_model[input.id] = to;
5322
+ input.input_parent.set( _new_model, {
5323
+ input_changed : input.id,
5324
+ input_transport : input.transport,
5325
+ not_preview_sent : 'postMessage' === input.transport//<= this parameter set to true will prevent the setting to be sent to the preview ( @see api.Setting.prototype.preview override ). This is useful to decide if a specific input should refresh or not the preview.
5326
+ } );
5327
+ if ( ! _isPreItemInput ) {
5328
+ input.input_parent.trigger( input.id + ':changed', to );
5329
+ if ( ! _.isEmpty( from ) || ! _.isUndefined( from ) && 'postMessage' === input.transport ) {
5330
+ input.module.sendInputToPreview( {
5331
+ input_id : input.id,
5332
+ input_parent_id : input.input_parent.id,
5333
+ to : to,
5334
+ from : from
5335
+ } );
5336
+ }
5337
+ }
5338
+ },
5339
+ setupColorPicker : function() {
5340
+ var input = this;
5341
+
5342
+ input.container.find('input').iris( {
5343
+ palettes: true,
5344
+ hide:false,
5345
+ change : function( e, o ) {
5346
+ $(this).val( o.color.toString() ).trigger('colorpickerchange').trigger('change');
5347
+ }
5348
+ });
5349
+ },
5350
+
5351
+ setupSelect : function() {
5352
+ var input = this;
5353
+ $('select', input.container ).not('.no-selecter-js')
5354
+ .each( function() {
5355
+ $(this).selecter({
5356
+ });
5357
+ });
5358
+ },
5359
+
5360
+ setupIcheck : function( obj ) {
5361
+ var input = this;
5362
+
5363
+ $( 'input[type=checkbox]', input.container ).each( function(e) {
5364
+ if ( 0 !== $(this).closest('div[class^="icheckbox"]').length )
5365
+ return;
5366
+
5367
+ $(this).iCheck({
5368
+ checkboxClass: 'icheckbox_flat-grey',
5369
+ checkedClass: 'checked',
5370
+ radioClass: 'iradio_flat-grey',
5371
+ })
5372
+ .on( 'ifChanged', function(e){
5373
+ $(this).val( false === $(this).is(':checked') ? 0 : 1 );
5374
+ $(e.currentTarget).trigger('change');
5375
+ });
5376
+ });
5377
+ },
5378
+
5379
+ setupStepper : function( obj ) {
5380
+ var input = this;
5381
+ $('input[type="number"]',input.container ).each( function( e ) {
5382
+ $(this).stepper();
5383
+ });
5384
+ },
5385
+ setupRangeSlider : function( options ) {
5386
+ var input = this,
5387
+ $handle,
5388
+ _updateHandle = function(el, val) {
5389
+ el.textContent = val + "%";
5390
+ };
5391
+
5392
+ $( input.container ).find('input').rangeslider( {
5393
+ polyfill: false,
5394
+ rangeClass: 'rangeslider',
5395
+ disabledClass: 'rangeslider--disabled',
5396
+ horizontalClass: 'rangeslider--horizontal',
5397
+ verticalClass: 'rangeslider--vertical',
5398
+ fillClass: 'rangeslider__fill',
5399
+ handleClass: 'rangeslider__handle',
5400
+ onInit: function() {
5401
+ $handle = $('.rangeslider__handle', this.$range);
5402
+ $('.rangeslider__handle', this.$range);
5403
+ _updateHandle( $handle[0], this.value );
5404
+ },
5405
+ } ).on('input', function() {
5406
+ _updateHandle( $handle[0], this.value );
5407
+ });
5408
+ }
5409
+ });//$.extend
5410
+ })( wp.customize , jQuery, _ );var CZRInputMths = CZRInputMths || {};
5411
+ ( function ( api, $, _ ) {
5412
+ $.extend( CZRInputMths , {
5413
+ setupImageUploader : function() {
5414
+ var input = this,
5415
+ _model = input();
5416
+ input.attachment = {};
5417
+ if ( ! input.container )
5418
+ return this;
5419
+
5420
+ this.tmplRendered = $.Deferred();
5421
+ this.setupContentRendering( _model, {} );
5422
+ this.tmplRendered.done( function(){
5423
+ input.czrImgUploaderBinding();
5424
+ });
5425
+ },
5426
+
5427
+ setupContentRendering : function( to, from) {
5428
+ var input = this, _attachment;
5429
+ if ( ( input.attachment.id != to ) && from !== to ) {
5430
+ if ( ! to ) {
5431
+ input.attachment = {};
5432
+ input.renderImageUploaderTemplate();
5433
+ }
5434
+ _attachment = wp.media.attachment( to );
5435
+ if ( _.isObject( _attachment ) && _.has( _attachment, 'attributes' ) && _.has( _attachment.attributes, 'sizes' ) ) {
5436
+ input.attachment = _attachment.attributes;
5437
+ input.renderImageUploaderTemplate();
5438
+ } else {
5439
+ wp.media.attachment( to ).fetch().done( function() {
5440
+ input.attachment = this.attributes;
5441
+ input.renderImageUploaderTemplate();
5442
+ });
5443
+ }
5444
+ }//Standard reaction, the image has been updated by the user or init
5445
+ else if ( ! input.attachment.id || input.attachment.id === to ) {
5446
+ input.renderImageUploaderTemplate();
5447
+ }
5448
+ },
5449
+
5450
+ czrImgUploaderBinding : function() {
5451
+ var input = this;
5452
+ _.bindAll( input, 'czrImgUploadRemoveFile', 'czrImgUploadOpenFrame', 'czrImgUploadSelect');
5453
+ input.container.on( 'click keydown', '.upload-button', input.czrImgUploadOpenFrame );
5454
+ input.container.on( 'click keydown', '.thumbnail-image img', input.czrImgUploadOpenFrame );
5455
+ input.container.on( 'click keydown', '.remove-button', input.czrImgUploadRemoveFile );
5456
+
5457
+ input.bind( input.id + ':changed', function( to, from ){
5458
+ input.tmplRendered = $.Deferred();
5459
+ input.setupContentRendering(to,from);
5460
+ });
5461
+ },
5462
+ czrImgUploadOpenFrame: function( event ) {
5463
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
5464
+ return;
5465
+ }
5466
+
5467
+ event.preventDefault();
5468
+
5469
+ if ( ! this.frame ) {
5470
+ this.czrImgUploadInitFrame();
5471
+ }
5472
+
5473
+ this.frame.open();
5474
+ },
5475
+ czrImgUploadInitFrame: function() {
5476
+ var input = this,
5477
+ button_labels = this.getUploaderLabels();
5478
+
5479
+ input.frame = wp.media({
5480
+ button: {
5481
+ text: button_labels.frame_button
5482
+ },
5483
+ states: [
5484
+ new wp.media.controller.Library({
5485
+ title: button_labels.frame_title,
5486
+ library: wp.media.query({ type: 'image' }),
5487
+ multiple: false,
5488
+ date: false
5489
+ })
5490
+ ]
5491
+ });
5492
+ input.frame.on( 'select', input.czrImgUploadSelect );
5493
+ },
5494
+ czrImgUploadRemoveFile: function( event ) {
5495
+ var input = this;
5496
+
5497
+ if ( api.utils.isKeydownButNotEnterEvent( event ) ) {
5498
+ return;
5499
+ }
5500
+ event.preventDefault();
5501
+ input.attachment = {};
5502
+ input.set('');
5503
+ },
5504
+ czrImgUploadSelect: function() {
5505
+ var node,
5506
+ input = this,
5507
+ attachment = input.frame.state().get( 'selection' ).first().toJSON(), // Get the attachment from the modal frame.
5508
+ mejsSettings = window._wpmejsSettings || {};
5509
+ input.attachment = attachment;
5510
+ input.set(attachment.id);
5511
+ },
5512
+ renderImageUploaderTemplate: function() {
5513
+ var input = this;
5514
+ if ( 0 === $( '#tmpl-czr-input-img-uploader-view-content' ).length )
5515
+ return;
5516
+
5517
+ var view_template = wp.template('czr-input-img-uploader-view-content');
5518
+ if ( ! view_template || ! input.container )
5519
+ return;
5520
+
5521
+ var $_view_el = input.container.find('.' + input.module.control.css_attr.img_upload_container );
5522
+
5523
+ if ( ! $_view_el.length )
5524
+ return;
5525
+
5526
+ var _template_params = {
5527
+ button_labels : input.getUploaderLabels(),
5528
+ settings : input.id,
5529
+ attachment : input.attachment,
5530
+ canUpload : true
5531
+ };
5532
+
5533
+ $_view_el.html( view_template( _template_params) );
5534
+
5535
+ input.tmplRendered.resolve();
5536
+ input.container.trigger( input.id + ':content_rendered' );
5537
+
5538
+ return true;
5539
+ },
5540
+
5541
+ getUploaderLabels : function() {
5542
+ var _ts = serverControlParams.i18n,
5543
+ _map = {
5544
+ 'select' : _ts.select_image,
5545
+ 'change' : _ts.change_image,
5546
+ 'remove' : _ts.remove_image,
5547
+ 'default' : _ts.default_image,
5548
+ 'placeholder' : _ts.placeholder_image,
5549
+ 'frame_title' : _ts.frame_title_image,
5550
+ 'frame_button': _ts.frame_button_image
5551
+ };
5552
+ _.each( _map, function( ts_string, key ) {
5553
+ if ( _.isUndefined( ts_string ) ) {
5554
+ var input = this;
5555
+ api.errorLog( 'A translated string is missing ( ' + key + ' ) for the image uploader input in module : ' + input.module.id );
5556
+ return '';
5557
+ }
5558
+ });
5559
+
5560
+ return _map;
5561
+ }
5562
+ });//$.extend
5563
+ })( wp.customize , jQuery, _ );/* Fix caching, select2 default one seems to not correctly work, or it doesn't what I think it should */
5564
+ var CZRInputMths = CZRInputMths || {};
5565
+ ( function ( api, $, _ ) {
5566
+ $.extend( CZRInputMths , {
5567
+ setupContentPicker: function( wpObjectTypes ) {
5568
+ var input = this,
5569
+ _event_map = [];
5570
+ $.extend( {
5571
+ post : '',
5572
+ taxonomy : ''
5573
+ }, _.isObject( wpObjectTypes ) ? wpObjectTypes : {} );
5574
+
5575
+ input.wpObjectTypes = wpObjectTypes;
5576
+ input.container.find('.czr-input').append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>');
5577
+ _event_map = [
5578
+ {
5579
+ trigger : 'change',
5580
+ selector : 'select[data-select-type]',
5581
+ name : 'set_input_value',
5582
+ actions : function( obj ){
5583
+ var $_changed_input = $(obj.dom_event.currentTarget, obj.dom_el ),
5584
+ _raw_val = $( $_changed_input, obj.dom_el ).select2( 'data' ),
5585
+ _val_candidate = {},
5586
+ _default = {
5587
+ id : '',
5588
+ type_label : '',
5589
+ title : '',
5590
+ object_type : '',
5591
+ url : ''
5592
+ };
5593
+
5594
+ _raw_val = _.isArray( _raw_val ) ? _raw_val[0] : _raw_val;
5595
+ if ( ! _.isObject( _raw_val ) || _.isEmpty( _raw_val ) ) {
5596
+ api.consoleLog( 'Content Picker Input : the picked value should be an object not empty.');
5597
+ return;
5598
+ }
5599
+ _.each( _default, function( val, k ){
5600
+ if ( '_custom_' !== _raw_val.id ) {
5601
+ if ( ! _.has( _raw_val, k ) || _.isEmpty( _raw_val[ k ] ) ) {
5602
+ api.consoleLog( 'content_picker : missing input param : ' + k );
5603
+ return;
5604
+ }
5605
+ }
5606
+ _val_candidate[ k ] = _raw_val[ k ];
5607
+ } );
5608
+ input.set( _val_candidate );
5609
+ }
5610
+ }
5611
+ ];
5612
+
5613
+ input.setupDOMListeners( _event_map , { dom_el : input.container }, input );
5614
+ input.setupContentSelecter();
5615
+ },
5616
+
5617
+ setupContentSelecter : function() {
5618
+ var input = this;
5619
+
5620
+ input.container.find('select').select2( {
5621
+ placeholder: {
5622
+ id: '-1', // the value of the option
5623
+ title: 'Select'
5624
+ },
5625
+ data : input.setupSelectedContents(),
5626
+ ajax: {
5627
+ url: serverControlParams.AjaxUrl,
5628
+ type: 'POST',
5629
+ dataType: 'json',
5630
+ delay: 250,
5631
+ debug: true,
5632
+ data: function ( params ) {
5633
+ var page = params.page ? params.page - 1 : 0;
5634
+ page = params.term ? params.page : page;
5635
+ return {
5636
+ action : params.term ? "search-available-content-items-customizer" : "load-available-content-items-customizer",
5637
+ search : params.term,
5638
+ wp_customize : 'on',
5639
+ page : page,
5640
+ wp_object_types : JSON.stringify( input.wpObjectTypes ),
5641
+ CZRCpNonce : serverControlParams.CZRCpNonce
5642
+ };
5643
+ },
5644
+ processResults: function ( data, params ) {
5645
+ input.defaultContentPickerOption = input.defaultContentPickerOption || [];
5646
+
5647
+ if ( ! data.success )
5648
+ return { results: input.defaultContentPickerOption };
5649
+
5650
+ var items = data.data.items,
5651
+ _results = _.clone( input.defaultContentPickerOption );
5652
+
5653
+ _.each( items, function( item ) {
5654
+ _results.push({
5655
+ id : item.id,
5656
+ title : item.title,
5657
+ type_label : item.type_label,
5658
+ object_type : item.object,
5659
+ url : item.url
5660
+ });
5661
+ });
5662
+ return {
5663
+ results: _results,
5664
+ pagination: { more: data.data.items.length == 10 }
5665
+ };
5666
+ },
5667
+ },//ajax
5668
+ templateSelection: input.czrFormatContentSelected,
5669
+ templateResult: input.czrFormatContentSelected,
5670
+ escapeMarkup: function (markup) { return markup; },
5671
+ });//select2 setup
5672
+ },
5673
+
5674
+
5675
+ czrFormatContentSelected: function (item) {
5676
+ if ( item.loading ) return item.text;
5677
+ var markup = "<div class='content-picker-item clearfix'>" +
5678
+ "<div class='content-item-bar'>" +
5679
+ "<span class='item-title'>" + item.title + "</span>";
5680
+
5681
+ if ( item.type_label ) {
5682
+ markup += "<span class='item-type'>" + item.type_label + "</span>";
5683
+ }
5684
+
5685
+ markup += "</div></div>";
5686
+
5687
+ return markup;
5688
+ },
5689
+
5690
+ setupSelectedContents : function() {
5691
+ var input = this,
5692
+ _model = input();
5693
+
5694
+ return _model;
5695
+ }
5696
+ });//$.extend
5697
+ })( wp.customize , jQuery, _ );var CZRInputMths = CZRInputMths || {};
5698
+ ( function ( api, $, _ ) {
5699
+ $.extend( CZRInputMths , {
5700
+ setupTextEditor : function() {
5701
+ var input = this,
5702
+ _model = input();
5703
+ if ( ! input.container ) {
5704
+ throw new Error( 'The input container is not set for WP text editor in module.' + input.module.id );
5705
+ }
5706
+
5707
+ if ( ! input.czrRenderInputTextEditorTemplate() )
5708
+ return;
5709
+
5710
+ input.editor = tinyMCE( 'czr-customize-content_editor' );
5711
+ input.textarea = $( '#czr-customize-content_editor' );
5712
+ input.editorPane = $( '#czr-customize-content_editor-pane' );
5713
+ input.dragbar = $( '#czr-customize-content_editor-dragbar' );
5714
+ input.editorFrame = $( '#czr-customize-content_editor_ifr' );
5715
+ input.mceTools = $( '#wp-czr-customize-content_editor-tools' );
5716
+ input.mceToolbar = input.editorPane.find( '.mce-toolbar-grp' );
5717
+ input.mceStatusbar = input.editorPane.find( '.mce-statusbar' );
5718
+
5719
+ input.preview = $( '#customize-preview' );
5720
+ input.collapse = $( '.collapse-sidebar' );
5721
+
5722
+ input.textpreview = input.container.find('textarea');
5723
+ input.toggleButton = input.container.find('button.text_editor-button');
5724
+ input.editorExpanded = new api.Value( false );
5725
+ input.czrUpdateTextPreview();
5726
+ input.czrSetToggleButtonText( input.editorExpanded() );
5727
+
5728
+ input.czrTextEditorBinding();
5729
+
5730
+ input.czrResizeEditorOnUserRequest();
5731
+ },
5732
+
5733
+ czrTextEditorBinding : function() {
5734
+ var input = this,
5735
+ editor = input.editor,
5736
+ textarea = input.textarea,
5737
+ toggleButton = input.toggleButton,
5738
+ editorExpanded = input.editorExpanded,
5739
+ editorPane = input.editorPane;
5740
+
5741
+
5742
+ input.bind( input.id + ':changed', input.czrUpdateTextPreview );
5743
+
5744
+ _.bindAll( input, 'czrOnVisualEditorChange', 'czrOnTextEditorChange', 'czrResizeEditorOnWindowResize' );
5745
+
5746
+ toggleButton.on( 'click', function() {
5747
+ input.editorExpanded.set( ! input.editorExpanded() );
5748
+ if ( input.editorExpanded() ) {
5749
+ editor.focus();
5750
+ }
5751
+ });
5752
+ input.module.czr_ModuleState.bind(
5753
+ function( state ) {
5754
+ if ( 'expanded' != state )
5755
+ input.editorExpanded.set( false );
5756
+ });
5757
+
5758
+ input.editorExpanded.bind( function (expanded) {
5759
+
5760
+ api.consoleLog('in input.editorExpanded', expanded, input() );
5761
+ if ( editor.locker && editor.locker !== input ) {
5762
+ editor.locker.editorExpanded.set(false);
5763
+ editor.locker = null;
5764
+ }if ( ! editor.locker || editor.locker === input ) {
5765
+ $(document.body).toggleClass('czr-customize-content_editor-pane-open', expanded);
5766
+ editor.locker = input;
5767
+ }
5768
+ input.czrSetToggleButtonText( expanded );
5769
+
5770
+ if ( expanded ) {
5771
+ editor.setContent( wp.editor.autop( input() ) );
5772
+ editor.on( 'input change keyup', input.czrOnVisualEditorChange );
5773
+ textarea.on( 'input', input.czrOnTextEditorChange );
5774
+ input.czrResizeEditor( window.innerHeight - editorPane.height() );
5775
+ $( window ).on('resize', input.czrResizeEditorOnWindowResize );
5776
+
5777
+ } else {
5778
+ editor.off( 'input change keyup', input.czrOnVisualEditorChange );
5779
+ textarea.off( 'input', input.czrOnTextEditorChange );
5780
+ $( window ).off('resize', input.czrResizeEditorOnWindowResize );
5781
+ input.czrResizeReset();
5782
+ }
5783
+ } );
5784
+ },
5785
+
5786
+ czrOnVisualEditorChange : function() {
5787
+ var input = this,
5788
+ editor = input.editor,
5789
+ value;
5790
+
5791
+ value = wp.editor.removep( editor.getContent() );
5792
+ input.set(value);
5793
+ },
5794
+
5795
+ czrOnTextEditorChange : function() {
5796
+ var input = this,
5797
+ textarea = input.textarea,
5798
+ value;
5799
+
5800
+ value = textarea.val();
5801
+ input.set(value);
5802
+ },
5803
+ czrUpdateTextPreview: function() {
5804
+ var input = this,
5805
+ input_model = input(),
5806
+ value;
5807
+ value = input_model.replace(/(<([^>]+)>)/ig,"");
5808
+ if ( value.length > 30 )
5809
+ value = value.substring(0, 34) + '...';
5810
+
5811
+ input.textpreview.val( value );
5812
+ },
5813
+ czrRenderInputTextEditorTemplate: function() {
5814
+ var input = this;
5815
+ if ( 0 === $( '#tmpl-czr-input-text_editor-view-content' ).length ) {
5816
+ throw new Error('Missing js template for text editor input in module : ' + input.module.id );
5817
+ }
5818
+
5819
+ var view_template = wp.template('czr-input-text_editor-view-content'),
5820
+ $_view_el = input.container.find('input');
5821
+ if ( ! view_template || ! input.container )
5822
+ return;
5823
+
5824
+ api.consoleLog('Model injected in text editor tmpl : ', input() );
5825
+
5826
+ $_view_el.after( view_template( input() ) );
5827
+
5828
+ return true;
5829
+ },
5830
+ czrIsEditorExpanded : function() {
5831
+ return $( document.body ).hasClass('czr-customize-content_editor-pane-open');
5832
+ },
5833
+ czrResizeReset : function() {
5834
+ var input = this,
5835
+ preview = input.preview,
5836
+ collapse = input.collapse,
5837
+ sectionContent = input.container.closest('ul.accordion-section-content');
5838
+
5839
+ sectionContent.css( 'padding-bottom', '' );
5840
+ preview.css( 'bottom', '' );
5841
+ collapse.css( 'bottom', '' );
5842
+ },
5843
+ czrResizeEditor : function( position ) {
5844
+ var windowHeight = window.innerHeight,
5845
+ windowWidth = window.innerWidth,
5846
+ minScroll = 40,
5847
+ maxScroll = 1,
5848
+ mobileWidth = 782,
5849
+ collapseMinSpacing = 56,
5850
+ collapseBottomOutsideEditor = 8,
5851
+ collapseBottomInsideEditor = 4,
5852
+ args = {},
5853
+ input = this,
5854
+ sectionContent = input.container.closest('ul.accordion-section-content'),
5855
+ mceTools = input.mceTools,
5856
+ mceToolbar = input.mceToolbar,
5857
+ mceStatusbar = input.mceStatusbar,
5858
+ preview = input.preview,
5859
+ collapse = input.collapse,
5860
+ editorPane = input.editorPane,
5861
+ editorFrame = input.editorFrame;
5862
+
5863
+ if ( ! input.editorExpanded() ) {
5864
+ return;
5865
+ }
5866
+
5867
+ if ( ! _.isNaN( position ) ) {
5868
+ resizeHeight = windowHeight - position;
5869
+ }
5870
+
5871
+ args.height = resizeHeight;
5872
+ args.components = mceTools.outerHeight() + mceToolbar.outerHeight() + mceStatusbar.outerHeight();
5873
+
5874
+ if ( resizeHeight < minScroll ) {
5875
+ args.height = minScroll;
5876
+ }
5877
+
5878
+ if ( resizeHeight > windowHeight - maxScroll ) {
5879
+ args.height = windowHeight - maxScroll;
5880
+ }
5881
+
5882
+ if ( windowHeight < editorPane.outerHeight() ) {
5883
+ args.height = windowHeight;
5884
+ }
5885
+
5886
+ preview.css( 'bottom', args.height );
5887
+ editorPane.css( 'height', args.height );
5888
+ editorFrame.css( 'height', args.height - args.components );
5889
+ collapse.css( 'bottom', args.height + collapseBottomOutsideEditor );
5890
+
5891
+ if ( collapseMinSpacing > windowHeight - args.height ) {
5892
+ collapse.css( 'bottom', mceStatusbar.outerHeight() + collapseBottomInsideEditor );
5893
+ }
5894
+
5895
+ if ( windowWidth <= mobileWidth ) {
5896
+ sectionContent.css( 'padding-bottom', args.height );
5897
+ } else {
5898
+ sectionContent.css( 'padding-bottom', '' );
5899
+ }
5900
+ },
5901
+ czrResizeEditorOnWindowResize : function() {
5902
+ var input = this,
5903
+ resizeDelay = 50,
5904
+ editorPane = input.editorPane;
5905
+
5906
+ if ( ! input.editorExpanded() ) {
5907
+ return;
5908
+ }
5909
+
5910
+ _.delay( function() {
5911
+ input.czrResizeEditor( window.innerHeight - editorPane.height() );
5912
+ }, resizeDelay );
5913
+
5914
+ },
5915
+ czrResizeEditorOnUserRequest : function() {
5916
+ var input = this,
5917
+ dragbar = input.dragbar,
5918
+ editorFrame = input.editorFrame;
5919
+
5920
+ dragbar.on( 'mousedown', function() {
5921
+ if ( ! input.editorExpanded() )
5922
+ return;
5923
+
5924
+ $( document ).on( 'mousemove.czr-customize-content_editor', function( event ) {
5925
+ event.preventDefault();
5926
+ $( document.body ).addClass( 'czr-customize-content_editor-pane-resize' );
5927
+ editorFrame.css( 'pointer-events', 'none' );
5928
+ input.czrResizeEditor( event.pageY );
5929
+ } );
5930
+ } );
5931
+
5932
+ dragbar.on( 'mouseup', function() {
5933
+ if ( ! input.editorExpanded() )
5934
+ return;
5935
+
5936
+ $( document ).off( 'mousemove.czr-customize-content_editor' );
5937
+ $( document.body ).removeClass( 'czr-customize-content_editor-pane-resize' );
5938
+ editorFrame.css( 'pointer-events', '' );
5939
+ } );
5940
+
5941
+ },
5942
+ czrSetToggleButtonText : function( $_expanded ) {
5943
+ var input = this;
5944
+
5945
+ input.toggleButton.text( serverControlParams.i18n.mods.textEditor[ ! $_expanded ? 'Edit' : 'Close Editor' ] );
5946
+ }
5947
+ });//$.extend
5948
+ })( wp.customize , jQuery, _ );//extends api.Value
5949
+
5950
+ var CZRItemMths = CZRItemMths || {};
5951
+ ( function ( api, $, _ ) {
5952
+ $.extend( CZRItemMths , {
5953
+ initialize: function( id, options ) {
5954
+ if ( _.isUndefined(options.module) || _.isEmpty(options.module) ) {
5955
+ throw new Error('No module assigned to item ' + id + '. Aborting');
5956
+ }
5957
+
5958
+ var item = this;
5959
+ api.Value.prototype.initialize.call( item, null, options );
5960
+ item.isReady = $.Deferred();
5961
+ item.embedded = $.Deferred();
5962
+ item.container = null;//will store the item $ dom element
5963
+ item.contentContainer = null;//will store the item content $ dom element
5964
+ item.inputCollection = new api.Value({});
5965
+ item.viewState = new api.Value( 'closed' );
5966
+ item.removeDialogVisible = new api.Value( false );
5967
+ $.extend( item, options || {} );
5968
+ item.defaultItemModel = _.clone( options.defaultItemModel ) || { id : '', title : '' };
5969
+ var _initial_model = $.extend( item.defaultItemModel, options.initial_item_model );
5970
+ item.set( _initial_model );
5971
+ item.userEventMap = new api.Value( [
5972
+ {
5973
+ trigger : 'click keydown',
5974
+ selector : [ '.' + item.module.control.css_attr.display_alert_btn, '.' + item.module.control.css_attr.cancel_alert_btn ].join(','),
5975
+ name : 'toggle_remove_alert',
5976
+ actions : function() {
5977
+ var _isVisible = this.removeDialogVisible();
5978
+ this.module.closeRemoveDialogs();
5979
+ this.removeDialogVisible( ! _isVisible );
5980
+ }
5981
+ },
5982
+ {
5983
+ trigger : 'click keydown',
5984
+ selector : '.' + item.module.control.css_attr.remove_view_btn,
5985
+ name : 'remove_item',
5986
+ actions : ['removeItem']
5987
+ },
5988
+ {
5989
+ trigger : 'click keydown',
5990
+ selector : [ '.' + item.module.control.css_attr.edit_view_btn, '.' + item.module.control.css_attr.item_title ].join(','),
5991
+ name : 'edit_view',
5992
+ actions : [ 'setViewVisibility' ]
5993
+ },
5994
+ {
5995
+ trigger : 'click keydown',
5996
+ selector : '.tabs nav li',
5997
+ name : 'tab_nav',
5998
+ actions : function( args ) {
5999
+ this.module.toggleTabVisibility.call( this, args );
6000
+ }
6001
+ }
6002
+ ]);
6003
+ item.isReady.done( function() {
6004
+ item.module.updateItemsCollection( { item : item() } );
6005
+ item.callbacks.add( function() { return item.itemReact.apply(item, arguments ); } );
6006
+ item.bind( 'contentRendered', function() {
6007
+ if ( ! _.has( item, 'czr_Input' ) || _.isEmpty( item.inputCollection() ) ) {
6008
+ try {
6009
+ api.CZR_Helpers.setupInputCollectionFromDOM.call( item );
6010
+ item.module.setupTabNav.call( item );
6011
+ } catch( er ) {
6012
+ api.errorLog( 'In item.isReady.done : ' + er );
6013
+ }
6014
+ }
6015
+ });
6016
+ item.bind( 'contentRemoved', function() {
6017
+ if ( _.has(item, 'czr_Input') )
6018
+ api.CZR_Helpers.removeInputCollection.call( item );
6019
+ });
6020
+ item.mayBeRenderItemWrapper();
6021
+ item.embedded.done( function() {
6022
+ item.itemWrapperViewSetup( _initial_model );
6023
+ });
6024
+ });//item.isReady.done()
6025
+
6026
+ },//initialize
6027
+ ready : function() {
6028
+ this.isReady.resolve();
6029
+ },
6030
+ itemReact : function( to, from, data ) {
6031
+ var item = this,
6032
+ module = item.module;
6033
+
6034
+ data = data || {};
6035
+ module.updateItemsCollection( { item : to, data : data } ).done( function() {
6036
+ item.writeItemViewTitle( to, data );
6037
+ });
6038
+ }
6039
+ });//$.extend
6040
+ })( wp.customize , jQuery, _ );//extends api.CZRBaseControl
6041
+
6042
+ var CZRItemMths = CZRItemMths || {};
6043
+ ( function ( api, $, _ ) {
6044
+ $.extend( CZRItemMths , {
6045
+ _sendItem : function( to, from ) {
6046
+ var item = this,
6047
+ module = item.module,
6048
+ _changed_props = [];
6049
+ _.each( from, function( _val, _key ) {
6050
+ if ( _val != to[_key] )
6051
+ _changed_props.push(_key);
6052
+ });
6053
+
6054
+ _.each( _changed_props, function( _prop ) {
6055
+ module.control.previewer.send( 'sub_setting', {
6056
+ set_id : module.control.id,
6057
+ id : to.id,
6058
+ changed_prop : _prop,
6059
+ value : to[_prop]
6060
+ });
6061
+ module.trigger('item_sent', { item : to , dom_el: item.container, changed_prop : _prop } );
6062
+ });
6063
+ },
6064
+ removeItem : function() {
6065
+ var item = this,
6066
+ module = this.module,
6067
+ _new_collection = _.clone( module.itemCollection() );
6068
+ module.trigger('pre_item_dom_remove', item() );
6069
+ item._destroyView();
6070
+ _new_collection = _.without( _new_collection, _.findWhere( _new_collection, {id: item.id }) );
6071
+ module.itemCollection.set( _new_collection );
6072
+ module.trigger('pre_item_api_remove', item() );
6073
+ module.czr_Item.remove(item.id);
6074
+ },
6075
+ getModel : function(id) {
6076
+ return this();
6077
+ }
6078
+
6079
+ });//$.extend
6080
+ })( wp.customize , jQuery, _ );
6081
+ var CZRItemMths = CZRItemMths || {};
6082
+ ( function ( api, $, _ ) {
6083
+ $.extend( CZRItemMths , {
6084
+ mayBeRenderItemWrapper : function() {
6085
+ var item = this;
6086
+
6087
+ if ( 'pending' != item.embedded.state() )
6088
+ return;
6089
+
6090
+ $.when( item.renderItemWrapper() ).done( function( $_container ) {
6091
+ item.container = $_container;
6092
+ if ( _.isUndefined(item.container) || ! item.container.length ) {
6093
+ throw new Error( 'In mayBeRenderItemWrapper the Item view has not been rendered : ' + item.id );
6094
+ } else {
6095
+ item.embedded.resolve();
6096
+ }
6097
+ });
6098
+ },
6099
+ itemWrapperViewSetup : function( item_model ) {
6100
+ var item = this,
6101
+ module = this.module;
6102
+
6103
+ item_model = item() || item.initial_item_model;//could not be set yet
6104
+ item.writeItemViewTitle();
6105
+ var _updateItemContentDeferred = function( $_content, to, from ) {
6106
+ if ( ! _.isUndefined( $_content ) && false !== $_content.length ) {
6107
+ item.trigger( 'contentRendered' );
6108
+ item.contentContainer = $_content;
6109
+ item.toggleItemExpansion( to, from );
6110
+ }
6111
+ else {
6112
+ throw new Error( 'Module : ' + item.module.id + ', the item content has not been rendered for ' + item.id );
6113
+ }
6114
+ };
6115
+
6116
+ if ( item.module.isMultiItem() ) {
6117
+ item.viewState.callbacks.add( function( to, from ) {
6118
+ var _isExpanded = -1 !== to.indexOf( 'expanded' );
6119
+ if ( _isExpanded ) {
6120
+ if ( _.isObject( item.contentContainer ) && false !== item.contentContainer.length ) {
6121
+ item.toggleItemExpansion(to, from );
6122
+ } else {
6123
+ $.when( item.renderItemContent( item() || item.initial_item_model ) ).done( function( $_item_content ) {
6124
+ _updateItemContentDeferred = _.debounce(_updateItemContentDeferred, 50 );
6125
+ _updateItemContentDeferred( $_item_content, to, from );
6126
+ });
6127
+ }
6128
+ } else {
6129
+ item.toggleItemExpansion( to, from ).done( function() {
6130
+ if ( _.isObject( item.contentContainer ) && false !== item.contentContainer.length ) {
6131
+ item.trigger( 'beforeContenRemoved' );
6132
+ $( '.' + module.control.css_attr.item_content, item.container ).children().each( function() {
6133
+ $(this).remove();
6134
+ });
6135
+ $( '.' + module.control.css_attr.item_content, item.container ).html('');
6136
+ item.contentContainer = null;
6137
+ item.trigger( 'contentRemoved' );
6138
+ }
6139
+ });
6140
+ }
6141
+ });
6142
+ } else {
6143
+ item.viewState.callbacks.add( function( to, from ) {
6144
+ item.toggleItemExpansion.apply(item, arguments );
6145
+ });
6146
+ $.when( item.renderItemContent( item_model ) ).done( function( $_item_content ) {
6147
+ _updateItemContentDeferred( $_item_content, true );
6148
+ });
6149
+ }
6150
+ api.CZR_Helpers.setupDOMListeners(
6151
+ item.userEventMap(),//actions to execute
6152
+ { model:item_model, dom_el:item.container },//model + dom scope
6153
+ item //instance where to look for the cb methods
6154
+ );
6155
+ item.removeDialogVisible.bind( function( visible ) {
6156
+ var module = item.module,
6157
+ $_alert_el = $( '.' + module.control.css_attr.remove_alert_wrapper, item.container ).first();
6158
+ if ( visible )
6159
+ module.closeAllItems();
6160
+ if ( visible && module.hasModOpt() ) {
6161
+ api.czr_ModOptVisible( false );
6162
+ }
6163
+ if ( visible && _.has( module, 'preItem' ) ) {
6164
+ module.preItemExpanded(false);
6165
+ }
6166
+ $('.' + module.control.css_attr.remove_alert_wrapper, item.container ).not( $_alert_el ).each( function() {
6167
+ if ( $(this).hasClass( 'open' ) ) {
6168
+ $(this).slideToggle( {
6169
+ duration : 200,
6170
+ done : function() {
6171
+ $(this).toggleClass('open' , false );
6172
+ $(this).siblings().find('.' + module.control.css_attr.display_alert_btn).toggleClass( 'active' , false );
6173
+ }
6174
+ } );
6175
+ }
6176
+ });
6177
+ if ( visible ) {
6178
+ if ( ! wp.template( module.AlertPart ) || ! item.container ) {
6179
+ api.consoleLog( 'No removal alert template available for items in module :' + module.id );
6180
+ return;
6181
+ }
6182
+
6183
+ $_alert_el.html( wp.template( module.AlertPart )( { title : ( item().title || item.id ) } ) );
6184
+ }
6185
+ var _slideComplete = function( visible ) {
6186
+ $_alert_el.toggleClass( 'open' , visible );
6187
+ item.container.find('.' + module.control.css_attr.display_alert_btn ).toggleClass( 'active', visible );
6188
+ if ( visible )
6189
+ module._adjustScrollExpandedBlock( item.container );
6190
+ };
6191
+ if ( visible )
6192
+ $_alert_el.stop( true, true ).slideDown( 200, function() { _slideComplete( visible ); } );
6193
+ else
6194
+ $_alert_el.stop( true, true ).slideUp( 200, function() { _slideComplete( visible ); } );
6195
+ });//item.removeDialogVisible.bind()
6196
+ },//itemWrapperViewSetup
6197
+ renderItemWrapper : function( item_model ) {
6198
+ var item = this,
6199
+ module = item.module;
6200
+
6201
+ item_model = item_model || item();
6202
+ $_view_el = $('<li>', { class : module.control.css_attr.single_item, 'data-id' : item_model.id, id : item_model.id } );
6203
+ module.itemsWrapper.append( $_view_el );
6204
+ if ( module.isMultiItem() ) {
6205
+ var _template_selector = module.getTemplateEl( 'rudItemPart', item_model );
6206
+ if ( 0 === $( '#tmpl-' + _template_selector ).length ) {
6207
+ throw new Error('Missing template for item ' + item.id + '. The provided template script has no been found : #tmpl-' + module.getTemplateEl( 'rudItemPart', item_model ) );
6208
+ }
6209
+ $_view_el.append( $( wp.template( _template_selector )( item_model ) ) );
6210
+ }
6211
+ $_view_el.append( $( '<div/>', { class: module.control.css_attr.item_content } ) );
6212
+
6213
+ return $_view_el;
6214
+ },
6215
+ renderItemContent : function( item_model ) {
6216
+ var item = this,
6217
+ module = this.module;
6218
+
6219
+ item_model = item_model || item();
6220
+ if ( 0 === $( '#tmpl-' + module.getTemplateEl( 'itemInputList', item_model ) ).length ) {
6221
+ throw new Error('No item content template defined for module ' + module.id + '. The template script id should be : #tmpl-' + module.getTemplateEl( 'itemInputList', item_model ) );
6222
+ }
6223
+
6224
+ var item_content_template = wp.template( module.getTemplateEl( 'itemInputList', item_model ) );
6225
+ if ( ! item_content_template )
6226
+ return this;
6227
+ $( item_content_template( item_model )).appendTo( $('.' + module.control.css_attr.item_content, item.container ) );
6228
+
6229
+ return $( $( item_content_template( item_model )), item.container );
6230
+ },
6231
+ writeItemViewTitle : function( item_model ) {
6232
+ var item = this,
6233
+ module = item.module,
6234
+ _model = item_model || item(),
6235
+ _title = _.has( _model, 'title')? api.CZR_Helpers.capitalize( _model.title ) : _model.id;
6236
+
6237
+ _title = api.CZR_Helpers.truncate( _title, 20 );
6238
+ $( '.' + module.control.css_attr.item_title , item.container ).text(_title );
6239
+ api.CZR_Helpers.doActions('after_writeViewTitle', item.container , _model, item );
6240
+ },
6241
+ setViewVisibility : function( obj, is_added_by_user ) {
6242
+ var item = this,
6243
+ module = this.module;
6244
+ if ( is_added_by_user ) {
6245
+ item.viewState.set( 'expanded_noscroll' );
6246
+ } else {
6247
+ module.closeAllItems( item.id );
6248
+ if ( _.has(module, 'preItem') ) {
6249
+ module.preItemExpanded.set(false);
6250
+ }
6251
+ item.viewState.set( 'expanded' == item._getViewState() ? 'closed' : 'expanded' );
6252
+ }
6253
+ },
6254
+
6255
+
6256
+ _getViewState : function() {
6257
+ return -1 == this.viewState().indexOf('expanded') ? 'closed' : 'expanded';
6258
+ },
6259
+ toggleItemExpansion : function( status, from, duration ) {
6260
+ var visible = 'closed' != status,
6261
+ item = this,
6262
+ module = this.module,
6263
+ $el = $( '.' + module.control.css_attr.item_content , item.container ).first(),
6264
+ dfd = $.Deferred(),
6265
+ _slideComplete = function( visible ) {
6266
+ item.container.toggleClass( 'open' , visible );
6267
+ if ( visible )
6268
+ module.closeRemoveDialogs();
6269
+ var $_edit_icon = $el.siblings().find('.' + module.control.css_attr.edit_view_btn );
6270
+
6271
+ $_edit_icon.toggleClass('active' , visible );
6272
+ if ( visible )
6273
+ $_edit_icon.removeClass('fa-pencil').addClass('fa-minus-square').attr('title', serverControlParams.i18n.close );
6274
+ else
6275
+ $_edit_icon.removeClass('fa-minus-square').addClass('fa-pencil').attr('title', serverControlParams.i18n.edit );
6276
+ if ( 'expanded' == status )
6277
+ module._adjustScrollExpandedBlock( item.container );
6278
+
6279
+ dfd.resolve();
6280
+ };
6281
+
6282
+ if ( visible )
6283
+ $el.stop( true, true ).slideDown( duration || 200, function() { _slideComplete( visible ); } );
6284
+ else
6285
+ $el.stop( true, true ).slideUp( 200, function() { _slideComplete( visible ); } );
6286
+
6287
+ return dfd.promise();
6288
+ },
6289
+ _destroyView : function ( duration ) {
6290
+ this.container.fadeOut( {
6291
+ duration : duration ||400,
6292
+ done : function() {
6293
+ $(this).remove();
6294
+ }
6295
+ });
6296
+ }
6297
+ });//$.extend
6298
+ })( wp.customize , jQuery, _ );//extends api.Value
6299
+
6300
+ var CZRModOptMths = CZRModOptMths || {};
6301
+ ( function ( api, $, _ ) {
6302
+ $.extend( CZRModOptMths , {
6303
+ initialize: function( options ) {
6304
+ if ( _.isUndefined(options.module) || _.isEmpty(options.module) ) {
6305
+ throw new Error('No module assigned to modOpt.');
6306
+ }
6307
+
6308
+ var modOpt = this;
6309
+ api.Value.prototype.initialize.call( modOpt, null, options );
6310
+ modOpt.isReady = $.Deferred();
6311
+ modOpt.container = null;//will store the modOpt $ dom element
6312
+ modOpt.inputCollection = new api.Value({});
6313
+ $.extend( modOpt, options || {} );
6314
+ modOpt.defaultModOptModel = _.clone( options.defaultModOptModel ) || { is_mod_opt : true };
6315
+ var _initial_model = $.extend( modOpt.defaultModOptModel, options.initial_modOpt_model );
6316
+ var ctrl = modOpt.module.control;
6317
+ modOpt.set( _initial_model );
6318
+ api.czr_ModOptVisible = new api.Value( false );
6319
+ api.czr_ModOptVisible.bind( function( visible ) {
6320
+ if ( visible ) {
6321
+ modOpt.module.closeRemoveDialogs();
6322
+
6323
+ modOpt.modOptWrapperViewSetup( _initial_model ).done( function( $_container ) {
6324
+ modOpt.container = $_container;
6325
+ try {
6326
+ api.CZR_Helpers.setupInputCollectionFromDOM.call( modOpt ).toggleModPanelView( visible );
6327
+ } catch(e) {
6328
+ api.consoleLog(e);
6329
+ }
6330
+ });
6331
+
6332
+ } else {
6333
+ modOpt.toggleModPanelView( visible ).done( function() {
6334
+ if ( false !== modOpt.container.length ) {
6335
+ $.when( modOpt.container.remove() ).done( function() {
6336
+ api.CZR_Helpers.removeInputCollection.call( modOpt );
6337
+ });
6338
+ } else {
6339
+ api.CZR_Helpers.removeInputCollection.call( modOpt );
6340
+ }
6341
+ modOpt.container = null;
6342
+ });
6343
+ }
6344
+ } );
6345
+ modOpt.isReady.done( function() {
6346
+ if( ! $( '.' + ctrl.css_attr.edit_modopt_icon, ctrl.container ).length ) {
6347
+ $.when( ctrl.container
6348
+ .find('.customize-control-title').first()//was.find('.customize-control-title')
6349
+ .append( $( '<span/>', {
6350
+ class : [ ctrl.css_attr.edit_modopt_icon, 'fa fa-cog' ].join(' '),
6351
+ title : serverControlParams.i18n['Settings']
6352
+ } ) ) )
6353
+ .done( function(){
6354
+ $( '.' + ctrl.css_attr.edit_modopt_icon, ctrl.container ).fadeIn( 400 );
6355
+ });
6356
+ }
6357
+ api.CZR_Helpers.setupDOMListeners(
6358
+ [
6359
+ {
6360
+ trigger : 'click keydown',
6361
+ selector : '.' + ctrl.css_attr.edit_modopt_icon,
6362
+ name : 'toggle_mod_option',
6363
+ actions : function() {
6364
+ api.czr_ModOptVisible( ! api.czr_ModOptVisible() );
6365
+ }
6366
+ }
6367
+ ],//actions to execute
6368
+ { dom_el: ctrl.container },//dom scope
6369
+ modOpt //instance where to look for the cb methods
6370
+ );
6371
+ });//modOpt.isReady.done()
6372
+
6373
+ },//initialize
6374
+ ready : function() {
6375
+ this.isReady.resolve();
6376
+ }
6377
+ });//$.extend
6378
+ })( wp.customize , jQuery, _ );//extends api.CZRBaseControl
6379
+
6380
+ var CZRModOptMths = CZRModOptMths || {};
6381
+ ( function ( api, $, _ ) {
6382
+ $.extend( CZRModOptMths , {
6383
+ modOptWrapperViewSetup : function( modOpt_model ) {
6384
+ var modOpt = this,
6385
+ module = this.module,
6386
+ dfd = $.Deferred(),
6387
+ _setupDOMListeners = function( $_container ) {
6388
+ api.CZR_Helpers.setupDOMListeners(
6389
+ [
6390
+ {
6391
+ trigger : 'click keydown',
6392
+ selector : '.' + module.control.css_attr.close_modopt_icon,
6393
+ name : 'close_mod_option',
6394
+ actions : function() {
6395
+ api.czr_ModOptVisible( false );
6396
+ }
6397
+ },
6398
+ {
6399
+ trigger : 'click keydown',
6400
+ selector : '.tabs nav li',
6401
+ name : 'tab_nav',
6402
+ actions : function( args ) {
6403
+ this.module.toggleTabVisibility.call( this, args );
6404
+ }
6405
+ }
6406
+ ],//actions to execute
6407
+ { dom_el: $_container },//model + dom scope
6408
+ modOpt //instance where to look for the cb methods
6409
+ );
6410
+ };
6411
+
6412
+ modOpt_model = modOpt() || modOpt.initial_modOpt_model;//could not be set yet
6413
+ $.when( modOpt.renderModOptContent( modOpt_model ) )
6414
+ .done( function( $_container ) {
6415
+ if ( ! _.isUndefined( $_container ) && false !== $_container.length ) {
6416
+ _setupDOMListeners( $_container );
6417
+ dfd.resolve( $_container );
6418
+ }
6419
+ else {
6420
+ throw new Error( 'Module : ' + modOpt.module.id + ', the modOpt content has not been rendered' );
6421
+ }
6422
+ })
6423
+ .then( function() {
6424
+ modOpt.module.setupTabNav.call( modOpt );
6425
+ });
6426
+
6427
+ return dfd.promise();
6428
+ },
6429
+ renderModOptContent : function( modOpt_model ) {
6430
+ var modOpt = this,
6431
+ module = this.module;
6432
+
6433
+ modOpt_model = modOpt_model || modOpt();
6434
+ if ( 0 === $( '#tmpl-' + module.getTemplateEl( 'modOptInputList', modOpt_model ) ).length ) {
6435
+ api.errorLog('renderModOptContent : No modOpt content template defined for module ' + module.id + '. The template script id should be : #tmpl-' + module.getTemplateEl( 'modOptInputList', modOpt_model ) );
6436
+ return;
6437
+ }
6438
+ var modOpt_content_template = wp.template( module.getTemplateEl( 'modOptInputList', modOpt_model ) );
6439
+ if ( ! modOpt_content_template )
6440
+ return this;
6441
+
6442
+ var _ctrlLabel = '';
6443
+ try {
6444
+ _ctrlLabel = [ serverControlParams.i18n['Options for'], module.control.params.label ].join(' ');
6445
+ } catch( er ) {
6446
+ api.errorLog( 'In renderModOptContent : ' + er );
6447
+ _ctrlLabel = serverControlParams.i18n['Settings'];
6448
+ }
6449
+
6450
+ $('#widgets-left').after( $( '<div/>', {
6451
+ class : module.control.css_attr.mod_opt_wrapper,
6452
+ html : [
6453
+ [ '<h2 class="mod-opt-title">', _ctrlLabel , '</h2>' ].join(''),
6454
+ '<span class="fa fa-times ' + module.control.css_attr.close_modopt_icon + '" title="close"></span>'
6455
+ ].join('')
6456
+ } ) );
6457
+ $( '.' + module.control.css_attr.mod_opt_wrapper ).append( $( modOpt_content_template( modOpt_model ) ) );
6458
+
6459
+ return $( '.' + module.control.css_attr.mod_opt_wrapper );
6460
+ },
6461
+
6462
+
6463
+
6464
+ toggleModPanelView : function( visible ) {
6465
+ var modOpt = this,
6466
+ module = this.module,
6467
+ ctrl = module.control,
6468
+ dfd = $.Deferred();
6469
+
6470
+ module.control.container.toggleClass( 'czr-modopt-visible', visible );
6471
+ $('body').toggleClass('czr-editing-modopt', visible );
6472
+ _.delay( function() {
6473
+ dfd.resolve();
6474
+ }, 200 );
6475
+ return dfd.promise();
6476
+ }
6477
+ });//$.extend
6478
+ })( wp.customize , jQuery, _ );//MULTI CONTROL CLASS
6479
+ var CZRModuleMths = CZRModuleMths || {};
6480
+ ( function ( api, $, _ ) {
6481
+ $.extend( CZRModuleMths, {
6482
+ initialize: function( id, constructorOptions ) {
6483
+ if ( _.isUndefined(constructorOptions.control) || _.isEmpty(constructorOptions.control) ) {
6484
+ throw new Error('No control assigned to module ' + id );
6485
+ }
6486
+ var module = this;
6487
+ api.Value.prototype.initialize.call( this, null, constructorOptions );
6488
+ module.isReady = $.Deferred();
6489
+ $.extend( module, constructorOptions || {} );
6490
+ $.extend( module, {
6491
+ crudModulePart : 'czr-crud-module-part',//create, read, update, delete
6492
+ rudItemPart : 'czr-rud-item-part',//read, update, delete
6493
+ ruItemPart : 'czr-ru-item-part',//read, update
6494
+ itemInputList : '',//is specific for each crud module
6495
+ modOptInputList : '',//is specific for each module
6496
+ AlertPart : 'czr-rud-item-alert-part',//used both for items and modules removal
6497
+
6498
+ } );
6499
+ module.embedded = $.Deferred();
6500
+ if ( ! module.isInSektion() ) {
6501
+ module.container = $( module.control.selector );
6502
+ module.embedded.resolve();
6503
+ }
6504
+ module.embedded.done( function() {
6505
+ $.when( module.renderModuleParts() ).done(function( $_module_items_wrapper ){
6506
+ if ( false === $_module_items_wrapper.length ) {
6507
+ throw new Error( 'The items wrapper has not been rendered for module : ' + module.id );
6508
+ }
6509
+ module.itemsWrapper = $_module_items_wrapper;
6510
+ });
6511
+ });
6512
+ module.defaultAPImodOptModel = {
6513
+ initial_modOpt_model : {},
6514
+ defaultModOptModel : {},
6515
+ control : {},//control instance
6516
+ module : {}//module instance
6517
+ };
6518
+ module.defaultModOptModel = {};
6519
+ module.modOptConstructor = api.CZRModOpt;
6520
+ module.itemCollection = new api.Value( [] );
6521
+ module.defaultAPIitemModel = {
6522
+ id : '',
6523
+ initial_item_model : {},
6524
+ defaultItemModel : {},
6525
+ control : {},//control instance
6526
+ module : {},//module instance
6527
+ is_added_by_user : false
6528
+ };
6529
+ module.defaultItemModel = { id : '', title : '' };
6530
+ module.itemConstructor = api.CZRItem;
6531
+ module.czr_Item = new api.Values();
6532
+ module.inputConstructor = api.CZRInput;//constructor for the items input
6533
+ if ( module.hasModOpt() ) {
6534
+ module.inputModOptConstructor = api.CZRInput;//constructor for the modOpt input
6535
+ }
6536
+ module.inputOptions = {};//<= can be set by each module specifically
6537
+ module.isReady.done( function() {
6538
+ module.isDirty = new api.Value( constructorOptions.dirty || false );
6539
+ module.initializeModuleModel( constructorOptions )
6540
+ .done( function( initialModuleValue ) {
6541
+ module.set( initialModuleValue );
6542
+ })
6543
+ .fail( function( response ){ api.consoleLog( 'Module : ' + module.id + ' initialize module model failed : ', response ); })
6544
+ .always( function( initialModuleValue ) {
6545
+ module.callbacks.add( function() { return module.moduleReact.apply( module, arguments ); } );
6546
+ if ( ! module.control.isModuleRegistered( module.id ) ) {
6547
+ module.control.updateModulesCollection( { module : constructorOptions, is_registered : false } );
6548
+ }
6549
+
6550
+ module.bind('items-collection-populated', function( collection ) {
6551
+ module.itemCollection.callbacks.add( function() { return module.itemCollectionReact.apply( module, arguments ); } );
6552
+ if ( module.isMultiItem() ) {
6553
+ module._makeItemsSortable();
6554
+ }
6555
+ });
6556
+ if ( ! module.isInSektion() )
6557
+ module.populateSavedItemCollection();
6558
+ if ( module.hasModOpt() ) {
6559
+ module.instantiateModOpt();
6560
+ }
6561
+ });
6562
+ });//module.isReady.done()
6563
+ },
6564
+ ready : function() {
6565
+ var module = this;
6566
+ module.isReady.resolve();
6567
+ },
6568
+ initializeModuleModel : function( constructorOptions ) {
6569
+ var module = this, dfd = $.Deferred();
6570
+ if ( ! module.isMultiItem() && ! module.isCrud() ) {
6571
+ if ( _.isEmpty( constructorOptions.items ) ) {
6572
+ var def = _.clone( module.defaultItemModel );
6573
+ constructorOptions.items = [ $.extend( def, { id : module.id } ) ];
6574
+ }
6575
+ }
6576
+ return dfd.resolve( constructorOptions ).promise();
6577
+ },
6578
+ itemCollectionReact : function( to, from, data ) {
6579
+ var module = this,
6580
+ _current_model = module(),
6581
+ _new_model = $.extend( true, {}, _current_model );
6582
+ _new_model.items = to;
6583
+ module.isDirty.set(true);
6584
+ module.set( _new_model, data || {} );
6585
+ },
6586
+ moduleReact : function( to, from, data ) {
6587
+ var module = this,
6588
+ control = module.control,
6589
+ isItemUpdate = ( _.size(from.items) == _.size(to.items) ) && ! _.isEmpty( _.difference(to.items, from.items) ),
6590
+ isColumnUpdate = to.column_id != from.column_id,
6591
+ refreshPreview = function() {
6592
+ module.control.previewer.refresh();
6593
+ };
6594
+ control.updateModulesCollection( {
6595
+ module : $.extend( true, {}, to ),
6596
+ data : data//useful to pass contextual info when a change happens
6597
+ } );
6598
+ },
6599
+ getModuleSection : function() {
6600
+ return this.section;
6601
+ },
6602
+ isInSektion : function() {
6603
+ var module = this;
6604
+ return _.has( module, 'sektion_id' );
6605
+ },
6606
+ isMultiItem : function() {
6607
+ return api.CZR_Helpers.isMultiItemModule( null, this );
6608
+ },
6609
+ isCrud : function() {
6610
+ return api.CZR_Helpers.isCrudModule( null, this );
6611
+ },
6612
+
6613
+ hasModOpt : function() {
6614
+ return api.CZR_Helpers.hasModuleModOpt( null, this );
6615
+ },
6616
+ instantiateModOpt : function() {
6617
+ var module = this;
6618
+ var modOpt_candidate = module.prepareModOptForAPI( module().modOpt || {} );
6619
+ module.czr_ModOpt = new module.modOptConstructor( modOpt_candidate );
6620
+ module.czr_ModOpt.ready();
6621
+ module.czr_ModOpt.callbacks.add( function( to, from, data ) {
6622
+ var _current_model = module(),
6623
+ _new_model = $.extend( true, {}, _current_model );
6624
+ _new_model.modOpt = to;
6625
+ module.isDirty(true);
6626
+ module( _new_model, data );
6627
+ });
6628
+ },
6629
+ prepareModOptForAPI : function( modOpt_candidate ) {
6630
+ var module = this,
6631
+ api_ready_modOpt = {};
6632
+ modOpt_candidate = _.isObject( modOpt_candidate ) ? modOpt_candidate : {};
6633
+
6634
+ _.each( module.defaultAPImodOptModel, function( _value, _key ) {
6635
+ var _candidate_val = modOpt_candidate[_key];
6636
+ switch( _key ) {
6637
+ case 'initial_modOpt_model' :
6638
+ _.each( module.getDefaultModOptModel() , function( _value, _property ) {
6639
+ if ( ! _.has( modOpt_candidate, _property) )
6640
+ modOpt_candidate[_property] = _value;
6641
+ });
6642
+ api_ready_modOpt[_key] = modOpt_candidate;
6643
+
6644
+ break;
6645
+ case 'defaultModOptModel' :
6646
+ api_ready_modOpt[_key] = _.clone( module.defaultModOptModel );
6647
+ break;
6648
+ case 'control' :
6649
+ api_ready_modOpt[_key] = module.control;
6650
+ break;
6651
+ case 'module' :
6652
+ api_ready_modOpt[_key] = module;
6653
+ break;
6654
+ }//switch
6655
+ });
6656
+ return api_ready_modOpt;
6657
+ },
6658
+ getDefaultModOptModel : function( id ) {
6659
+ var module = this;
6660
+ return $.extend( _.clone( module.defaultModOptModel ), { is_mod_opt : true } );
6661
+ },
6662
+ sendInputToPreview : function( args ) {
6663
+ var module = this;
6664
+ args = _.extend(
6665
+ {
6666
+ input_id : '',
6667
+ input_parent_id : '',//<= can be the mod opt or an item
6668
+ to : null,
6669
+ from : null
6670
+ } , args );
6671
+
6672
+ if ( _.isEqual( args.to, args.from ) )
6673
+ return;
6674
+ module.control.previewer.send( 'czr_input', {
6675
+ set_id : api.CZR_Helpers.getControlSettingId( module.control.id ),
6676
+ module_id : module.id,//<= will allow us to target the right dom element on front end
6677
+ module : { items : $.extend( true, {}, module().items) , modOpt : module.hasModOpt() ? $.extend( true, {}, module().modOpt ): {} },
6678
+ input_parent_id : args.input_parent_id,//<= can be the mod opt or the item
6679
+ input_id : args.input_id,
6680
+ value : args.to
6681
+ });
6682
+ module.trigger( 'input_sent', { input : args.to , dom_el: module.container } );
6683
+ },
6684
+ sendModuleInputsToPreview : function() {
6685
+ var module = this,
6686
+ _sendInputData = function() {
6687
+ var inputParent = this,//this is the input parent : item or modOpt
6688
+ inputParentModel = $.extend( true, {}, inputParent() );
6689
+ inputParentModel = _.omit( inputParentModel, 'id' );
6690
+
6691
+ _.each( inputParentModel, function( inputVal, inputId ) {
6692
+ module.sendInputToPreview( {
6693
+ input_id : inputId,
6694
+ input_parent_id : inputParent.id,
6695
+ to : inputVal,
6696
+ from : null
6697
+ });
6698
+ });
6699
+ };
6700
+
6701
+ module.czr_Item.each( function( _itm_ ) {
6702
+ _sendInputData.call( _itm_ );
6703
+ });
6704
+
6705
+ if ( module.hasModOpt() ) {
6706
+ _sendInputData.call( module.czr_ModOpt );
6707
+ }
6708
+ }
6709
+ });//$.extend//CZRBaseControlMths
6710
+ })( wp.customize , jQuery, _ );//MULTI CONTROL CLASS
6711
+
6712
+ var CZRModuleMths = CZRModuleMths || {};
6713
+ ( function ( api, $, _ ) {
6714
+ $.extend( CZRModuleMths, {
6715
+ populateSavedItemCollection : function() {
6716
+ var module = this, _saved_items = [];
6717
+ if ( ! _.isArray( module().items ) ) {
6718
+ api.errorLog( 'populateSavedItemCollection : The saved items collection must be an array in module :' + module.id );
6719
+ return;
6720
+ }
6721
+ _.each( module().items, function( item_candidate , key ) {
6722
+ if ( _.has( item_candidate, 'id') && ! _.has( item_candidate, 'is_mod_opt' ) ) {
6723
+ _saved_items.push( item_candidate );
6724
+ }
6725
+ });
6726
+ _.each( _saved_items, function( item_candidate , key ) {
6727
+ try { module.instantiateItem( item_candidate ).ready(); } catch( er ) {
6728
+ api.errorLog( 'populateSavedItemCollection : ' + er );
6729
+ }
6730
+ });
6731
+ _.each( _saved_items, function( _item ) {
6732
+ if ( _.isUndefined( _.findWhere( module.itemCollection(), _item.id ) ) ) {
6733
+ throw new Error( 'populateSavedItemCollection : The saved items have not been properly populated in module : ' + module.id );
6734
+ }
6735
+ });
6736
+
6737
+ module.trigger( 'items-collection-populated' );
6738
+ },
6739
+
6740
+
6741
+ instantiateItem : function( item, is_added_by_user ) {
6742
+ var module = this;
6743
+ item_candidate = module.prepareItemForAPI( item );
6744
+ if ( ! _.has( item_candidate, 'id' ) ) {
6745
+ throw new Error('CZRModule::instantiateItem() : an item has no id and could not be added in the collection of : ' + this.id );
6746
+ }
6747
+ if ( module.czr_Item.has( item_candidate.id ) ) {
6748
+ throw new Error('CZRModule::instantiateItem() : the following item id ' + item_candidate.id + ' already exists in module.czr_Item() for module ' + this.id );
6749
+ }
6750
+ module.czr_Item.add( item_candidate.id, new module.itemConstructor( item_candidate.id, item_candidate ) );
6751
+
6752
+ if ( ! module.czr_Item.has( item_candidate.id ) ) {
6753
+ throw new Error('CZRModule::instantiateItem() : instantiation failed for item id ' + item_candidate.id + ' for module ' + this.id );
6754
+ }
6755
+ return module.czr_Item( item_candidate.id );
6756
+ },
6757
+ prepareItemForAPI : function( item_candidate ) {
6758
+ var module = this,
6759
+ api_ready_item = {};
6760
+ item_candidate = _.isObject( item_candidate ) ? item_candidate : {};
6761
+
6762
+ _.each( module.defaultAPIitemModel, function( _value, _key ) {
6763
+ var _candidate_val = item_candidate[_key];
6764
+ switch( _key ) {
6765
+ case 'id' :
6766
+ if ( _.isEmpty( _candidate_val ) ) {
6767
+ api_ready_item[_key] = module.generateItemId( module.module_type );
6768
+ } else {
6769
+ api_ready_item[_key] = _candidate_val;
6770
+ }
6771
+ break;
6772
+ case 'initial_item_model' :
6773
+ _.each( module.getDefaultItemModel() , function( _value, _property ) {
6774
+ if ( ! _.has( item_candidate, _property) )
6775
+ item_candidate[_property] = _value;
6776
+ });
6777
+ api_ready_item[_key] = item_candidate;
6778
+
6779
+ break;
6780
+ case 'defaultItemModel' :
6781
+ api_ready_item[_key] = _.clone( module.defaultItemModel );
6782
+ break;
6783
+ case 'control' :
6784
+ api_ready_item[_key] = module.control;
6785
+ break;
6786
+ case 'module' :
6787
+ api_ready_item[_key] = module;
6788
+ break;
6789
+ case 'is_added_by_user' :
6790
+ api_ready_item[_key] = _.isBoolean( _candidate_val ) ? _candidate_val : false;
6791
+ break;
6792
+ }//switch
6793
+ });
6794
+ if ( ! _.has( api_ready_item, 'id' ) ) {
6795
+ api_ready_item.id = module.generateItemId( module.module_type );
6796
+ }
6797
+ api_ready_item.initial_item_model.id = api_ready_item.id;
6798
+
6799
+ return api_ready_item;
6800
+ },
6801
+ generateItemId : function( module_type, key, i ) {
6802
+ i = i || 1;
6803
+ if ( i > 100 ) {
6804
+ throw new Error( 'Infinite loop when generating of a module id.' );
6805
+ }
6806
+ var module = this;
6807
+ key = key || module._getNextItemKeyInCollection();
6808
+ var id_candidate = module_type + '_' + key;
6809
+ if ( ! _.has(module, 'itemCollection') || ! _.isArray( module.itemCollection() ) ) {
6810
+ throw new Error('The item collection does not exist or is not properly set in module : ' + module.id );
6811
+ }
6812
+ if ( module.isItemRegistered( id_candidate ) ) {
6813
+ key++; i++;
6814
+ return module.generateItemId( module_type, key, i );
6815
+ }
6816
+ return id_candidate;
6817
+ },
6818
+ _getNextItemKeyInCollection : function() {
6819
+ var module = this,
6820
+ _maxItem = {},
6821
+ _next_key = 0;
6822
+ if ( _.isEmpty( module.itemCollection() ) )
6823
+ return _next_key;
6824
+ if ( _.isArray( module.itemCollection() ) && 1 === _.size( module.itemCollection() ) ) {
6825
+ _maxItem = module.itemCollection()[0];
6826
+ } else {
6827
+ _maxItem = _.max( module.itemCollection(), function( _item ) {
6828
+ if ( ! _.isNumber( _item.id.replace(/[^\/\d]/g,'') ) )
6829
+ return 0;
6830
+ return parseInt( _item.id.replace( /[^\/\d]/g, '' ), 10 );
6831
+ });
6832
+ }
6833
+ if ( ! _.isUndefined( _maxItem ) && _.isNumber( _maxItem.id.replace(/[^\/\d]/g,'') ) ) {
6834
+ _next_key = parseInt( _maxItem.id.replace(/[^\/\d]/g,''), 10 ) + 1;
6835
+ }
6836
+ return _next_key;
6837
+ },
6838
+ isItemRegistered : function( id_candidate ) {
6839
+ var module = this;
6840
+ return ! _.isUndefined( _.findWhere( module.itemCollection(), { id : id_candidate}) );
6841
+ },
6842
+ updateItemsCollection : function( args ) {
6843
+ var module = this,
6844
+ _current_collection = module.itemCollection(),
6845
+ _new_collection = _.clone(_current_collection),
6846
+ dfd = $.Deferred();
6847
+ if ( _.has( args, 'collection' ) ) {
6848
+ module.itemCollection.set( args.collection );
6849
+ return;
6850
+ }
6851
+
6852
+ if ( ! _.has( args, 'item' ) ) {
6853
+ throw new Error('updateItemsCollection, no item provided ' + module.control.id + '. Aborting');
6854
+ }
6855
+ args = _.extend( { data : {} }, args );
6856
+
6857
+ var item = _.clone( args.item );
6858
+ if ( _.findWhere( _new_collection, { id : item.id } ) ) {
6859
+ _.each( _current_collection , function( _item, _ind ) {
6860
+ if ( _item.id != item.id )
6861
+ return;
6862
+ _new_collection[_ind] = item;
6863
+ });
6864
+ }
6865
+ else {
6866
+ _new_collection.push(item);
6867
+ }
6868
+ module.itemCollection.set( _new_collection, args.data );
6869
+ return dfd.resolve( { collection : _new_collection, data : args.data } ).promise();
6870
+ },
6871
+ _getSortedDOMItemCollection : function( ) {
6872
+ var module = this,
6873
+ _old_collection = _.clone( module.itemCollection() ),
6874
+ _new_collection = [],
6875
+ dfd = $.Deferred();
6876
+ $( '.' + module.control.css_attr.single_item, module.container ).each( function( _index ) {
6877
+ var _item = _.findWhere( _old_collection, {id: $(this).attr('data-id') });
6878
+ if ( ! _item )
6879
+ return;
6880
+
6881
+ _new_collection[_index] = _item;
6882
+ });
6883
+
6884
+ if ( _old_collection.length != _new_collection.length ) {
6885
+ throw new Error('There was a problem when re-building the item collection from the DOM in module : ' + module.id );
6886
+ }
6887
+ return dfd.resolve( _new_collection ).promise();
6888
+ },
6889
+ refreshItemCollection : function() {
6890
+ var module = this;
6891
+ module.czr_Item.each( function( _itm ) {
6892
+ $.when( module.czr_Item( _itm.id ).container.remove() ).done( function() {
6893
+ module.czr_Item.remove( _itm.id );
6894
+ });
6895
+ });
6896
+ module.itemCollection = new api.Value( [] );
6897
+ module.populateSavedItemCollection();
6898
+ }
6899
+ });//$.extend//CZRBaseControlMths
6900
+ })( wp.customize , jQuery, _ );//MULTI CONTROL CLASS
6901
+
6902
+ var CZRModuleMths = CZRModuleMths || {};
6903
+ ( function ( api, $, _ ) {
6904
+ $.extend( CZRModuleMths, {
6905
+ getDefaultItemModel : function( id ) {
6906
+ var module = this;
6907
+ return $.extend( _.clone( module.defaultItemModel ), { id : id || '' } );
6908
+ },
6909
+ _initNewItem : function( _item , _next_key ) {
6910
+ var module = this,
6911
+ _new_item = { id : '' },
6912
+ _id;
6913
+ _next_key = 'undefined' != typeof(_next_key) ? _next_key : _.size( module.itemCollection() );
6914
+
6915
+ if ( _.isNumber(_next_key) ) {
6916
+ _id = module.module_type + '_' + _next_key;
6917
+ }
6918
+ else {
6919
+ _id = _next_key;
6920
+ _next_key = 0;
6921
+ }
6922
+
6923
+ if ( _item && ! _.isEmpty( _item) )
6924
+ _new_item = $.extend( _item, { id : _id } );
6925
+ else
6926
+ _new_item = this.getDefaultItemModel( _id );
6927
+ if ( _.has(_new_item, 'id') && module._isItemIdPossible(_id) ) {
6928
+ _.map( module.getDefaultItemModel() , function( value, property ){
6929
+ if ( ! _.has(_new_item, property) )
6930
+ _new_item[property] = value;
6931
+ });
6932
+
6933
+ return _new_item;
6934
+ }
6935
+ return module._initNewItem( _new_item, _next_key + 1);
6936
+ }
6937
+ });//$.extend
6938
+ })( wp.customize , jQuery, _ );//MULTI CONTROL CLASS
6939
+
6940
+ var CZRModuleMths = CZRModuleMths || {};
6941
+ ( function ( api, $, _ ) {
6942
+ $.extend( CZRModuleMths, {
6943
+ renderModuleParts : function() {
6944
+ var module = this,
6945
+ $_moduleContentEl = module.isInSektion() ? $( module.container ).find('.czr-mod-content') : $( module.container );
6946
+ if ( module.isCrud() ) {
6947
+ if ( 0 === $( '#tmpl-' + module.crudModulePart ).length ) {
6948
+ throw new Error('No crud Module Part template for module ' + module.id + '. The template script id should be : #tmpl-' + module.crudModulePart );
6949
+ }
6950
+ $_moduleContentEl.append( $( wp.template( module.crudModulePart )( {} ) ) );
6951
+ }
6952
+ var $_module_items_wrapper = $(
6953
+ '<ul/>',
6954
+ {
6955
+ class : [
6956
+ module.control.css_attr.items_wrapper,
6957
+ module.module_type,
6958
+ module.isMultiItem() ? 'multi-item-mod' : 'mono-item-mod',
6959
+ module.isCrud() ? 'crud-mod' : 'not-crud-mod'
6960
+ ].join(' ')
6961
+ }
6962
+ );
6963
+
6964
+ $_moduleContentEl.append($_module_items_wrapper);
6965
+
6966
+ return $( $_module_items_wrapper, $_moduleContentEl );
6967
+ },
6968
+ getTemplateEl : function( type, item_model ) {
6969
+ var module = this, _el;
6970
+ switch(type) {
6971
+ case 'rudItemPart' :
6972
+ _el = module.rudItemPart;
6973
+ break;
6974
+ case 'ruItemPart' :
6975
+ _el = module.ruItemPart;
6976
+ break;
6977
+ case 'modOptInputList' :
6978
+ _el = module.modOptInputList;
6979
+ break;
6980
+ case 'itemInputList' :
6981
+ _el = module.itemInputList;
6982
+ break;
6983
+ }
6984
+ if ( _.isEmpty(_el) ) {
6985
+ throw new Error('No valid template has been found in getTemplateEl() ' + module.id + '. Aborting');
6986
+ } else {
6987
+ return _el;
6988
+ }
6989
+ },
6990
+ getViewEl : function( id ) {
6991
+ var module = this;
6992
+ return $( '[data-id = "' + id + '"]', module.container );
6993
+ },
6994
+ closeAllItems : function( id ) {
6995
+ var module = this,
6996
+ _current_collection = _.clone( module.itemCollection() ),
6997
+ _filtered_collection = _.filter( _current_collection , function( mod) { return mod.id != id; } );
6998
+
6999
+ _.each( _filtered_collection, function( _item ) {
7000
+ if ( module.czr_Item.has(_item.id) && 'expanded' == module.czr_Item(_item.id)._getViewState(_item.id) )
7001
+ module.czr_Item( _item.id ).viewState.set( 'closed' ); // => will fire the cb toggleItemExpansion
7002
+ } );
7003
+ return this;
7004
+ },
7005
+ _adjustScrollExpandedBlock : function( $_block_el, adjust ) {
7006
+ if ( ! $_block_el.length || _.isUndefined( this.getModuleSection() ) )
7007
+ return;
7008
+ var module = this,
7009
+ $_moduleSection = $( '.accordion-section-content', module.section.container ),//was api.section( control.section() )
7010
+ _currentScrollTopVal = $_moduleSection.scrollTop(),
7011
+ _scrollDownVal,
7012
+ _adjust = adjust || 90;
7013
+
7014
+ setTimeout( function() {
7015
+ if ( ( $_block_el.offset().top + $_block_el.height() + _adjust ) > $(window.top).height() ) {
7016
+ _scrollDownVal = $_block_el.offset().top + $_block_el.height() + _adjust - $(window.top).height();
7017
+ if ( _scrollDownVal > 0 ) {
7018
+ $_moduleSection.animate({
7019
+ scrollTop: _currentScrollTopVal + _scrollDownVal
7020
+ }, 500);
7021
+ }
7022
+ }
7023
+ }, 50);
7024
+ },
7025
+ closeRemoveDialogs : function() {
7026
+ var module = this;
7027
+ if ( ! _.isArray( module.itemCollection() ) )
7028
+ return;
7029
+
7030
+ module.czr_Item.each( function( _item_ ) {
7031
+ _item_.removeDialogVisible( false );
7032
+ });
7033
+ return this;
7034
+ },
7035
+ _makeItemsSortable : function(obj) {
7036
+ if ( wp.media.isTouchDevice || ! $.fn.sortable )
7037
+ return;
7038
+ var module = this;
7039
+ $( '.' + module.control.css_attr.items_wrapper, module.container ).sortable( {
7040
+ handle: '.' + module.control.css_attr.item_sort_handle,
7041
+ start: function() {
7042
+ if ( _.has(api, 'czrModulePanelState' ) )
7043
+ api.czrModulePanelState.set(false);
7044
+ if ( _.has(api, 'czrSekSettingsPanelState' ) )
7045
+ api.czrSekSettingsPanelState.set(false);
7046
+ },
7047
+ update: function( event, ui ) {
7048
+ var _sortedCollectionReact = function() {
7049
+ if ( _.has(module, 'preItem') ) {
7050
+ module.preItemExpanded.set(false);
7051
+ }
7052
+
7053
+ module.closeAllItems().closeRemoveDialogs();
7054
+ var refreshPreview = function() {
7055
+ api.previewer.refresh();
7056
+ };
7057
+ if ( 'postMessage' == api(module.control.id).transport && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
7058
+ refreshPreview = _.debounce( refreshPreview, 500 );//500ms are enough
7059
+ refreshPreview();
7060
+ }
7061
+
7062
+ module.trigger( 'item-collection-sorted' );
7063
+ };
7064
+ module._getSortedDOMItemCollection()
7065
+ .done( function( _collection_ ) {
7066
+ module.itemCollection.set( _collection_ );
7067
+ })
7068
+ .then( function() {
7069
+ _sortedCollectionReact();
7070
+ });
7071
+ }//update
7072
+ }
7073
+ );
7074
+ },
7075
+ toggleTabVisibility : function( args ) {
7076
+ var inputParent = this,
7077
+ tabs = $( inputParent.container ).find('li'),
7078
+ content_items = $( inputParent.container ).find('section'),
7079
+ tabIdSwitchedTo = $( args.dom_event.currentTarget, args.dom_el ).attr('data-tab-id');
7080
+
7081
+ $( '.tabs nav li', inputParent.container ).each( function() {
7082
+ $(this).removeClass('tab-current').addClass('tab-inactive');
7083
+ });
7084
+ $( inputParent.container ).find('li[data-tab-id="' + tabIdSwitchedTo + '"]').addClass('tab-current').removeClass('tab-inactive');
7085
+
7086
+ $( 'section', inputParent.container ).each( function() {
7087
+ $(this).removeClass('content-current');
7088
+ });
7089
+ $( inputParent.container ).find('section[id="' + tabIdSwitchedTo + '"]').addClass('content-current');
7090
+ },
7091
+ setupTabNav : function() {
7092
+ var inputParent = this,
7093
+ preProcessTabs = function() {
7094
+ var dfd = $.Deferred(),
7095
+ $tabs = $( '.tabs nav li', inputParent.container );
7096
+
7097
+ $tabs.each( function() {
7098
+ $(this).removeClass('tab-current').addClass('tab-inactive');
7099
+ });
7100
+ $tabs.first().addClass( 'tab-current' ).removeClass('tab-inactive');
7101
+ $( 'section', inputParent.container ).first().addClass( 'content-current' );
7102
+ var _nb = $tabs.length;
7103
+ $tabs.each( function() {
7104
+ $(this).addClass( _nb > 0 ? 'cols-' + _nb : '' );
7105
+ });
7106
+ return dfd.resolve().promise();
7107
+ };
7108
+ setTimeout(
7109
+ function() {
7110
+ preProcessTabs().done( function() {
7111
+ $('.tabs', inputParent.container ).fadeIn( 450 );
7112
+ });
7113
+ },
7114
+ 20//<= introducing a small delay to let jQuery do its preprocessing job
7115
+ );
7116
+ }
7117
+ });//$.extend
7118
+ })( wp.customize , jQuery, _ );//MULTI CONTROL CLASS
7119
+
7120
+ var CZRDynModuleMths = CZRDynModuleMths || {};
7121
+ ( function ( api, $, _ ) {
7122
+ $.extend( CZRDynModuleMths, {
7123
+ initialize: function( id, options ) {
7124
+ var module = this;
7125
+ api.CZRModule.prototype.initialize.call( module, id, options );
7126
+ $.extend( module, {
7127
+ itemPreAddEl : ''//is specific for each crud module
7128
+ } );
7129
+ module.itemAddedMessage = serverControlParams.i18n.successMessage;
7130
+ module.userEventMap = new api.Value( [
7131
+ {
7132
+ trigger : 'click keydown',
7133
+ selector : [ '.' + module.control.css_attr.open_pre_add_btn, '.' + module.control.css_attr.cancel_pre_add_btn ].join(','),
7134
+ name : 'pre_add_item',
7135
+ actions : [ 'closeAllItems', 'closeRemoveDialogs', 'renderPreItemView','setPreItemViewVisibility' ],
7136
+ },
7137
+ {
7138
+ trigger : 'click keydown',
7139
+ selector : '.' + module.control.css_attr.add_new_btn, //'.czr-add-new',
7140
+ name : 'add_item',
7141
+ actions : [ 'closeRemoveDialogs', 'closeAllItems', 'addItem' ],
7142
+ }
7143
+ ]);//module.userEventMap
7144
+ },
7145
+ ready : function() {
7146
+ var module = this;
7147
+ module.setupDOMListeners( module.userEventMap() , { dom_el : module.container } );
7148
+ module.preItem = new api.Value( module.getDefaultItemModel() );
7149
+ module.preItemEmbedded = $.Deferred();//was module.czr_preItem.create('item_content');
7150
+ module.preItemEmbedded.done( function() {
7151
+ module.setupPreItemInputCollection();
7152
+ });
7153
+ module.preItemExpanded = new api.Value(false);
7154
+ module.preItemExpanded.callbacks.add( function( to, from ) {
7155
+ module._togglePreItemViewExpansion( to );
7156
+ });
7157
+
7158
+ api.CZRModule.prototype.ready.call( module );//fires the parent
7159
+ },//ready()
7160
+ setupPreItemInputCollection : function() {
7161
+ var module = this;
7162
+ module.preItem.czr_Input = new api.Values();
7163
+ $('.' + module.control.css_attr.pre_add_wrapper, module.container)
7164
+ .find( '.' + module.control.css_attr.sub_set_wrapper)
7165
+ .each( function( _index ) {
7166
+ var _id = $(this).find('[data-type]').attr('data-type') || 'sub_set_' + _index;
7167
+ module.preItem.czr_Input.add( _id, new module.inputConstructor( _id, {//api.CZRInput;
7168
+ id : _id,
7169
+ type : $(this).attr('data-input-type'),
7170
+ container : $(this),
7171
+ input_parent : module.preItem,
7172
+ module : module,
7173
+ is_preItemInput : true
7174
+ } ) );
7175
+ module.preItem.czr_Input(_id).ready();
7176
+ });//each
7177
+ },
7178
+ addItem : function(obj) {
7179
+ var module = this,
7180
+ item = module.preItem(),
7181
+ collapsePreItem = function() {
7182
+ module.preItemExpanded.set(false);
7183
+ module._resetPreItemInputs();
7184
+ module.toggleSuccessMessage('off');
7185
+ };
7186
+
7187
+ if ( _.isEmpty(item) || ! _.isObject(item) ) {
7188
+ throw new Error('addItem : an item should be an object and not empty. In : ' + module.id +'. Aborted.' );
7189
+ }
7190
+ collapsePreItem = _.debounce( collapsePreItem, 2000 );
7191
+ module.instantiateItem( item, true ).ready(); //true == Added by user
7192
+
7193
+ module.czr_Item( item.id ).isReady.then( function() {
7194
+ module.toggleSuccessMessage('on');
7195
+ collapsePreItem();
7196
+
7197
+ module.trigger('item_added', item );
7198
+ if ( 'postMessage' == api(module.control.id).transport && _.has( obj, 'dom_event') && ! _.has( obj.dom_event, 'isTrigger' ) && ! api.CZR_Helpers.hasPartRefresh( module.control.id ) ) {
7199
+ module.control.previewer.refresh();
7200
+ }
7201
+ });
7202
+
7203
+
7204
+
7205
+ },
7206
+
7207
+ _resetPreItemInputs : function() {
7208
+ var module = this;
7209
+ module.preItem.set( module.getDefaultItemModel() );
7210
+ module.preItem.czr_Input.each( function( input_instance ) {
7211
+ var _input_id = input_instance.id;
7212
+ if ( ! _.has( module.getDefaultItemModel(), _input_id ) )
7213
+ return;
7214
+ input_instance.set( module.getDefaultItemModel()._input_id );
7215
+ });
7216
+ }
7217
+ });//$.extend
7218
+ })( wp.customize , jQuery, _ );//MULTI CONTROL CLASS
7219
+
7220
+ var CZRDynModuleMths = CZRDynModuleMths || {};
7221
+ ( function ( api, $, _ ) {
7222
+ $.extend( CZRDynModuleMths, {
7223
+ renderPreItemView : function( obj ) {
7224
+ var module = this;
7225
+ if ( 'pending' != module.preItemEmbedded.state() ) //was ! _.isEmpty( module.czr_preItem('item_content')() ) )
7226
+ return;
7227
+ if ( ! _.has(module, 'itemPreAddEl') || 0 === $( '#tmpl-' + module.itemPreAddEl ).length )
7228
+ return this;
7229
+ var pre_add_template = wp.template( module.itemPreAddEl );
7230
+ if ( ! pre_add_template || ! module.container )
7231
+ return this;
7232
+
7233
+ var $_pre_add_el = $('.' + module.control.css_attr.pre_add_item_content, module.container );
7234
+ $_pre_add_el.prepend( pre_add_template() );
7235
+ module.preItemEmbedded.resolve();
7236
+ },
7237
+ _getPreItemView : function() {
7238
+ var module = this;
7239
+ return $('.' + module.control.css_attr.pre_add_item_content, module.container );
7240
+ },
7241
+ setPreItemViewVisibility : function(obj) {
7242
+ var module = this;
7243
+ module.preItemExpanded.set( ! module.preItemExpanded() );
7244
+ },
7245
+ _togglePreItemViewExpansion : function( _is_expanded ) {
7246
+ var module = this,
7247
+ $_pre_add_el = $( '.' + module.control.css_attr.pre_add_item_content, module.container );
7248
+ $_pre_add_el.slideToggle( {
7249
+ duration : 200,
7250
+ done : function() {
7251
+ var $_btn = $( '.' + module.control.css_attr.open_pre_add_btn, module.container );
7252
+
7253
+ $(this).toggleClass('open' , _is_expanded );
7254
+ if ( _is_expanded )
7255
+ $_btn.find('.fa').removeClass('fa-plus-square').addClass('fa-minus-square');
7256
+ else
7257
+ $_btn.find('.fa').removeClass('fa-minus-square').addClass('fa-plus-square');
7258
+ $_btn.toggleClass( 'active', _is_expanded );
7259
+ $( module.container ).toggleClass( module.control.css_attr.adding_new, _is_expanded );
7260
+ module._adjustScrollExpandedBlock( $(this), 120 );
7261
+ }//done
7262
+ } );
7263
+ },
7264
+
7265
+
7266
+ toggleSuccessMessage : function( status ) {
7267
+ var module = this,
7268
+ _message = module.itemAddedMessage,
7269
+ $_pre_add_wrapper = $('.' + module.control.css_attr.pre_add_wrapper, module.container );
7270
+ $_success_wrapper = $('.' + module.control.css_attr.pre_add_success, module.container );
7271
+
7272
+ if ( 'on' == status ) {
7273
+ $_success_wrapper.find('p').text(_message);
7274
+ $_success_wrapper.css('z-index', 1000001 )
7275
+ .css('height', $_pre_add_wrapper.height() + 'px' )
7276
+ .css('line-height', $_pre_add_wrapper.height() + 'px');
7277
+ } else {
7278
+ $_success_wrapper.attr('style','');
7279
+ }
7280
+ module.container.toggleClass('czr-model-added', 'on' == status );
7281
+ return this;
7282
+ }
7283
+ });//$.extend//CZRBaseControlMths
7284
+ })( wp.customize , jQuery, _ );
7285
+ var CZRSocialModuleMths = CZRSocialModuleMths || {};
7286
+ ( function ( api, $, _ ) {
7287
+ $.extend( CZRSocialModuleMths, {
7288
+ initialize: function( id, options ) {
7289
+ var module = this;
7290
+ api.CZRDynModule.prototype.initialize.call( module, id, options );
7291
+ $.extend( module, {
7292
+ itemPreAddEl : 'czr-module-social-pre-add-view-content',
7293
+ itemInputList : 'czr-module-social-item-content',
7294
+ modOptInputList : 'czr-module-social-mod-opt'
7295
+ } );
7296
+
7297
+
7298
+ this.social_icons = [
7299
+ '500px',
7300
+ 'adn',
7301
+ 'amazon',
7302
+ 'android',
7303
+ 'angellist',
7304
+ 'apple',
7305
+ 'behance',
7306
+ 'behance-square',
7307
+ 'bitbucket',
7308
+ 'bitbucket-square',
7309
+ 'black-tie',
7310
+ 'btc',
7311
+ 'buysellads',
7312
+ 'chrome',
7313
+ 'codepen',
7314
+ 'codiepie',
7315
+ 'connectdevelop',
7316
+ 'contao',
7317
+ 'dashcube',
7318
+ 'delicious',
7319
+ 'deviantart',
7320
+ 'digg',
7321
+ 'dribbble',
7322
+ 'dropbox',
7323
+ 'drupal',
7324
+ 'edge',
7325
+ 'empire',
7326
+ 'envelope',
7327
+ 'envelope-o',
7328
+ 'envelope-square',
7329
+ 'expeditedssl',
7330
+ 'facebook',
7331
+ 'facebook-f (alias)',
7332
+ 'facebook-official',
7333
+ 'facebook-square',
7334
+ 'firefox',
7335
+ 'flickr',
7336
+ 'fonticons',
7337
+ 'fort-awesome',
7338
+ 'forumbee',
7339
+ 'foursquare',
7340
+ 'get-pocket',
7341
+ 'gg',
7342
+ 'gg-circle',
7343
+ 'git',
7344
+ 'github',
7345
+ 'github-alt',
7346
+ 'github-square',
7347
+ 'gitlab',
7348
+ 'git-square',
7349
+ 'google',
7350
+ 'google-plus',
7351
+ 'google-plus-circle',
7352
+ 'google-plus-official',
7353
+ 'google-plus-square',
7354
+ 'google-wallet',
7355
+ 'gratipay',
7356
+ 'hacker-news',
7357
+ 'houzz',
7358
+ 'instagram',
7359
+ 'internet-explorer',
7360
+ 'ioxhost',
7361
+ 'joomla',
7362
+ 'jsfiddle',
7363
+ 'lastfm',
7364
+ 'lastfm-square',
7365
+ 'leanpub',
7366
+ 'linkedin',
7367
+ 'linkedin-square',
7368
+ 'linux',
7369
+ 'maxcdn',
7370
+ 'meanpath',
7371
+ 'medium',
7372
+ 'mixcloud',
7373
+ 'mobile',
7374
+ 'modx',
7375
+ 'odnoklassniki',
7376
+ 'odnoklassniki-square',
7377
+ 'opencart',
7378
+ 'openid',
7379
+ 'opera',
7380
+ 'optin-monster',
7381
+ 'pagelines',
7382
+ 'paypal',
7383
+ 'phone',
7384
+ 'phone-square',
7385
+ 'pied-piper',
7386
+ 'pied-piper-alt',
7387
+ 'pinterest',
7388
+ 'pinterest-p',
7389
+ 'pinterest-square',
7390
+ 'product-hunt',
7391
+ 'qq',
7392
+ 'rebel',
7393
+ 'reddit',
7394
+ 'reddit-alien',
7395
+ 'reddit-square',
7396
+ 'renren',
7397
+ 'rss',
7398
+ 'rss-square',
7399
+ 'safari',
7400
+ 'scribd',
7401
+ 'sellsy',
7402
+ 'share-alt',
7403
+ 'share-alt-square',
7404
+ 'shirtsinbulk',
7405
+ 'simplybuilt',
7406
+ 'skyatlas',
7407
+ 'skype',
7408
+ 'slack',
7409
+ 'slideshare',
7410
+ 'snapchat',
7411
+ 'soundcloud',
7412
+ 'spotify',
7413
+ 'stack-exchange',
7414
+ 'stack-overflow',
7415
+ 'steam',
7416
+ 'steam-square',
7417
+ 'stumbleupon',
7418
+ 'stumbleupon-circle',
7419
+ 'telegram',
7420
+ 'tencent-weibo',
7421
+ 'trello',
7422
+ 'tripadvisor',
7423
+ 'tumblr',
7424
+ 'tumblr-square',
7425
+ 'twitch',
7426
+ 'twitter',
7427
+ 'twitter-square',
7428
+ 'usb',
7429
+ 'viacoin',
7430
+ 'vimeo',
7431
+ 'vimeo-square',
7432
+ 'vine',
7433
+ 'vk',
7434
+ 'weibo',
7435
+ 'weixin',
7436
+ 'whatsapp',
7437
+ 'wikipedia-w',
7438
+ 'windows',
7439
+ 'wordpress',
7440
+ 'xing',
7441
+ 'xing-square',
7442
+ 'yahoo',
7443
+ 'y-combinator',
7444
+ 'yelp',
7445
+ 'youtube',
7446
+ 'youtube-play',
7447
+ 'youtube-square'
7448
+ ];
7449
+ module.inputConstructor = api.CZRInput.extend( module.CZRSocialsInputMths || {} );
7450
+ module.itemConstructor = api.CZRItem.extend( module.CZRSocialsItem || {} );
7451
+ this.defaultModOptModel = {
7452
+ is_mod_opt : true,
7453
+ module_id : module.id,
7454
+ 'social-size' : serverControlParams.social_el_params.defaultSocialSize || 14
7455
+ };
7456
+ this.defaultItemModel = {
7457
+ id : '',
7458
+ title : '' ,
7459
+ 'social-icon' : '',
7460
+ 'social-link' : '',
7461
+ 'social-color' : serverControlParams.social_el_params.defaultSocialColor,
7462
+ 'social-target' : 1
7463
+ };
7464
+ this.itemAddedMessage = serverControlParams.i18n.socialLinkAdded;
7465
+ if ( _.has( api, 'czr_activeSectionId' ) && module.control.section() == api.czr_activeSectionId() && 'resolved' != module.isReady.state() ) {
7466
+ module.ready();
7467
+ }
7468
+
7469
+ api.section( module.control.section() ).expanded.bind(function(to) {
7470
+ if ( 'resolved' != module.isReady.state() ) {
7471
+ module.ready();
7472
+ }
7473
+ });
7474
+
7475
+ module.isReady.then( function() {
7476
+ module.preItem.bind( function( to, from ) {
7477
+ if ( ! _.has(to, 'social-icon') )
7478
+ return;
7479
+ if ( _.isEqual( to['social-icon'], from['social-icon'] ) )
7480
+ return;
7481
+ module.updateItemModel( module.preItem, true );
7482
+ });
7483
+ });
7484
+ },//initialize
7485
+ updateItemModel : function( item_instance, is_preItem ) {
7486
+ var item = item_instance;
7487
+ is_preItem = is_preItem || false;
7488
+ if ( ! _.has( item(), 'social-icon') || _.isEmpty( item()['social-icon'] ) )
7489
+ return;
7490
+
7491
+ var _new_model, _new_title, _new_color;
7492
+
7493
+ _new_model = $.extend( true, {}, item() );//always safer to deep clone ( alternative to _.clone() ) => we don't know how nested this object might be in the future
7494
+ _new_title = this.getTitleFromIcon( _new_model['social-icon'] );
7495
+ _new_color = serverControlParams.social_el_params.defaultSocialColor;
7496
+ if ( ! is_preItem && item.czr_Input.has( 'social-color' ) )
7497
+ _new_color = item.czr_Input('social-color')();
7498
+ _new_title = [ serverControlParams.i18n.followUs, _new_title].join(' ');
7499
+
7500
+ if ( is_preItem ) {
7501
+ _new_model = $.extend( _new_model, { title : _new_title, 'social-color' : _new_color } );
7502
+ item.set( _new_model );
7503
+ } else {
7504
+ item.czr_Input('title').set( _new_title );
7505
+ if ( item.czr_Input('social-color') ) { //optional
7506
+ item.czr_Input('social-color').set( _new_color );
7507
+ }
7508
+ }
7509
+ },
7510
+ getTitleFromIcon : function( icon ) {
7511
+ return api.CZR_Helpers.capitalize( icon.replace('fa-', '').replace('envelope', 'email') );
7512
+ },
7513
+
7514
+ getIconFromTitle : function( title ) {
7515
+ return 'fa-' . title.toLowerCase().replace('envelope', 'email');
7516
+ },
7517
+
7518
+
7519
+
7520
+
7521
+
7522
+
7523
+
7524
+ CZRSocialsInputMths : {
7525
+ setupSelect : function() {
7526
+ var input = this,
7527
+ item = input.input_parent,
7528
+ module = input.module,
7529
+ socialList = module.social_icons,
7530
+ _model = item(),
7531
+ is_preItem = _.isEmpty(_model.id);
7532
+ if ( is_preItem ) {
7533
+ socialList = _.union( [ serverControlParams.i18n.selectSocialIcon ], socialList );
7534
+ }
7535
+ _.each( socialList , function( icon_name, k ) {
7536
+ var _value = ( is_preItem && 0 === k ) ? '' : 'fa-' + icon_name.toLowerCase(),
7537
+ _attributes = {
7538
+ value : _value,
7539
+ html: module.getTitleFromIcon( icon_name )
7540
+ };
7541
+ if ( _value == _model['social-icon'] )
7542
+ $.extend( _attributes, { selected : "selected" } );
7543
+
7544
+ $( 'select[data-type="social-icon"]', input.container ).append( $('<option>', _attributes) );
7545
+ });
7546
+
7547
+ function addIcon( state ) {
7548
+ if (! state.id) { return state.text; }
7549
+ var $state = $(
7550
+ '<span class="fa ' + state.element.value.toLowerCase() + '">&nbsp;&nbsp;' + state.text + '</span>'
7551
+ );
7552
+ return $state;
7553
+ }
7554
+ $( 'select[data-type="social-icon"]', input.container ).select2( {
7555
+ templateResult: addIcon,
7556
+ templateSelection: addIcon
7557
+ });
7558
+ },
7559
+
7560
+ setupColorPicker : function( obj ) {
7561
+ var input = this,
7562
+ item = input.input_parent,
7563
+ module = input.module,
7564
+ $el = $( 'input[data-type="social-color"]', input.container );
7565
+
7566
+ $el.iris( {
7567
+ palettes: true,
7568
+ hide:false,
7569
+ defaultColor : serverControlParams.social_el_params.defaultSocialColor || 'rgba(255,255,255,0.7)',
7570
+ change : function( e, o ) {
7571
+ if ( _.has( o, 'color') && 16777215 == o.color._color )
7572
+ $(this).val( serverControlParams.social_el_params.defaultSocialColor || 'rgba(255,255,255,0.7)' );
7573
+ else
7574
+ $(this).val( o.color.toString() );
7575
+
7576
+ $(this).trigger('colorpickerchange').trigger('change');
7577
+ }
7578
+ });
7579
+ $el.closest('div').on('click keydown', function() {
7580
+ module._adjustScrollExpandedBlock( input.container );
7581
+ });
7582
+ }
7583
+
7584
+ },//CZRSocialsInputMths
7585
+
7586
+
7587
+
7588
+
7589
+
7590
+
7591
+
7592
+
7593
+
7594
+ CZRSocialsItem : {
7595
+ ready : function() {
7596
+ var item = this;
7597
+ api.CZRItem.prototype.ready.call( item );
7598
+ item.bind('social-icon:changed', function(){
7599
+ item.module.updateItemModel( item );
7600
+ });
7601
+ },
7602
+
7603
+
7604
+ _buildTitle : function( title, icon, color ) {
7605
+ var item = this,
7606
+ module = item.module;
7607
+
7608
+ title = title || ( 'string' === typeof(icon) ? api.CZR_Helpers.capitalize( icon.replace( 'fa-', '') ) : '' );
7609
+ title = api.CZR_Helpers.truncate(title, 20);
7610
+ icon = icon || 'fa-' + module.social_icons[0];
7611
+ color = color || serverControlParams.social_el_params.defaultSocialColor;
7612
+
7613
+ return '<div><span class="fa ' + icon + '" style="color:' + color + '"></span> ' + title + '</div>';
7614
+ },
7615
+ writeItemViewTitle : function( model ) {
7616
+ var item = this,
7617
+ module = item.module,
7618
+ _model = model || item(),
7619
+ _title = module.getTitleFromIcon( _model['social-icon'] );
7620
+
7621
+ $( '.' + module.control.css_attr.item_title , item.container ).html(
7622
+ item._buildTitle( _title, _model['social-icon'], _model['social-color'] )
7623
+ );
7624
+ }
7625
+ },//CZRSocialsItem
7626
+ });//$.extend
7627
+ })( wp.customize , jQuery, _ );//extends api.CZRDynModule
7628
+
7629
+ var CZRWidgetAreaModuleMths = CZRWidgetAreaModuleMths || {};
7630
+ ( function ( api, $, _ ) {
7631
+ $.extend( CZRWidgetAreaModuleMths, {
7632
+ initialize: function( id, constructorOptions ) {
7633
+ var module = this;
7634
+
7635
+ api.CZRDynModule.prototype.initialize.call( this, id, constructorOptions );
7636
+ $.extend( module, {
7637
+ itemPreAddEl : 'czr-module-widgets-pre-add-view-content',
7638
+ itemInputList : 'czr-module-widgets-item-input-list',
7639
+ itemInputListReduced : 'czr-module-widgets-item-input-list-reduced',
7640
+ ruItemPart : 'czr-module-widgets-ru-item-part'
7641
+ } );
7642
+ module.inputConstructor = api.CZRInput.extend( module.CZRWZonesInputMths || {} );
7643
+ module.itemConstructor = api.CZRItem.extend( module.CZRWZonesItem || {} );
7644
+
7645
+ module.serverParams = serverControlParams.widget_area_el_params || {};
7646
+ module.contexts = _.has( module.serverParams , 'sidebar_contexts') ? module.serverParams.sidebar_contexts : {};
7647
+ module.context_match_map = {
7648
+ is_404 : '404',
7649
+ is_category : 'archive-category',
7650
+ is_home : 'home',
7651
+ is_page : 'page',
7652
+ is_search : 'search',
7653
+ is_single : 'single'
7654
+ };
7655
+
7656
+
7657
+ module.locations = _.has( module.serverParams , 'sidebar_locations') ? module.serverParams.sidebar_locations : {};
7658
+ module.defaultItemModel = {
7659
+ id : '',
7660
+ title : serverControlParams.i18n.widgetZone,
7661
+ contexts : _.without( _.keys(module.contexts), '_all_' ),//the server list of contexts is an object, we only need the keys, whitout _all_
7662
+ locations : [ module.serverParams.defaultWidgetLocation ],
7663
+ description : ''
7664
+ };
7665
+ this.itemAddedMessage = serverControlParams.i18n.widgetZoneAdded;
7666
+ if ( ! _.has( api, 'sidebar_insights' ) ) {
7667
+ api.sidebar_insights = new api.Values();
7668
+ api.sidebar_insights.create('candidates');//will store the sidebar candidates on preview refresh
7669
+ api.sidebar_insights.create('actives');//will record the refreshed active list of active sidebars sent from the preview
7670
+ api.sidebar_insights.create('inactives');
7671
+ api.sidebar_insights.create('registered');
7672
+ api.sidebar_insights.create('available_locations');
7673
+ }
7674
+
7675
+
7676
+ this.listenToSidebarInsights();
7677
+ api.czr_widgetZoneSettings = api.czr_widgetZoneSettings || new api.Value();
7678
+ api.czr_widgetZoneSettings.bind( function( updated_data_sent_from_preview , from ) {
7679
+ module.isReady.then( function() {
7680
+ _.each( updated_data_sent_from_preview, function( _data, _key ) {
7681
+ api.sidebar_insights( _key ).set( _data );
7682
+ });
7683
+ });
7684
+ });
7685
+ module.preItem_location_alert_view_state = new api.Value( 'closed');
7686
+ module.preItem_location_alert_view_state.callbacks.add( function( to, from ) {
7687
+ module._toggleLocationAlertExpansion( module.container, to );
7688
+ });
7689
+ module.bind( 'item_added', function( model ) {
7690
+ module.addWidgetSidebar( model );
7691
+ });
7692
+
7693
+ module.bind( 'pre_item_api_remove' , function(model) {
7694
+ module.removeWidgetSidebar( model );
7695
+ });
7696
+ var fixTopMargin = new api.Values();
7697
+ fixTopMargin.create('fixed_for_current_session');
7698
+ fixTopMargin.create('value');
7699
+
7700
+ api.section(module.serverParams.dynWidgetSection).fixTopMargin = fixTopMargin;
7701
+ api.section(module.serverParams.dynWidgetSection).fixTopMargin('fixed_for_current_session').set(false);
7702
+ api.panel('widgets').expanded.callbacks.add( function(to, from) {
7703
+ module.widgetPanelReact();//setup some visual adjustments, must be ran each time panel is closed or expanded
7704
+ if ( 'resolved' == module.isReady.state() )
7705
+ return;
7706
+ module.ready();
7707
+ });
7708
+ },//initialize
7709
+ ready : function() {
7710
+ var module = this;
7711
+ api.CZRDynModule.prototype.ready.call( module );
7712
+ module.preItemExpanded.callbacks.add( function( to, from ) {
7713
+ if ( ! to )
7714
+ return;
7715
+ module.preItem.czr_Input('locations')._setupLocationSelect( true );//true for refresh
7716
+ module.preItem.czr_Input('locations').mayBeDisplayModelAlert();
7717
+ });
7718
+ },
7719
+ initializeModuleModel : function( constructorOptions ) {
7720
+ var module = this, dfd = $.Deferred();
7721
+ constructorOptions.items = _.union( _.has( module.serverParams, 'default_zones' ) ? module.serverParams.default_zones : [], constructorOptions.items );
7722
+ return dfd.resolve( constructorOptions ).promise();
7723
+ },
7724
+
7725
+
7726
+
7727
+
7728
+
7729
+
7730
+
7731
+
7732
+
7733
+
7734
+
7735
+
7736
+
7737
+
7738
+
7739
+
7740
+ CZRWZonesInputMths : {
7741
+ ready : function() {
7742
+ var input = this;
7743
+
7744
+ input.bind('locations:changed', function(){
7745
+ input.mayBeDisplayModelAlert();
7746
+ });
7747
+
7748
+ api.CZRInput.prototype.ready.call( input);
7749
+ },
7750
+ setupSelect : function() {
7751
+ var input = this;
7752
+ if ( 'locations' == this.id )
7753
+ this._setupLocationSelect();
7754
+ if ( 'contexts' == this.id )
7755
+ this._setupContextSelect();
7756
+
7757
+ },
7758
+ _setupContextSelect : function() {
7759
+ var input = this,
7760
+ input_contexts = input(),
7761
+ item = input.input_parent,
7762
+ module = input.module;
7763
+ _.each( module.contexts, function( title, key ) {
7764
+ var _attributes = {
7765
+ value : key,
7766
+ html: title
7767
+ };
7768
+ if ( key == input_contexts || _.contains( input_contexts, key ) )
7769
+ $.extend( _attributes, { selected : "selected" } );
7770
+
7771
+ $( 'select[data-type="contexts"]', input.container ).append( $('<option>', _attributes) );
7772
+ });
7773
+ $( 'select[data-type="contexts"]', input.container ).select2();
7774
+ },
7775
+ _setupLocationSelect : function(refresh ) {
7776
+ var input = this,
7777
+ input_locations = input(),
7778
+ item = input.input_parent,
7779
+ module = input.module,
7780
+ available_locs = api.sidebar_insights('available_locations')();
7781
+ if ( ! $( 'select[data-type="locations"]', input.container ).children().length ) {
7782
+ _.each( module.locations, function( title, key ) {
7783
+ var _attributes = {
7784
+ value : key,
7785
+ html: title
7786
+ };
7787
+
7788
+ if ( key == input_locations || _.contains( input_locations, key ) )
7789
+ $.extend( _attributes, { selected : "selected" } );
7790
+
7791
+ $( 'select[data-type="locations"]', input.container ).append( $('<option>', _attributes) );
7792
+ });
7793
+ }//if
7794
+
7795
+ function setAvailability( state ) {
7796
+ if (! state.id) { return state.text; }
7797
+ if ( _.contains(available_locs, state.element.value) ) { return state.text; }
7798
+ var $state = $(
7799
+ '<span class="czr-unavailable-location fa fa-ban" title="' + serverControlParams.i18n.unavailableLocation + '">&nbsp;&nbsp;' + state.text + '</span>'
7800
+ );
7801
+ return $state;
7802
+ }
7803
+
7804
+ if ( refresh ) {
7805
+ $( 'select[data-type="locations"]', input.container ).select2( 'destroy' );
7806
+ }
7807
+ $( 'select[data-type="locations"]', input.container ).select2( {
7808
+ templateResult: setAvailability,
7809
+ templateSelection: setAvailability
7810
+ });
7811
+ },
7812
+ mayBeDisplayModelAlert : function() {
7813
+ var input = this,
7814
+ item = input.input_parent,
7815
+ module = input.module;
7816
+ if ( ! _.has( item(), 'locations') || _.isEmpty( item().locations ) )
7817
+ return;
7818
+
7819
+ var _selected_locations = $('select[data-type="locations"]', input.container ).val(),
7820
+ available_locs = api.sidebar_insights('available_locations')(),
7821
+ _unavailable = _.filter( _selected_locations, function( loc ) {
7822
+ return ! _.contains(available_locs, loc);
7823
+ });
7824
+ if ( ! _.has( item(), 'id' ) || _.isEmpty( item().id ) ) {
7825
+ module.preItem_location_alert_view_state.set( ! _.isEmpty( _unavailable ) ? 'expanded' : 'closed' );
7826
+ } else {
7827
+ item.czr_itemLocationAlert.set( ! _.isEmpty( _unavailable ) ? 'expanded' : 'closed' );
7828
+ }
7829
+ }
7830
+ },//CZRWZonesInputMths
7831
+
7832
+
7833
+
7834
+
7835
+
7836
+
7837
+
7838
+
7839
+
7840
+
7841
+
7842
+
7843
+
7844
+
7845
+
7846
+ CZRWZonesItem : {
7847
+ initialize : function( id, options ) {
7848
+ var item = this,
7849
+ module = item.module;
7850
+ item.czr_itemLocationAlert = new api.Value();
7851
+
7852
+ api.CZRItem.prototype.initialize.call( item, null, options );
7853
+ },
7854
+ itemWrapperViewSetup : function() {
7855
+ var item = this,
7856
+ module = item.module;
7857
+
7858
+ api.CZRItem.prototype.itemWrapperViewSetup.call(item);
7859
+ item.czr_itemLocationAlert.set('closed');
7860
+ item.czr_itemLocationAlert.callbacks.add( function( to, from ) {
7861
+ module._toggleLocationAlertExpansion( item.container , to );
7862
+ });
7863
+ item.writeSubtitleInfos(item());
7864
+ item.viewState.callbacks.add( function( to, from ) {
7865
+ if ( -1 == to.indexOf('expanded') )//can take the expanded_noscroll value !
7866
+ return;
7867
+ item.bind('contentRendered', function() {
7868
+ item.czr_Input('locations')._setupLocationSelect( true );//true for refresh
7869
+ item.czr_Input('locations').mayBeDisplayModelAlert();
7870
+ });
7871
+
7872
+ });
7873
+ },
7874
+ itemReact : function(to, from) {
7875
+ var item = this;
7876
+ api.CZRItem.prototype.itemReact.call(item, to, from);
7877
+
7878
+ item.writeSubtitleInfos(to);
7879
+ item.updateSectionTitle(to).setModelUpdateTimer();
7880
+ },
7881
+ writeSubtitleInfos : function(model) {
7882
+ var item = this,
7883
+ module = item.module,
7884
+ _model = _.clone( model || item() ),
7885
+ _locations = [],
7886
+ _contexts = [],
7887
+ _html = '';
7888
+
7889
+ if ( ! item.container.length )
7890
+ return this;
7891
+ _model.locations =_.isString(_model.locations) ? [_model.locations] : _model.locations;
7892
+ _.each( _model.locations, function( loc ) {
7893
+ if ( _.has( module.locations , loc ) )
7894
+ _locations.push(module.locations[loc]);
7895
+ else
7896
+ _locations.push(loc);
7897
+ }
7898
+ );
7899
+ _model.contexts =_.isString(_model.contexts) ? [_model.contexts] : _model.contexts;
7900
+ if ( item._hasModelAllContexts( model ) ) {
7901
+ _contexts.push(module.contexts._all_);
7902
+ } else {
7903
+ _.each( _model.contexts, function( con ) {
7904
+ if ( _.has( module.contexts , con ) )
7905
+ _contexts.push(module.contexts[con]);
7906
+ else
7907
+ _contexts.push(con);
7908
+ }
7909
+ );
7910
+ }
7911
+ var _locationText = serverControlParams.i18n.locations,
7912
+ _contextText = serverControlParams.i18n.contexts,
7913
+ _notsetText = serverControlParams.i18n.notset;
7914
+
7915
+ _locations = _.isEmpty( _locations ) ? '<span style="font-weight: bold;">' + _notsetText + '</span>' : _locations.join(', ');
7916
+ _contexts = _.isEmpty( _contexts ) ? '<span style="font-weight: bold;">' + _notsetText + '</span>' : _contexts.join(', ');
7917
+
7918
+ _html = '<u>' + _locationText + '</u> : ' + _locations + ' <strong>|</strong> <u>' + _contextText + '</u> : ' + _contexts;
7919
+
7920
+ if ( ! $('.czr-zone-infos', item.container ).length ) {
7921
+ var $_zone_infos = $('<div/>', {
7922
+ class : [ 'czr-zone-infos' , module.control.css_attr.item_sort_handle ].join(' '),
7923
+ html : _html
7924
+ });
7925
+ $( '.' + module.control.css_attr.item_btns, item.container ).after($_zone_infos);
7926
+ } else {
7927
+ $('.czr-zone-infos', item.container ).html(_html);
7928
+ }
7929
+
7930
+ return this;
7931
+ },//writeSubtitleInfos
7932
+ updateSectionTitle : function(model) {
7933
+ var _sidebar_id = 'sidebar-widgets-' + model.id,
7934
+ _new_title = model.title;
7935
+ if ( ! api.section.has(_sidebar_id) )
7936
+ return this;
7937
+ $('.accordion-section-title', api.section(_sidebar_id).container ).text(_new_title);
7938
+ $('.customize-section-title h3', api.section(_sidebar_id).container ).html(
7939
+ '<span class="customize-action">' + api.section(_sidebar_id).params.customizeAction + '</span>' + _new_title
7940
+ );
7941
+ return this;
7942
+ },
7943
+ setModelUpdateTimer : function() {
7944
+ var item = this,
7945
+ module = item.module;
7946
+
7947
+ clearTimeout( $.data(this, 'modelUpdateTimer') );
7948
+ $.data(
7949
+ this,
7950
+ 'modelUpdateTimer',
7951
+ setTimeout( function() {
7952
+ module.control.refreshPreview();
7953
+ } , 1000)
7954
+ );//$.data
7955
+ },
7956
+ _hasModelAllContexts : function( model ) {
7957
+ var item = this,
7958
+ module = item.module,
7959
+ moduleContexts = _.keys(module.contexts);
7960
+
7961
+ model = model || this();
7962
+
7963
+ if ( ! _.has(model, 'contexts') )
7964
+ return;
7965
+
7966
+ if ( _.contains( model.contexts, '_all_') )
7967
+ return true;
7968
+ return _.isEmpty( _.difference( _.without(moduleContexts, '_all_') , model.contexts ) );
7969
+ },
7970
+ _getMatchingContexts : function( defaults ) {
7971
+ var module = this,
7972
+ _current = api.czr_wpQueryInfos().conditional_tags || {},
7973
+ _matched = _.filter( module.context_match_map, function( hu, wp ) { return true === _current[wp]; } );
7974
+
7975
+ return _.isEmpty( _matched ) ? defaults : _matched;
7976
+ }
7977
+ },//CZRWZonesItem
7978
+ addWidgetSidebar : function( model, sidebar_data ) {
7979
+ if ( ! _.isObject(model) && _.isEmpty(sidebar_data) ) {
7980
+ throw new Error('No valid input were provided to add a new Widget Zone.');
7981
+ }
7982
+ var module = this,
7983
+ _model = ! _.isEmpty(model) ? _.clone(model) : sidebar_data,
7984
+ _new_sidebar = _.isEmpty(model) ? sidebar_data : $.extend(
7985
+ _.clone( _.findWhere( api.Widgets.data.registeredSidebars, { id: module.serverParams.defaultWidgetSidebar } ) ),
7986
+ {
7987
+ name : _model.title,
7988
+ id : _model.id
7989
+ }
7990
+ );
7991
+ api.Widgets.registeredSidebars.add( _new_sidebar );
7992
+ var _params = $.extend(
7993
+ _.clone( api.section( "sidebar-widgets-" + module.serverParams.defaultWidgetSidebar ).params ),
7994
+ {
7995
+ id : "sidebar-widgets-" + _model.id,
7996
+ instanceNumber: _.max(api.settings.sections, function(sec){ return sec.instanceNumber; }).instanceNumber + 1,
7997
+ sidebarId: _new_sidebar.id,
7998
+ title: _new_sidebar.name,
7999
+ description : 'undefined' != typeof(sidebar_data) ? sidebar_data.description : api.section( "sidebar-widgets-" + module.serverParams.defaultWidgetSidebar ).params.description,
8000
+ priority: _.max( _.omit( api.settings.sections, module.serverParams.dynWidgetSection), function(sec){ return sec.instanceNumber; }).priority + 1,
8001
+ }
8002
+ );
8003
+
8004
+ api.section.add( _params.id, new api.sectionConstructor[ _params.type ]( _params.id ,{ params : _params } ) );
8005
+ api.settings.sections[ _params.id ] = _params.id;
8006
+ var _new_set_id = 'sidebars_widgets['+_model.id+']',
8007
+ _new_set = $.extend(
8008
+ _.clone( api.settings.settings['sidebars_widgets[' + module.serverParams.defaultWidgetSidebar + ']'] ),
8009
+ {
8010
+ value:[]
8011
+ }
8012
+ );
8013
+ api.settings.settings[ _new_set_id ] = _new_set;
8014
+ api.create( _new_set_id, _new_set_id, _new_set.value, {
8015
+ transport: _new_set.transport,
8016
+ previewer: api.previewer,
8017
+ dirty: false
8018
+ } );
8019
+ var _cloned_control = $.extend(
8020
+ _.clone( api.settings.controls['sidebars_widgets[' + module.serverParams.defaultWidgetSidebar + ']'] ),
8021
+ {
8022
+ settings : { default : _new_set_id }
8023
+ }),
8024
+ _new_control = {};
8025
+ _.each( _cloned_control, function( param, key ) {
8026
+ if ( 'string' == typeof(param) ) {
8027
+ param = param.replace( module.serverParams.defaultWidgetSidebar , _model.id );
8028
+ }
8029
+ _new_control[key] = param;
8030
+ });
8031
+ _new_control.instanceNumber = _.max(api.settings.controls, function(con){ return con.instanceNumber; }).instanceNumber + 1;
8032
+ api.settings.controls[_new_set_id] = _new_control;
8033
+ api.control.add( _new_set_id, new api.controlConstructor[ _new_control.type ]( _new_set_id, {
8034
+ params: _new_control,
8035
+ previewer: api.previewer
8036
+ } ) );
8037
+ if ( _.has(this, 'container') )
8038
+ this.container.trigger( 'widget_zone_created', { model : _model, section_id : "sidebar-widgets-" + _model.id , setting_id : _new_set_id });
8039
+ },//addWidgetSidebar
8040
+ removeWidgetSidebar : function( model ) {
8041
+ var module = this;
8042
+ if ( ! _.isObject(model) || _.isEmpty(model) ) {
8043
+ throw new Error('No valid data were provided to remove a Widget Zone.');
8044
+ }
8045
+ api.Widgets.registeredSidebars.remove( model.id );
8046
+ if ( api.section.has("sidebar-widgets-" + model.id) ) {
8047
+ api.section("sidebar-widgets-" + model.id).container.remove();
8048
+ api.section.remove( "sidebar-widgets-" + model.id );
8049
+ delete api.settings.sections[ "sidebar-widgets-" + model.id ];
8050
+ }
8051
+ if ( api.has('sidebars_widgets['+model.id+']') ) {
8052
+ api.remove( 'sidebars_widgets['+model.id+']' );
8053
+ delete api.settings.settings['sidebars_widgets['+model.id+']'];
8054
+ }
8055
+ if ( api.control.has('sidebars_widgets['+model.id+']') ) {
8056
+ api.control( 'sidebars_widgets['+model.id+']' ).container.remove();
8057
+ api.control.remove( 'sidebars_widgets['+model.id+']' );
8058
+ delete api.settings.controls['sidebars_widgets['+model.id+']'];
8059
+ }
8060
+ var _refresh = function() {
8061
+ api.previewer.refresh();
8062
+ };
8063
+ _refresh = _.debounce( _refresh, 500 );
8064
+ $.when( _refresh() ).done( function() {
8065
+ module.trigger( 'widget_zone_removed',
8066
+ {
8067
+ model : model,
8068
+ section_id : "sidebar-widgets-" + model.id ,
8069
+ setting_id : 'sidebars_widgets['+model.id+']'
8070
+ }
8071
+ );
8072
+ });
8073
+ },
8074
+ widgetPanelReact : function() {
8075
+ var module = this;
8076
+ var _top_margin = api.panel('widgets').container.find( '.control-panel-content' ).css('margin-top');
8077
+
8078
+ api.section(module.serverParams.dynWidgetSection).fixTopMargin('value').set( _top_margin );
8079
+
8080
+ var _section_content = api.section(module.serverParams.dynWidgetSection).container.find( '.accordion-section-content' ),
8081
+ _panel_content = api.panel('widgets').container.find( '.control-panel-content' ),
8082
+ _set_margins = function() {
8083
+ _section_content.css( 'margin-top', '' );
8084
+ _panel_content.css('margin-top', api.section(module.serverParams.dynWidgetSection).fixTopMargin('value')() );
8085
+ };
8086
+ api.bind( 'pane-contents-reflowed', _.debounce( function() {
8087
+ _set_margins();
8088
+ }, 150 ) );
8089
+ module.closeAllItems().closeRemoveDialogs();
8090
+ if ( _.has( module, 'preItemExpanded' ) )
8091
+ module.preItemExpanded.set(false);
8092
+ },//widgetPanelReact()
8093
+ widgetSectionReact : function( to, from ) {
8094
+ var module = this,
8095
+ section = api.section(module.serverParams.dynWidgetSection),
8096
+ container = section.container.closest( '.wp-full-overlay-sidebar-content' ),
8097
+ content = section.container.find( '.accordion-section-content' ),
8098
+ overlay = section.container.closest( '.wp-full-overlay' ),
8099
+ backBtn = section.container.find( '.customize-section-back' ),
8100
+ sectionTitle = section.container.find( '.accordion-section-title' ).first(),
8101
+ headerActionsHeight = $( '#customize-header-actions' ).height(),
8102
+ resizeContentHeight, expand, position, scroll;
8103
+
8104
+ if ( to ) {
8105
+ overlay.removeClass( 'section-open' );
8106
+ content.css( 'height', 'auto' );
8107
+ sectionTitle.attr( 'tabindex', '0' );
8108
+ content.css( 'margin-top', '' );
8109
+ container.scrollTop( 0 );
8110
+ }
8111
+
8112
+ module.closeAllItems().closeRemoveDialogs();
8113
+
8114
+ content.slideToggle();
8115
+ },
8116
+ listenToSidebarInsights : function() {
8117
+ var module = this;
8118
+ api.sidebar_insights('registered').callbacks.add( function( _registered_zones ) {
8119
+ var _current_collection = _.clone( module.itemCollection() );
8120
+ _.each( _current_collection, function( _model ) {
8121
+ if ( ! module.getViewEl(_model.id).length )
8122
+ return;
8123
+
8124
+ module.getViewEl(_model.id).css('display' , _.contains( _registered_zones, _model.id ) ? 'block' : 'none' );
8125
+ });
8126
+ });
8127
+ api.sidebar_insights('inactives').callbacks.add( function( _inactives_zones ) {
8128
+ var _current_collection = _.clone( module.itemCollection() );
8129
+ _.each( _current_collection, function( _model ) {
8130
+ if ( ! module.getViewEl(_model.id).length )
8131
+ return;
8132
+
8133
+ if ( _.contains( _inactives_zones, _model.id ) ) {
8134
+ module.getViewEl( _model.id ).addClass('inactive');
8135
+ if ( ! module.getViewEl( _model.id ).find('.czr-inactive-alert').length ) {
8136
+ module.getViewEl( _model.id ).find('.czr-item-title').append(
8137
+ $('<span/>', {class : "czr-inactive-alert", html : " [ " + serverControlParams.i18n.inactiveWidgetZone + " ]" })
8138
+ );
8139
+ }
8140
+ }
8141
+ else {
8142
+ module.getViewEl( _model.id ).removeClass('inactive');
8143
+ if ( module.getViewEl( _model.id ).find('.czr-inactive-alert').length )
8144
+ module.getViewEl( _model.id ).find('.czr-inactive-alert').remove();
8145
+ }
8146
+ });
8147
+ });
8148
+ api.sidebar_insights('candidates').callbacks.add( function(_candidates) {
8149
+ if ( ! _.isArray(_candidates) )
8150
+ return;
8151
+ _.each( _candidates, function( _sidebar ) {
8152
+ if ( ! _.isObject(_sidebar) )
8153
+ return;
8154
+ if ( api.section.has("sidebar-widgets-" +_sidebar.id ) )
8155
+ return;
8156
+ module.addWidgetSidebar( {}, _sidebar );
8157
+ if ( _.has( api.sidebar_insights('actives')(), _sidebar.id ) && api.section.has("sidebar-widgets-" +_sidebar.id ) )
8158
+ api.section( "sidebar-widgets-" +_sidebar.id ).activate();
8159
+ });
8160
+ });
8161
+ },//listenToSidebarInsights()
8162
+ _adjustScrollExpandedBlock : function( $_block_el, adjust ) {
8163
+ if ( ! $_block_el.length )
8164
+ return;
8165
+ var module = this,
8166
+ _currentScrollTopVal = $('.wp-full-overlay-sidebar-content').scrollTop(),
8167
+ _scrollDownVal,
8168
+ _adjust = adjust || 90;
8169
+ setTimeout( function() {
8170
+ if ( ( $_block_el.offset().top + $_block_el.height() + _adjust ) > $(window.top).height() ) {
8171
+ _scrollDownVal = $_block_el.offset().top + $_block_el.height() + _adjust - $(window.top).height();
8172
+ $('.wp-full-overlay-sidebar-content').animate({
8173
+ scrollTop: _currentScrollTopVal + _scrollDownVal
8174
+ }, 600);
8175
+ }
8176
+ }, 50);
8177
+ },
8178
+ getDefaultItemModel : function( id ) {
8179
+ var module = this,
8180
+ _current_collection = module.itemCollection(),
8181
+ _default = _.clone( module.defaultItemModel ),
8182
+ _default_contexts = _default.contexts;
8183
+ return $.extend( _default, {
8184
+ title : 'Widget Zone ' + ( _.size(_current_collection)*1 + 1 )
8185
+ });
8186
+ },
8187
+ getTemplateEl : function( type, item_model ) {
8188
+ var module = this, _el;
8189
+ if ( 'rudItemPart' == type ) {
8190
+ type = ( _.has(item_model, 'is_builtin') && item_model.is_builtin ) ? 'ruItemPart' : type;
8191
+ } else if ( 'itemInputList' == type ) {
8192
+ type = ( _.has(item_model, 'is_builtin') && item_model.is_builtin ) ? 'itemInputListReduced' : type;
8193
+ }
8194
+
8195
+ switch(type) {
8196
+ case 'rudItemPart' :
8197
+ _el = module.rudItemPart;
8198
+ break;
8199
+ case 'ruItemPart' :
8200
+ _el = module.ruItemPart;
8201
+ break;
8202
+ case 'itemInputList' :
8203
+ _el = module.itemInputList;
8204
+ break;
8205
+ case 'itemInputListReduced' :
8206
+ _el = module.itemInputListReduced;
8207
+ break;
8208
+ }
8209
+
8210
+ if ( _.isEmpty(_el) ) {
8211
+ throw new Error( 'No valid template has been found in getTemplateEl()' );
8212
+ } else {
8213
+ return _el;
8214
+ }
8215
+ },
8216
+
8217
+
8218
+ _toggleLocationAlertExpansion : function( $view, to ) {
8219
+ var $_alert_el = $view.find('.czr-location-alert');
8220
+ if ( ! $_alert_el.length ) {
8221
+ var _html = [
8222
+ '<span>' + serverControlParams.i18n.locationWarning + '</span>',
8223
+ api.CZR_Helpers.getDocSearchLink( serverControlParams.i18n.locationWarning ),
8224
+ ].join('');
8225
+
8226
+ $_alert_el = $('<div/>', {
8227
+ class:'czr-location-alert',
8228
+ html:_html,
8229
+ style:"display:none"
8230
+ });
8231
+
8232
+ $('select[data-type="locations"]', $view ).closest('div').after($_alert_el);
8233
+ }
8234
+ $_alert_el.toggle( 'expanded' == to);
8235
+ }
8236
+ });//$.extend()
8237
+ })( wp.customize , jQuery, _ );
8238
+ var CZRBodyBgModuleMths = CZRBodyBgModuleMths || {};
8239
+ ( function ( api, $, _ ) {
8240
+ $.extend( CZRBodyBgModuleMths, {
8241
+ initialize: function( id, options ) {
8242
+ var module = this;
8243
+ api.CZRModule.prototype.initialize.call( module, id, options );
8244
+ $.extend( module, {
8245
+ itemInputList : 'czr-module-bodybg-item-content'
8246
+ } );
8247
+ module.inputConstructor = api.CZRInput.extend( module.CZRBodyBgInputMths || {} );
8248
+ module.itemConstructor = api.CZRItem.extend( module.CZBodyBgItemMths || {} );
8249
+ module.defaultItemModel = {
8250
+ 'background-color' : '#eaeaea',
8251
+ 'background-image' : '',
8252
+ 'background-repeat' : 'no-repeat',
8253
+ 'background-attachment' : 'fixed',
8254
+ 'background-position' : 'center center',
8255
+ 'background-size' : 'cover'
8256
+ };
8257
+ api.consoleLog('New module instantiated : ', module.id );
8258
+ if ( _.has( api, 'czr_activeSectionId' ) && module.control.section() == api.czr_activeSectionId() && 'resolved' != module.isReady.state() ) {
8259
+ module.ready();
8260
+ }
8261
+ api.section( module.control.section() ).expanded.bind(function(to) {
8262
+ if ( 'resolved' == module.isReady.state() )
8263
+ return;
8264
+ module.ready();
8265
+ });
8266
+ },//initialize
8267
+
8268
+
8269
+
8270
+ CZRBodyBgInputMths : {
8271
+ setupSelect : function() {
8272
+ var input = this,
8273
+ _id_param_map = {
8274
+ 'background-repeat' : 'bg_repeat_options',
8275
+ 'background-attachment' : 'bg_attachment_options',
8276
+ 'background-position' : 'bg_position_options'
8277
+ },
8278
+ item = input.input_parent,
8279
+ serverParams = serverControlParams.body_bg_module_params,
8280
+ options = {},
8281
+ module = input.module;
8282
+
8283
+ if ( ! _.has( _id_param_map, input.id ) )
8284
+ return;
8285
+
8286
+ if ( _.isUndefined( serverParams ) || _.isUndefined( serverParams[ _id_param_map[input.id] ] ) )
8287
+ return;
8288
+ options = serverParams[ _id_param_map[input.id] ];
8289
+ if ( _.isEmpty(options) )
8290
+ return;
8291
+ _.each( options, function( title, key ) {
8292
+ var _attributes = {
8293
+ value : key,
8294
+ html: title
8295
+ };
8296
+ if ( key == input() || _.contains( input(), key ) )
8297
+ $.extend( _attributes, { selected : "selected" } );
8298
+
8299
+ $( 'select[data-type]', input.container ).append( $('<option>', _attributes) );
8300
+ });
8301
+ $( 'select[data-type]', input.container ).select2();
8302
+ }
8303
+ },
8304
+
8305
+
8306
+ CZBodyBgItemMths : {
8307
+ ready : function() {
8308
+ var item = this;
8309
+ api.CZRItem.prototype.ready.call( item );
8310
+
8311
+ item.inputCollection.bind( function( _col_ ) {
8312
+ if ( ! _.isEmpty( _col ) && item.czr_Input && item.czr_Input.has( 'background-image' ) ) {
8313
+ item.czr_Input('background-image').isReady.done( function( input_instance ) {
8314
+ var set_visibilities = function( bg_val ) {
8315
+ var is_bg_img_set = ! _.isEmpty( bg_val ) ||_.isNumber( bg_val);
8316
+ _.each( ['background-repeat', 'background-attachment', 'background-position', 'background-size'], function( dep ) {
8317
+ item.czr_Input(dep).container.toggle( is_bg_img_set || false );
8318
+ });
8319
+ };
8320
+ set_visibilities( input_instance() );
8321
+ item.bind('background-image:changed', function(){
8322
+ set_visibilities( item.czr_Input('background-image')() );
8323
+ });
8324
+ });
8325
+ }
8326
+ });
8327
+
8328
+ },
8329
+
8330
+ }
8331
+ });//$.extend
8332
+ })( wp.customize , jQuery, _ );
8333
+ (function ( api, $, _ ) {
8334
+ api.czrModuleMap = api.czrModuleMap || {};
8335
+ $.extend( api.czrModuleMap, {
8336
+ czr_widget_areas_module : {
8337
+ mthds : CZRWidgetAreaModuleMths,
8338
+ crud : true,
8339
+ sektion_allowed : false,
8340
+ name : 'Widget Areas'
8341
+ },
8342
+ czr_social_module : {
8343
+ mthds : CZRSocialModuleMths,
8344
+ crud : true,
8345
+ name : 'Social Icons',
8346
+ has_mod_opt : true
8347
+ },
8348
+ czr_background : {
8349
+ mthds : CZRBodyBgModuleMths,
8350
+ crud : false,
8351
+ multi_item : false,
8352
+ name : 'Slider'
8353
+ }
8354
+ });
8355
+ })( wp.customize, jQuery, _ );//BASE CONTROL CLASS
8356
+
8357
+ var CZRBaseControlMths = CZRBaseControlMths || {};
8358
+ ( function ( api, $, _ ) {
8359
+ $.extend( CZRBaseControlMths, {
8360
+ initialize: function( id, options ) {
8361
+ var control = this;
8362
+ control.css_attr = _.has( serverControlParams , 'css_attr') ? serverControlParams.css_attr : {};
8363
+ api.Control.prototype.initialize.call( control, id, options );
8364
+ control.bind( 'czr-partial-refresh-done', function() {
8365
+ if ( _.has( control, 'czr_moduleCollection' ) ) {
8366
+ _.each( control.czr_moduleCollection(), function( _mod_ ) {
8367
+ if ( ! control.czr_Module( _mod_.id ) )
8368
+ return;
8369
+
8370
+ control.czr_Module( _mod_.id ).sendModuleInputsToPreview();
8371
+ });
8372
+ }
8373
+ });
8374
+ },
8375
+ refreshPreview : function( obj ) {
8376
+ this.previewer.refresh();
8377
+ }
8378
+ });//$.extend//CZRBaseControlMths
8379
+ })( wp.customize , jQuery, _ );
8380
+ var CZRBaseModuleControlMths = CZRBaseModuleControlMths || {};
8381
+ ( function ( api, $, _ ) {
8382
+ $.extend( CZRBaseModuleControlMths, {
8383
+ initialize: function( id, options ) {
8384
+ var control = this;
8385
+
8386
+ control.czr_Module = new api.Values();
8387
+ control.czr_moduleCollection = new api.Value();
8388
+ control.czr_moduleCollection.set([]);
8389
+ control.moduleCollectionReady = $.Deferred();
8390
+ control.moduleCollectionReady.done( function( obj ) {
8391
+ if ( ! control.isMultiModuleControl( options.params ) ) {
8392
+ }
8393
+ control.czr_moduleCollection.callbacks.add( function() { return control.moduleCollectionReact.apply( control, arguments ); } );
8394
+ } );
8395
+ if ( control.isMultiModuleControl( options.params ) ) {
8396
+ control.syncSektionModule = new api.Value();
8397
+ }
8398
+
8399
+ api.CZRBaseControl.prototype.initialize.call( control, id, options );
8400
+ api.section( control.section() ).expanded.bind(function(to) {
8401
+ control.czr_Module.each( function( _mod ){
8402
+ _mod.closeAllItems().closeRemoveDialogs();
8403
+ if ( _.has( _mod, 'preItem' ) ) {
8404
+ _mod.preItemExpanded(false);
8405
+ }
8406
+ });
8407
+ });
8408
+
8409
+ },
8410
+ ready : function() {
8411
+ var control = this;
8412
+ if ( control.isMultiModuleControl() ) {
8413
+ control.syncSektionModule.bind( function( sektion_module_instance, from) {
8414
+ if ( 'resolved' == control.moduleCollectionReady.state() )
8415
+ return;
8416
+ control.registerModulesOnInit( sektion_module_instance );
8417
+ control.moduleCollectionReady.resolve();
8418
+ });
8419
+ } else {
8420
+ var single_module = {};
8421
+ _.each( control.getSavedModules() , function( _mod, _key ) {
8422
+ single_module = _mod;
8423
+ try { control.instantiateModule( _mod, {} ); } catch( er ) {
8424
+ api.errorLog( 'Failed to instantiate module ' + _mod.id + ' ' + er );
8425
+ return;
8426
+ }
8427
+ control.container.attr('data-module', _mod.id );
8428
+ });
8429
+ control.moduleCollectionReady.resolve( single_module );
8430
+ }
8431
+ control.bind( 'user-module-candidate', function( _module ) {
8432
+ var module;
8433
+ try {
8434
+ module = control.instantiateModule( _module, {} ); //module, constructor
8435
+ } catch( er ) {
8436
+ api.errorLog( 'Failed to instantiate module ' + _module.id + ' ' + er );
8437
+ return;
8438
+ }
8439
+ module.ready( _module.is_added_by_user );
8440
+ });
8441
+ },
8442
+ getDefaultModuleApiModel : function() {
8443
+ var commonAPIModel = {
8444
+ id : '',//module.id,
8445
+ module_type : '',//module.module_type,
8446
+ modOpt : {},//the module modOpt property, typically high level properties that area applied to all items of the module
8447
+ items : [],//$.extend( true, {}, module.items ),
8448
+ crud : false,
8449
+ multi_item : false,
8450
+ sortable : false,//<= a module can be multi-item but not necessarily sortable
8451
+ control : {},//control,
8452
+ };
8453
+ if ( ! this.isMultiModuleControl() ) {
8454
+ return $.extend( commonAPIModel, {
8455
+ section : ''//id of the control section
8456
+ } );
8457
+ } else {
8458
+ return $.extend( commonAPIModel, {
8459
+ column_id : '',//a string like col_7
8460
+ sektion : {},// => the sektion instance
8461
+ sektion_id : '',
8462
+ is_added_by_user : false,
8463
+ dirty : false
8464
+ } );
8465
+ }
8466
+ },
8467
+ getDefaultModuleDBModel : function() {
8468
+ var commonDBModel = {
8469
+ items : [],//$.extend( true, {}, module.items ),
8470
+ };
8471
+ if ( this.isMultiModuleControl() ) {
8472
+ return $.extend( commonDBModel, {
8473
+ id : '',
8474
+ module_type : '',
8475
+ column_id : '',
8476
+ sektion_id : '',
8477
+ dirty : false
8478
+ } );
8479
+ } else {
8480
+ return commonDBModel;
8481
+ }
8482
+ },
8483
+ isMultiModuleControl : function( params ) {
8484
+ return 'czr_multi_module' == ( params || this.params ).type;
8485
+ },
8486
+ getSyncCollectionControl : function() {
8487
+ var control = this;
8488
+ if ( _.isUndefined( control.params.syncCollection ) ) {
8489
+ throw new Error( 'Control ' + control.id + ' has no synchronized sektion control defined.');
8490
+ }
8491
+ return api.control( api.CZR_Helpers.build_setId( control.params.syncCollection ) );
8492
+ },
8493
+ getSavedModules : function() {
8494
+ var control = this,
8495
+ _savedModulesCandidates = [],
8496
+ _module_type = control.params.module_type,
8497
+ _raw_saved_module_val = [],
8498
+ _saved_items = [],
8499
+ _saved_modOpt = {};
8500
+ if ( control.isMultiModuleControl() ) {
8501
+ _savedModulesCandidates = $.extend( true, [], api( control.id )() );//deep clone
8502
+ } else {
8503
+ if ( api.CZR_Helpers.isMultiItemModule( _module_type ) && ! _.isEmpty( api( control.id )() ) && ! _.isObject( api( control.id )() ) ) {
8504
+ api.consoleLog('Module Control Init for ' + control.id + ' : a mono item module control value should be an object if not empty.');
8505
+ }
8506
+ _raw_saved_module_val = _.isArray( api( control.id )() ) ? api( control.id )() : [ api( control.id )() ];
8507
+
8508
+ _.each( _raw_saved_module_val, function( item_or_mod_opt_candidate , key ) {
8509
+ if ( api.CZR_Helpers.hasModuleModOpt( _module_type ) && 0*0 === key ) {
8510
+ if ( _.has( item_or_mod_opt_candidate, 'id') ) {
8511
+ api.consoleLog( 'getSavedModules : the module ' + _module_type + ' in control ' + control.id + ' has no mod_opt defined while it should.' );
8512
+ } else {
8513
+ _saved_modOpt = item_or_mod_opt_candidate;
8514
+ }
8515
+ }
8516
+ if ( _.has( item_or_mod_opt_candidate, 'id') && ! _.has( item_or_mod_opt_candidate, 'is_mod_opt' ) ) {
8517
+ _saved_items.push( item_or_mod_opt_candidate );
8518
+ }
8519
+ });
8520
+ _savedModulesCandidates.push(
8521
+ {
8522
+ id : api.CZR_Helpers.getOptionName( control.id ) + '_' + control.params.type,
8523
+ module_type : control.params.module_type,
8524
+ section : control.section(),
8525
+ modOpt : $.extend( true, {} , _saved_modOpt ),//disconnect with a deep cloning
8526
+ items : $.extend( true, [] , _saved_items )//disconnect with a deep cloning
8527
+ }
8528
+ );
8529
+ }
8530
+ return _savedModulesCandidates;
8531
+ },
8532
+ isModuleRegistered : function( id_candidate ) {
8533
+ var control = this;
8534
+ return ! _.isUndefined( _.findWhere( control.czr_moduleCollection(), { id : id_candidate}) );
8535
+ }
8536
+ });//$.extend//CZRBaseControlMths
8537
+ })( wp.customize , jQuery, _ );
8538
+ var CZRBaseModuleControlMths = CZRBaseModuleControlMths || {};
8539
+ ( function ( api, $, _ ) {
8540
+ $.extend( CZRBaseModuleControlMths, {
8541
+ instantiateModule : function( module, constructor ) {
8542
+ if ( ! _.has( module,'id') ) {
8543
+ throw new Error('CZRModule::instantiateModule() : a module has no id and could not be added in the collection of : ' + this.id +'. Aborted.' );
8544
+ }
8545
+ var control = this;
8546
+ if ( _.isUndefined(constructor) || _.isEmpty(constructor) ) {
8547
+ constructor = control.getModuleConstructor( module );
8548
+ }
8549
+ if ( ! _.isEmpty( module.id ) && control.czr_Module.has( module.id ) ) {
8550
+ throw new Error('The module id already exists in the collection in control : ' + control.id );
8551
+ }
8552
+
8553
+ var module_api_ready = control.prepareModuleForAPI( module );
8554
+ control.czr_Module.add( module_api_ready.id, new constructor( module_api_ready.id, module_api_ready ) );
8555
+
8556
+ if ( ! control.czr_Module.has( module_api_ready.id ) ) {
8557
+ throw new Error('instantiateModule() : instantiation failed for module id ' + module_api_ready.id + ' in control ' + control.id );
8558
+ }
8559
+ return control.czr_Module(module_api_ready.id);
8560
+ },
8561
+ getModuleConstructor : function( module ) {
8562
+ var control = this,
8563
+ parentConstructor = {},
8564
+ constructor = {};
8565
+
8566
+ if ( ! _.has( module, 'module_type' ) ) {
8567
+ throw new Error('CZRModule::getModuleConstructor : no module type found for module ' + module.id );
8568
+ }
8569
+ if ( ! _.has( api.czrModuleMap, module.module_type ) ) {
8570
+ throw new Error('Module type ' + module.module_type + ' is not listed in the module map api.czrModuleMap.' );
8571
+ }
8572
+
8573
+ var _mthds = api.czrModuleMap[ module.module_type ].mthds,
8574
+ _is_crud = api.czrModuleMap[ module.module_type ].crud,
8575
+ _base_constructor = _is_crud ? api.CZRDynModule : api.CZRModule;
8576
+ if ( ! _.isEmpty( module.sektion_id ) ) {
8577
+ parentConstructor = _base_constructor.extend( _mthds );
8578
+ constructor = parentConstructor.extend( control.getMultiModuleExtender( parentConstructor ) );
8579
+ } else {
8580
+ constructor = _base_constructor.extend( _mthds );
8581
+ }
8582
+
8583
+ if ( _.isUndefined(constructor) || _.isEmpty(constructor) || ! constructor ) {
8584
+ throw new Error('CZRModule::getModuleConstructor : no constructor found for module type : ' + module.module_type +'.' );
8585
+ }
8586
+ return constructor;
8587
+ },
8588
+ prepareModuleForAPI : function( module_candidate ) {
8589
+ if ( ! _.isObject( module_candidate ) ) {
8590
+ throw new Error('prepareModuleForAPI : a module must be an object to be instantiated.');
8591
+ }
8592
+
8593
+ var control = this,
8594
+ api_ready_module = {};
8595
+
8596
+ _.each( control.getDefaultModuleApiModel() , function( _value, _key ) {
8597
+ var _candidate_val = module_candidate[_key];
8598
+ switch( _key ) {
8599
+ case 'id' :
8600
+ if ( _.isEmpty( _candidate_val ) ) {
8601
+ api_ready_module[_key] = control.generateModuleId( module_candidate.module_type );
8602
+ } else {
8603
+ api_ready_module[_key] = _candidate_val;
8604
+ }
8605
+ break;
8606
+ case 'module_type' :
8607
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8608
+ throw new Error('prepareModuleForAPI : a module type must a string not empty');
8609
+ }
8610
+ api_ready_module[_key] = _candidate_val;
8611
+ break;
8612
+ case 'items' :
8613
+ if ( ! _.isArray( _candidate_val ) ) {
8614
+ throw new Error('prepareModuleForAPI : a module item list must be an array');
8615
+ }
8616
+ api_ready_module[_key] = _candidate_val;
8617
+ break;
8618
+ case 'modOpt' :
8619
+ if ( ! _.isObject( _candidate_val ) ) {
8620
+ throw new Error('prepareModuleForAPI : a module modOpt property must be an object');
8621
+ }
8622
+ api_ready_module[_key] = _candidate_val;
8623
+ break;
8624
+ case 'crud' :
8625
+ if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
8626
+ _candidate_val = api.czrModuleMap[ module_candidate.module_type ].crud;
8627
+ } else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
8628
+ throw new Error('prepareModuleForAPI : the module param "crud" must be a boolean');
8629
+ }
8630
+ api_ready_module[_key] = _candidate_val || false;
8631
+ break;
8632
+ case 'multi_item' :
8633
+ if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
8634
+ _candidate_val = api.czrModuleMap[ module_candidate.module_type ].crud || api.czrModuleMap[ module_candidate.module_type ].multi_item;
8635
+ } else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
8636
+ throw new Error('prepareModuleForAPI : the module param "multi_item" must be a boolean');
8637
+ }
8638
+ api_ready_module[_key] = _candidate_val || false;
8639
+ break;
8640
+ case 'sortable' :
8641
+ if ( _.has( api.czrModuleMap, module_candidate.module_type ) ) {
8642
+ _candidate_val = api.czrModuleMap[ module_candidate.module_type ].sortable || api.czrModuleMap[ module_candidate.module_type ].crud || api.czrModuleMap[ module_candidate.module_type ].multi_item;
8643
+ } else if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
8644
+ throw new Error('prepareModuleForAPI : the module param "sortable" must be a boolean');
8645
+ }
8646
+ api_ready_module[_key] = _candidate_val || false;
8647
+ break;
8648
+ case 'control' :
8649
+ api_ready_module[_key] = control;//this
8650
+ break;
8651
+ case 'section' :
8652
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8653
+ throw new Error('prepareModuleForAPI : a module section must be a string not empty');
8654
+ }
8655
+ api_ready_module[_key] = _candidate_val;
8656
+ break;
8657
+ case 'column_id' :
8658
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8659
+ throw new Error('prepareModuleForAPI : a module column id must a string not empty');
8660
+ }
8661
+ api_ready_module[_key] = _candidate_val;
8662
+ break;
8663
+ case 'sektion' :
8664
+ if ( ! _.isObject( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8665
+ throw new Error('prepareModuleForAPI : a module sektion must be an object not empty');
8666
+ }
8667
+ api_ready_module[_key] = _candidate_val;
8668
+ break;
8669
+ case 'sektion_id' :
8670
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8671
+ throw new Error('prepareModuleForAPI : a module sektion id must be a string not empty');
8672
+ }
8673
+ api_ready_module[_key] = _candidate_val;
8674
+ break;
8675
+ case 'is_added_by_user' :
8676
+ if ( ! _.isUndefined( _candidate_val) && ! _.isBoolean( _candidate_val ) ) {
8677
+ throw new Error('prepareModuleForAPI : the module param "is_added_by_user" must be a boolean');
8678
+ }
8679
+ api_ready_module[_key] = _candidate_val || false;
8680
+ break;
8681
+ case 'dirty' :
8682
+ api_ready_module[_key] = _candidate_val || false;
8683
+ break;
8684
+ }//switch
8685
+ });
8686
+ return api_ready_module;
8687
+ },
8688
+ generateModuleId : function( module_type, key, i ) {
8689
+ i = i || 1;
8690
+ if ( i > 100 ) {
8691
+ throw new Error('Infinite loop when generating of a module id.');
8692
+ }
8693
+ var control = this;
8694
+ key = key || control._getNextModuleKeyInCollection();
8695
+ var id_candidate = module_type + '_' + key;
8696
+ if ( ! _.has(control, 'czr_moduleCollection') || ! _.isArray( control.czr_moduleCollection() ) ) {
8697
+ throw new Error('The module collection does not exist or is not properly set in control : ' + control.id );
8698
+ }
8699
+ if ( control.isModuleRegistered( id_candidate ) ) {
8700
+ key++; i++;
8701
+ return control.generateModuleId( module_type, key, i );
8702
+ }
8703
+
8704
+ return id_candidate;
8705
+ },
8706
+ _getNextModuleKeyInCollection : function() {
8707
+ var control = this,
8708
+ _max_mod_key = {},
8709
+ _next_key = 0;
8710
+ if ( ! _.isEmpty( control.czr_moduleCollection() ) ) {
8711
+ _max_mod_key = _.max( control.czr_moduleCollection(), function( _mod ) {
8712
+ return parseInt( _mod.id.replace(/[^\/\d]/g,''), 10 );
8713
+ });
8714
+ _next_key = parseInt( _max_mod_key.id.replace(/[^\/\d]/g,''), 10 ) + 1;
8715
+ }
8716
+ return _next_key;
8717
+ }
8718
+ });//$.extend//CZRBaseControlMths
8719
+ })( wp.customize , jQuery, _ );
8720
+ var CZRBaseModuleControlMths = CZRBaseModuleControlMths || {};
8721
+ ( function ( api, $, _ ) {
8722
+ $.extend( CZRBaseModuleControlMths, {
8723
+ registerModulesOnInit : function( sektion_module_instance ) {
8724
+ var control = this,
8725
+ _orphan_mods = [];
8726
+
8727
+ _.each( control.getSavedModules() , function( _mod, _key ) {
8728
+ if ( ! sektion_module_instance.czr_Item.has( _mod.sektion_id ) ) {
8729
+ api.errorLog( 'Warning Module ' + _mod.id + ' is orphan : it has no sektion to be embedded to. It Must be removed.');
8730
+ _orphan_mods.push(_mod);
8731
+ return;
8732
+ }
8733
+
8734
+ var _sektion = sektion_module_instance.czr_Item( _mod.sektion_id );
8735
+
8736
+ if ( _.isUndefined( _sektion ) ) {
8737
+ throw new Error( 'sektion instance missing. Impossible to instantiate module : ' + _mod.id );
8738
+ }
8739
+ $.extend( _mod, {sektion : _sektion} );
8740
+ control.updateModulesCollection( {module : _mod } );
8741
+ });
8742
+ control.moduleCollectionReady.then( function() {
8743
+ if ( ! _.isEmpty( _orphan_mods ) ) {
8744
+ control.moduleCollectionReact( control.czr_moduleCollection(), [], { orphans_module_removal : _orphan_mods } );
8745
+ }
8746
+ });
8747
+ },
8748
+ updateModulesCollection : function( obj ) {
8749
+ var control = this,
8750
+ _current_collection = control.czr_moduleCollection(),
8751
+ _new_collection = $.extend( true, [], _current_collection);
8752
+ if ( _.has( obj, 'collection' ) ) {
8753
+ control.czr_moduleCollection.set( obj.collection, obj.data || {} );
8754
+ return;
8755
+ }
8756
+
8757
+ if ( ! _.has(obj, 'module') ) {
8758
+ throw new Error('updateModulesCollection, no module provided ' + control.id + '. Aborting');
8759
+ }
8760
+ var module_api_ready = control.prepareModuleForAPI( _.clone( obj.module ) );
8761
+ if ( _.findWhere( _new_collection, { id : module_api_ready.id } ) ) {
8762
+ _.each( _current_collection , function( _elt, _ind ) {
8763
+ if ( _elt.id != module_api_ready.id )
8764
+ return;
8765
+ _new_collection[_ind] = module_api_ready;
8766
+ });
8767
+ }
8768
+ else {
8769
+ _new_collection.push(module_api_ready);
8770
+ }
8771
+ var _params = {};
8772
+ if ( _.has( obj, 'data') ) {
8773
+ _params = $.extend( true, {}, obj.data );
8774
+ $.extend( _params, { module : module_api_ready } );
8775
+ }
8776
+ control.czr_moduleCollection.set( _new_collection, _params );
8777
+ },
8778
+ moduleCollectionReact : function( to, from, data ) {
8779
+ var control = this,
8780
+ is_module_added = _.size(to) > _.size(from),
8781
+ is_module_removed = _.size(from) > _.size(to),
8782
+ is_module_update = _.size(from) == _.size(to);
8783
+ is_collection_sorted = false;
8784
+ if ( is_module_removed ) {
8785
+ var _to_remove = _.filter( from, function( _mod ){
8786
+ return _.isUndefined( _.findWhere( to, { id : _mod.id } ) );
8787
+ });
8788
+ _to_remove = _to_remove[0];
8789
+ control.czr_Module.remove( _to_remove.id );
8790
+ }
8791
+ if ( _.isObject( data ) && _.has( data, 'module' ) ) {
8792
+ data.module_id = data.module.id;
8793
+ data.module = control.prepareModuleForDB( $.extend( true, {}, data.module ) );
8794
+ }
8795
+ if ( ! control.isMultiModuleControl() && is_module_added ) {
8796
+ return;
8797
+ }
8798
+ else {
8799
+ api( this.id )
8800
+ .set( control.filterModuleCollectionBeforeAjax( to ), data );
8801
+ }
8802
+ },
8803
+ filterModuleCollectionBeforeAjax : function( collection ) {
8804
+ var control = this,
8805
+ _filtered_collection = $.extend( true, [], collection ),
8806
+ _to_return;
8807
+
8808
+ _.each( collection , function( _mod, _key ) {
8809
+ var db_ready_mod = $.extend( true, {}, _mod );
8810
+ _filtered_collection[_key] = control.prepareModuleForDB( db_ready_mod );
8811
+ });
8812
+ if ( control.isMultiModuleControl() ) {
8813
+ return _filtered_collection;
8814
+ } else {
8815
+ if ( _.size(collection) > 1 ) {
8816
+ throw new Error('There should not be several modules in the collection of control : ' + control.id );
8817
+ }
8818
+ if ( ! _.isArray(collection) || _.isEmpty(collection) || ! _.has( collection[0], 'items' ) ) {
8819
+ throw new Error('The setting value could not be populated in control : ' + control.id );
8820
+ }
8821
+ var module_id = collection[0].id;
8822
+
8823
+ if ( ! control.czr_Module.has( module_id ) ) {
8824
+ throw new Error('The single module control (' + control.id + ') has no module registered with the id ' + module_id );
8825
+ }
8826
+ var module_instance = control.czr_Module( module_id );
8827
+ if ( ! _.isArray( module_instance().items ) ) {
8828
+ throw new Error('The module ' + module_id + ' should be an array in control : ' + control.id );
8829
+ }
8830
+ _to_return = module_instance.isMultiItem() ? module_instance().items : ( module_instance().items[0] || [] );
8831
+ return module_instance.hasModOpt() ? _.union( [ module_instance().modOpt ] , _to_return ) : _to_return;
8832
+ }
8833
+ },
8834
+ prepareModuleForDB : function ( module_db_candidate ) {
8835
+ if ( ! _.isObject( module_db_candidate ) ) {
8836
+ throw new Error('MultiModule Control::prepareModuleForDB : a module must be an object. Aborting.');
8837
+ }
8838
+ var control = this,
8839
+ db_ready_module = {};
8840
+
8841
+ _.each( control.getDefaultModuleDBModel() , function( _value, _key ) {
8842
+ if ( ! _.has( module_db_candidate, _key ) ) {
8843
+ throw new Error('MultiModule Control::prepareModuleForDB : a module is missing the property : ' + _key + ' . Aborting.');
8844
+ }
8845
+
8846
+ var _candidate_val = module_db_candidate[ _key ];
8847
+ switch( _key ) {
8848
+ case 'items' :
8849
+ if ( ! _.isArray( _candidate_val ) ) {
8850
+ throw new Error('prepareModuleForDB : a module item list must be an array');
8851
+ }
8852
+ db_ready_module[ _key ] = _candidate_val;
8853
+ break;
8854
+ case 'id' :
8855
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8856
+ throw new Error('prepareModuleForDB : a module id must a string not empty');
8857
+ }
8858
+ db_ready_module[ _key ] = _candidate_val;
8859
+ break;
8860
+ case 'module_type' :
8861
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8862
+ throw new Error('prepareModuleForDB : a module type must a string not empty');
8863
+ }
8864
+ db_ready_module[ _key ] = _candidate_val;
8865
+ break;
8866
+ case 'column_id' :
8867
+ if ( ! _.isString( _candidate_val ) || _.isEmpty( _candidate_val ) ) {
8868
+ throw new Error('prepareModuleForDB : a module column id must a string not empty');
8869
+ }
8870
+ db_ready_module[ _key ] = _candidate_val;
8871
+ break;
8872
+ case 'sektion_id' :
8873
+ if ( ! _.isObject( module_db_candidate.sektion ) || ! _.has( module_db_candidate.sektion, 'id' ) ) {
8874
+ throw new Error('prepareModuleForDB : a module sektion must be an object with an id.');
8875
+ }
8876
+ db_ready_module[ _key ] = module_db_candidate.sektion.id;
8877
+ break;
8878
+ case 'dirty' :
8879
+ if ( control.czr_Module.has( module_db_candidate.id ) )
8880
+ db_ready_module[ _key ] = control.czr_Module( module_db_candidate.id ).isDirty();
8881
+ else
8882
+ db_ready_module[ _key ] = _candidate_val;
8883
+ if ( ! _.isBoolean( db_ready_module[ _key ] ) ) {
8884
+ throw new Error('prepareModuleForDB : a module dirty state must be a boolean.');
8885
+ }
8886
+ break;
8887
+ }//switch
8888
+ });
8889
+ return db_ready_module;
8890
+ }
8891
+ });//$.extend//CZRBaseControlMths
8892
+ })( wp.customize , jQuery, _ );
8893
+ var CZRMultiModuleControlMths = CZRMultiModuleControlMths || {};
8894
+ ( function ( api, $, _ ) {
8895
+ $.extend( CZRMultiModuleControlMths, {
8896
+ initialize: function( id, options ) {
8897
+ var control = this;
8898
+ api.consoleLog('IN MULTI MODULE INITIALIZE ? ', options );
8899
+ api(id).callbacks.add( function() { return control.syncColumn.apply( control, arguments ); } );
8900
+
8901
+ api.CZRBaseModuleControl.prototype.initialize.call( control, id, options );
8902
+ },
8903
+
8904
+
8905
+ ready : function() {
8906
+ var control = this;
8907
+ api.consoleLog('MODULE-COLLECTION CONTROL READY', this.id );
8908
+ api.CZRBaseModuleControl.prototype.ready.apply( control, arguments);
8909
+ },
8910
+ syncColumn : function( to, from, data ) {
8911
+ api.consoleLog('IN SYNC COLUMN', to, from, data );
8912
+ if ( ! _.isUndefined(data) && data.silent )
8913
+ return;
8914
+ api.consoleLog('IN SYNXXX', api.control('hu_theme_options[module-collection]').syncSektionModule()(), this.syncSektionModule()(), this.id );
8915
+ if ( _.has( data, 'orphans_module_removal' ) )
8916
+ return;
8917
+ var control = api.control( this.id );
8918
+ var added_mod = _.filter( to, function( _mod, _key ){
8919
+ return ! _.findWhere( from, { id : _mod.id } );
8920
+ } );
8921
+ if ( ! _.isEmpty( added_mod ) ) {
8922
+ api.consoleLog('ADDED MODULE?', added_mod );
8923
+ _.each( added_mod, function( _mod ) {
8924
+ control.syncSektionModule().czr_Column( _mod.column_id ).updateColumnModuleCollection( { module : _mod } );
8925
+ });
8926
+ }
8927
+ var removed_mod = _.filter( from, function( _mod, _key ){
8928
+ return ! _.findWhere( to, { id : _mod.id } );
8929
+ } );
8930
+ if ( ! _.isEmpty( removed_mod ) ) {
8931
+ _.each( removed_mod, function( _mod ) {
8932
+ control.syncSektionModule().czr_Column( _mod.column_id ).removeModuleFromColumnCollection( _mod );
8933
+ });
8934
+ }
8935
+ if ( _.size(from) == _.size(to) && _.has( data, 'module') && _.has( data, 'source_column') && _.has( data, 'target_column') ) {
8936
+ $.when( control.syncSektionModule().moveModuleFromTo( data.module, data.source_column, data.target_column ) ).done( function() {
8937
+ control.syncSektionModule().control.trigger('module-moved', { module : data.module, source_column: data.source_column, target_column :data.target_column });
8938
+ } );
8939
+ }
8940
+ control.trigger( 'columns-synchronized', to );
8941
+ },
8942
+ removeModule : function( module ) {
8943
+ var control = this;
8944
+ if ( control.czr_Module.has( module.id ) && 'resolved' == control.czr_Module( module.id ).embedded.state() )
8945
+ control.czr_Module( module.id ).container.remove();
8946
+ control.removeModuleFromCollection( module );
8947
+ },
8948
+
8949
+
8950
+ removeModuleFromCollection : function( module ) {
8951
+ var control = this,
8952
+ _current_collection = control.czr_moduleCollection(),
8953
+ _new_collection = $.extend( true, [], _current_collection);
8954
+
8955
+ _new_collection = _.filter( _new_collection, function( _mod ) {
8956
+ return _mod.id != module.id;
8957
+ } );
8958
+ control.czr_moduleCollection.set( _new_collection );
8959
+ }
8960
+ });//$.extend//CZRBaseControlMths
8961
+ })( wp.customize , jQuery, _ );
8962
+ var CZRMultiModuleControlMths = CZRMultiModuleControlMths || {};
8963
+ ( function ( api, $, _ ) {
8964
+ $.extend( CZRMultiModuleControlMths, {
8965
+ getMultiModuleExtender : function( parentConstructor ) {
8966
+ var control = this;
8967
+ $.extend( control.CZRModuleExtended, {
8968
+ initialize: function( id, constructorOptions ) {
8969
+ var module = this;
8970
+ parentConstructor.prototype.initialize.call( module, id, constructorOptions );
8971
+
8972
+ api.consoleLog('MODULE INSTANTIATED : ', module.id );
8973
+ $.extend( module, {
8974
+ singleModuleWrapper : 'czr-single-module-wrapper',
8975
+ sektionModuleTitle : 'czr-module-sektion-title-part',
8976
+ ruModuleEl : 'czr-ru-module-sektion-content'
8977
+ } );
8978
+ module.czr_ModuleState = new api.Value( false );
8979
+ module.isReady.done( function() {
8980
+ module.setupModuleView();
8981
+ });
8982
+ module.moduleTitleEmbedded = $.Deferred();
8983
+ module.modColumn = new api.Value();
8984
+ module.modColumn.set( constructorOptions.column_id );
8985
+ module.modColumn.bind( function( to, from ) {
8986
+ api.consoleLog('MODULE ' + module.id + ' HAS BEEN MOVED TO COLUMN', to, module() );
8987
+ var _current_model = module(),
8988
+ _new_model = $.extend( true, {}, _current_model );
8989
+
8990
+ _new_model.column_id = to;
8991
+ module.set( _new_model, { target_column : to, source_column : from } );
8992
+ } );
8993
+ },
8994
+ ready : function( is_added_by_user ) {
8995
+ var module = this;
8996
+ api.consoleLog('MODULE READY IN EXTENDED MODULE CLASS : ', module.id );
8997
+ $.when( module.renderModuleWrapper( is_added_by_user ) ).done( function( $_module_container ) {
8998
+ if ( _.isUndefined($_module_container) || false === $_module_container.length ) {
8999
+ throw new Error( 'Module container has not been embedded for module :' + module.id );
9000
+ }
9001
+ module.container = $_module_container;
9002
+ module.embedded.resolve();
9003
+ } );
9004
+ parentConstructor.prototype.ready.call( module );
9005
+ }
9006
+
9007
+ });
9008
+ return control.CZRModuleExtended;
9009
+ },
9010
+ CZRModuleExtended : {
9011
+ renderModuleWrapper : function( is_added_by_user ) {
9012
+ var module = this;
9013
+ if ( 'resolved' == module.embedded.state() )
9014
+ return module.container;
9015
+ if ( 0 === $( '#tmpl-' + module.singleModuleWrapper ).length ) {
9016
+ throw new Error('No template for module ' + module.id + '. The template script id should be : #tmpl-' + module.singleModuleWrapper );
9017
+ }
9018
+
9019
+ var module_wrapper_tmpl = wp.template( module.singleModuleWrapper ),
9020
+ tmpl_data = {
9021
+ id : module.id,
9022
+ type : module.module_type
9023
+ },
9024
+ $_module_el = $( module_wrapper_tmpl( tmpl_data ) );
9025
+ if ( is_added_by_user ) {
9026
+ $.when( $( '.czr-module-collection-wrapper' , module._getColumn().container ).find( '.czr-module-candidate').after( $_module_el ) ).
9027
+ done( function() {
9028
+ $( '.czr-module-collection-wrapper' , module._getColumn().container ).find( '.czr-module-candidate').remove();
9029
+ });
9030
+ } else {
9031
+ $( '.czr-module-collection-wrapper' , module._getColumn().container).append( $_module_el );
9032
+ }
9033
+
9034
+ return $_module_el;
9035
+ },
9036
+
9037
+
9038
+
9039
+
9040
+
9041
+ setupModuleView : function() {
9042
+ var module = this;
9043
+
9044
+ module.view_event_map = [
9045
+ {
9046
+ trigger : 'click keydown',
9047
+ selector : [ '.czr-remove-mod', '.' + module.control.css_attr.cancel_alert_btn ].join(','),
9048
+ name : 'toggle_remove_alert',
9049
+ actions : ['toggleModuleRemoveAlert']
9050
+ },
9051
+ {
9052
+ trigger : 'click keydown',
9053
+ selector : '.' + module.control.css_attr.remove_view_btn,
9054
+ name : 'remove_module',
9055
+ actions : ['removeModule']
9056
+ },
9057
+ {
9058
+ trigger : 'click keydown',
9059
+ selector : '.czr-edit-mod',
9060
+ name : 'edit_module',
9061
+ actions : ['setModuleViewVisibility', 'sendEditModule']
9062
+ },
9063
+ {
9064
+ trigger : 'click keydown',
9065
+ selector : '.czr-module-back',
9066
+ name : 'back_to_column',
9067
+ actions : ['setModuleViewVisibility']
9068
+ },
9069
+ {
9070
+ trigger : 'mouseenter',
9071
+ selector : '.czr-mod-header',
9072
+ name : 'hovering_module',
9073
+ actions : function( obj ) {
9074
+ module.control.previewer.send( 'start_hovering_module', {
9075
+ id : module.id
9076
+ });
9077
+ }
9078
+ },
9079
+ {
9080
+ trigger : 'mouseleave',
9081
+ selector : '.czr-mod-header',
9082
+ name : 'hovering_module',
9083
+ actions : function( obj ) {
9084
+ module.control.previewer.send( 'stop_hovering_module', {
9085
+ id : module.id
9086
+ });
9087
+ }
9088
+ }
9089
+ ];
9090
+ module.embedded.done( function() {
9091
+ module.czr_ModuleState.callbacks.add( function() { return module.setupModuleViewStateListeners.apply(module, arguments ); } );
9092
+ api.CZR_Helpers.setupDOMListeners(
9093
+ module.view_event_map,//actions to execute
9094
+ { module : { id : module.id } , dom_el:module.container },//model + dom scope
9095
+ module //instance where to look for the cb methods
9096
+ );//listeners for the view wrapper
9097
+ });
9098
+ },
9099
+ setModuleViewVisibility : function( obj, is_added_by_user ) {
9100
+ var module = this;
9101
+
9102
+ module.czr_ModuleState( ! module.czr_ModuleState() );
9103
+ api.czrModulePanelState.set(false);
9104
+ api.czrSekSettingsPanelState.set(false);
9105
+ module.control.syncSektionModule().closeAllOtherSektions( $(obj.dom_event.currentTarget, obj.dom_el ) );
9106
+ },
9107
+ sendEditModule : function( obj ) {
9108
+ var module = this;
9109
+ module.control.previewer.send( 'edit_module', {
9110
+ id : module.id
9111
+ });
9112
+ },
9113
+ setupModuleViewStateListeners : function( expanded ) {
9114
+ var module = this;
9115
+ api.czr_isModuleExpanded = api.czr_isModuleExpanded || new api.Value();
9116
+
9117
+ if ( expanded )
9118
+ api.czr_isModuleExpanded( module );
9119
+ else
9120
+ api.czr_isModuleExpanded( false );
9121
+ $.when( module.toggleModuleViewExpansion( expanded ) ).done( function() {
9122
+ if ( expanded ) {
9123
+ module.renderModuleTitle();
9124
+ module.populateSavedItemCollection();
9125
+ }
9126
+ else {
9127
+ module.czr_Item.each ( function( item ) {
9128
+ item.viewState.set('closed');
9129
+ item._destroyView( 0 );
9130
+ module.czr_Item.remove( item.id );
9131
+ } );
9132
+ }
9133
+ });
9134
+ },
9135
+
9136
+
9137
+ renderModuleTitle : function() {
9138
+ var module = this;
9139
+ if( 'resolved' == module.moduleTitleEmbedded.state() )
9140
+ return;
9141
+ if ( 0 === $( '#tmpl-' + module.sektionModuleTitle ).length ) {
9142
+ throw new Error('No sektion title Module Part template for module ' + module.id + '. The template script id should be : #tmpl-' + module.sektionModuleTitle );
9143
+ }
9144
+ $.when( $( module.container ).find('.czr-mod-content').prepend(
9145
+ $( wp.template( module.sektionModuleTitle )( { id : module.id } ) )
9146
+ ) ).done( function() {
9147
+ module.moduleTitleEmbedded.resolve();
9148
+ });
9149
+ },
9150
+ toggleModuleViewExpansion : function( expanded, duration ) {
9151
+ var module = this;
9152
+ $( '.czr-mod-content' , module.container ).slideToggle( {
9153
+ duration : duration || 200,
9154
+ done : function() {
9155
+ var $_overlay = module.container.closest( '.wp-full-overlay' ),
9156
+ $_backBtn = module.container.find( '.czr-module-back' ),
9157
+ $_modTitle = module.container.find('.czr-module-title');
9158
+
9159
+ module.container.toggleClass('open' , expanded );
9160
+ $_overlay.toggleClass('czr-module-open', expanded );
9161
+ $_modTitle.attr( 'tabindex', expanded ? '-1' : '0' );
9162
+ $_backBtn.attr( 'tabindex', expanded ? '0' : '-1' );
9163
+
9164
+ if( expanded ) {
9165
+ $_backBtn.focus();
9166
+ } else {
9167
+ $_modTitle.focus();
9168
+ }
9169
+ if ( expanded )
9170
+ module._adjustScrollExpandedBlock( module.container );
9171
+ }//done callback
9172
+ } );
9173
+ },
9174
+
9175
+
9176
+
9177
+
9178
+
9179
+
9180
+
9181
+
9182
+
9183
+ toggleModuleRemoveAlert : function( obj ) {
9184
+ var module = this,
9185
+ control = this.control,
9186
+ $_alert_el = $( '.' + module.control.css_attr.remove_alert_wrapper, module.container ).first(),
9187
+ $_clicked = obj.dom_event,
9188
+ $_column_container = control.syncSektionModule().czr_Column( module.column_id ).container;
9189
+ if ( _.has(module, 'preItem') ) {
9190
+ control.syncSektionModule().preItemExpanded.set( false );
9191
+ }
9192
+ $('.' + module.control.css_attr.remove_alert_wrapper, $_column_container ).not($_alert_el).each( function() {
9193
+ if ( $(this).hasClass('open') ) {
9194
+ $(this).slideToggle( {
9195
+ duration : 200,
9196
+ done : function() {
9197
+ $(this).toggleClass('open' , false );
9198
+ $(this).siblings().find('.' + module.control.css_attr.display_alert_btn).toggleClass('active' , false );
9199
+ }
9200
+ } );
9201
+ }
9202
+ });
9203
+ if ( ! wp.template( module.AlertPart ) || ! module.container ) {
9204
+ throw new Error( 'No removal alert template available for module :' + module.id );
9205
+ }
9206
+
9207
+ $_alert_el.html( wp.template( module.AlertPart )( { title : ( module().title || module.id ) } ) );
9208
+ $_alert_el.slideToggle( {
9209
+ duration : 200,
9210
+ done : function() {
9211
+ var _is_open = ! $(this).hasClass('open') && $(this).is(':visible');
9212
+ $(this).toggleClass('open' , _is_open );
9213
+ $( obj.dom_el ).find('.' + module.control.css_attr.display_alert_btn).toggleClass( 'active', _is_open );
9214
+ if ( _is_open )
9215
+ module._adjustScrollExpandedBlock( module.container );
9216
+ }
9217
+ } );
9218
+ },
9219
+ removeModule : function( obj ) {
9220
+ this.control.removeModule( obj.module );
9221
+ },
9222
+
9223
+
9224
+
9225
+
9226
+
9227
+
9228
+
9229
+
9230
+
9231
+
9232
+
9233
+
9234
+
9235
+
9236
+ _getColumn : function() {
9237
+ var module = this;
9238
+ return module.control.syncSektionModule().czr_Column( module.modColumn() );
9239
+ },
9240
+
9241
+ _getSektion : function() {
9242
+
9243
+ }
9244
+ }
9245
+ });//$.extend//CZRBaseControlMths
9246
+ })( wp.customize , jQuery, _ );
9247
+ var CZRMultiplePickerMths = CZRMultiplePickerMths || {};
9248
+ ( function ( api, $, _ ) {
9249
+ $.extend( CZRMultiplePickerMths , {
9250
+ ready: function() {
9251
+ var control = this,
9252
+ _select = this.container.find('select');
9253
+
9254
+
9255
+ _select.select2({
9256
+ closeOnSelect: false,
9257
+ templateSelection: czrEscapeMarkup
9258
+ });
9259
+
9260
+ function czrEscapeMarkup(obj) {
9261
+ return obj.text.replace(/\u2013|\u2014/g, "");
9262
+ }
9263
+ _select.on('change', function(e){
9264
+ if ( 0 === $(this).find("option:selected").length )
9265
+ control.setting.set([]);
9266
+ });
9267
+ }
9268
+ });//$.extend
9269
+ })( wp.customize , jQuery, _ );
9270
+ var CZRCroppedImageMths = CZRCroppedImageMths || {};
9271
+
9272
+ (function (api, $, _) {
9273
+ if ( 'function' != typeof wp.media.controller.Cropper || 'function' != typeof api.CroppedImageControl )
9274
+ return;
9275
+ wp.media.controller.CZRCustomizeImageCropper = wp.media.controller.Cropper.extend({
9276
+ doCrop: function( attachment ) {
9277
+ var cropDetails = attachment.get( 'cropDetails' ),
9278
+ control = this.get( 'control' );
9279
+
9280
+ cropDetails.dst_width = control.params.dst_width;
9281
+ cropDetails.dst_height = control.params.dst_height;
9282
+
9283
+ return wp.ajax.post( 'crop-image', {
9284
+ wp_customize: 'on',
9285
+ nonce: attachment.get( 'nonces' ).edit,
9286
+ id: attachment.get( 'id' ),
9287
+ context: control.id,
9288
+ cropDetails: cropDetails
9289
+ } );
9290
+ }
9291
+ });
9292
+ $.extend( CZRCroppedImageMths , {
9293
+ initFrame: function() {
9294
+
9295
+ var l10n = _wpMediaViewsL10n;
9296
+
9297
+ this.frame = wp.media({
9298
+ button: {
9299
+ text: l10n.select,
9300
+ close: false
9301
+ },
9302
+ states: [
9303
+ new wp.media.controller.Library({
9304
+ title: this.params.button_labels.frame_title,
9305
+ library: wp.media.query({ type: 'image' }),
9306
+ multiple: false,
9307
+ date: false,
9308
+ priority: 20,
9309
+ suggestedWidth: this.params.width,
9310
+ suggestedHeight: this.params.height
9311
+ }),
9312
+ new wp.media.controller.CZRCustomizeImageCropper({
9313
+ imgSelectOptions: this.calculateImageSelectOptions,
9314
+ control: this
9315
+ })
9316
+ ]
9317
+ });
9318
+
9319
+ this.frame.on( 'select', this.onSelect, this );
9320
+ this.frame.on( 'cropped', this.onCropped, this );
9321
+ this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
9322
+ },
9323
+ onSelect: function() {
9324
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON();
9325
+ if ( ! ( attachment.mime && attachment.mime.indexOf("image") > -1 ) ){
9326
+ this.frame.trigger( 'content:error' );
9327
+ return;
9328
+ }
9329
+ if ( ( _.contains( ['image/svg+xml', 'image/gif'], attachment.mime ) ) || //do not crop gifs or svgs
9330
+ this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
9331
+ this.setImageFromAttachment( attachment );
9332
+ this.frame.close();
9333
+ } else {
9334
+ this.frame.setState( 'cropper' );
9335
+ }
9336
+ },
9337
+ });//extend
9338
+ })( wp.customize, jQuery, _);
9339
+
9340
+ var CZRUploadMths = CZRUploadMths || {};
9341
+ ( function ( api, $, _ ) {
9342
+ $.extend( CZRUploadMths, {
9343
+ ready: function() {
9344
+ var control = this;
9345
+
9346
+ this.params.removed = this.params.removed || '';
9347
+
9348
+ this.success = $.proxy( this.success, this );
9349
+
9350
+ this.uploader = $.extend({
9351
+ container: this.container,
9352
+ browser: this.container.find('.czr-upload'),
9353
+ success: this.success,
9354
+ plupload: {},
9355
+ params: {}
9356
+ }, this.uploader || {} );
9357
+
9358
+ if ( control.params.extensions ) {
9359
+ control.uploader.plupload.filters = [{
9360
+ title: api.l10n.allowedFiles,
9361
+ extensions: control.params.extensions
9362
+ }];
9363
+ }
9364
+
9365
+ if ( control.params.context )
9366
+ control.uploader.params['post_data[context]'] = this.params.context;
9367
+
9368
+ if ( api.settings.theme.stylesheet )
9369
+ control.uploader.params['post_data[theme]'] = api.settings.theme.stylesheet;
9370
+
9371
+ this.uploader = new wp.Uploader( this.uploader );
9372
+
9373
+ this.remover = this.container.find('.remove');
9374
+ this.remover.on( 'click keydown', function( event ) {
9375
+ if ( event.type === 'keydown' && 13 !== event.which ) // enter
9376
+ return;
9377
+ control.setting.set( control.params.removed );
9378
+ event.preventDefault();
9379
+ });
9380
+
9381
+ this.removerVisibility = $.proxy( this.removerVisibility, this );
9382
+ this.setting.bind( this.removerVisibility );
9383
+ this.removerVisibility( this.setting() );
9384
+ },
9385
+
9386
+
9387
+ success: function( attachment ) {
9388
+ this.setting.set( attachment.get('id') );
9389
+ },
9390
+ removerVisibility: function( to ) {
9391
+ this.remover.toggle( to != this.params.removed );
9392
+ }
9393
+ });//extend
9394
+ })( wp.customize , jQuery, _ );
9395
+ var CZRLayoutSelectMths = CZRLayoutSelectMths || {};
9396
+ ( function ( api, $, _ ) {
9397
+ $.extend( CZRLayoutSelectMths , {
9398
+ ready: function() {
9399
+ this.setupSelect();
9400
+ },
9401
+
9402
+ setupSelect : function( obj ) {
9403
+ var control = this;
9404
+ $_select = this.container.find('select');
9405
+
9406
+ function addImg( state ) {
9407
+ if (! state.id) { return state.text; }
9408
+ if ( ! _.has( control.params.layouts, state.element.value ) )
9409
+ return;
9410
+
9411
+ var _layout_data = control.params.layouts[state.element.value],
9412
+ _src = _layout_data.src,
9413
+ _title = _layout_data.label,
9414
+ $state = $(
9415
+ '<img src="' + _src +'" class="czr-layout-img" title="' + _title + '" /><span class="czr-layout-title">' + _title + '</span>'
9416
+ );
9417
+ return $state;
9418
+ }
9419
+ $_select.select2( {
9420
+ templateResult: addImg,
9421
+ templateSelection: addImg,
9422
+ minimumResultsForSearch: Infinity
9423
+ });
9424
+ },
9425
+ });//$.extend
9426
+ })( wp.customize , jQuery, _ );
9427
+ ( function ( api, $, _ ) {
9428
+ $.extend( CZRBaseControlMths, api.Events );
9429
+ $.extend( api.Control.prototype, api.Events );//ensures that the default WP control constructor is extended as well
9430
+ $.extend( CZRModuleMths, api.Events );
9431
+ $.extend( CZRItemMths, api.Events );
9432
+ $.extend( CZRModOptMths, api.Events );
9433
+ $.extend( CZRSkopeBaseMths, api.Events );
9434
+ $.extend( CZRSkopeMths, api.Events );
9435
+ $.extend( CZRBaseControlMths, api.CZR_Helpers );
9436
+ $.extend( CZRInputMths, api.CZR_Helpers );
9437
+ $.extend( CZRModuleMths, api.CZR_Helpers );
9438
+ $.extend( CZRSkopeMths, api.CZR_Helpers );
9439
+ api.CZR_skopeBase = api.Class.extend( CZRSkopeBaseMths );
9440
+ api.CZR_skopeSave = api.Class.extend( CZRSkopeSaveMths );
9441
+ api.CZR_skopeReset = api.Class.extend( CZRSkopeResetMths );
9442
+ api.CZR_skope = api.Value.extend( CZRSkopeMths ); //=> used as constructor when creating the collection of skopes
9443
+ if ( _.has(api, 'HeaderTool') ) {
9444
+ api.czr_HeaderTool = $.extend( true, {}, api.HeaderTool );
9445
+ }
9446
+ api.CZRInput = api.Value.extend( CZRInputMths );
9447
+ api.CZRItem = api.Value.extend( CZRItemMths );
9448
+ api.CZRModOpt = api.Value.extend( CZRModOptMths );
9449
+ api.CZRModule = api.Value.extend( CZRModuleMths );
9450
+ api.CZRDynModule = api.CZRModule.extend( CZRDynModuleMths );
9451
+ if ( ! _.isUndefined( window.CZRColumnMths ) ) {
9452
+ api.CZRColumn = api.Value.extend( CZRColumnMths );
9453
+ }
9454
+ api.CZRBaseControl = api.Control.extend( CZRBaseControlMths );
9455
+ api.CZRBaseModuleControl = api.CZRBaseControl.extend( CZRBaseModuleControlMths );
9456
+ api.CZRMultiModuleControl = api.CZRBaseModuleControl.extend( CZRMultiModuleControlMths );
9457
+
9458
+ api.CZRUploadControl = api.Control.extend( CZRUploadMths );
9459
+ api.CZRLayoutControl = api.Control.extend( CZRLayoutSelectMths );
9460
+ api.CZRMultiplePickerControl = api.Control.extend( CZRMultiplePickerMths );
9461
+
9462
+
9463
+
9464
+ $.extend( api.controlConstructor, {
9465
+ czr_upload : api.CZRUploadControl,
9466
+
9467
+ czr_module : api.CZRBaseModuleControl,
9468
+ czr_multi_module : api.CZRMultiModuleControl,
9469
+
9470
+ czr_multiple_picker : api.CZRMultiplePickerControl,
9471
+ czr_layouts : api.CZRLayoutControl
9472
+ });
9473
+
9474
+ if ( 'function' == typeof api.CroppedImageControl ) {
9475
+ api.CZRCroppedImageControl = api.CroppedImageControl.extend( CZRCroppedImageMths );
9476
+
9477
+ $.extend( api.controlConstructor, {
9478
+ czr_cropped_image : api.CZRCroppedImageControl
9479
+ });
9480
+ }
9481
+ api.czrInputMap = api.czrInputMap || {};
9482
+ $.extend( api.czrInputMap, {
9483
+ text : '',
9484
+ textarea : '',
9485
+ check : 'setupIcheck',
9486
+ select : 'setupSelect',
9487
+ number : 'setupStepper',
9488
+ upload : 'setupImageUploader',
9489
+ color : 'setupColorPicker',
9490
+ content_picker : 'setupContentPicker',
9491
+ text_editor : 'setupTextEditor',
9492
+ password : '',
9493
+ range_slider : 'setupRangeSlider'
9494
+ });
9495
+ })( wp.customize, jQuery, _ );
9496
+ ( function (api, $, _) {
9497
+ var $_nav_section_container,
9498
+ i18n = serverControlParams.i18n || {};
9499
+
9500
+ api.czr_CrtlDependenciesReady = $.Deferred();
9501
+
9502
+ api.bind( 'ready' , function() {
9503
+ if ( _.has( api, 'czr_ctrlDependencies') )
9504
+ return;
9505
+ if ( serverControlParams.isSkopOn ) {
9506
+ if ( 'resolved' != api.czr_skopeReady.state() ) {
9507
+ api.czr_skopeReady.done( function() {
9508
+ api.czr_ctrlDependencies = new api.CZR_ctrlDependencies();
9509
+ api.czr_CrtlDependenciesReady.resolve();
9510
+ });
9511
+ }
9512
+ } else {
9513
+ api.czr_ctrlDependencies = new api.CZR_ctrlDependencies();
9514
+ api.czr_CrtlDependenciesReady.resolve();
9515
+ }
9516
+
9517
+ } );
9518
+
9519
+
9520
+ api.CZR_ctrlDependencies = api.Class.extend( {
9521
+ dominiDeps : [],
9522
+ initialize: function() {
9523
+ var self = this;
9524
+
9525
+ this.defaultDominusParams = {
9526
+ dominus : '',
9527
+ servi : [],
9528
+ visibility : null,
9529
+ actions : null,
9530
+ onSectionExpand : true
9531
+ };
9532
+ this.dominiDeps = _.extend( this.dominiDeps, this._getControlDeps() );
9533
+ if ( ! _.isArray( self.dominiDeps ) ) {
9534
+ throw new Error('Visibilities : the dominos dependency array is not an array.');
9535
+ }
9536
+ api.czr_activeSectionId.bind( function( section_id ) {
9537
+ if ( ! _.isEmpty( section_id ) && api.section.has( section_id ) ) {
9538
+ try {
9539
+ self.setServiDependencies( section_id );
9540
+ } catch( er ) {
9541
+ api.errorLog( 'In api.CZR_ctrlDependencies : ' + er );
9542
+ }
9543
+ }
9544
+ });
9545
+ api.bind( 'awaken-section', function( target_source ) {
9546
+ if ( serverControlParams.isSkopOn && _.has( api ,'czr_skopeBase' ) ) {
9547
+ api.czr_skopeBase.processSilentUpdates( {
9548
+ candidates : {},
9549
+ section_id : target_source.target,
9550
+ refresh : false
9551
+ } ).then( function() {
9552
+ try {
9553
+ self.setServiDependencies( target_source.target, target_source.source );
9554
+ } catch( er ) {
9555
+ api.errorLog( 'On awaken-section, ctrl deps : ' + er );
9556
+ }
9557
+ });
9558
+ } else {
9559
+ try {
9560
+ self.setServiDependencies( target_source.target, target_source.source );
9561
+ } catch( er ) {
9562
+ api.errorLog( 'On awaken-section, ctrl deps : ' + er );
9563
+ }
9564
+ }
9565
+ });
9566
+ this._handleFaviconNote();
9567
+ },
9568
+ setServiDependencies : function( targetSectionId, sourceSectionId, refresh ) {
9569
+ var self = this, params, dfd = $.Deferred();
9570
+
9571
+ refresh = refresh || false;
9572
+
9573
+ if ( _.isUndefined( targetSectionId ) || ! api.section.has( targetSectionId ) ) {
9574
+ throw new Error( 'Control Dependencies : the targetSectionId is missing or not registered : ' + targetSectionId );
9575
+ }
9576
+ api.section( targetSectionId ).czr_ctrlDependenciesReady = api.section( targetSectionId ).czr_ctrlDependenciesReady || $.Deferred();
9577
+ if ( ! refresh && 'resolved' == api.section( targetSectionId ).czr_ctrlDependenciesReady.state() )
9578
+ return dfd.resolve().promise();
9579
+ _.each( self.dominiDeps , function( params ) {
9580
+ if ( ! _.has( params, 'dominus' ) || ! _.isString( params.dominus ) || _.isEmpty( params.dominus ) ) {
9581
+ throw new Error( 'Control Dependencies : a dominus control id must be a not empty string.');
9582
+ }
9583
+
9584
+ var wpDominusId = api.CZR_Helpers.build_setId( params.dominus );
9585
+ if ( ! api.control.has( wpDominusId ) )
9586
+ return;
9587
+
9588
+ if ( api.control( wpDominusId ).section() != targetSectionId )
9589
+ return;
9590
+ params = self._prepareDominusParams( params );
9591
+ if ( _.isEmpty(params) )
9592
+ return;
9593
+
9594
+ self._processDominusCallbacks( params.dominus, params, refresh )
9595
+ .fail( function() {
9596
+ api.consoleLog( 'self._processDominusCallbacks fail for section ' + targetSectionId );
9597
+ dfd.reject();
9598
+ })
9599
+ .done( function() {
9600
+ dfd.resolve();
9601
+ });
9602
+ });
9603
+ var _secCtrls = api.CZR_Helpers.getSectionControlIds( targetSectionId ),
9604
+ _getServusDomini = function( shortServudId ) {
9605
+ var _dominiIds = [];
9606
+ _.each( self.dominiDeps , function( params ) {
9607
+ if ( ! _.has( params, 'servi' ) || ! _.isArray( params.servi ) || ! _.has( params, 'dominus' ) || _.isEmpty( params.dominus ) ) {
9608
+ api.errorLog( 'Control Dependencies : wrong params in _getServusDomini.');
9609
+ return;
9610
+ }
9611
+
9612
+ if ( _.contains( params.servi , shortServudId ) && ! _.contains( _dominiIds , params.dominus ) ) {
9613
+ params = self._prepareDominusParams( params );
9614
+ if ( _.isEmpty(params) )
9615
+ return;
9616
+ else
9617
+ _dominiIds.push( params.dominus );
9618
+ }
9619
+ });
9620
+ return ! _.isArray( _dominiIds ) ? [] : _dominiIds;
9621
+ },
9622
+ _servusDominiIds = [];
9623
+ _.each( _secCtrls, function( servusCandidateId ) {
9624
+ if ( _.isEmpty( _getServusDomini( servusCandidateId ) ) )
9625
+ return;
9626
+
9627
+ _servusDominiIds = _.union( _servusDominiIds, _getServusDomini( servusCandidateId ) );
9628
+ });
9629
+ _.each( _servusDominiIds, function( shortDominusId ){
9630
+
9631
+ var wpDominusId = api.CZR_Helpers.build_setId( shortDominusId );
9632
+ if ( api.control( wpDominusId ).section() == targetSectionId )
9633
+ return;
9634
+ if ( sourceSectionId == api.control( wpDominusId ).section() )
9635
+ return;
9636
+ api.trigger( 'awaken-section', {
9637
+ target : api.control( wpDominusId ).section(),
9638
+ source : targetSectionId
9639
+ } );
9640
+ } );
9641
+ dfd.always( function() {
9642
+ api.section( targetSectionId ).czr_ctrlDependenciesReady.resolve();
9643
+ });
9644
+ return dfd.promise();
9645
+ },
9646
+ _deferCallbackForControl : function( wpCrtlId, callback, args ) {
9647
+ var dfd = $.Deferred();
9648
+ if ( _.isEmpty(wpCrtlId) || ! _.isString(wpCrtlId) ) {
9649
+ throw new Error( '_deferCallbackForControl : the control id is missing.' );
9650
+ }
9651
+ if ( ! _.isFunction( callback ) ) {
9652
+ throw new Error( '_deferCallbackForControl : callback must be a funtion.' );
9653
+ }
9654
+ args = ( _.isUndefined(args) || ! _.isArray( args ) ) ? [] : args;
9655
+
9656
+ if ( api.control.has( wpCrtlId ) ) {
9657
+ if ( 'resolved' == api.control(wpCrtlId ).deferred.embedded.state() ) {
9658
+ $.when( callback.apply( null, args ) )
9659
+ .fail( function() { dfd.reject(); })
9660
+ .done( function() { dfd.resolve(); });
9661
+ } else {
9662
+ api.control( wpCrtlId ).deferred.embedded.then( function() {
9663
+ $.when( callback.apply( null, args ) )
9664
+ .fail( function() { dfd.reject(); })
9665
+ .done( function() { dfd.resolve(); });
9666
+ });
9667
+ }
9668
+ } else {
9669
+ api.control.when( wpCrtlId, function() {
9670
+ api.control( wpCrtlId ).deferred.embedded.then( function() {
9671
+ $.when( callback.apply( null, args ) )
9672
+ .fail( function() { dfd.reject(); })
9673
+ .done( function() { dfd.resolve(); });
9674
+ });
9675
+ });
9676
+ }
9677
+ return dfd.promise();
9678
+ },
9679
+ _processDominusCallbacks : function( shortDominusId, dominusParams, refresh ) {
9680
+ var self = this,
9681
+ wpDominusId = api.CZR_Helpers.build_setId( shortDominusId ),
9682
+ dominusSetInst = api( wpDominusId ),
9683
+ dfd = $.Deferred(),
9684
+ hasProcessed = false;
9685
+ _.each( dominusParams.servi , function( servusShortSetId ) {
9686
+ if ( ! api.control.has( api.CZR_Helpers.build_setId( servusShortSetId ) ) ) {
9687
+ return;
9688
+ }
9689
+ var _fireDominusCallbacks = function( dominusSetVal, servusShortSetId, dominusParams, refresh ) {
9690
+ var _toFire = [],
9691
+ _args = arguments;
9692
+ _.each( dominusParams, function( _item, _key ) {
9693
+ switch( _key ) {
9694
+ case 'visibility' :
9695
+ self._setVisibility.apply( null, _args );
9696
+ break;
9697
+ case 'actions' :
9698
+ if ( _.isFunction( _item ) )
9699
+ _item.apply( null, _args );
9700
+ break;
9701
+ }
9702
+ });
9703
+ },
9704
+ _deferCallbacks = function( dominusSetVal ) {
9705
+ dominusSetVal = dominusSetVal || dominusSetInst();
9706
+ var wpServusSetId = api.CZR_Helpers.build_setId( servusShortSetId );
9707
+ self._deferCallbackForControl(
9708
+ wpServusSetId,
9709
+ _fireDominusCallbacks,
9710
+ [ dominusSetVal, servusShortSetId, dominusParams ]
9711
+ )
9712
+ .always( function() { hasProcessed = true; })
9713
+ .fail( function() { dfd.reject(); })
9714
+ .done( function() { dfd.resolve(); });
9715
+ };
9716
+ _deferCallbacks();
9717
+ if ( ! _.has( dominusSetInst, 'czr_visibilityServi' ) )
9718
+ dominusSetInst.czr_visibilityServi = new api.Value( [] );
9719
+ var _currentDependantBound = dominusSetInst.czr_visibilityServi();
9720
+ if ( ! _.contains( _currentDependantBound, servusShortSetId ) ) {
9721
+ dominusSetInst.bind( function( dominusSetVal ) {
9722
+ _deferCallbacks( dominusSetVal );
9723
+ });
9724
+ dominusSetInst.czr_visibilityServi( _.union( _currentDependantBound, [ servusShortSetId ] ) );
9725
+ }
9726
+ } );//_.each
9727
+ if ( ! hasProcessed )
9728
+ return dfd.resolve().promise();
9729
+ return dfd.promise();
9730
+ },
9731
+ _setVisibility : function ( dominusSetVal, servusShortSetId, dominusParams, refresh ) {
9732
+ var wpServusSetId = api.CZR_Helpers.build_setId( servusShortSetId ),
9733
+ visibility = dominusParams.visibility( dominusSetVal, servusShortSetId, dominusParams.dominus );
9734
+
9735
+ refresh = refresh || false;
9736
+ if ( ! _.isBoolean( visibility ) || ( 'unchanged' == visibility && ! refresh ) )
9737
+ return;
9738
+ var _doVisibilitiesWhenPossible = function() {
9739
+ if ( api.state.has( 'silent-update-processing' ) && api.state( 'silent-update-processing' )() )
9740
+ return;
9741
+ api.control( wpServusSetId, function( _controlInst ) {
9742
+ var _args = {
9743
+ duration : 'fast',
9744
+ completeCallback : function() {},
9745
+ unchanged : false
9746
+ };
9747
+
9748
+ if ( _.has( _controlInst, 'active' ) )
9749
+ visibility = visibility && _controlInst.active();
9750
+
9751
+ if ( _.has( _controlInst, 'defaultActiveArguments' ) )
9752
+ _args = control.defaultActiveArguments;
9753
+
9754
+ _controlInst.onChangeActive( visibility , _controlInst.defaultActiveArguments );
9755
+ });
9756
+ if ( api.state.has( 'silent-update-processing' ) ) {
9757
+ api.state( 'silent-update-processing' ).unbind( _doVisibilitiesWhenPossible );
9758
+ }
9759
+ };
9760
+
9761
+ if ( api.state.has( 'silent-update-processing' ) && api.state( 'silent-update-processing' )() ) {
9762
+ api.state( 'silent-update-processing' ).bind( _doVisibilitiesWhenPossible );
9763
+ } else {
9764
+ _doVisibilitiesWhenPossible();
9765
+ }
9766
+
9767
+ },
9768
+ _getControlDeps : function() {
9769
+ return {};
9770
+ },
9771
+ _prepareDominusParams : function( params_candidate ) {
9772
+ var self = this,
9773
+ _ready_params = {};
9774
+ if ( ! _.isObject( params_candidate ) ) {
9775
+ api.errorLog( 'Visibilities : a dominus param definition must be an object.');
9776
+ return _ready_params;
9777
+ }
9778
+ if ( ! _.has( params_candidate, 'visibility' ) && ! _.has( params_candidate, 'actions' ) ) {
9779
+ api.errorLog( 'Visibilities : a dominus definition must include a visibility or an actions callback.');
9780
+ return _ready_params;
9781
+ }
9782
+ if ( ! _.has( params_candidate, 'dominus' ) || ! _.isString( params_candidate.dominus ) || _.isEmpty( params_candidate.dominus ) ) {
9783
+ api.errorLog( 'Visibilities : a dominus control id must be a not empty string.');
9784
+ return _ready_params;
9785
+ }
9786
+ var wpDominusId = api.CZR_Helpers.build_setId( params_candidate.dominus );
9787
+ if ( ! api.control.has( wpDominusId ) ) {
9788
+ api.errorLog( 'Visibilities : a dominus control id is not registered : ' + wpDominusId );
9789
+ return _ready_params;
9790
+ }
9791
+ if ( ! _.has( params_candidate, 'servi' ) || _.isUndefined( params_candidate.servi ) || ! _.isArray( params_candidate.servi ) || _.isEmpty( params_candidate.servi ) ) {
9792
+ api.errorLog( 'Visibilities : servi must be set as an array not empty.');
9793
+ return _ready_params;
9794
+ }
9795
+
9796
+ _.each( self.defaultDominusParams , function( _value, _key ) {
9797
+ var _candidate_val = params_candidate[ _key ];
9798
+
9799
+ switch( _key ) {
9800
+ case 'visibility' :
9801
+ if ( ! _.isUndefined( _candidate_val ) && ! _.isEmpty( _candidate_val ) && ! _.isFunction( _candidate_val ) ) {
9802
+ throw new Error( 'Visibilities : a dominus visibility callback must be a function : ' + params_candidate.dominus );
9803
+ }
9804
+ break;
9805
+ case 'actions' :
9806
+ if ( ! _.isUndefined( _candidate_val ) && ! _.isEmpty( _candidate_val ) && ! _.isFunction( _candidate_val ) ) {
9807
+ throw new Error( 'Visibilities : a dominus actions callback must be a function : ' + params_candidate.dominus );
9808
+ }
9809
+ break;
9810
+ case 'onSectionExpand' :
9811
+ if ( ! _.isUndefined( _candidate_val ) && ! _.isEmpty( _candidate_val ) && ! _.isBoolean( _candidate_val ) ) {
9812
+ throw new Error( 'Visibilities : a dominus onSectionExpand param must be a boolean : ' + params_candidate.dominus );
9813
+ }
9814
+ break;
9815
+ }
9816
+ _ready_params[_key] = _candidate_val;
9817
+ });
9818
+
9819
+ return _ready_params;
9820
+ },
9821
+ _handleFaviconNote : function() {
9822
+ var self = this,
9823
+ _fav_setId = api.CZR_Helpers.build_setId( serverControlParams.faviconOptionName );
9824
+ if ( ! api.has('site_icon') || ! api.control('site_icon') || ( api.has( _fav_setId ) && 0 === + api( _fav_setId )() ) || + api('site_icon')() > 0 )
9825
+ return;
9826
+
9827
+ var _oldDes = api.control('site_icon').params.description;
9828
+ _newDes = ['<strong>' , i18n.faviconNote || '' , '</strong><br/><br/>' ].join('') + _oldDes;
9829
+ self._printFaviconNote(_newDes );
9830
+ api('site_icon').callbacks.add( function(to) {
9831
+ if ( +to > 0 ) {
9832
+ api.control('site_icon').container.find('.description').text(_oldDes);
9833
+ if ( api.has( _fav_setId ) )
9834
+ api( _fav_setId ).set("");
9835
+ }
9836
+ else {
9837
+ self._printFaviconNote(_newDes );
9838
+ }
9839
+ });
9840
+ },
9841
+ _printFaviconNote : function( _newDes ) {
9842
+ api.control('site_icon').container.find('.description').html(_newDes);
9843
+ }
9844
+ }
9845
+ );//api.Class.extend() //api.CZR_ctrlDependencies
9846
+ })( wp.customize, jQuery, _);
9847
+ ( function ( wp, $ ) {
9848
+ $( function($) {
9849
+ var api = wp.customize || api;
9850
+ $('.accordion-section').not('.control-panel').click( function () {
9851
+ _recenter_current_section($(this));
9852
+ });
9853
+
9854
+ function _recenter_current_section( section ) {
9855
+ var $siblings = section.siblings( '.open' );
9856
+ if ( 0 !== $siblings.length && $siblings.offset().top < 0 ) {
9857
+ $('.wp-full-overlay-sidebar-content').animate({
9858
+ scrollTop: - $('#customize-theme-controls').offset().top - $siblings.height() + section.offset().top + $('.wp-full-overlay-sidebar-content').offset().top
9859
+ }, 700);
9860
+ }
9861
+ }//end of fn
9862
+ api.czrSetupCheckbox = function( controlId, refresh ) {
9863
+ $('input[type=checkbox]', api.control(controlId).container ).each( function() {
9864
+ if ( 0 === $(this).val() || '0' == $(this).val() || 'off' == $(this).val() || _.isEmpty($(this).val() ) ) {
9865
+ $(this).prop('checked', false);
9866
+ } else {
9867
+ $(this).prop('checked', true);
9868
+ }
9869
+ if ( 0 !== $(this).closest('div[class^="icheckbox"]').length )
9870
+ return;
9871
+
9872
+ $(this).iCheck({
9873
+ checkboxClass: 'icheckbox_flat-grey',
9874
+ radioClass: 'iradio_flat-grey',
9875
+ })
9876
+ .on( 'ifChanged', function(e){
9877
+ $(this).val( false === $(this).is(':checked') ? 0 : 1 );
9878
+ $(e.currentTarget).trigger('change');
9879
+ });
9880
+ });
9881
+ };//api.czrSetupCheckbox()
9882
+ api.czrSetupSelect = function(controlId, refresh) {
9883
+ $('select[data-customize-setting-link]', api.control(controlId).container )
9884
+ .not('.no-selecter-js')
9885
+ .each( function() {
9886
+ $(this).selecter({
9887
+ });
9888
+ });
9889
+ };//api.czrSetupSelect()
9890
+ api.czrSetupStepper = function( controlId, refresh ) {
9891
+ $('input[type="number"]', api.control(controlId).container ).each( function() {
9892
+ $(this).stepper();
9893
+ });
9894
+ };//api.czrSetupStepper()
9895
+
9896
+ api.control.each(function(control){
9897
+ if ( ! _.has(control,'id') )
9898
+ return;
9899
+ if ( 'widget_' != control.id.substring(0, 'widget_'.length ) && 'nav_menu' != control.id.substring( 0, 'nav_menu'.length ) ) {
9900
+ api.czrSetupCheckbox(control.id);
9901
+ }
9902
+ if ( 'nav_menu_locations' != control.id.substring( 0, 'nav_menu_locations'.length ) ) {
9903
+ api.czrSetupSelect(control.id);
9904
+ }
9905
+ api.czrSetupStepper(control.id);
9906
+ });
9907
+
9908
+
9909
+ var fireHeaderButtons = function() {
9910
+ var $home_button = $('<span/>', { class:'customize-controls-home fa fa-home', html:'<span class="screen-reader-text">Home</span>' } );
9911
+ $.when( $('#customize-header-actions').append( $home_button ) )
9912
+ .done( function() {
9913
+ $home_button
9914
+ .keydown( function( event ) {
9915
+ if ( 9 === event.which ) // tab
9916
+ return;
9917
+ if ( 13 === event.which ) // enter
9918
+ this.click();
9919
+ event.preventDefault();
9920
+ })
9921
+ .on( 'click.customize-controls-home', function() {
9922
+ if ( api.section.has( api.czr_activeSectionId() ) ) {
9923
+ api.section( api.czr_activeSectionId() ).expanded( false );
9924
+ } else {
9925
+ api.section.each( function( _s ) {
9926
+ _s.expanded( false );
9927
+ });
9928
+ }
9929
+ api.panel.each( function( _p ) {
9930
+ _p.expanded( false );
9931
+ });
9932
+ });
9933
+ });
9934
+ };
9935
+
9936
+ fireHeaderButtons();
9937
+
9938
+ });//end of $( function($) ) dom ready
9939
+ })( wp, jQuery );
addons/assets/czr/js/czr-control-base.min.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! addEventListener Polyfill ie9- http://stackoverflow.com/a/27790212*/
2
+ window.addEventListener=window.addEventListener||function(a,b){window.attachEvent("on"+a,b)},/*! Datenow Polyfill ie9- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now */
3
+ Date.now||(Date.now=function(){return(new Date).getTime()}),/*! Object.create monkey patch ie8 http://stackoverflow.com/a/18020326 */
4
+ Object.create||(Object.create=function(a,b){function c(){}if("undefined"!=typeof b)throw"The multiple-argument version of Object.create is not provided by this browser and cannot be shimmed.";return c.prototype=a,new c}),/*! https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter */
5
+ Array.prototype.filter||(Array.prototype.filter=function(a){"use strict";if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;f<c;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),/*! map was added to the ECMA-262 standard in the 5th edition */
6
+ Array.prototype.map||(Array.prototype.map=function(a,b){var c,d,e;if(null===this)throw new TypeError(" this is null or not defined");var f=Object(this),g=f.length>>>0;if("function"!=typeof a)throw new TypeError(a+" is not a function");for(arguments.length>1&&(c=b),d=new Array(g),e=0;e<g;){var h,i;e in f&&(h=f[e],i=a.call(c,h,e,f),d[e]=i),e++}return d}),/*! Array.from was added to the ECMA-262 standard in the 6th edition (ES2015) */
7
+ Array.from||(Array.from=function(){var a=Object.prototype.toString,b=function(b){return"function"==typeof b||"[object Function]"===a.call(b)},c=function(a){var b=Number(a);return isNaN(b)?0:0!==b&&isFinite(b)?(b>0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k<i;)h=d[k],g?j[k]="undefined"==typeof f?g(h,k):g.call(f,h,k):j[k]=h,k+=1;return j.length=i,j}}()),/*! iCheck v1.0.1 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
8
+ "function"!=typeof jQuery.fn.iCheck&&!function(a){function b(a,b,e){var f=a[0],g=/er/.test(e)?p:/bl/.test(e)?n:l,h=e==q?{checked:f[l],disabled:f[n],indeterminate:"true"==a.attr(p)||"false"==a.attr(o)}:f[g];if(/^(ch|di|in)/.test(e)&&!h)c(a,g);else if(/^(un|en|de)/.test(e)&&h)d(a,g);else if(e==q)for(g in h)h[g]?c(a,g,!0):d(a,g,!0);else b&&"toggle"!=e||(b||a[u]("ifClicked"),h?f[r]!==k&&d(a,g):c(a,g))}function c(b,c,e){var q=b[0],u=b.parent(),v=c==l,x=c==p,y=c==n,z=x?o:v?m:"enabled",A=f(b,z+g(q[r])),B=f(b,c+g(q[r]));if(!0!==q[c]){if(!e&&c==l&&q[r]==k&&q.name){var C=b.closest("form"),D='input[name="'+q.name+'"]',D=C.length?C.find(D):a(D);D.each(function(){this!==q&&a(this).data(i)&&d(a(this),c)})}x?(q[c]=!0,q[l]&&d(b,l,"force")):(e||(q[c]=!0),v&&q[p]&&d(b,p,!1)),h(b,v,c,e)}q[n]&&f(b,w,!0)&&u.find("."+j).css(w,"default"),u[s](B||f(b,c)||""),y?u.attr("aria-disabled","true"):u.attr("aria-checked",x?"mixed":"true"),u[t](A||f(b,z)||"")}function d(a,b,c){var d=a[0],e=a.parent(),i=b==l,k=b==p,q=b==n,u=k?o:i?m:"enabled",v=f(a,u+g(d[r])),x=f(a,b+g(d[r]));!1!==d[b]&&((k||!c||"force"==c)&&(d[b]=!1),h(a,i,u,c)),!d[n]&&f(a,w,!0)&&e.find("."+j).css(w,"pointer"),e[t](x||f(a,b)||""),q?e.attr("aria-disabled","false"):e.attr("aria-checked","false"),e[s](v||f(a,u)||"")}function e(b,c){b.data(i)&&(b.parent().html(b.attr("style",b.data(i).s||"")),c&&b[u](c),b.off(".i").unwrap(),a(v+'[for="'+b[0].id+'"]').add(b.closest(v)).off(".i"))}function f(a,b,c){return a.data(i)?a.data(i).o[b+(c?"":"Class")]:void 0}function g(a){return a.charAt(0).toUpperCase()+a.slice(1)}function h(a,b,c,d){d||(b&&a[u]("ifToggled"),a[u]("ifChanged")[u]("if"+g(c)))}var i="iCheck",j=i+"-helper",k="radio",l="checked",m="un"+l,n="disabled",o="determinate",p="in"+o,q="update",r="type",s="addClass",t="removeClass",u="trigger",v="label",w="cursor",x=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);a.fn[i]=function(f,g){var h='input[type="checkbox"], input[type="'+k+'"]',m=a(),o=function(b){b.each(function(){var b=a(this);m=b.is(h)?m.add(b):m.add(b.find(h))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(f))return f=f.toLowerCase(),o(this),m.each(function(){var c=a(this);"destroy"==f?e(c,"ifDestroyed"):b(c,!0,f),a.isFunction(g)&&g()});if("object"!=typeof f&&f)return this;var w=a.extend({checkedClass:l,disabledClass:n,indeterminateClass:p,labelHover:!0,aria:!1},f),y=w.handle,z=w.hoverClass||"hover",A=w.focusClass||"focus",B=w.activeClass||"active",C=!!w.labelHover,D=w.labelHoverClass||"hover",E=0|(""+w.increaseArea).replace("%","");return("checkbox"==y||y==k)&&(h='input[type="'+y+'"]'),-50>E&&(E=-50),o(this),m.each(function(){var f=a(this);e(f);var g=this,h=g.id,m=-E+"%",o=100+2*E+"%",o={position:"absolute",top:m,left:m,display:"block",width:o,height:o,margin:0,padding:0,background:"#fff",border:0,opacity:0},m=x?{position:"absolute",visibility:"hidden"}:E?o:{position:"absolute",opacity:0},p="checkbox"==g[r]?w.checkboxClass||"icheckbox":w.radioClass||"i"+k,y=a(v+'[for="'+h+'"]').add(f.closest(v)),F=!!w.aria,G=i+"-"+Math.random().toString(36).substr(2,6),H='<div class="'+p+'" '+(F?'role="'+g[r]+'" ':"");F&&y.each(function(){H+='aria-labelledby="',this.id?H+=this.id:(this.id=G,H+=G),H+='"'}),H=f.wrap(H+"/>")[u]("ifCreated").parent().append(w.insert),o=a('<ins class="'+j+'"/>').css(o).appendTo(H),f.data(i,{o:w,s:f.attr("style")}).css(m),w.inheritClass&&H[s](g.className||""),w.inheritID&&h&&H.attr("id",i+"-"+h),"static"==H.css("position")&&H.css("position","relative"),b(f,!0,q),y.length&&y.on("click.i mouseover.i mouseout.i touchbegin.i touchend.i",function(c){var d=c[r],e=a(this);if(!g[n]){if("click"==d){if(a(c.target).is("a"))return;b(f,!1,!0)}else C&&(/ut|nd/.test(d)?(H[t](z),e[t](D)):(H[s](z),e[s](D)));if(!x)return!1;c.stopPropagation()}}),f.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(a){var b=a[r];return a=a.keyCode,"click"!=b&&("keydown"==b&&32==a?(g[r]==k&&g[l]||(g[l]?d(f,l):c(f,l)),!1):void("keyup"==b&&g[r]==k?!g[l]&&c(f,l):/us|ur/.test(b)&&H["blur"==b?t:s](A)))}),o.on("click mousedown mouseup mouseover mouseout touchbegin.i touchend.i",function(a){var c=a[r],d=/wn|up/.test(c)?B:z;if(!g[n]){if("click"==c?b(f,!1,!0):(/wn|er|in/.test(c)?H[s](d):H[t](d+" "+B),y.length&&C&&d==z&&y[/ut|nd/.test(c)?t:s](D)),!x)return!1;a.stopPropagation()}})})}}(window.jQuery||window.Zepto),"function"!=typeof jQuery.fn.selecter&&!function(a,b){"use strict";function c(b){b=a.extend({},x,b||{}),null===w&&(w=a("body"));for(var c=a(this),e=0,f=c.length;f>e;e++)d(c.eq(e),b);return c}function d(b,c){if(!b.hasClass("selecter-element")){c=a.extend({},c,b.data("selecter-options")),c.external&&(c.links=!0);var d=b.find("option, optgroup"),g=d.filter("option"),h=g.filter(":selected"),n=""!==c.label?-1:g.index(h),p=c.links?"nav":"div";c.tabIndex=b[0].tabIndex,b[0].tabIndex=-1,c.multiple=b.prop("multiple"),c.disabled=b.is(":disabled");var q="<"+p+' class="selecter '+c.customClass;v?q+=" mobile":c.cover&&(q+=" cover"),q+=c.multiple?" multiple":" closed",c.disabled&&(q+=" disabled"),q+='" tabindex="'+c.tabIndex+'">',c.multiple||(q+='<span class="selecter-selected'+(""!==c.label?" placeholder":"")+'">',q+=a("<span></span").text(r(""!==c.label?c.label:h.text(),c.trim)).html(),q+="</span>"),q+='<div class="selecter-options">',q+="</div>",q+="</"+p+">",b.addClass("selecter-element").after(q);var s=b.next(".selecter"),u=a.extend({$select:b,$allOptions:d,$options:g,$selecter:s,$selected:s.find(".selecter-selected"),$itemsWrapper:s.find(".selecter-options"),index:-1,guid:t++},c);e(u),o(n,u),void 0!==a.fn.scroller&&u.$itemsWrapper.scroller(),u.$selecter.on("touchstart.selecter click.selecter",".selecter-selected",u,f).on("click.selecter",".selecter-item",u,j).on("close.selecter",u,i).data("selecter",u),u.$select.on("change.selecter",u,k),v||(u.$selecter.on("focus.selecter",u,l).on("blur.selecter",u,m),u.$select.on("focus.selecter",u,function(a){a.data.$selecter.trigger("focus")}))}}function e(b){for(var c="",d=b.links?"a":"span",e=0,f=0,g=b.$allOptions.length;g>f;f++){var h=b.$allOptions.eq(f);if("OPTGROUP"===h[0].tagName)c+='<span class="selecter-group',h.is(":disabled")&&(c+=" disabled"),c+='">'+h.attr("label")+"</span>";else{var i=h.val();h.attr("value")||h.attr("value",i),c+="<"+d+' class="selecter-item',h.is(":selected")&&""===b.label&&(c+=" selected"),h.is(":disabled")&&(c+=" disabled"),c+='" ',c+=b.links?'href="'+i+'"':'data-value="'+i+'"',c+=">"+a("<span></span>").text(r(h.text(),b.trim)).html()+"</"+d+">",e++}}b.$itemsWrapper.html(c),b.$items=b.$selecter.find(".selecter-item")}function f(c){c.preventDefault(),c.stopPropagation();var d=c.data;if(!d.$select.is(":disabled"))if(a(".selecter").not(d.$selecter).trigger("close.selecter",[d]),v){var e=d.$select[0];if(b.document.createEvent){var f=b.document.createEvent("MouseEvents");f.initMouseEvent("mousedown",!1,!0,b,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(f)}else e.fireEvent&&e.fireEvent("onmousedown")}else d.$selecter.hasClass("closed")?g(c):d.$selecter.hasClass("open")&&i(c)}function g(b){b.preventDefault(),b.stopPropagation();var c=b.data;if(!c.$selecter.hasClass("open")){var d=c.$selecter.offset(),e=w.outerHeight(),f=c.$itemsWrapper.outerHeight(!0),g=c.index>=0?c.$items.eq(c.index).position():{left:0,top:0};d.top+f>e&&c.$selecter.addClass("bottom"),c.$itemsWrapper.show(),c.$selecter.removeClass("closed").addClass("open"),w.on("click.selecter-"+c.guid,":not(.selecter-options)",c,h),void 0!==a.fn.scroller?c.$itemsWrapper.scroller("scroll",c.$itemsWrapper.find(".scroller-content").scrollTop()+g.top,0).scroller("reset"):c.$itemsWrapper.scrollTop(c.$itemsWrapper.scrollTop()+g.top)}}function h(b){b.preventDefault(),b.stopPropagation(),0===a(b.currentTarget).parents(".selecter").length&&i(b)}function i(a){a.preventDefault(),a.stopPropagation();var b=a.data;b.$selecter.hasClass("open")&&(b.$itemsWrapper.hide(),b.$selecter.removeClass("open bottom").addClass("closed"),w.off(".selecter-"+b.guid))}function j(b){b.preventDefault(),b.stopPropagation();var c=a(this),d=b.data;if(!d.$select.is(":disabled")){if(d.$itemsWrapper.is(":visible")){var e=d.$items.index(c);o(e,d),p(d)}d.multiple||i(b)}}function k(b,c){var d=a(this),e=b.data;if(!c&&!e.multiple){var f=e.$options.index(e.$options.filter("[value='"+s(d.val())+"']"));o(f,e),p(e)}}function l(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$select.is(":disabled")||c.multiple||(c.$selecter.addClass("focus").on("keydown.selecter"+c.guid,c,n),a(".selecter").not(c.$selecter).trigger("close.selecter",[c]))}function m(b){b.preventDefault(),b.stopPropagation();var c=b.data;c.$selecter.removeClass("focus").off("keydown.selecter"+c.guid+" keyup.selecter"+c.guid),a(".selecter").not(c.$selecter).trigger("close.selecter",[c])}function n(b){var c=b.data;if(13===b.keyCode)c.$selecter.hasClass("open")&&(i(b),o(c.index,c)),p(c);else if(!(9===b.keyCode||b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)){b.preventDefault(),b.stopPropagation();var d=c.$items.length-1,e=c.index<0?0:c.index;if(a.inArray(b.keyCode,u?[38,40,37,39]:[38,40])>-1)e+=38===b.keyCode||u&&37===b.keyCode?-1:1,0>e&&(e=0),e>d&&(e=d);else{var f,g,h=String.fromCharCode(b.keyCode).toUpperCase();for(g=c.index+1;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}if(0>e)for(g=0;d>=g;g++)if(f=c.$options.eq(g).text().charAt(0).toUpperCase(),f===h){e=g;break}}e>=0&&o(e,c)}}function o(a,b){var c=b.$items.eq(a),d=c.hasClass("selected"),e=c.hasClass("disabled");if(!e){if(-1===a&&""!==b.label)b.$selected.html(b.label);else if(d)b.multiple&&(b.$options.eq(a).prop("selected",null),c.removeClass("selected"));else{var f=c.html();c.data("value"),b.multiple?b.$options.eq(a).prop("selected",!0):(b.$selected.html(f).removeClass("placeholder"),b.$items.filter(".selected").removeClass("selected"),b.$select[0].selectedIndex=a),c.addClass("selected")}(!d||b.multiple)&&(b.index=a)}}function p(a){a.links?q(a):(a.callback.call(a.$selecter,a.$select.val(),a.index),a.$select.trigger("change",[!0]))}function q(a){var c=a.$select.val();a.external?b.open(c):b.location.href=c}function r(a,b){return 0===b?a:a.length>b?a.substring(0,b)+"...":a}function s(a){return a.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1")}var t=0,u=b.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,v=/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(b.navigator.userAgent||b.navigator.vendor||b.opera),w=null,x={callback:a.noop,cover:!1,customClass:"",label:"",external:!1,links:!1,trim:0},y={defaults:function(b){return x=a.extend(x,b||{}),a(this)},disable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).addClass("disabled"),e.$options.eq(f).prop("disabled",!0)}else e.$selecter.hasClass("open")&&e.$selecter.find(".selecter-selected").trigger("click.selecter"),e.$selecter.addClass("disabled"),e.$select.prop("disabled",!0)})},enable:function(b){return a(this).each(function(c,d){var e=a(d).next(".selecter").data("selecter");if(e)if("undefined"!=typeof b){var f=e.$items.index(e.$items.filter("[data-value="+b+"]"));e.$items.eq(f).removeClass("disabled"),e.$options.eq(f).prop("disabled",!1)}else e.$selecter.removeClass("disabled"),e.$select.prop("disabled",!1)})},destroy:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");d&&(d.$selecter.hasClass("open")&&d.$selecter.find(".selecter-selected").trigger("click.selecter"),void 0!==a.fn.scroller&&d.$selecter.find(".selecter-options").scroller("destroy"),d.$select[0].tabIndex=d.tabIndex,d.$select.off(".selecter").removeClass("selecter-element").show(),d.$selecter.off(".selecter").remove())})},refresh:function(){return a(this).each(function(b,c){var d=a(c).next(".selecter").data("selecter");if(d){var f=d.index;d.$allOptions=d.$select.find("option, optgroup"),d.$options=d.$allOptions.filter("option"),d.index=-1,f=d.$options.index(d.$options.filter(":selected")),e(d),o(f,d)}})}};a.fn.selecter=function(a){return y[a]?y[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:c.apply(this,arguments)},a.selecter=function(a){"defaults"===a&&y.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,window),"function"!=typeof jQuery.fn.stepper&&!function(a){"use strict";function b(b){b=a.extend({},k,b||{});for(var d=a(this),e=0,f=d.length;f>e;e++)c(d.eq(e),b);return d}function c(b,c){if(!b.hasClass("stepper-input")){c=a.extend({},c,b.data("stepper-options"));var e=parseFloat(b.attr("min")),f=parseFloat(b.attr("max")),g=parseFloat(b.attr("step"))||1;b.addClass("stepper-input").wrap('<div class="stepper '+c.customClass+'" />').after('<span class="stepper-arrow up">'+c.labels.up+'</span><span class="stepper-arrow down">'+c.labels.down+"</span>");var h=b.parent(".stepper"),j=a.extend({$stepper:h,$input:b,$arrow:h.find(".stepper-arrow"),min:void 0!==typeof e&&!isNaN(e)&&e,max:void 0!==typeof f&&!isNaN(f)&&f,step:void 0===typeof g||isNaN(g)?1:g,timer:null},c);j.digits=i(j.step),b.is(":disabled")&&h.addClass("disabled"),h.on("touchstart.stepper mousedown.stepper",".stepper-arrow",j,d).data("stepper",j)}}function d(b){b.preventDefault(),b.stopPropagation(),e(b);var c=b.data;if(!c.$input.is(":disabled")&&!c.$stepper.hasClass("disabled")){var d=a(b.target).hasClass("up")?c.step:-c.step;c.timer=g(c.timer,125,function(){f(c,d,!1)}),f(c,d),a("body").on("touchend.stepper mouseup.stepper",c,e)}}function e(b){b.preventDefault(),b.stopPropagation();var c=b.data;h(c.timer),a("body").off(".stepper")}function f(a,b){var c=parseFloat(a.$input.val()),d=b;void 0===typeof c||isNaN(c)?d=a.min!==!1?a.min:0:a.min!==!1&&c<a.min?d=a.min:d+=c;var e=(d-a.min)%a.step;0!==e&&(d-=e),a.min!==!1&&d<a.min&&(d=a.min),a.max!==!1&&d>a.max&&(d-=a.step),d!==c&&(d=j(d,a.digits),a.$input.val(d).trigger("change"))}function g(a,b,c){return h(a),setInterval(c,b)}function h(a){a&&(clearInterval(a),a=null)}function i(a){var b=String(a);return b.indexOf(".")>-1?b.length-b.indexOf(".")-1:0}function j(a,b){var c=Math.pow(10,b);return Math.round(a*c)/c}var k={customClass:"",labels:{up:"Up",down:"Down"}},l={defaults:function(b){return k=a.extend(k,b||{}),a(this)},destroy:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$stepper.off(".stepper").find(".stepper-arrow").remove(),b.$input.unwrap().removeClass("stepper-input"))})},disable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled","disabled"),b.$stepper.addClass("disabled"))})},enable:function(){return a(this).each(function(){var b=a(this).data("stepper");b&&(b.$input.attr("disabled",null),b.$stepper.removeClass("disabled"))})}};a.fn.stepper=function(a){return l[a]?l[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.stepper=function(a){"defaults"===a&&l.defaults.apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery,this),/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group",a(h),this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){
9
+ function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";
10
+ return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}),/*! rangeslider.js - v2.3.0 | (c) 2016 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
11
+ !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute("type","range"),"text"!==a.type}function c(a,b){var c=Array.prototype.slice.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)}function d(a,b){return b=b||100,function(){if(!a.debouncing){var c=Array.prototype.slice.apply(arguments);a.lastReturnVal=a.apply(window,c),a.debouncing=!0}return clearTimeout(a.debounceTimeout),a.debounceTimeout=setTimeout(function(){a.debouncing=!1},b),a.lastReturnVal}}function e(a){return a&&(0===a.offsetWidth||0===a.offsetHeight||a.open===!1)}function f(a){for(var b=[],c=a.parentNode;e(c);)b.push(c),c=c.parentNode;return b}function g(a,b){function c(a){"undefined"!=typeof a.open&&(a.open=!a.open)}var d=f(a),e=d.length,g=[],h=a[b];if(e){for(var i=0;i<e;i++)g[i]=d[i].style.cssText,d[i].style.setProperty?d[i].style.setProperty("display","block","important"):d[i].style.cssText+=";display: block !important",d[i].style.height="0",d[i].style.overflow="hidden",d[i].style.visibility="hidden",c(d[i]);h=a[b];for(var j=0;j<e;j++)d[j].style.cssText=g[j],c(d[j])}return h}function h(a,b){var c=parseFloat(a);return Number.isNaN(c)?b:c}function i(a){return a.charAt(0).toUpperCase()+a.substr(1)}function j(b,e){if(this.$window=a(window),this.$document=a(document),this.$element=a(b),this.options=a.extend({},n,e),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=o.orientation[this.orientation].dimension,this.DIRECTION=o.orientation[this.orientation].direction,this.DIRECTION_STYLE=o.orientation[this.orientation].directionStyle,this.COORDINATE=o.orientation[this.orientation].coordinate,this.polyfill&&m)return!1;this.identifier="js-"+k+"-"+l++,this.startEvent=this.options.startEvent.join("."+this.identifier+" ")+"."+this.identifier,this.moveEvent=this.options.moveEvent.join("."+this.identifier+" ")+"."+this.identifier,this.endEvent=this.options.endEvent.join("."+this.identifier+" ")+"."+this.identifier,this.toFixed=(this.step+"").replace(".","").length-1,this.$fill=a('<div class="'+this.options.fillClass+'" />'),this.$handle=a('<div class="'+this.options.handleClass+'" />'),this.$range=a('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=a.proxy(this.handleDown,this),this.handleMove=a.proxy(this.handleMove,this),this.handleEnd=a.proxy(this.handleEnd,this),this.init();var f=this;this.$window.on("resize."+this.identifier,d(function(){c(function(){f.update(!1,!1)},300)},20)),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(a,b){if(!b||b.origin!==f.identifier){var c=a.target.value,d=f.getPositionFromValue(c);f.setPosition(d)}})}Number.isNaN=Number.isNaN||function(a){return"number"==typeof a&&a!==a};var k="rangeslider",l=0,m=b(),n={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},o={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};return j.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},j.prototype.update=function(a,b){a=a||!1,a&&(this.min=h(this.$element[0].getAttribute("min"),0),this.max=h(this.$element[0].getAttribute("max"),100),this.value=h(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=h(this.$element[0].getAttribute("step"),1)),this.handleDimension=g(this.$handle[0],"offset"+i(this.DIMENSION)),this.rangeDimension=g(this.$range[0],"offset"+i(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,b)},j.prototype.handleDown=function(a){if(a.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),!((" "+a.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)>-1)){var b=this.getRelativePosition(a),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=this.getPositionFromNode(this.$handle[0])-c,e="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(e),b>=d&&b<d+this.handleDimension&&(this.grabPos=b-d)}},j.prototype.handleMove=function(a){a.preventDefault();var b=this.getRelativePosition(a),c="vertical"===this.orientation?this.maxHandlePos-(b-this.grabPos):b-this.grabPos;this.setPosition(c)},j.prototype.handleEnd=function(a){a.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},j.prototype.cap=function(a,b,c){return a<b?b:a>c?c:a},j.prototype.setPosition=function(a,b){var c,d;void 0===b&&(b=!0),c=this.getValueFromPosition(this.cap(a,0,this.maxHandlePos)),d=this.getPositionFromValue(c),this.$fill[0].style[this.DIMENSION]=d+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=d+"px",this.setValue(c),this.position=d,this.value=c,b&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(d,c)},j.prototype.getPositionFromNode=function(a){for(var b=0;null!==a;)b+=a.offsetLeft,a=a.offsetParent;return b},j.prototype.getRelativePosition=function(a){var b=i(this.COORDINATE),c=this.$range[0].getBoundingClientRect()[this.DIRECTION],d=0;return"undefined"!=typeof a.originalEvent["client"+b]?d=a.originalEvent["client"+b]:a.originalEvent.touches&&a.originalEvent.touches[0]&&"undefined"!=typeof a.originalEvent.touches[0]["client"+b]?d=a.originalEvent.touches[0]["client"+b]:a.currentPoint&&"undefined"!=typeof a.currentPoint[this.COORDINATE]&&(d=a.currentPoint[this.COORDINATE]),d-c},j.prototype.getPositionFromValue=function(a){var b,c;return b=(a-this.min)/(this.max-this.min),c=Number.isNaN(b)?0:b*this.maxHandlePos},j.prototype.getValueFromPosition=function(a){var b,c;return b=a/(this.maxHandlePos||1),c=this.step*Math.round(b*(this.max-this.min)/this.step)+this.min,Number(c.toFixed(this.toFixed))},j.prototype.setValue=function(a){a===this.value&&""!==this.$element[0].value||this.$element.val(a).trigger("input",{origin:this.identifier})},j.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_"+k),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},a.fn[k]=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),e=d.data("plugin_"+k);e||d.data("plugin_"+k,e=new j(this,b)),"string"==typeof b&&e[b].apply(e,c)})},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"});var czr_debug={log:function(a){debug.queue.push(["log",arguments,debug.stack.slice(0)]),window.console&&"function"==typeof window.console.log&&window.console.log(a)},error:function(a){debug.queue.push(["error",arguments,debug.stack.slice(0)]),window.console&&"function"==typeof window.console.error&&window.console.error(a)},queue:[],stack:[]};!function(a,b,c){var d=function(a){var b={bgCol:"#5ed1f5",textCol:"#000",consoleArguments:[]};a=c.extend(b,a);var d=Array.from(a.consoleArguments),e=function(a){return c.isString(a)?a.length>150?a.substr(0,149):a:""};return d=c.isEmpty(c.filter(d,function(a){return!c.isString(a)}))?d.join(" "):JSON.stringify(d),["%c "+e(d),["background:"+a.bgCol,"color:"+a.textCol,"display: block;"].join(";")]};a.consoleLog=function(){serverControlParams.isDevMode&&(c.isUndefined(console)&&"function"!=typeof window.console.log||console.log.apply(console,d({consoleArguments:arguments})))},a.errorLog=function(){c.isUndefined(console)&&"function"!=typeof window.console.log||console.log.apply(console,d({bgCol:"#ffd5a0",textCol:"#000",consoleArguments:arguments}))},a.czr_isSkopOn=function(){return serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase")},a.czr_isChangeSetOn=function(){return serverControlParams.isChangeSetOn&&!0},a.czr_activeSectionId=new a.Value(""),a.czr_activePanelId=new a.Value(""),"function"==typeof a.Section&&a.control.bind("add",function(b){b.params.ubq_section&&b.params.ubq_section.section&&(b.params.original_priority=b.params.priority,b.params.original_section=b.params.section,a.section.when(b.params.ubq_section.section,function(a){a.expanded.bind(function(a){a?(b.params.ubq_section.priority&&b.priority(b.params.ubq_section.priority),b.section(b.params.ubq_section.section)):(b.priority(b.params.original_priority),b.section(b.params.original_section))})}))});var e=function(){c.has(a,"czr_ModOptVisible")&&a.czr_ModOptVisible(!1)};a.czr_activeSectionId.bind(e),a.czr_activePanelId.bind(e),a.bind("ready",function(){if("function"!=typeof a.Section)throw new Error("Your current version of WordPress does not support the customizer sections needed for this theme. Please upgrade WordPress to the latest version.");var b=function(b,c){a.czr_activeSectionId(b?c:"")};a.section.each(function(a){a.expanded.bind(function(c){b(c,a.id)})}),a.section.bind("add",function(c){a.trigger("czr-paint",{active_panel_id:c.panel()}),c.expanded.bind(function(a){b(a,c.id)})});var d=function(b,d){a.czr_activePanelId(b?d:""),c.isEmpty(a.czr_activePanelId())&&a.czr_activeSectionId("")};a.panel.each(function(a){a.expanded.bind(function(b){d(b,a.id)})}),a.panel.bind("add",function(a){a.expanded.bind(function(b){d(b,a.id)})})}),a.bind("ready",function(){var d=function(){a.section("themes").active.bind(function(d){c.has(serverControlParams,"isThemeSwitchOn")&&c.isEmpty(serverControlParams.isThemeSwitchOn)&&(a.section("themes").active(serverControlParams.isThemeSwitchOn),a.section("themes").active.callbacks=b.Callbacks())})};a.section.has("themes")?d():a.section.when("themes",function(a){d()})}),a.czr_skopeReady=b.Deferred(),a.bind("ready",function(){serverControlParams.isSkopOn&&(a.czr_isLoadingSkope=new a.Value((!1)),a.czr_isLoadingSkope.bind(function(a){f(a)}),a.czr_skopeBase=new a.CZR_skopeBase,a.czr_skopeSave=new a.CZR_skopeSave,a.czr_skopeReset=new a.CZR_skopeReset,a.trigger("czr-skope-started"),a.czr_skopeReady.done(function(){a.trigger("czr-skope-ready")}).fail(function(b){a.errorLog("Skope could not be instantiated : "+b),serverControlParams.isSkopOn=!1,a.czr_isLoadingSkope(!1)}),"rejected"!=a.czr_skopeReady.state()&&setTimeout(function(){"pending"==a.czr_skopeReady.state()&&(a.czr_skopeBase.toggleTopNote(!0,{title:serverControlParams.i18n.skope["There was a problem when trying to load the customizer."],message:[serverControlParams.i18n.skope["Please open your"],'<a href="http://docs.presscustomizr.com/article/272-inspect-your-webpages-in-your-browser-with-the-development-tools" target="_blank">',serverControlParams.i18n.skope["browser debug tool"],"</a>",",",serverControlParams.i18n.skope["and report any error message (in red) printed in the javascript console in the"],'<a href="https://wordpress.org/support/theme/hueman" target="_blank">',serverControlParams.i18n.skope["Hueman theme forum"],"</a>."].join(" "),selfCloseAfter:4e4}),a.czr_isLoadingSkope(!1))},3e4)),serverControlParams.isChangeSetOn&&(a.settings.timeouts.changesetAutoSave=1e4)}),c.has(a,"_latestRevision")||(a._latestRevision=0,a._latestSettingRevisions={},a.bind("change",function(b){a._latestRevision+=1,a._latestSettingRevisions[b.id]=a._latestRevision}),a.bind("ready",function(){a.bind("add",function(b){b._dirty&&(a._latestRevision+=1,a._latestSettingRevisions[b.id]=a._latestRevision)})}));var f=function(d){d=!!c.isUndefined(d)||d;var e,f=function(){var c=b.Deferred();try{_tmpl=wp.template("czr-skope-pane")({is_skope_loading:!0})}catch(d){a.errorLog("In toggleSkopeLoadPane : error when parsing the the reset skope template : "+d),c.resolve(!1)}return b.when(b("#customize-preview").after(b(_tmpl))).always(function(){c.resolve(b("#czr-skope-pane"))}),c.promise()},g=function(){c.delay(function(){b.when(b("body").removeClass("czr-skope-pane-open")).done(function(){c.delay(function(){b.when(b("body").removeClass("czr-skop-loading")).done(function(){!1!==b("#czr-skope-pane").length&&setTimeout(function(){b("#czr-skope-pane").remove()},400)})},200)})},50)};"pending"==a.czr_skopeReady.state()&&d&&(b("body").addClass("czr-skop-loading"),f().done(function(a){e=a}).then(function(){e.length&&c.delay(function(){var a=b("#customize-preview").height();e.css("line-height",a+"px").css("height",a+"px"),b("body").addClass("czr-skope-pane-open")},50)})),a.czr_skopeReady.done(function(){g()}),d||g()}}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{globalSettingVal:{},initialize:function(){var d=this;d.skope_colors={global:"rgb(255, 255, 255)",special_group:"rgba(173, 213, 247, 0.55)",group:"rgba(173, 213, 247, 0.55)",local:"rgba(78, 122, 199, 0.35)"},a.czr_isPreviewerSkopeAware=b.Deferred(),a.czr_initialSkopeCollectionPopulated=b.Deferred(),d.skopeWrapperEmbedded=b.Deferred(),a.czr_skope=new a.Values,a.czr_skopeCollection=new a.Value([]),a.czr_currentSkopesCollection=new a.Value([]),a.czr_activeSkopeId=new a.Value,a.czr_dirtyness=new a.Value((!1)),a.czr_isResettingSkope=new a.Value((!1)),a.state.create("switching-skope")(!1),a.czr_dirtyness.callbacks.add(function(){return d.apiDirtynessReact.apply(d,arguments)}),a.czr_isLoadingSkope(!0),d.bindAPISettings(),a.state.bind("change",function(){d.setSaveButtonStates()}),a.czr_skopeReady.then(function(){"pending"==d.skopeWrapperEmbedded.state()&&b.when(d.embedSkopeWrapper()).done(function(){d.skopeWrapperEmbedded.resolve()})}),a.previewer.bind("czr-skopes-synced",function(b){if(serverControlParams.isSkopOn&&"rejected"!=a.czr_skopeReady.state()){var e=this,f=a.czr_currentSkopesCollection();if(!c.has(b,"czr_skopes"))return void a.errorLog("On 'czr-skopes-synced' : missing skopes in the server data");try{a.czr_skopeBase.updateSkopeCollection(b.czr_skopes,e.channel())}catch(g){return void a.czr_skopeReady.reject(g)}a.czr_initialSkopeCollectionPopulated.then(function(){var e=c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{id:a.czr_activeSkopeId()}));a.czr_skopeBase.reactWhenSkopeSyncedDone(b).done(function(){if(e)try{a.czr_activeSkopeId(d.getActiveSkopeId()).done(function(){"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.resolve(d.getActiveSkopeId()),d._writeCurrentSkopeTitle()}).fail(function(){throw new Error("Error when trying to set the active skope after skope synced.")})}catch(g){a.errorLog("In reactWhenSkopeSyncedDone => api.czr_activeSkopeId() : "+g)}else if(!c.isEmpty(f)){var h=c.findWhere(f,{skope:"local"}).opt_name,i=c.findWhere(b.czr_skopes,{skope:"local"}).opt_name;i!==h&&"resolved"==a.czr_skopeReady.state()&&d._writeCurrentSkopeTitle()}})})}}),a.czr_currentSkopesCollection.bind(function(a,b){return d.currentSkopesCollectionReact(a,b)},{deferred:!0}),a.czr_initialSkopeCollectionPopulated.done(function(){a.czr_activeSkopeId.bind(function(b,e){return c.has(a,"czr_ModOptVisible")&&a.czr_ModOptVisible(!1),d.activeSkopeReact(b,e).then(function(c){a.trigger("skope-switched-done",{current_skope_id:b,previous_skope_id:e,updated_setting_ids:c||[]})})},{deferred:!0}),a.czr_activeSectionId.callbacks.add(function(){return d.activeSectionReact.apply(d,arguments)}),a.czr_activePanelId.callbacks.add(function(){return d.activePanelReact.apply(d,arguments)})}),a.bind("skope-switched-done",function(a){return a=c.extend({current_skope_id:"",previous_skope_id:"",updated_setting_ids:[]},a),d.skopeSwitchedDoneReact(a)}),a.czr_serverNotification=new a.Value({status:"success",message:"",expanded:!0}),a.czr_serverNotification.bind(function(a,b){d.toggleServerNotice(a)}),a.czr_topNoteVisible=new a.Value((!1)),a.czr_skopeReady.then(function(){a.czr_topNoteVisible.bind(function(c){var e={},f={title:"",message:"",actions:"",selfCloseAfter:2e4};e=b.extend(f,serverControlParams.topNoteParams),e.actions=function(){var c=b.extend(a.previewer.query(),{nonce:a.previewer.nonce.save});wp.ajax.post("czr_dismiss_top_note",c).always(function(){}).fail(function(b){a.consoleLog("czr_dismiss_top_note failed",c,b)}).done(function(a){})},d.toggleTopNote(c,e)}),c.delay(function(){a.czr_topNoteVisible(!c.isEmpty(serverControlParams.isTopNoteOn)||1==serverControlParams.isTopNoteOn)},2e3)}),d.scopeSwitcherEventMap=[{trigger:"click keydown",selector:".czr-dismiss-notification",name:"dismiss-notification",actions:function(){a.czr_serverNotification({expanded:!1})}},{trigger:"click keydown",selector:".czr-toggle-title-notice",name:"toggle-title-notice",actions:function(b){c.isUndefined(d.skopeTitleNoticeVisible)&&(d.skopeTitleNoticeVisible=new a.Value((!1)),d.skopeTitleNoticeVisible.bind(function(a){b.dom_el.find(".czr-skope-title").toggleClass("notice-visible",a)})),d.skopeTitleNoticeVisible(!d.skopeTitleNoticeVisible())}}],d.skopeWrapperEmbedded.then(function(){a.CZR_Helpers.setupDOMListeners(d.scopeSwitcherEventMap,{dom_el:b(".czr-scope-switcher")},d)}),d.refreshedControls=["czr_cropped_image"],d.initWidgetSidebarSpecifics(),a.bind("czr-paint",function(b){a.czr_skopeReady.then(function(){d.wash(b).paint(b)})})},embedSkopeWrapper:function(){var d=this;b("#customize-header-actions").append(b("<div/>",{"class":"czr-scope-switcher",html:'<div class="czr-skopes-wrapper"></div>'})),b("body").addClass("czr-skop-on");var e=[{trigger:"click keydown",selector:".czr-skope-switch",name:"control_skope_switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}}];a.CZR_Helpers.setupDOMListeners(e,{dom_el:b(".czr-scope-switcher")},d)},apiDirtynessReact:function(c){b("body").toggleClass("czr-api-dirty",c),a.state("saved")(!c)},setSaveButtonStates:function(){a.state.has("saving")||(a.state.create("saving"),a.state("saving").bind(function(a){b(document.body).toggleClass("saving",a)}));var c=b("#save"),d=b(".customize-controls-close"),e=a.state("saved"),f=a.state("saving"),g=a.state("activated"),h=a.state.has("changesetStatus")?a.state("changesetStatus")():"auto-draft";a.czr_dirtyness()||!e()?(c.val(a.l10n.save),d.find(".screen-reader-text").text(a.l10n.cancel)):(c.val(a.l10n.saved),d.find(".screen-reader-text").text(a.l10n.close));var i=!(f()||g()&&e()||"publish"===h);c.prop("disabled",!i)},skopeSwitchedDoneReact:function(d){var e=this,f=function(){a.czr_CrtlDependenciesReady.then(function(){if(!c.isUndefined(a.czr_activeSectionId())&&!c.isEmpty(a.czr_activeSectionId()))try{a.czr_ctrlDependencies.setServiDependencies(a.czr_activeSectionId(),null,!0)}catch(b){a.errorLog("On skope-switched-done : "+b)}}),e.updateCtrlSkpNot(a.CZR_Helpers.getSectionControlIds()),a.czr_skope.has(d.previous_skope_id)&&b("#customize-controls").removeClass(["czr-",a.czr_skope(d.previous_skope_id)().skope,"-skope-level"].join("")),a.czr_skope.has(d.current_skope_id)&&b("#customize-controls").addClass(["czr-",a.czr_skope(d.current_skope_id)().skope,"-skope-level"].join(""));var f=function(){if(!c.isUndefined(a.czr_activeSectionId())&&!c.isEmpty(a.czr_activeSectionId())){var b=a.CZR_Helpers.getSectionControlIds(a.czr_activeSectionId());c.each(b,function(b){a.control.when(b,function(){var d=a.control(b);c.has(d,"czr_states")&&d.deferred.embedded.then(function(){d.czr_states("noticeVisible")(e.isCtrlNoticeVisible(b)),d.czr_states("resetVisible")(!1)})})})}};c.delay(function(){f()},500)};a.czr_skopeReady.then(function(){f()})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleServerNotice:function(d){if(d=c.isObject(d)?d:{},d=c.extend({status:"success",expanded:!0,message:"",auto_collapse:!1},d),"changeset_already_published"!=d.message&&serverControlParams.isDevMode){this.serverNoticeEmbedded=this.serverNoticeEmbedded||b.Deferred();var e=this,f=function(){b(".czr-scope-switcher").prepend(b("<div/>",{"class":"czr-server-notice",html:'<span class="czr-server-message"></span><span class="fa fa-times-circle czr-dismiss-notification"></span>'}))},g=function(){var a,f,g=b(".czr-server-notice",".czr-scope-switcher"),h=b(".wp-full-overlay-header"),i=(b(".wp-full-overlay-sidebar .wp-full-overlay-sidebar-content"),function(a){return!0});e.skopeTitleNoticeVisible&&e.skopeTitleNoticeVisible(!1),d.expanded?(g.toggleClass("czr-server-error","error"==d.status),"error"==d.status?b(".czr-server-message",g).html(c.isEmpty(d.message)?"Server Problem.":d.message):b(".czr-server-message",g).html(c.isEmpty(d.message)?"Success.":d.message),f=b(".czr-server-notice",".czr-scope-switcher").outerHeight(),a=h.outerHeight()+f,setTimeout(function(){b.when(i(a)).done(function(){g.fadeIn({duration:200,complete:function(){b(this).css("height","auto")}})})},400)):(g.fadeOut({duration:200,complete:function(){}}),setTimeout(function(){i()},200))};"pending"==e.serverNoticeEmbedded.state()?b.when(f()).done(function(){setTimeout(function(){e.serverNoticeEmbedded.resolve(),g()},200)}):g(),c.delay(function(){a.czr_serverNotification({expanded:!1})},"success"==d.status||!1!==d.auto_collapse?4e3:5e3)}},buildServerResponse:function(a){var b=!1;if(c.isObject(a)&&(!c.has(a,"responseJSON")||c.isUndefined(a.responseJSON.data)||c.isEmpty(a.responseJSON.data)?c.has(a,"statusText")&&!c.isEmpty(a.statusText)&&(b=a.statusText):b=a.responseJSON.data),c.isObject(a)&&!b)try{JSON.stringify(a)}catch(d){b="Server Error"}else b?"-1"===a&&(b="Identification issue detected, please refresh your page."):b="0"===a?"Not logged in.":a;return b}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{toggleTopNote:function(d,e){e=c.isObject(e)?e:{};var f=this,g={title:"",message:"",actions:"",selfCloseAfter:2e4},h=function(){b.when(f.renderTopNoteTmpl(e)).done(function(d){f.welcomeNote=d,c.delay(function(){b("body").addClass("czr-top-note-open")},200),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:".czr-top-note-close",name:"close-top-note",actions:function(){i().done(function(){c.isFunction(e.actions)&&e.actions()})}}],{dom_el:f.welcomeNote},f)})},i=function(){var a=b.Deferred();return b("body").removeClass("czr-top-note-open"),f.welcomeNote.length?c.delay(function(){f.welcomeNote.remove(),a.resolve()},300):a.resolve(),a.promise()};e=b.extend(g,e),d?h():i(),c.delay(function(){i()},e.selfCloseAfter||2e4)},renderTopNoteTmpl:function(c){if(b("#czr-top-note").length)return b("#czr-top-note");var d="",e=c.title||"",f=c.message||"";try{d=wp.template("czr-top-note")({title:e})}catch(g){return a.errorLog("Error when parsing the the top note template : "+g),!1}return b("#customize-preview").after(b(d)),b(".czr-note-message","#czr-top-note").html(f),b("#czr-top-note")}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{bindAPISettings:function(b){var d=this,e=function(b,e,f){var g,h=this.id;serverControlParams.isSkopOn&&(c.has(a,"czr_activeSkopeId")&&!c.isUndefined(a.czr_activeSkopeId())||a.errorLog("The api.czr_activeSkopeId() is undefined in the api.czr_skopeBase.bindAPISettings method."),a(h)._dirty&&(g=d.isSettingSkopeEligible(h)?a.czr_activeSkopeId():d.getGlobalSkopeId(),a.czr_skope(g).updateSkopeDirties(h,b)),c.has(a.control(h),"czr_states")&&!a.control(h).czr_states("isResetting")()&&a.control(h).czr_states("resetVisible")(!1),d.isSettingSkopeEligible(h)&&d.updateCtrlSkpNot(h))};c.isUndefined(b)?a.each(function(a){a.bind(e)}):a(b).bind(e);var f=function(a){a.callbacks.has(e)||a.bind(e)};a.topics.change.has(f)||a.bind("change",f)}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{reactWhenSkopeSyncedDone:function(d){var e=b.Deferred();if(!c.has(d,"czr_skopes")||c.isEmpty(d.czr_skopes))return a.errorLog("Missing skope data after refresh",d),e.resolve().promise();a.czr_dirtyness()||a.czr_dirtyness(!!c.isBoolean(d.isChangesetDirty)&&d.isChangesetDirty);var f=d.czr_skopes;return c.each(a.czr_skopeCollection(),function(b){var d=c.findWhere(f,{opt_name:b.opt_name});if(!c.isUndefined(d)){var e=c.isEmpty(d.changeset||{})?{}:d.changeset,g={};c.each(e,function(b,c){a.has(c)||a.consoleLog("In reactWhenSkopeSyncedDone : attempting to update the changeset with a non registered setting : "+c),g[c]=b}),a.czr_skope(b.id).changesetValues(g)}}),c.each(a.czr_skopeCollection(),function(d){var e=c.findWhere(f,{opt_name:d.opt_name});if(!c.isUndefined(e)){var g=b.extend(!0,{},a.czr_skope(d.id).dbValues()),h=b.extend(g,e.db||{}),i={};c.each(h,function(b,c){a.has(c)||a.consoleLog("In reactWhenSkopeSyncedDone : attempting to update the db values with a non registered setting : "+c),i[c]=b}),a.czr_skope(d.id).dbValues(i)}}),c.delay(function(){e.resolve()},500),e.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{_maybeSetupAssignedMenuLocations:function(b){(c.isUndefined(b)||c.isEmpty(b)||!a.section.has(b.id))&&a.consoleLog("In _maybeSetupAssignedMenuLocations : no valid section_id provided.");if(b.assignedLocations){var d=function(a){};b.assignedLocations.callbacks.has(d)||b.assignedLocations.bind(d)}},activeSectionReact:function(b,d){"add_menu"!=b&&a.trigger("czr-paint",{active_section_id:b});var e=this,f=function(b){var d=a.CZR_Helpers.getSectionControlIds(b);c.each(d,function(b){if(a.has(b)&&!c.isUndefined(a.control(b))){var d=a.control(b);c.has(d,"czr_states")&&d.czr_states("resetVisible")(!1)}})},g=function(b,d){e.setupActiveSkopedControls({section_id:d}),e.processSilentUpdates({section_id:d}).fail(function(){throw new Error("Fail to process silent updates after initial skope collection has been populated")}).done(function(){var b=function(){var b=a.CZR_Helpers.getSectionControlIds(d);c.each(b,function(b){if(a.has(b)&&!c.isUndefined(a.control(b))){var d=a.control(b);c.has(d,"czr_states")&&d.czr_states("noticeVisible")(e.isCtrlNoticeVisible(b))}})};c.delay(function(){b()},700),e.isExcludedSidebarsWidgets()||e.forceSidebarDirtyRefresh(d,a.czr_activeSkopeId())}),c.has(a.topics,"active-section-setup")||a.bind("active-section-setup",function(a){var b={controls:[],section_id:""};a=c.extend(b,a),e._maybeSetupAssignedMenuLocations(a)}),a.czr_skopeReady.then(function(){var b=function(b){a.czr_serverNotification({status:"success",message:[b,serverControlParams.i18n.skope["can only be customized sitewide."]].join(" ")}),a.czr_activeSkopeId(e.getGlobalSkopeId())};"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&(!e.isExcludedWPCustomCss()||"custom_css"!=d&&"admin_sec"!=d||b(a.section(d).params.title),"nav_menu["!=d.substring(0,"nav_menu[".length)&&"add_menu"!=d||a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Menus are created sitewide."]].join(" ")}))}),a.trigger("active-section-setup",b)};a.czr_initialSkopeCollectionPopulated.then(function(){a.section.when(b,function(c){c.deferred.embedded.then(function(){try{g(c,b)}catch(d){a.errorLog("activeSectionReact => _doReactActive : "+d)}})}),!c.isEmpty(d)&&a.section.has(d)&&f(d)})},activePanelReact:function(b,d){var e=this;a.czr_initialSkopeCollectionPopulated.then(function(){a.trigger("czr-paint",{active_panel_id:b});a.czr_skopeReady.then(function(){"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&e.isExcludedSidebarsWidgets()&&"widgets"==b&&a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Widgets are created sitewide."]].join(" ")})}),a.czr_skopeReady.then(function(){"nav_menus"==b&&c.each(a.panel(b).sections(),function(a){e.processSilentUpdates({section_id:a.id,awake_if_not_active:!0})})})})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{wash:function(d){var e=function(a){c.has(a,"el")&&a.el.length&&b.when(a.el.removeClass("czr-painted")).done(function(){b(this).css("background","").css("color","")})};return a.czr_skopeBase.paintedElements&&(c.each(a.czr_skopeBase.paintedElements(),function(a){e(a)}),a.czr_skopeBase.paintedElements([])),this},paint:function(d){var e="inherit",f={active_panel_id:a.czr_activePanelId(),active_section_id:a.czr_activeSectionId(),is_skope_switch:!1},g=[];d=b.extend(f,d),!c.isUndefined(a.czr_activeSkopeId())&&a.czr_skope.has(a.czr_activeSkopeId())&&(e=a.czr_skope(a.czr_activeSkopeId()).color);var h=function(f){c.has(f,"el")&&f.el.length&&(d.is_skope_switch?b.when(f.el.addClass("czr-painted")).done(function(){b(this).css("background",f.bgColor||e)}):f.el.css("background",f.bgColor||e),"global"!=a.czr_skope(a.czr_activeSkopeId())().skope&&f.el.css("color","#000"))};return a.czr_skopeBase.paintedElements=a.czr_skopeBase.paintedElements||new a.Value([]),c.isEmpty(d.active_panel_id)&&c.isEmpty(d.active_section_id)&&(g.push({el:b("#customize-info").find(".accordion-section-title").first()}),a.panel.each(function(a){g.push({el:a.container.find(".accordion-section-title").first()})}),a.section.each(function(a){c.isEmpty(a.panel())&&g.push({el:a.container.find(".accordion-section-title").first()})})),!c.isEmpty(d.active_panel_id)&&c.isEmpty(d.active_section_id)&&a.panel.when(d.active_panel_id,function(a){a.deferred.embedded.then(function(){g.push({el:a.container.find(".accordion-section-title, .customize-panel-back")})})}),c.isEmpty(d.active_section_id)||a.section.when(d.active_section_id,function(b){b.deferred.embedded.then(function(){g.push({el:b.container.find(".customize-section-title, .customize-section-back"),bgColor:"inherit"},{el:b.container}),a.czr_isChangeSetOn()||g.push({el:b.container.find(".accordion-section-content")})})}),c.each(g,function(a){h(a)}),a.czr_skopeBase.paintedElements(g),this}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{isSkopeRegisteredInCollection:function(b,d){return d=d||a.czr_skopeCollection(),!c.isUndefined(c.findWhere(d,{id:b}))},isSkopeRegisteredInCurrentCollection:function(b,d){return d=d||a.czr_currentSkopesCollection(),!c.isUndefined(c.findWhere(d,{id:b}))},isGlobalSkopeRegistered:function(){var b=c.findWhere(a.czr_currentSkopesCollection(),{skope:"global"});return c.isObject(b)&&c.has(b,"id")},getGlobalSkopeId:function(){if(!c.has(a,"czr_skope"))return"";var b="";return a.czr_skope.each(function(a){"global"==a().skope&&(b=a().id)}),b},getChangedGlobalDBSettingValues:function(b){var d={};return c.each(b,function(b,e){_wpSetId=a.CZR_Helpers.build_setId(e),c.has(a.settings.settings,_wpSetId)&&(c.isEqual(b,a.settings.settings[_wpSetId].value)||(d[e]=b))}),d},getActiveSkopeId:function(b){b=b||a.czr_currentSkopesCollection();var d=!c.isEmpty(a.czr_activeSkopeId())&&a.czr_skope.has(a.czr_activeSkopeId())?a.czr_skope(a.czr_activeSkopeId())().skope:serverControlParams.isLocalSkope?"local":"global",e=c.findWhere(b,{
12
+ skope:d});if(_skpId=c.isUndefined(e)?c.findWhere(b,{skope:"global"}).id:e.id,c.isUndefined(_skpId))throw new Error("No default skope was found in getActiveSkopeId ",b);return _skpId},getActiveSkopeName:function(){return a.czr_skope.has(a.czr_activeSkopeId())?a.czr_skope(a.czr_activeSkopeId())().skope:"global"},isSettingSkopeEligible:function(b){var d=this,e=a.CZR_Helpers.getOptionName(b);return c.isUndefined(b)||!a.has(b)?(a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO SKOPE BECAUSE UNDEFINED OR NOT REGISTERED IN THE API."),!1):!d.isExcludedWPBuiltinSetting(b)&&(!c.contains(serverControlParams.skopeExcludedSettings,e)&&(d.isThemeSetting(b),!0))},isSettingResetEligible:function(b){var d=this;a.CZR_Helpers.getOptionName(b);if(c.isUndefined(b)||!a.has(b))return void a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO RESET BECAUSE UNDEFINED OR NOT REGISTERED IN THE API.");if(!d.isExcludedWPBuiltinSetting(b))return!(!d.isThemeSetting(b)&&!d.isWPAuthorizedSetting(b))||void a.consoleLog("THE SETTING "+b+" IS NOT ELIGIBLE TO RESET BECAUSE NOT PART OF THE THEME OPTIONS AND NOT WP AUTHORIZED BUILT IN OPTIONS")},isThemeSetting:function(a){return c.isString(a)&&-1!==a.indexOf(serverControlParams.themeOptions)},isWPAuthorizedSetting:function(a){return c.isString(a)&&c.contains(serverControlParams.wpBuiltinSettings,a)},isExcludedWPBuiltinSetting:function(a){var b=this;if(c.isUndefined(a))return!0;if("active_theme"==a)return!0;if(c.contains(serverControlParams.wpBuiltinSettings,a))return!1;var d=["widget_","nav_menu","sidebars_","custom_css","nav_menu[","nav_menu_item","nav_menus_created_posts","nav_menu_locations"],e=!1;return c.each(d,function(c){switch(c){case"widget_":case"sidebars_":c==a.substring(0,c.length)&&(e=b.isExcludedSidebarsWidgets());break;case"nav_menu[":case"nav_menu_item":case"nav_menus_created_posts":c==a.substring(0,c.length)&&(e=!0);break;case"nav_menu_locations":c==a.substring(0,c.length)&&(e=b.isExcludedNavMenuLocations());break;case"custom_css":c==a.substring(0,c.length)&&(e=b.isExcludedWPCustomCss())}}),e},isExcludedSidebarsWidgets:function(){var a=serverControlParams.isSidebarsWigetsSkoped;return!(!c.isUndefined(a)&&!c.isEmpty(a)&&!1!==a)},isExcludedNavMenuLocations:function(){if(!a.czr_isChangeSetOn())return!0;var b=serverControlParams.isNavMenuLocationsSkoped;return!(!c.isUndefined(b)&&!c.isEmpty(b)&&!1!==b)},isExcludedWPCustomCss:function(){var a=serverControlParams.isWPCustomCssSkoped;return!(!c.isUndefined(a)&&!c.isEmpty(a)&&!1!==a)},_getDBSettingVal:function(b,d){var e=a.CZR_Helpers.getOptionName(b),f=a.CZR_Helpers.build_setId(b);return a.czr_skope.has(d)?c.has(a.czr_skope(d).dbValues(),f)?a.czr_skope(d).dbValues()[f]:c.has(a.czr_skope(d).dbValues(),e)?a.czr_skope(d).dbValues()[e]:"_no_db_val":(a.consoleLog("_getDBSettingVal : the requested skope id is not registered : "+d),"_no_db_val")},getSkopeDirties:function(b,d){if(!a.czr_skope.has(b))return{};d=d||{},d=c.extend({unsaved:!0},d);var e={};return c.each(a.czr_skope(b).dirtyValues(),function(b,f){var g;a.czr_isChangeSetOn()&&(g=a._latestSettingRevisions[f],a.state("changesetStatus").get()&&d&&d.unsaved&&(c.isUndefined(g)||g<=a._lastSavedRevision))||(e[f]=b)}),e},getSkopeExcludedDirties:function(){var b=this,d={};a.each(function(a,b){a._dirty&&(d[b]=a())});var e=b.getGlobalSkopeId();b.getSkopeDirties(e);return c.omit(d,function(a,c){return b.isSettingSkopeEligible(c)})},parseWidgetId:function(a,b){var d,e={number:null,id_base:null};return d=a.match(/^(.+)-(\d+)$/),d?(e.id_base=d[1],e.number=parseInt(d[2],10)):e.id_base=a,c.isUndefined(b)||(e.id_base=e.id_base.replace(b,"")),e},widgetIdToSettingId:function(a,b){var c,d=this.parseWidgetId(a,b);return c=d.id_base,d.number&&(c+="["+d.number+"]"),c},isWidgetRegisteredGlobally:function(a){var b=this;return registered=!1,c.each(_wpCustomizeWidgetsSettings.registeredWidgets,function(c,d){registered||"widget_"+b.widgetIdToSettingId(d)!=a||(registered=!0)}),registered}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{getAppliedPrioritySkopeId:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getAppliedPrioritySkopeId : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),d;if(!a.czr_skope.has(d))return a.errorLog("getAppliedPrioritySkopeId : the requested skope id is not registered : "+d),d;var e=this,f=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(c.isUndefined(f)||d==f)return d;var g=function(c){var f=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(c)();if(c==d)return d;if(a.czr_skope(c).getSkopeSettingAPIDirtyness(f))return i.id;if(a.czr_isChangeSetOn()&&a.czr_skope(c).getSkopeSettingChangesetDirtyness(f))return i.id;var j=e._getDBSettingVal(b,c);return"_no_db_val"!=j?i.id:"global"==i.skope?i.id:"___"!=h?i.title:g(e._getParentSkopeId(i))};return g(f)},getOverridenSkopeTitles:function(){var b=b||a.czr_activeSkopeId();if(!a.czr_skope.has(b))return a.errorLog("getInheritedSkopeTitles : the requested skope id is not registered : "+b),"";var d=this,e=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(c.isUndefined(e)||b==e)return"";var f=function(c,e){e=e||[];var g=a.czr_skope(c)();return c==b?e:(e.unshift(c),f(d._getParentSkopeId(g),e))};return c.map(f(e),function(a){return d.buildSkopeLink(a)}).join(" "+serverControlParams.i18n.skope.and+" ")},getInheritedSkopeId:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getInheritedSkopeId : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),d;if(!a.czr_skope.has(d))return a.errorLog("getInheritedSkopeId : the requested skope id is not registered : "+d),d;var e,f=this,g=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(d)();if(e=c.has(a.settings.settings,g)?a.settings.settings[g].value:null,a.czr_skope(d).getSkopeSettingAPIDirtyness(g))return d;if(a.czr_isChangeSetOn()&&a.czr_skope(d).getSkopeSettingChangesetDirtyness(g))return d;var j=f._getDBSettingVal(b,d);return"_no_db_val"!=j?d:"global"==i.skope?d:"___"!=h?d:f.getInheritedSkopeId(b,f._getParentSkopeId(i))},getInheritedSkopeTitles:function(b,d){if(b=b||a.czr_activeSkopeId(),!a.czr_skope.has(b))return a.errorLog("getInheritedSkopeTitles : the requested skope id is not registered : "+b),"";d=d||[];var e=this,f=a.czr_skope(b)();return b!==a.czr_activeSkopeId()&&d.unshift(b),"global"!==f.skope?e.getInheritedSkopeTitles(e._getParentSkopeId(f),d):c.map(d,function(a){return e.buildSkopeLink(a)}).join(" "+serverControlParams.i18n.skope.and+" ")},buildSkopeLink:function(b){if(!a.czr_skope.has(b))return a.errorLog("buildSkopeLink : the requested skope id is not registered : "+b),"";var c=[serverControlParams.i18n.skope["Switch to scope"],a.czr_skope(b)().title].join(" : ");return['<span class="czr-skope-switch" title=" '+c+'" data-skope-id="'+b+'">',a.czr_skope(b)().title,"</span>"].join("")},getSkopeSettingVal:function(b,d){if(!a.has(a.CZR_Helpers.build_setId(b)))return a.errorLog("getSkopeSettingVal : the requested setting id does not exist in the api : "+a.CZR_Helpers.build_setId(b)),null;if(!a.czr_skope.has(d))return a.errorLog("getSkopeSettingVal : the requested skope id is not registered : "+d),null;var e,f=this,g=a.CZR_Helpers.build_setId(b),h="___",i=a.czr_skope(d)();if(e=c.has(a.settings.settings,g)?a.settings.settings[g].value:null,a.czr_skope(d).getSkopeSettingAPIDirtyness(g))return a.czr_skope(d).dirtyValues()[g];if(a.czr_isChangeSetOn()&&a.czr_skope(d).getSkopeSettingChangesetDirtyness(g))return a.czr_skope(d).changesetValues()[g];var j=f._getDBSettingVal(b,d);return"_no_db_val"!=j?j:"global"==i.skope?"___"==h?e:h:"___"!=h?h:f.getSkopeSettingVal(b,f._getParentSkopeId(i))},applyDirtyCustomizedInheritance:function(b,d){d=d||a.czr_activeSkopeId()||a.czr_skopeBase.getGlobalSkopeId(),b=b||{};var e=this,f=a.czr_skope(d)();if("global"==f.skope)return b;var g=e._getParentSkopeId(f),h=a.czr_skope(g).dirtyValues();return c.each(h,function(d,e){var g=a.CZR_Helpers.getOptionName(e);c.isUndefined(b[e])&&c.isUndefined(a.czr_skope(f.id).dbValues()[g])&&(b[e]=d)}),"global"==a.czr_skope(g)().skope?b:e.applyDirtyCustomizedInheritance(b,g)},_getParentSkopeId:function(b,d){var e=this,f=["local","group","special_group","global"],g=d||1*(c.findIndex(f,function(a){return b.skope==a})+1),h=f[g];return c.isUndefined(h)?c.findWhere(a.czr_currentSkopesCollection(),{skope:"global"}).id:c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{skope:h}))?e._getParentSkopeId(b,g+1):c.findWhere(a.czr_currentSkopesCollection(),{skope:h}).id},_getChildSkopeId:function(b,d){var e=this,f=["local","group","special_group","global"],g=d||1*(c.findIndex(f,function(a){return b.skope==a})-1),h=f[g];return c.isUndefined(h)?c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id:c.isUndefined(c.findWhere(a.czr_currentSkopesCollection(),{skope:h}))?e._getParentSkopeId(b,g-1):c.findWhere(a.czr_currentSkopesCollection(),{skope:h}).id}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{updateSkopeCollection:function(d,e){var f=this;if(_api_ready_collection=[],c.each(d,function(a,c){var d=b.extend(!0,{},a);_api_ready_collection.push(f.prepareSkopeForAPI(d))}),f.isGlobalSkopeRegistered()){var g=[],h=b.extend(!0,{},a.czr_skope(f.getGlobalSkopeId())());c.each(_api_ready_collection,function(a,b){"global"==a.skope?g.push(h):g.push(a)}),_api_ready_collection=g}a.czr_currentSkopesCollection(_api_ready_collection)},prepareSkopeForAPI:function(a){if(!c.isObject(a))throw new Error("prepareSkopeForAPI : a skope must be an object to be API ready");var b=this,d={};if(c.each(serverControlParams.defaultSkopeModel,function(b,e){var f=a[e];switch(e){case"title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope title property must a string");d[e]=f;break;case"long_title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope title property must a string");d[e]=f;break;case"ctx_title":if(!c.isString(f))throw new Error("prepareSkopeForAPI : a skope context title property must a string");d[e]=f;break;case"skope":if(!c.isString(f)||c.isEmpty(f))throw new Error('prepareSkopeForAPI : a skope "skope" property must a string not empty');d[e]=f;break;case"level":if(!c.isString(f)||c.isEmpty(f))throw new Error("prepareSkopeForAPI : a skope level must a string not empty for skope "+f.skope);d[e]=f;break;case"dyn_type":if(!c.isString(f)||!c.contains(serverControlParams.skopeDynTypes,f))throw new Error("prepareSkopeForAPI : missing or invalid dyn type for skope "+a);d[e]=f;break;case"opt_name":if(!c.isString(f)||c.isEmpty(f))throw new Error('prepareSkopeForAPI : invalid "opt_name" property for skope '+f.skope);d[e]=f;break;case"obj_id":if(!c.isString(f))throw new Error('prepareSkopeForAPI : invalid "obj_id" for skope '+f.skope);d[e]=f;break;case"is_winner":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "is_winner" must be a boolean');d[e]=f;break;case"is_forced":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "is_primary" must be a boolean');d[e]=f;break;case"db":if((c.isArray(f)||c.isEmpty(f))&&(f={}),c.isUndefined(f)||!c.isObject(f))throw new Error('prepareSkopeForAPI : skope property "db" must be an object');d[e]=f;break;case"changeset":if((c.isArray(f)||c.isEmpty(f))&&(f={}),c.isUndefined(f)||!c.isObject(f))throw new Error('prepareSkopeForAPI : skope property "changeset" must be an object');d[e]=f;break;case"has_db_val":if(!c.isUndefined(f)&&!c.isBoolean(f))throw new Error('prepareSkopeForAPI : skope property "has_db_val" must be a boolean');d[e]=f}}),d.color=b.skope_colors[d.skope]||"rgb(255, 255, 255)",d.id=d.skope+"_"+d.level,!c.isString(d.id)||c.isEmpty(d.id))throw new Error("prepareSkopeForAPI : a skope id must a string not empty");return c.isString(d.title)&&!c.isEmpty(d.title)||(d.title=id,d.long_title=id),d},currentSkopesCollectionReact:function(d,e){var f=this,g=b.extend(!0,[],d)||[],h=(b.extend(!0,[],e)||[],b.Deferred()),i=[];_to_remove=[],_to_update=[],_instantiateAndEmbed=function(d){c.each(d,function(c){c=b.extend(!0,{},c),a.czr_skope.add(c.id,new a.CZR_skope(c.id,c))}),c.each(d,function(b){if(!a.czr_skope.has(b.id))throw new Error("Skope id : "+b.id+" has not been instantiated.");"pending"==a.czr_skope(b.id).isReady.state()&&a.czr_skope(b.id).ready()})},c.each(g,function(b){a.czr_skope.has(b.id)||i.push(b)});try{_instantiateAndEmbed(i)}catch(j){return a.errorLog("currentSkopesCollectionReact : "+j),h.resolve().promise()}var k=function(){var d=c.size(g),e=function(a){var e=a.container.attr("class").split(" ");c.each(a.container.attr("class").split(" "),function(a){"width-"==a.substring(0,6)&&(e=c.without(e,a))}),b.when(a.container.attr("class",e.join(" "))).done(function(){a.container.addClass("width-"+Math.round(100/d))})};a.czr_skope.each(function(a){if(c.isUndefined(c.findWhere(g,{id:a().id})))a.visible(!1),a.isReady.then(function(){a.container.toggleClass("active-collection",!1)});else{a.visible(!0);var b=function(){e(a),a.container.toggleClass("active-collection",!0)};"pending"==a.isReady.state()?a.isReady.then(function(){b()}):b()}})};return f.skopeWrapperEmbedded.then(function(){k()}),c.isEmpty(e)&&!c.isEmpty(d)&&a.czr_initialSkopeCollectionPopulated.resolve(),f.maybeSynchronizeGlobalSkope(),h.resolve("changed").promise()},maybeSynchronizeGlobalSkope:function(d){if(d=d||{},!c.isObject(d))throw new Error("maybeSynchronizeGlobalSkope : args must be an object");var e,f,g,h=this,i=b.Deferred();c.extend({isGlobalReset:!1,isSetting:!1,settingIdToReset:"",isSkope:!1,skopeIdToReset:""},d);if(h.isGlobalSkopeRegistered()){var j=a.czr_skope(h.getGlobalSkopeId()).dbValues();if(c.each(j,function(b,d){a.has(d)&&!c.isEqual(a.settings.settings[d].value,b)&&(a.settings.settings[d].value=b)}),d.isGlobalReset&&d.isSetting){if(e=d.settingIdToReset,f=a.CZR_Helpers.getOptionName(e),g=serverControlParams.defaultOptionsValues[f],c.isUndefined(a.settings.settings[e])||c.isUndefined(g))return;g!=a.settings.settings[e].value&&(a.settings.settings[e].value=g)}d.isGlobalReset&&d.isSkope&&c.each(a.settings.settings,function(b,d){h.isThemeSetting(d)&&(f=a.CZR_Helpers.getOptionName(d),c.has(serverControlParams.defaultOptionsValues,f)&&(a.settings.settings[d].value=serverControlParams.defaultOptionsValues[f]))})}return i.resolve().promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{activeSkopeReact:function(d,e){var f=this,g=b.Deferred();if(!c.isUndefined(e)&&a.czr_skope.has(e))a.czr_skope(e).active(!1);else if(!c.isUndefined(e))throw new Error("listenToActiveSkope : previous scope does not exist in the collection",e);if(c.isUndefined(d)||!a.czr_skope.has(d))throw new Error("listenToActiveSkope : requested scope "+d+" does not exist in the collection");a.czr_skope(d).active(!0);var h=function(b){return a.czr_activeSkopeId(f.getGlobalSkopeId()),a.czr_serverNotification({status:"success",message:[b,"can only be customized sitewide."].join(" ")}),g.resolve().promise()};if(f.isExcludedSidebarsWidgets()&&"widgets"==a.czr_activePanelId()&&d!=f.getGlobalSkopeId()&&a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Widgets are created sitewide."]].join(" ")}),f.isExcludedWPCustomCss()&&"custom_css"==a.czr_activeSectionId()&&d!=f.getGlobalSkopeId())return h(a.section(a.czr_activeSectionId()).params.title);if("admin_sec"==a.czr_activeSectionId()&&d!=f.getGlobalSkopeId())return h(a.section(a.czr_activeSectionId()).params.title);if("nav_menu"!=a.czr_activeSectionId().substring(0,"nav_menu".length)&&"add_menu"!=a.czr_activeSectionId()||d==f.getGlobalSkopeId()||a.czr_serverNotification({status:"success",message:[serverControlParams.i18n.skope["Menus are created sitewide."]].join(" ")}),"nav_menus"==a.czr_activePanelId()&&c.each(a.panel(a.czr_activePanelId()).sections(),function(a){f.processSilentUpdates({section_id:a.id,awake_if_not_active:!0})}),a.state("switching-skope")(!0),f._writeCurrentSkopeTitle(d),a.trigger("czr-paint",{is_skope_switch:!0}),c.isUndefined(a.czr_activeSectionId()))return a.state("switching-skope")(!1),a.previewer.refresh(),g.resolve().promise();c.has(a,"czrModulePanelState")&&a.czrModulePanelState(!1);var i=f._getSilentUpdateCandidates();c.isUndefined(e)||c.each(a.czr_skope(e).dirtyValues(),function(a,b){c.contains(i,b)||i.push(b)}),c.isUndefined(d)||c.each(a.czr_skope(d).dirtyValues(),function(a,b){c.contains(i,b)||i.push(b)});var j=function(){f.processSilentUpdates({candidates:i,section_id:null,refresh:!1}).fail(function(){throw g.reject(),a.state("switching-skope")(!1),new Error("Fail to process silent updates in _debouncedProcessSilentUpdates")}).done(function(b){a.previewer.refresh().always(function(){g.resolve(b),a.state("switching-skope")(!1)})})};return c.has(a,"czr_isModuleExpanded")&&!1!==a.czr_isModuleExpanded()?(a.czr_isModuleExpanded().setupModuleViewStateListeners(!1),(j=c.debounce(j,400))()):j(),g.promise()},_writeCurrentSkopeTitle:function(d){var e=this,f=a.czr_skope(d||a.czr_activeSkopeId())().long_title,g=function(){var g=e.getInheritedSkopeTitles(),h=e.getOverridenSkopeTitles();return b.trim(['<span class="czr-main-title"><span class="czr-toggle-title-notice fa fa-info-circle"></span>',"global"==a.czr_skope(d||a.czr_activeSkopeId())().skope?f:["Customizing",f].join(" "),"</span>",'<span class="czr-skope-inherits-from">',serverControlParams.i18n.skope["In this context :"],c.isEmpty(g)?" ":serverControlParams.i18n.skope["inherits from"],g,c.isEmpty(g)?"":c.isEmpty(h)?".":[",",serverControlParams.i18n.skope.and].join(" "),c.isEmpty(h)?" ":serverControlParams.i18n.skope["overridden by"],h,c.isEmpty(h)?"":".","</span>"].join(" "))},h=function(a){a?b(".czr-scope-switcher").find(".spinner").fadeIn():b(".czr-scope-switcher").find(".spinner").fadeOut()};e.skopeWrapperEmbedded.then(function(){b(".czr-scope-switcher").find(".czr-current-skope-title").length?b.when(b(".czr-scope-switcher").find(".czr-skope-title").fadeOut(200)).done(function(){b(this).html(g()).fadeIn(200)}):b(".czr-scope-switcher").prepend(b("<h2/>",{"class":"czr-current-skope-title",html:['<span class="czr-skope-title">','<span class="spinner">',g(),"</span>","</span>"].join("")})),c.isUndefined(a.state("switching-skope").isBound)&&(a.state("switching-skope").bind(h),a.state("switching-skope").isBound=!0)})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{processSilentUpdates:function(d){d=c.isString(d)?{candidates:[d]}:d||{};var e=this,f={candidates:[],section_id:a.czr_activeSectionId(),refresh:!0,awake_if_not_active:!1},g=b.Deferred();if(d=b.extend(f,d),c.isString(d.candidates)&&(d.candidates=[d.candidates]),c.isEmpty(d.candidates)&&(d.candidates=e._getSilentUpdateCandidates(d.section_id,d.awake_if_not_active)),!c.isArray(d.candidates))throw new Error("processSilentUpdates : the update candidates must be an array.");if(c.isEmpty(d.candidates))return g.resolve([]).promise();var h=function(){e.silentlyUpdateSettings(d.candidates,d.refresh).fail(function(){g.reject()}).done(function(a){c.delay(function(){e.setupActiveSkopedControls({section_id:d.section_id})},1e3),g.resolve(a)})};return"resolved"!=a.czr_skopeReady.state()?(g.resolve([]),a.czr_skopeReady.done(function(){h()})):h(),g.promise()},silentlyUpdateSettings:function(d,e){a.state.has("silent-update-processing")||a.state.create("silent-update-processing")(!1),a.state("silent-update-processing")(!0);var f=this,g={},h=b.Deferred();e=!!c.isUndefined(e)||e,(c.isUndefined(d)||c.isEmpty(d))&&(d=f._getSilentUpdateCandidates()),c.isString(d)&&(d=[d]),c.each(d,function(b){a.control.has(b)&&"czr_multi_module"==a.control(b).params.type||(g[b]=f.getSettingUpdatePromise(b))});var i=[],j=[];return c.each(g,function(b,d){b.done(function(b){var e=a.CZR_Helpers.build_setId(d),f=a.czr_skope(a.czr_activeSkopeId()).getSkopeSettingDirtyness(d);c.isEqual(a(e)(),b)||j.push(d),a(e).silent_set(b,f)}),i.push(b)}),b.when.apply(null,i).fail(function(){throw h.reject(),new Error("silentlyUpdateSettings FAILED. Candidates : "+d)}).always(function(){a.state("silent-update-processing")(!1)}).then(function(){c.each(i,function(a){if(c.isObject(a)&&"resolved"!==a.state())throw new Error("a silent update promise is unresolved : "+d)}),e&&!c.isEmpty(j)?a.previewer.refresh().always(function(){h.resolve(j)}):h.resolve(j)}),h.promise()},getSettingUpdatePromise:function(d){if(c.isUndefined(d))throw new Error("getSettingUpdatePromise : the provided setId is not defined");if(!a.has(a.CZR_Helpers.build_setId(d)))throw new Error("getSettingUpdatePromise : the provided wpSetId is not registered : "+a.CZR_Helpers.build_setId(d));var e=this,f=a.CZR_Helpers.build_setId(d),g=a(f)(),h=b.Deferred(),i=!1,j=a.czr_activeSkopeId(),k=a.czr_skopeBase.getSkopeSettingVal(d,j);if(c.isEqual(g,k))return h.resolve(k).promise();if(a.control.has(f)){var l=a.control(f).params.type,m=a.settings.controls[f];switch(l){case"czr_cropped_image":i=e._getCzrCroppedImagePromise(f,m);break;case"czr_module":e._processCzrModuleSilentActions(f,l,j,m)}}return c.has(a.settings.controls,"header_image")&&"header_image"==f&&(i=e._getHeaderImagePromise(f,j)),i&&c.isObject(i)?i.always(function(){h.resolve(k)}):h.resolve(k),h.promise()},_getSilentUpdateCandidates:function(b,d){var e=this,f=[];if(b=c.isUndefined(b)||c.isNull(b)?a.czr_activeSectionId():b,c.isEmpty(a.czr_activeSectionId())&&!d)return[];if(c.isUndefined(b))return a.consoleLog("_getSilentUpdateCandidates : No active section provided"),[];if(!a.section.has(b))throw new Error("_getSilentUpdateCandidates : The section "+b+" is not registered in the API.");var g=a.CZR_Helpers.getSectionSettingIds(b);return g=c.filter(g,function(a){return e.isSettingSkopeEligible(a)}),c.each(g,function(a){f.push(a)}),f}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{_processCzrModuleSilentActions:function(d,e,f,g){var h,i,j,k,l,m=c.has(a.control(d).params,"syncCollection")?a.control(d).params.syncCollection:"",n=a.CZR_Helpers.build_setId(d),o=a.czr_skopeBase.getSkopeSettingVal(n,f),p=a.czr_skope(a.czr_activeSkopeId());c.isEmpty(m)||c.isUndefined(m)||(h=a.CZR_Helpers.build_setId(m),i=a.czr_skopeBase.getSkopeSettingVal(h,f),j=a.settings.controls[h],k=a.controlConstructor.czr_multi_module,l=a.control(h).syncSektionModule()().id,a.control(h).container.remove(),a.control.remove(h),a(h).silent_set(i,p.getSkopeSettingDirtyness(h)),b.extend(j,{czr_skope:f}),a.control.add(h,new k(h,{params:j,previewer:a.previewer}))),_constructor=a.controlConstructor[e],a.control(d).container.remove(),a.control.remove(d),a(d).silent_set(o,p.getSkopeSettingDirtyness(n)),b.extend(g,{czr_skope:f}),a.control.add(d,new _constructor(d,{params:g,previewer:a.previewer})),c.isEmpty(m)||c.isUndefined(m)||(a.consoleLog("FIRE SEKTION MODULE?",l,a.control(d).czr_Module(l).isReady.state()),a.control(d).czr_Module(l).fireSektionModule())},_getCzrCroppedImagePromise:function(d,e){var f=a.controlConstructor.czr_cropped_image,g=b.Deferred(),h=a.has(d)?a(d)():null;return h=null===h?"":h,wp.media.attachment(h).fetch().done(function(){a.control(d).container.remove(),a.control.remove(d),e.attachment=this.attributes,a.control.add(d,new f(d,{params:e,previewer:a.previewer})),g.resolve()}).fail(function(){a.control(d).container.remove(),a.control.remove(d),e=c.omit(e,"attachment"),a.control.add(d,new f(d,{params:e,previewer:a.previewer})),g.reject()}),g.promise()},_getHeaderImagePromise:function(d,e){var f=b.Deferred();if(!c.has(a.settings.controls,"header_image")||"header_image"!=d)return f.resolve().promise();var g=a.controlConstructor.header,h=b.extend(!0,{},a.settings.controls.header_image);header_image_data=null===a.czr_skopeBase.getSkopeSettingVal("header_image_data",e)?"":a.czr_skopeBase.getSkopeSettingVal("header_image_data",e);var i,j=function(b){b=b||h,a.control("header_image").container.remove(),a.control.remove("header_image"),a.HeaderTool.UploadsList=a.czr_HeaderTool.UploadsList,a.HeaderTool.DefaultsList=a.czr_HeaderTool.DefaultsList,a.HeaderTool.CombinedList=a.czr_HeaderTool.CombinedList;var d=function(){a.control.add("header_image",new g("header_image",{params:b,previewer:a.previewer}))};(d=c.debounce(d,800))()};return c.has(header_image_data,"attachment_id")?(i=header_image_data.attachment_id,wp.media.attachment(i).fetch().done(function(){h.attachment=this.attributes,j(h),f.resolve()}).fail(function(){h=c.omit(h,"attachment"),a.control("header_image").container.remove(),a.control.remove("header_image"),a.HeaderTool.UploadsList=a.czr_HeaderTool.UploadsList,a.HeaderTool.DefaultsList=a.czr_HeaderTool.DefaultsList,a.HeaderTool.CombinedList=a.czr_HeaderTool.CombinedList,a.control.add("header_image",new g("header_image",{params:h,previewer:a.previewer})),f.reject()})):(j(),f.resolve()),f.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{setupActiveSkopedControls:function(d){var e,f,g,h,i=this,j=b.Deferred();if(defaultSetupParams={controls:[],section_id:a.czr_activeSectionId()},g=b.extend(defaultSetupParams,d),!c.isObject(g)||!c.has(g,"controls")||!c.has(g,"section_id"))throw new Error("setupActiveSkopedControls : the setupParams param must be an object with properties controls and section_id.");return e=g.section_id,f=g.controls,h=[],!c.isEmpty(e)&&c.isString(e)||(e=a.czr_activeSectionId()),c.isEmpty(f)&&(f=a.CZR_Helpers.getSectionControlIds(e)),f=c.isString(f)?[f]:f,h=c.filter(f,function(b){var c=a.CZR_Helpers.getControlSettingId(b);return c&&!i.isSettingSkopeEligible(c)&&a.control(b).container.addClass("czr-not-skoped"),c&&i.isWPAuthorizedSetting(c)&&a.control(b).container.addClass("is-wp-authorized-setting"),c&&i.isSettingSkopeEligible(c)}),"nav_menu["==e.substring(0,"nav_menu[".length)?j.resolve().promise():(c.isEmpty(f)||(a.czr_skopeReady.then(function(){b.when(i.renderControlsSingleReset(h)).done(function(){c.each(f,function(a){i.listenSkopedControl(a)}),j.resolve()})}),"rejected"==a.czr_skopeReady.state()&&j.resolve()),i.renderCtrlSkpNotIcon(f),j.promise())},listenSkopedControl:function(d){var e=this;if(a.has(d)&&!c.isUndefined(a.control(d))){var f=a.control(d),g=a.CZR_Helpers.getControlSettingId(d),h=(a.CZR_Helpers.getOptionName(g),{hasDBVal:!1,isDirty:!1,noticeVisible:!1,resetVisible:!1,isResetting:!1});if(!c.has(f,"czr_states")){f.czr_states=new a.Values,c.each(h,function(a,b){f.czr_states.create(b),f.czr_states(b)(a)});try{e.bindControlStates(f)}catch(i){a.errorLog("bindControlStates : "+i)}}f.czr_states("hasDBVal")(a.czr_skope(a.czr_activeSkopeId()).hasSkopeSettingDBValues(g)),f.czr_states("isDirty")(a.czr_skope(a.czr_activeSkopeId()).getSkopeSettingDirtyness(g)),c.has(f,"userEventMap")||(f.userEventMap=[{trigger:"click keydown",selector:".czr-setting-reset, .czr-cancel-button",name:"control_reset_warning",actions:function(){(f.czr_states("isDirty")()||f.czr_states("hasDBVal")())&&(c.each(c.without(a.CZR_Helpers.getSectionControlIds(f.section()),d),function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("resetVisible")(!1)}),f.czr_states("resetVisible")(!f.czr_states("resetVisible")()),f.czr_states("noticeVisible")(!f.czr_states("resetVisible")()))}},{trigger:"click keydown",selector:".czr-control-do-reset",name:"control_do_reset",actions:function(){e.doResetSetting(d)}},{trigger:"click keydown",selector:".czr-skope-switch",name:"control_skope_switch",actions:function(d){var e=b(d.dom_event.currentTarget,d.dom_el).attr("data-skope-id");!c.isEmpty(e)&&a.czr_skope.has(e)&&a.czr_activeSkopeId(e)}},{trigger:"click keydown",selector:".czr-toggle-notice",name:"control_toggle_notice",actions:function(a){f.czr_states("noticeVisible")(!f.czr_states("noticeVisible")()),f.czr_states("noticeVisible")()&&f.czr_states("resetVisible")(!1)}}],a.CZR_Helpers.setupDOMListeners(f.userEventMap,{dom_el:f.container},e))}},bindControlStates:function(d){if(!a.control.has(d.id))throw new Error("in bindControlStates, the provided ctrl id is not registered in the api : "+d.id);var e=this;a.CZR_Helpers.getControlSettingId(d.id);d.czr_states("hasDBVal").bind(function(a){d.container.toggleClass("has-db-val",a),a?_title=serverControlParams.i18n.skope["Reset your customized ( and published ) value"]:d.czr_states("isDirty")()?_title=serverControlParams.i18n.skope["Reset your customized ( but not yet published ) value"]:_title=serverControlParams.i18n.skope["Not customized yet, nothing to reset"],d.container.find(".czr-setting-reset").attr("title",_title)}),d.czr_states("isDirty").bind(function(a){d.container.toggleClass("is-dirty",a);var b;b=a?serverControlParams.i18n.skope["Reset your customized ( but not yet published ) value"]:d.czr_states("hasDBVal")()?serverControlParams.i18n.skope["Reset your customized ( and published ) value"]:serverControlParams.i18n.skope["Not customized yet, nothing to reset"],d.container.find(".czr-setting-reset").attr("title",b)}),d.czr_states("noticeVisible").bind(function(a){d.container.toggleClass("czr-notice-visible",a);var c=d.getNotificationsContainerElement();!1!==c&&!1!==c.length&&(a?(e.updateCtrlSkpNot(d.id,!0),c.stop().slideDown("fast",null,function(){b(this).css("height","auto")})):b.when(c.stop().slideUp("fast",null,function(){b(this).css("height","auto")})).done(function(){e.removeCtrlSkpNot(d.id)}))}),d.czr_states("resetVisible").bind(function(f){d.section()||a.czr_activeSectionId();f?b.when(e.renderControlResetWarningTmpl(d.id)).done(function(a){c.isEmpty(a)||(d.czr_resetDialogContainer=a.container,a.container.slideToggle("fast"),a.is_authorized||c.delay(function(){b.when(d.czr_resetDialogContainer.slideToggle("fast")).done(function(){d.czr_resetDialogContainer.remove()})},3e3))}):c.has(d,"czr_resetDialogContainer")&&d.czr_resetDialogContainer.length&&b.when(d.czr_resetDialogContainer.slideToggle("fast")).done(function(){d.czr_resetDialogContainer.remove()})})}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{renderControlsSingleReset:function(d){var e=this,f=b.Deferred();(c.isUndefined(d)||c.isEmpty(d))&&(d=a.CZR_Helpers.getSectionControlIds(a.czr_activeSectionId()),d=c.filter(d,function(b){var c=a.CZR_Helpers.getControlSettingId(b);return c&&e.isSettingSkopeEligible(c)}));var g=c.isArray(d)?d:[d],h=function(d){return c.isEmpty(d)?void f.resolve():void c.each(d,function(c){a.control.when(c,function(){var d=a.control(c);a.CZR_Helpers.getControlSettingId(c);return b(".czr-setting-reset",d.container).length?void f.resolve():void d.deferred.embedded.then(function(){b.when(d.container.find(".customize-control-title").first().prepend(b("<span/>",{"class":"czr-setting-reset fa fa-refresh",title:""}))).done(function(){d.container.addClass("czr-skoped"),b(".czr-setting-reset",d.container).fadeIn(400),f.resolve()})})})})};return h=c.debounce(h,200),h(g),f.promise()},renderControlResetWarningTmpl:function(d){if(!a.control.has(d))return{};var e,f,g=a.control(d),h=a.CZR_Helpers.getControlSettingId(d),i="",j=function(){return!!c.contains(serverControlParams.wpBuiltinSettings,a.CZR_Helpers.getOptionName(h))||!c.contains(serverControlParams.themeSettingList,a.CZR_Helpers.getOptionName(h))}(),k=a.czr_skope(a.czr_activeSkopeId())();g.czr_states("isDirty")()?(e=["global"==k.skope?serverControlParams.i18n.skope["Please confirm that you want to reset your current customizations for this option"]:serverControlParams.i18n.skope["Please confirm that you want to reset your current customizations for this option in"],"global"==k.skope?serverControlParams.i18n.skope.sitewide:k.ctx_title].join(" "),f=serverControlParams.i18n.skope["Your customizations have been reset"]):j&&"global"==k.skope?e=serverControlParams.i18n.skope["This WordPress setting can not be reset sitewide"]:(e=["global"==k.skope?serverControlParams.i18n.skope["Please confirm that you want to reset this option"]:serverControlParams.i18n.skope["Please confirm that you want to reset this option in"],"global"==k.skope?serverControlParams.i18n.skope.sitewide:k.ctx_title].join(" "),
13
+ f=serverControlParams.i18n.skope["The option has been reset"]);var l=!(j&&"global"==a.czr_skope(a.czr_activeSkopeId())().skope&&!g.czr_states("isDirty")()),m={warning_message:e+".",success_message:f+".",is_authorized:l};try{i=wp.template("czr-reset-control")(m)}catch(n){return a.errorLog("Error when parsing the the reset control template : "+n),{container:!1,is_authorized:!1}}return b(".customize-control-title",g.container).first().after(b(i)),{container:b(".czr-ctrl-reset-warning",g.container),is_authorized:l}},doResetSetting:function(d){var e=this,f=a.CZR_Helpers.getControlSettingId(d),g=a.control(d),h=a.czr_activeSkopeId(),i=g.czr_states("isDirty")()?"_resetControlDirtyness":"_resetControlAPIVal",j=function(){var a=this;a.czr_states("resetVisible")(!1),a.czr_states("isResetting")(!1),a.container.removeClass("czr-resetting-control")},k=function(d){var g=function(){a.czr_skopeBase.processSilentUpdates({candidates:d,refresh:!1}).fail(function(){a.consoleLog("Silent update failed after resetting control : "+d)}).done(function(){a.control.when(d,function(){var f=a.control(d);b.when(b(".czr-crtl-reset-dialog",f.container).fadeOut("300")).done(function(){b.when(b(".czr-reset-success",f.container).fadeIn("300")).done(function(a){c.delay(function(){b.when(a.fadeOut("300")).done(function(){e.setupActiveSkopedControls({controls:[d]}).done(function(){f.czr_states&&(j.call(f),f.czr_states("noticeVisible")(e.isCtrlNoticeVisible(d)))})})},500)})})})})};e[i](d).done(function(){a.consoleLog("REFRESH AFTER A SETTING RESET"),a.previewer.refresh().fail(function(b){a.errorLog("Setting reset refresh failed.",b)}).done(function(b){if("global"==a.czr_skope(h)().skope&&"_resetControlAPIVal"==i){var d,e={},j=a.czr_skope(h)().opt_name;!c.isUndefined(b.skopesServerData)&&c.has(b.skopesServerData,"czr_skopes")&&(d=b.skopesServerData.czr_skopes,c.isUndefined(c.findWhere(d,{opt_name:j}))&&(e=c.findWhere(d,{opt_name:j}).db||{})),a.czr_skopeBase.maybeSynchronizeGlobalSkope({isGlobalReset:!0,isSetting:!0,settingIdToReset:f}).done(function(){g()})}else g()})})};g.czr_states("isResetting")(!0),g.container.addClass("czr-resetting-control"),a.czr_skopeReset[g.czr_states("isDirty")()?"resetChangeset":"resetPublished"]({skope_id:h,setId:f,is_setting:!0}).done(function(a){k(d)}).fail(function(f){a.errorLog("Reset failed",f),b.when(b(".czr-crtl-reset-dialog",g.container).fadeOut("300")).done(function(){b.when(b(".czr-reset-fail",g.container).fadeIn("300")).done(function(){b(".czr-reset-fail",g.container).append("<p>"+f+"</p>"),c.delay(function(){j.call(g),e.setupActiveSkopedControls({controls:[d]})},2e3)})})})},_resetControlDirtyness:function(d){var e=a.CZR_Helpers.getControlSettingId(d),f=a.czr_skope(a.czr_activeSkopeId()),g=b.extend(!0,{},f.dirtyValues()),h={},i=b.extend(!0,{},f.changesetValues()),j={},k=b.Deferred();return h=c.omit(g,e),j=c.omit(i,e),f.dirtyValues(h),f.changesetValues(h),k.resolve().promise()},_resetControlAPIVal:function(d){var e=a.CZR_Helpers.getControlSettingId(d),f=a.czr_skope(a.czr_activeSkopeId()).dbValues(),g=b.extend(!0,{},f),h=b.Deferred();return c.has(a.control(d),"czr_states")&&(a.control(d).czr_states("hasDBVal")(!1),a.czr_skope(a.czr_activeSkopeId()).dbValues(c.omit(g,e))),h.resolve().promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{renderCtrlSkpNotIcon:function(d){var e=c.isArray(d)?d:[d];c.each(e,function(c){a.control.when(c,function(){var d=a.control(c);d.deferred.embedded.then(function(){b(".czr-toggle-notice",d.container).length||b.when(d.container.find(".customize-control-title").first().append(b("<span/>",{"class":"czr-toggle-notice fa fa-info-circle",title:serverControlParams.i18n.skope["Display informations about the scope of this option."]}))).done(function(){b(".czr-toggle-notice",d.container).fadeIn(400)})})})})},updateCtrlSkpNot:function(d,e){var f=this,g=c.isArray(d)?d:[d],h=function(a){return a&&f.isSettingSkopeEligible(a)},i=function(b,d){var e,g,i=a.czr_activeSkopeId(),j=f.getInheritedSkopeId(b,i),k=f.getAppliedPrioritySkopeId(b,i),l=[];return h(b)?(j==k&&a.czr_skope.has(j)&&i==j&&(e=!c.isUndefined(a.czr_skope(i).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(i).dbValues()[b]),e?"global"==a.czr_skope(j)().skope?l.push([serverControlParams.i18n.skope["Customized. Will be applied sitewide once published."]].join(" ")):l.push([serverControlParams.i18n.skope["Customized. Will be applied to"],"<strong>"+a.czr_skope(j)().ctx_title+"</strong>",serverControlParams.i18n.skope["once published."]].join(" ")):g?"global"==a.czr_skope(j)().skope?l.push([serverControlParams.i18n.skope["Customized and applied sitewide."]].join(" ")):l.push([serverControlParams.i18n.skope["Customized and applied to"],"<strong>"+a.czr_skope(j)().ctx_title+".</strong>"].join(" ")):l.push(serverControlParams.i18n.skope["Default website value applied sitewide."])),j!==i&&a.czr_skope.has(j)&&(e=!c.isUndefined(a.czr_skope(j).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(j).dbValues()[b]),e||g?l.push([serverControlParams.i18n.skope["Currently inherited from"],f.buildSkopeLink(j)+".",serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+a.czr_skope(i)().ctx_title+".</strong>"].join(" ")):l.push([serverControlParams.i18n.skope["Default website value."],serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+a.czr_skope(i)().ctx_title+".</strong>"].join(" "))),k!==i&&a.czr_skope.has(k)&&(e=!c.isUndefined(a.czr_skope(k).dirtyValues()[b]),l.push([e?serverControlParams.i18n.skope["The value that will be applied to"]:serverControlParams.i18n.skope["The value currently applied to"],"<strong>"+a.czr_skope(d)().ctx_title+"</strong>",e?serverControlParams.i18n.skope["is customized in"]:serverControlParams.i18n.skope["is set in"],f.buildSkopeLink(k),serverControlParams.i18n.skope["which has a higher priority than the current option scope"],"<strong>( "+a.czr_skope(i)().title+" ).</strong>"].join(" "))),l.join(" | ")):(l.push([serverControlParams.i18n.skope["This option is always customized sitewide and cannot be reset."]].join(" ")),l.join(" | "))};c.each(g,function(d){a.control.when(d,function(){var f=a.control(d),g=a.CZR_Helpers.getControlSettingId(d),h=c.isUndefined(e)?f.czr_states&&f.czr_states("noticeVisible")():e;h&&f.deferred.embedded.then(function(){var d=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id,e=f.getNotificationsContainerElement();if(e&&e.length&&!c.isUndefined(d)){try{_html=i(g,d)}catch(h){a.errorLog("_generateControlNotice : "+h)}var j=b(".czr-skope-notice",e);j.length?j.html(_html):e.append(['<span class="czr-notice czr-skope-notice">',_html,"</span>"].join(""))}})})})},isCtrlNoticeVisible:function(b){if(!a.control.has(b))return!1;var c=this,d=a.CZR_Helpers.getControlSettingId(b),e=a.czr_activeSkopeId(),f=c.getAppliedPrioritySkopeId(d,e);return"global"!=a.czr_skope(e)().skope||!(f===e||!a.czr_skope.has(f))},removeCtrlSkpNot:function(d){var e=c.isArray(d)?d:[d];c.each(e,function(c){a.control.when(c,function(){var d=a.control(c);d.deferred.embedded.then(function(){var a=d.getNotificationsContainerElement();if(a&&a.length){var c=b(".czr-skope-notice",a);c.length&&c.remove()}})})})}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{initialize:function(){this.changesetStatus="publish",this.saveBtn=b("#save")},save:function(d){var e,f=this,g=a.state("processing"),h=new a.Messenger({url:a.settings.url.parent,channel:"loader"});f.globalSaveDeferred=b.Deferred(),f.previewer=a.previewer,f.globalSkopeId=a.czr_skopeBase.getGlobalSkopeId(),f.saveArgs=d,d&&d.status&&(f.changesetStatus=d.status),a.state("saving")()&&f.globalSaveDeferred.reject("already_saving");var i=function(b,d){a.state("saving")(!1),a.state("processing").set(0),f.saveBtn.prop("disabled",!1),!c.isUndefined(b)&&b.setting_validities&&a._handleSettingValidities({settingValidities:b.setting_validities,focusInvalidControl:!0}),"pending"==d&&a.czr_serverNotification({message:b,status:"error"})},j=function(d){var e,g=b.Deferred();return a.state("saving")(!0),f.fireAllSubmission(d).always(function(a){e=a.response,i(e,this.state())}).fail(function(b){e=b.response,a.consoleLog("ALL SUBMISSIONS FAILED",e),f.globalSaveDeferred.reject(e),a.trigger("error",e),g.resolve(b.hasNewMenu)}).done(function(b){e=b.response,a.previewer.refresh({waitSkopeSynced:!0}).fail(function(b){f.globalSaveDeferred.reject(f.previewer,[e]),a.consoleLog("SAVE REFRESH FAIL",b)}).done(function(d){if(a.previewer.send("saved",e),e=c.extend({changeset_status:"publish"},e||{}),a.czr_isChangeSetOn()){var i=a._latestRevision;a.state("changesetStatus").set(e.changeset_status),"publish"===e.changeset_status&&(a.each(function(b){b._dirty&&(c.isUndefined(a._latestSettingRevisions[b.id])||a._latestSettingRevisions[b.id]<=i)&&(b._dirty=!1)}),a.state("changesetStatus").set(""),a.settings.changeset.uuid=e.next_changeset_uuid,h.send("changeset-uuid",a.settings.changeset.uuid))}else a.each(function(a){a._dirty=!1});d=c.extend({previewer:d.previewer||f.previewer,skopesServerData:d.skopesServerData||{}},d),f.reactWhenSaveDone(d.skopesServerData),f.globalSaveDeferred.resolveWith(f.previewer,[e]),a.trigger("saved",e||{}),g.resolve(b.hasNewMenu)})}),g.promise()};return 0===g()?j().done(function(a){a&&j({saveGlobal:!1,saveSkopes:!0})}):(e=function(){0===g()&&(a.state.unbind("change",e),j())},a.state.bind("change",e)),f.globalSaveDeferred.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{getSubmitPromise:function(d){var e=this,f=b.Deferred(),g={};if(c.isEmpty(d)||!a.czr_skope.has(d))return a.consoleLog("getSubmitPromise : no skope id requested OR skope_id not registered : "+d),f.resolve().promise();var h=a.czr_skope(d)();return a.czr_skope(d).dirtyness()||d===e.globalSkopeId?(c.each(a.czr_skopeBase.getSkopeDirties(d),function(a,b){g[b]=c.extend({value:a})}),this.submit({skope_id:d,customize_changeset_data:g,dyn_type:h.dyn_type}).done(function(a){f.resolve(a)}).fail(function(b){a.consoleLog("GETSUBMIT FAILED PROMISE FOR SKOPE : ",d,b),f.reject(b)}),f.promise()):f.resolve().promise()},submit:function(d){var e,f=this,g={skope_id:null,the_dirties:{},customize_changeset_data:{},dyn_type:null,opt_name:null},h=[],i=b.Deferred();if(d=b.extend(g,d),c.isNull(d.skope_id))throw new Error("OVERRIDEN SAVE::submit : MISSING skope_id");if(c.isNull(d.the_dirties))throw new Error("OVERRIDEN SAVE::submit : MISSING the_dirties");if(c.has(a,"Notification")&&(a.each(function(b){b.notifications.each(function(c){"error"===c.type&&a.consoleLog("NOTIFICATION ERROR on SUBMIT SAVE",c),"error"!==c.type||c.data&&c.data.from_server||(h.push(b.id),settingInvalidities[b.id]||(settingInvalidities[b.id]={}),settingInvalidities[b.id][c.code]=c)})}),e=a.findControlsForSettings(h),!c.isEmpty(e)))return c.values(e)[0][0].focus(),i.rejectWith(f.previewer,[{setting_invalidities:settingInvalidities}]).promise();var j={skope_id:d.skope_id,action:"save",the_dirties:d.the_dirties,dyn_type:d.dyn_type,opt_name:d.opt_name};a.czr_isChangeSetOn()&&b.extend(j,{excludeCustomizedSaved:!1});var k=b.extend(f.previewer.query(j),{nonce:f.previewer.nonce.save,customize_changeset_status:f.changesetStatus,customize_changeset_data:JSON.stringify(d.customize_changeset_data)});a.czr_isChangeSetOn()&&(f.saveArgs&&f.saveArgs.date&&(k.customize_changeset_date=f.saveArgs.date),f.saveArgs&&f.saveArgs.title&&(k.customize_changeset_title=f.saveArgs.title));var l=wp.ajax.post("global"!==k.skope?"customize_skope_changeset_save":"customize_save",k);return f.saveBtn.prop("disabled",!0),a.trigger("save",l),l.fail(function(b){a.consoleLog("SUBMIT REQUEST FAIL",d.skope_id,b),"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?f.previewer.cheatin():"not_logged_in"===b&&(f.previewer.preview.iframe.hide(),f.previewer.login().done(function(){f.previewer.save(),f.previewer.preview.iframe.show()})),a.trigger("error",b),i.reject(b)}),l.done(function(a){i.resolve(a)}),i.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{fireAllSubmission:function(d){var e=this,f=b.Deferred(),g=[],h=b.Deferred(),i={},j=[],k=[],l={saveGlobal:!0,saveSkopes:!0};d=b.extend(l,d),c.each(a.czr_skopeCollection(),function(a){"global"!==a.skope&&g.push(a.id)});var m=function(d){if(c.isUndefined(g[d+1])&&j.length==g.length){if(c.isEmpty(k))h.resolve(i);else{var e=function(){var d=[];return c.each(k,function(b){d.push(a.czr_skopeBase.buildServerResponse(b))}),b.trim(d.join(" | "))};h.reject(e())}return!0}},n=function(d){return d=d||0,c.isUndefined(g[d])&&(a.consoleLog("Undefined Skope in Save recursive call ",d,_skopesToUpdate,_skopesToUpdate[d]),h.resolve(i)),e.getSubmitPromise(g[d]).always(function(){j.push(d)}).fail(function(b){k.push(b),a.consoleLog("RECURSIVE PUSH FAIL FOR SKOPE : ",g[d]),m(d)||n(d+1)}).done(function(a){a=a||{},i=c.isEmpty(i)?a||{}:b.extend(i,a),m(d)||n(d+1)}),h.promise()},o=!1;c.each(a.czr_skope("global__all_").dirtyValues(),function(a,b){"nav_menu["==b.substring(0,"nav_menu[".length)&&(o=!0)});var p=function(){e.getSubmitPromise(e.globalSkopeId).fail(function(b){a.consoleLog("GLOBAL SAVE SUBMIT FAIL",b),b=a.czr_skopeBase.buildServerResponse(b),f.reject(b)}).done(function(a){i=c.isEmpty(i)?a||{}:b.extend(i,a),f.resolve({response:i,hasNewMenu:o})})};return o&&d.saveGlobal?p():d.saveGlobal&&d.saveSkopes?n().fail(function(b){a.consoleLog("RECURSIVE SAVE CALL FAIL",b),f.reject(b)}).done(function(a){e.cleanSkopeChangesetMetas().always(function(){p()})}):d.saveGlobal&&!d.saveSkopes?p():!d.saveGlobal&&d.saveSkopes&&n().fail(function(b){a.consoleLog("RECURSIVE SAVE CALL FAIL",b),f.reject(b)}).done(function(a){i=c.isEmpty(i)?a||{}:b.extend(i,a),e.cleanSkopeChangesetMetas().always(function(){f.resolve({response:i,hasNewMenu:o})})}),f.promise()},cleanSkopeChangesetMetas:function(){var c=b.Deferred();return _query=b.extend(a.previewer.query(),{nonce:a.previewer.nonce.save}),wp.ajax.post("czr_clean_skope_changeset_metas_after_publish",_query).always(function(){c.resolve()}).fail(function(b){a.consoleLog("cleanSkopeChangesetMetas failed",_query,b)}).done(function(b){a.consoleLog("cleanSkopeChangesetMetas done",_query,b)}),c.promise()}})}(wp.customize,jQuery,_);var CZRSkopeSaveMths=CZRSkopeSaveMths||{};!function(a,b,c){b.extend(CZRSkopeSaveMths,{reactWhenSaveDone:function(b){var d={};b=c.extend({czr_skopes:[],isChangesetDirty:!1},b),c.each(a.czr_skopeCollection(),function(b){d[b.opt_name]=a.czr_skopeBase.getSkopeDirties(b.id),a.czr_skope(b.id).dirtyValues({}),a.czr_skope(b.id).changesetValues({})});var e=[],f=b.czr_skopes;a.consoleLog("REACT WHEN SAVE DONE",d,f),c.each(d,function(b,d){c.each(b,function(b,g){if(!c.isUndefined(c.findWhere(f,{opt_name:d}))&&a.czr_skopeBase.isSettingSkopeEligible(g)){var h=c.findWhere(f,{opt_name:d}).db,i=c.findWhere(f,{opt_name:d}).skope,j=a.CZR_Helpers.build_setId(g),k=a.CZR_Helpers.getOptionName(g),l=h[j];c.isUndefined(l)&&"global"==i&&b===serverControlParams.defaultOptionsValues[k]||!c.isUndefined(l)&&c.isEqual(l,b)||e.push({opt_name:d,setId:j,server_val:l,api_val:b})}})}),c.isEmpty(e)?a.consoleLog("ALL RIGHT, SERVER AND API ARE SYNCHRONIZED AFTER SAVE"):a.consoleLog("SOME SETTINGS HAVE NOT BEEN PROPERLY SAVED : ",e),a.czr_skopeBase.maybeSynchronizeGlobalSkope(),a.czr_skopeBase.updateCtrlSkpNot(a.CZR_Helpers.getSectionControlIds())}})}(wp.customize,jQuery,_);var CZRSkopeResetMths=CZRSkopeResetMths||{};!function(a,b,c){b.extend(CZRSkopeResetMths,{initialize:function(){var c=this;c.previewer=a.previewer,a.state.create("czr-resetting")(!1),a.state("czr-resetting").bind(function(a){b(document.body).toggleClass("czr-resetting",!1!==a)})},resetChangeset:function(d){var e,f,g,h,i,j=b.Deferred(),k=this,l=a.state("processing"),m={is_setting:!1,is_skope:!1,skope_id:a.czr_activeSkopeId()||"",setId:""};d=c.extend(m,d);var n=d.skope_id,o=d.setId;return a.czr_isChangeSetOn()?(f=function(e,f){if(c.isUndefined(e))throw new Error("RESET: MISSING skope_id");if(a.state("czr-resetting")(!0),h={skope_id:e,action:"reset"},i=b.extend(k.previewer.query(h),{nonce:k.previewer.nonce.save}),d.is_setting)b.extend(i,{setting_id:f}),g="czr_changeset_setting_reset";else{if(!d.is_skope)return j.reject("reset_ajax_action_not_specified").promise();g="czr_changeset_skope_reset"}wp.ajax.post(g,i).always(function(){a.state("czr-resetting")(!1)}).fail(function(b){"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?k.previewer.cheatin():"not_logged_in"===b&&(k.previewer.preview.iframe.hide(),k.previewer.login().done(function(){k.resetChangeset(d),k.previewer.preview.iframe.show()})),a.consoleLog(g+" failed ",i,b),b=a.czr_skopeBase.buildServerResponse(b),a.trigger("error",b),a.czr_serverNotification({message:b,status:"error"}),j.reject(b)}).done(function(a){j.resolve(a)})},0===l()&&!1===a.state("czr-resetting")()?f(n,o):(e=function(){0===l()&&!1===a.state("czr-resetting")()&&(a.state.unbind("change",e),f(n,o))},a.state.bind("change",e)),j.promise()):j.resolve().promise()},resetPublished:function(d){var e,f,g,h,i,j=b.Deferred(),k=this,l=a.state("processing"),m={is_setting:!1,is_skope:!1,skope_id:a.czr_activeSkopeId()||"",setId:""};d=c.extend(m,d);var n=d.skope_id,o=d.setId;return f=function(e,f){if(c.isUndefined(e))throw new Error("RESET: MISSING skope_id");if(a.state("czr-resetting")(!0),h={skope_id:e,action:"reset"},i=b.extend(k.previewer.query(h),{nonce:k.previewer.nonce.save}),d.is_setting)b.extend(i,{setting_id:f}),g="czr_published_setting_reset";else{if(!d.is_skope)return j.reject("reset_ajax_action_not_specified").promise();g="czr_published_skope_reset"}a.consoleLog("in czr_reset submit : ",e,i),wp.ajax.post(g,i).always(function(){a.state("czr-resetting")(!1)}).fail(function(b){"0"===b?b="not_logged_in":"-1"===b&&(b="invalid_nonce"),"invalid_nonce"===b?k.previewer.cheatin():"not_logged_in"===b&&(k.previewer.preview.iframe.hide(),k.previewer.login().done(function(){k.resetChangeset(d),k.previewer.preview.iframe.show()})),a.consoleLog(g+" failed ",i,b),b=a.czr_skopeBase.buildServerResponse(b),a.trigger("error",b),a.czr_serverNotification({message:b,status:"error"}),j.reject(b)}).done(function(a){j.resolve(a)})},0===l()&&!1===a.state("czr-resetting")()?f(n,o):(e=function(){0===l()&&!1===a.state("czr-resetting")()&&(a.state.unbind("change",e),f(n,o))},a.state.bind("change",e)),j.promise()}})}(wp.customize,jQuery,_);var CZRSkopeBaseMths=CZRSkopeBaseMths||{};!function(a,b,c){b.extend(CZRSkopeBaseMths,{initWidgetSidebarSpecifics:function(){var c=this;c.isExcludedSidebarsWidgets()||a.czr_activeSkopeId.bind(function(b){c.forceSidebarDirtyRefresh(a.czr_activeSectionId(),b)}),b(document).bind("widget-added",function(b,d){if(!c.isExcludedSidebarsWidgets()){var e=d.closest(".customize-control").attr("id"),f=a.czr_skopeBase.widgetIdToSettingId(e,"customize-control-");if(!a.has(f))throw new Error("AN ADDED WIDGET COULD NOT BE BOUND IN SKOPE. "+f);c.listenAPISettings(f)}})},forceSidebarDirtyRefresh:function(b,d){var e=this;if(!e.isExcludedSidebarsWidgets()){var f=a.state("saved")(),g=function(){if(a.section.has(b)&&"sidebar"==a.section(b).params.type){var c=c||a.czr_activeSkopeId(),d="sidebars_widgets["+a.section(b).params.sidebarId+"]",g=e.getSkopeSettingVal(d,c);a.czr_skope(c).updateSkopeDirties(d,g),a.previewer.refresh({the_dirties:a.czr_skope(c).dirtyValues()}).done(function(){a.state("saved")(f)})}};g=c.debounce(g,500),g()}}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{initialize:function(d,e){var f=this;a.Value.prototype.initialize.call(f,null,e),f.isReady=b.Deferred(),f.embedded=b.Deferred(),f.el="czr-scope-"+d,b.extend(f,e||{}),f.visible=new a.Value((!0)),f.winner=new a.Value((!1)),f.priority=new a.Value,f.active=new a.Value((!1)),f.dirtyness=new a.Value((!1)),f.skopeResetDialogVisibility=new a.Value((!1)),f.hasDBValues=new a.Value((!1)),f.dirtyValues=new a.Value({}),f.dbValues=new a.Value({}),f.changesetValues=new a.Value({}),f.userEventMap=new a.Value([{trigger:"click keydown",selector:".czr-scope-switch, .czr-skp-switch-link",name:"skope_switch",actions:function(){a.czr_activeSkopeId(f().id)}},{trigger:"click keydown",selector:".czr-scope-reset",name:"skope_reset_warning",actions:"reactOnSkopeResetUserRequest"}]),f.skopeResetDialogVisibility.bind(function(a,b){return f.skopeResetDialogReact(a)},{deferred:!0}),f.dirtyValues.callbacks.add(function(){return f.dirtyValuesReact.apply(f,arguments)}),f.changesetValues.callbacks.add(function(){return f.changesetValuesReact.apply(f,arguments)}),f.dbValues.callbacks.add(function(){return f.dbValuesReact.apply(f,arguments)}),f.callbacks.add(function(){return f.skopeReact.apply(f,arguments)}),f.set(c.omit(e,function(a,b){return c.contains(["db","changeset","has_db_val"],b)})),f.setupObservableViewValuesCallbacks(),f.dirtyness(!c.isEmpty(e.changeset)),f.hasDBValues(!c.isEmpty(e.db)),f.winner(e.is_winner),f.embedded.fail(function(){throw new Error("The container of skope "+f().id+" has not been embededd")}).done(function(){f.setupDOMListeners(f.userEventMap(),{dom_el:f.container}),f.isReady.resolve()})},ready:function(){var c=this;a.czr_skopeBase.skopeWrapperEmbedded.done(function(){try{b.when(c.embedSkopeDialogBox()).done(function(a){!1!==a.length?(a.css("background-color",c.color),c.container=a,c.embedded.resolve(a)):c.embedded.reject()})}catch(d){a.errorLog("In skope base : "+d),c.embedded.reject()}})},dirtyValuesReact:function(b,d){var e=this;e.dirtyness(!c.isEmpty(b)),a.czr_dirtyness(!c.isEmpty(b));var f=[];c.each(d,function(a,d){c.has(b,d)||f.push(d)}),e().id==a.czr_activeSkopeId()&&(c.each(f,function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("isDirty")(!1)}),c.each(b,function(b,d){c.has(a.control(d),"czr_states")&&a.control(d).czr_states("isDirty")(!0)}))},changesetValuesReact:function(a,c){var d=this,e=b.extend(!0,{},d.dirtyValues());d.dirtyValues(b.extend(e,a))},dbValuesReact:function(b,d){var e=this;e.hasDBValues(!c.isEmpty("global"!=e().skope?b:c.omit(b,function(b,c){return!a.czr_skopeBase.isThemeSetting(c)})));var f=[];c.each(d,function(a,d){c.has(b,d)||f.push(d)}),e().id==a.czr_activeSkopeId()&&(c.each(f,function(b){c.has(a.control(b),"czr_states")&&a.control(b).czr_states("hasDBVal")(!1)}),c.each(b,function(b,d){c.has(a.control(d),"czr_states")&&a.control(d).czr_states("hasDBVal")(!0)}))},skopeReact:function(d,e){var f=this,g=[],h=[];a.czr_skopeBase.isSkopeRegisteredInCollection(d.id)?(g=b.extend(!0,[],a.czr_skopeCollection()),h=g,c.each(g,function(a,b){a.id==f().id&&(h[b]=d)}),a.czr_skopeCollection(h)):(g=b.extend(!0,[],a.czr_skopeCollection()),g.push(d),a.czr_skopeCollection(g))},setupObservableViewValuesCallbacks:function(){var a=this;a.visible.bind(function(b){"pending"==a.embedded.state()?a.embedded.done(function(){a.container.toggle(b)}):a.container.toggle(b)}),a.active.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.activeStateReact.apply(a,arguments)}):a.activeStateReact.apply(a,arguments)}),a.dirtyness.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.dirtynessReact.apply(a,arguments)}):a.dirtynessReact.apply(a,arguments)}),a.hasDBValues.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.hasDBValuesReact.apply(a,arguments)}):a.hasDBValuesReact.apply(a,arguments)}),a.winner.bind(function(){"pending"==a.embedded.state()?a.embedded.done(function(){a.winnerReact.apply(a,arguments)}):a.winnerReact.apply(a,arguments)})},activeStateReact:function(a,c){var d=this;d.container.toggleClass("inactive",!a).toggleClass("active",a),b(".czr-scope-switch",d.container).toggleClass("fa-toggle-on",a).toggleClass("fa-toggle-off",!a)},dirtynessReact:function(a,c){var d=this;b.when(this.container.toggleClass("dirty",a)).done(function(){a?b(".czr-scope-reset",d.container).fadeIn("slow").attr("title",[serverControlParams.i18n.skope["Reset the current customizations for"],d().title].join(" ")):d.hasDBValues()||b(".czr-scope-reset",d.container).fadeOut("fast")})},hasDBValuesReact:function(a,c){var d=this;b.when(d.container.toggleClass("has-db-val",a)).done(function(){a?b(".czr-scope-reset",d.container).fadeIn("slow").attr("title",["global"==d().skope?serverControlParams.i18n.skope["Reset the theme options published sitewide"]:serverControlParams.i18n.skope["Reset your website published options for"],"global"==d().skope?"":d().title].join(" ")):d.dirtyness()||b(".czr-scope-reset",d.container).fadeOut("fast")})},winnerReact:function(d){var e=this;this.container.toggleClass("is_winner",d),d&&c.each(a.czr_currentSkopesCollection(),function(c){if(c.id!=e().id){var d=b.extend(!0,{},c);b.extend(d,{is_winner:!1}),a.czr_skope(c.id)(d)}})},updateSkopeDirties:function(c,d){var e=this;a.CZR_Helpers.getOptionName(c);if(!a.czr_skopeBase.isSettingSkopeEligible(c)&&"global"!=e().skope)return a.czr_skope(a.czr_skopeBase.getGlobalSkopeId()).updateSkopeDirties(c,d);var f=b.extend(!0,{},e.dirtyValues()),g={};return g[c]=d,e.dirtyValues.set(b.extend(f,g)),e.dirtyValues()},getSkopeSettingDirtyness:function(a){var b=this;return b.getSkopeSettingAPIDirtyness(a)||b.getSkopeSettingChangesetDirtyness(a)},getSkopeSettingAPIDirtyness:function(b){var d=this;return c.has(d.dirtyValues(),a.CZR_Helpers.build_setId(b))},getSkopeSettingChangesetDirtyness:function(b){var d=this;return a.czr_isChangeSetOn()?c.has(d.changesetValues(),a.CZR_Helpers.build_setId(b)):d.getSkopeSettingAPIDirtyness(b)},hasSkopeSettingDBValues:function(b){var d=a.CZR_Helpers.build_setId(b);return!c.isUndefined(a.czr_skope(a.czr_activeSkopeId()).dbValues()[d])}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{embedSkopeDialogBox:function(){var d=this,e=b.extend(!0,{},d()),f="";if(!b("#customize-header-actions").find(".czr-scope-switcher").length)throw new Error("The skope switcher wrapper is not printed, the skope can not be embedded.");try{f=wp.template("czr-skope")(c.extend(e,{el:d.el}))}catch(g){return a.errorLog("Error when parsing the template of a skope"+g),!1}return b(".czr-skopes-wrapper","#customize-header-actions").append(b(f)),b("."+d.el,".czr-skopes-wrapper")},renderResetWarningTmpl:function(){var d,e,f=this,g=b.extend(!0,{},f()),h="";f.dirtyness()?(d=[serverControlParams.i18n.skope["Please confirm that you want to reset your current ( not published ) customizations for"],f().ctx_title].join(" "),e=[serverControlParams.i18n.skope["Your customizations have been reset for"],f().ctx_title].join(" ")):(d=["global"==f().skope?serverControlParams.i18n.skope["Please confirm that you want to reset your sitewide published customizations. Note : this will not reset the customizations made in other option scopes"]:serverControlParams.i18n.skope["Please confirm that you want to reset your published customizations for"],"global"==f().skope?"":f().ctx_title].join(" "),e=[serverControlParams.i18n.skope["Your published customizations have been reset for"],f().title].join(" "));try{h=wp.template("czr-skope-pane")(c.extend(g,{el:f.el,warning_message:d+".",success_message:e+"."}))}catch(i){return a.errorLog("Error when parsing the the reset skope template : "+i),!1}return b("#customize-preview").after(b(h)),b("#czr-skope-pane")},getEl:function(){var a=this;return b(a.el,"#customize-header-actions")}})}(wp.customize,jQuery,_);var CZRSkopeMths=CZRSkopeMths||{};!function(a,b,c){b.extend(CZRSkopeMths,{reactOnSkopeResetUserRequest:function(){var b=this,c=function(){a.state("czr-resetting")(!0),a.czr_activeSkopeId()!=b().id?a.czr_activeSkopeId(b().id).done(function(){b.skopeResetDialogVisibility(!b.skopeResetDialogVisibility()).done(function(){a.state("czr-resetting")(!1)})}):b.skopeResetDialogVisibility(!b.skopeResetDialogVisibility()).done(function(){a.state("czr-resetting")(!1)})};return a.state("czr-resetting")()||0!==a.state("processing")()?void a.czr_serverNotification({message:"Slow down, you move too fast !",status:"success",auto_collapse:!0}):void(a.czr_activeSkopeId()!=b().id&&a.czr_skope(a.czr_activeSkopeId()).skopeResetDialogVisibility()?a.czr_skope(a.czr_activeSkopeId()).skopeResetDialogVisibility(!1).done(function(){c()}):c())},skopeResetDialogReact:function(d){var e=this,f=b.Deferred();return e.userResetEventMap=e.userResetEventMap||new a.Value([{trigger:"click keydown",selector:".czr-scope-reset-cancel",name:"skope_reset_cancel",actions:function(){e.skopeResetDialogVisibility(!e.skopeResetDialogVisibility())}},{trigger:"click keydown",selector:".czr-scope-do-reset",name:"skope_do_reset",actions:"doResetSkopeValues"}]),d?(a.czr_isResettingSkope(e().id),b.when(e.renderResetWarningTmpl()).done(function(a){e.resetPanel=a,e.resetPanel.addClass(e.dirtyness()?"dirty-reset":"db-reset"),e.setupDOMListeners(e.userResetEventMap(),{dom_el:e.resetPanel})}).then(function(){setTimeout(function(){var a=b("#customize-preview").height();e.resetPanel.css("line-height",a+"px").css("height",a+"px"),b("body").addClass("czr-skope-pane-open")},50)})):b.when(b("body").removeClass("czr-skope-pane-open")).done(function(){c.has(e,"resetPanel")&&!1!==e.resetPanel.length&&setTimeout(function(){e.resetPanel.remove(),a.czr_isResettingSkope(!1)},300)}),c.delay(function(){f.resolve()},350),f.promise()},doResetSkopeValues:function(){var d=this,e=d().id,f=d.dirtyness()?"_resetSkopeDirties":"_resetSkopeAPIValues",g=function(){var g=function(){a.czr_skopeBase.processSilentUpdates({refresh:!1}).fail(function(){a.consoleLog("Silent update failed after resetting skope : "+e)}).done(function(){b.when(b(".czr-reset-warning",d.resetPanel).fadeOut("300")).done(function(){b.when(b(".czr-reset-success",d.resetPanel).fadeIn("300")).done(function(){c.delay(function(){a.czr_isResettingSkope(!1),d.skopeResetDialogVisibility(!1)},2e3)})})})};d[f]().done(function(){a.previewer.refresh().fail(function(b){a.consoleLog("SKOPE RESET REFRESH FAILED",b)}).done(function(b){if("global"==a.czr_skope(e)().skope&&"_resetSkopeAPIValues"==f){var d,h={},i=a.czr_skope(e)().opt_name;!c.isUndefined(b.skopesServerData)&&c.has(b.skopesServerData,"czr_skopes")&&(d=b.skopesServerData.czr_skopes,c.isUndefined(c.findWhere(d,{opt_name:i}))&&(h=c.findWhere(d,{opt_name:i}).db||{})),a.czr_skopeBase.maybeSynchronizeGlobalSkope({isGlobalReset:!0,isSkope:!0,skopeIdToReset:e}).done(function(){g()})}else g()})})};b("body").addClass("czr-resetting-skope"),a.czr_skopeReset[d.dirtyness()?"resetChangeset":"resetPublished"]({skope_id:d().id,is_skope:!0}).always(function(){b("body").removeClass("czr-resetting-skope")}).done(function(a){g()}).fail(function(b){d.skopeResetDialogVisibility(!1),a.consoleLog("Skope reset failed",b)})},_resetSkopeDirties:function(){var a=this,c=b.Deferred();return a.dirtyValues({}),a.changesetValues({}),c.resolve().promise()},_resetSkopeAPIValues:function(){var a=this,c=b.Deferred();return a.dbValues({}),c.resolve().promise()}})}(wp.customize,jQuery,_),function(a,b,c){a.Value.prototype.set=function(d,e){var f=this._value,g=b.Deferred(),h=this,i=[];return d=this._setter.apply(this,arguments),d=this.validate(d),args=c.extend({silent:!1},c.isObject(e)?e:{}),null===d||c.isEqual(f,d)?g.resolveWith(h,[d,f,e]).promise():(this._value=d,this._dirty=!0,!0===args.silent?g.resolveWith(h,[d,f,e]).promise():this._deferreds?(c.each(h._deferreds,function(a){i.push(a.apply(null,[d,f,e]))}),b.when.apply(null,i).fail(function(){a.errorLog("A deferred callback failed in api.Value::set()")}).then(function(){h.callbacks.fireWith(h,[d,f,e]),g.resolveWith(h,[d,f,e])}),g.promise(h)):(this.callbacks.fireWith(this,[d,f,e]),g.resolveWith(h,[d,f,e]).promise(h)))},a.Value.prototype.bind=function(){var a=this,d=!1,e=[];return b.each(arguments,function(a,b){d||(d=c.isObject(b)&&b.deferred),c.isFunction(b)&&e.push(b)}),d?(a._deferreds=a._deferreds||[],c.each(e,function(b){c.contains(b,a._deferreds)||a._deferreds.push(b)})):a.callbacks.add.apply(a.callbacks,arguments),
14
+ this},a.Setting.prototype.silent_set=function(b,d){var e=this._value,f=a.state("saved")();return b=this._setter.apply(this,arguments),b=this.validate(b),null===b||c.isEqual(e,b)?this:(this._value=b,this._dirty=c.isUndefined(d)||!c.isBoolean(d)?this._dirty:d,this.callbacks.fireWith(this,[b,e,{silent:!0}]),a.state("saved")(f),this)}}(wp.customize,jQuery,_),function(a,b,c){a.bind("ready",function(){if(serverControlParams.isSkopOn){var d=a.previewer.query;a.previewer.query=function(e){if(!serverControlParams.isSkopOn)return d.apply(this);if(!c.has(a,"czr_skope"))return a.consoleLog("QUERY : SKOPE IS NOT FULLY READY YEY. FALLING BACK ON CORE QUERY"),d.apply(this);if("pending"==a.czr_initialSkopeCollectionPopulated.state())return a.consoleLog("QUERY : INITIAL SKOPE COLLECTION NOT POPULATED YET. FALLING BACK ON CORE QUERY"),d.apply(this);if("pending"==a.czr_isPreviewerSkopeAware.state()&&a.czr_isPreviewerSkopeAware.resolve(),!c.isObject(e)&&"resolved"==a.czr_initialSkopeCollectionPopulated.state()&&"resolved"==a.czr_initialSkopeCollectionPopulated.state())return d.apply(this);!c.isUndefined(e.skope_id)&&c.isString(e.skope_id)||(e.skope_id=a.czr_activeSkopeId()||a.czr_skopeBase.getGlobalSkopeId());var f,g={},h={},i={skope_id:null,action:null,the_dirties:{},dyn_type:null,opt_name:null};if(e=b.extend(i,e),!c.isObject(e.the_dirties))throw a.consoleLog("QUERY PARAMS : ",e),new Error("QUERY DIRTIES MUST BE AN OBJECT. Requested action : "+e.action);if("pending"!=a.czr_isPreviewerSkopeAware.state()&&c.isNull(e.skope_id))throw a.consoleLog("QUERY PARAMS : ",e),new Error("OVERRIDEN QUERY : NO SKOPE ID. FALLING BACK ON CORE QUERY. Requested action : "+e.action);if(!c.contains([null,"refresh","save","reset","changeset_update"],e.action))throw a.consoleLog("QUERY PARAMS : ",e),new Error("A REQUESTED QUERY HAS NO AUTHORIZED ACTION. Requested action : "+e.action);var j=function(){if("pending"==a.czr_initialSkopeCollectionPopulated.state())return{};var b={};return c.each(a.czr_currentSkopesCollection(),function(c){"global"!=c.skope&&(b[c.id]=a.czr_skopeBase.getSkopeDirties(c.id))}),b};switch(c.isNull(e.the_dirties)||c.isEmpty(e.the_dirties)?(g=a.dirtyValues({unsaved:e.excludeCustomizedSaved||!1}),h=j()):"global"==a.czr_skopeBase.getActiveSkopeName()?g=e.the_dirties:h[a.czr_activeSkopeId()]=e.the_dirties,e.action){case null:case"refresh":break;case"changeset_update":if(c.isUndefined(e.opt_name))throw new Error("Missing opt_name param in the changeset_update query for skope : "+e.skope_id);break;case"save":if(c.isNull(e.dyn_type)&&(e.dyn_type=a.czr_skope(e.skope_id)().dyn_type),c.isNull(e.dyn_type)||c.isUndefined(e.dyn_type))throw new Error("QUERY : A SAVE QUERY MUST HAVE A VALID DYN TYPE."+e.skope_id);break;case"reset":if(c.isNull(e.dyn_type)&&(e.dyn_type=a.czr_skope(e.skope_id)().dyn_type),c.isNull(e.dyn_type)||c.isUndefined(e.dyn_type))throw new Error("QUERY : A RESET QUERY MUST HAVE A VALID DYN TYPE."+e.skope_id)}var k={};return c.each(a.czr_currentSkopesCollection(),function(a){k[a.skope]={id:a.id,opt_name:a.opt_name}}),f={wp_customize:"on",customized:"{}"==JSON.stringify(g)?'{"__not_customized__"}':JSON.stringify(g),skopeCustomized:JSON.stringify(h),nonce:this.nonce.preview,skope:a.czr_skope(e.skope_id)().skope,level_id:a.czr_skope(e.skope_id)().level,skope_id:e.skope_id,dyn_type:e.dyn_type,opt_name:c.isNull(e.opt_name)?a.czr_skope(e.skope_id)().opt_name:e.opt_name,obj_id:a.czr_skope(e.skope_id)().obj_id,current_skopes:JSON.stringify(k)||{},channel:this.channel(),revisionIndex:a._latestRevision},f=a.czr_isChangeSetOn()?b.extend(f,{customize_theme:a.settings.theme.stylesheet,customize_changeset_uuid:a.settings.changeset.uuid}):b.extend(f,{theme:a.settings.theme.stylesheet})}}})}(wp.customize,jQuery,_),function(a,b,c){a.bind("czr-skope-started",function(){a.previewer.save=function(b){return a.czr_skopeSave.save()}})}(wp.customize,jQuery,_),function(a,b,c){if(serverControlParams.isSkopOn){a.Element.synchronizer.checkbox.update=function(a){this.element.prop("checked",a),this.element.iCheck("update")};var d=a.Element.synchronizer.val.update;a.Element.synchronizer.val.update=function(b){var c=this,e=function(){c.element.is("select")?c.element.val(b).trigger("change"):c.element.hasClass("wp-color-picker")?c.element.val(b).trigger("change"):c.element.val(b)};if(serverControlParams.isSkopOn){if("resolved"!=a.czr_skopeReady.state())return d.call(c,b);a.czr_skopeReady.then(function(){e()})}else e()},a.Element.synchronizer.val.refresh=function(){var a=this;return this.element.is("select")&&c.isNull(this.element.val())?c.isArray(a())?[]:c.isObject(a())?{}:"":this.element.val()}}}(wp.customize,jQuery,_),function(a,b,c){var d=a.Previewer.prototype.refresh,e=function(f){f=c.extend({waitSkopeSynced:!0,the_dirties:{}},f);var g=this,h=b.Deferred();if(!serverControlParams.isSkopOn)return h.resolve().promise();if(c.has(a,"czr_activeSkopeId")&&!c.isUndefined(a.czr_activeSkopeId())||a.consoleLog("The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method."),!c.has(a,"czr_activeSkopeId")&&"resolved"!=a.czr_skopeReady.state())return a.czr_skopeReady.done(function(){e.apply(a.previewer,f)}),d.apply(g),h.resolve().promise();g.send("loading-initiated"),g.abort();var i=a.czr_getSkopeQueryParams({skope_id:a.czr_activeSkopeId(),action:"refresh",the_dirties:f.the_dirties||{}});return g.loading=new a.PreviewFrame({url:g.url(),previewUrl:g.previewUrl(),query:g.query(i)||{},container:g.container,signature:"WP_CUSTOMIZER_SIGNATURE"}),g.settingsModifiedWhileLoading={},onSettingChange=function(a){g.settingsModifiedWhileLoading[a.id]=!0},a.bind("change",onSettingChange),g.loading.always(function(){a.unbind("change",onSettingChange)}),a.czr_isChangeSetOn()||(g._previousPreview=g._previousPreview||g.preview),g.loading.done(function(b){var c,d=this;g.preview=d,g.targetWindow(d.targetWindow()),g.channel(d.channel()),c=function(b){d.unbind("synced",c),d.unbind("czr-skopes-synced",c),g._previousPreview?g._previousPreview.destroy():g.preview&&g.preview.destroy(),g._previousPreview=g.preview,g.deferred.active.resolve(),delete g.loading,a.trigger("pre_refresh_done",{previewer:g,skopesServerData:b||{}}),h.resolve({previewer:g,skopesServerData:b||{}})},a.czr_isChangeSetOn()||g.send("sync",{scroll:g.scroll,settings:a.get()}),f.waitSkopeSynced?d.bind("czr-skopes-synced",c):d.bind("synced",c),g.trigger("ready",b)}),g.loading.fail(function(b,c){a.consoleLog("LOADING FAILED : ",arguments),g.send("loading-failed"),a.czr_isChangeSetOn()||"redirect"===b&&c&&g.previewUrl(c),"logged out"===b&&(g.preview&&(g.preview.destroy(),delete g.preview),g.login().done(g.refresh)),"cheatin"===b&&g.cheatin(),h.reject(b)}),h.promise()};a.bind("czr-skope-started",function(){czr_override_refresh_for_skope(),a.Previewer.prototype.refresh=e}),a.czr_getSkopeQueryParams=function(d){if(!a.czr_isChangeSetOn())return d;d=c.isObject(d)?d:{};var e=d.action||"refresh";switch(e){case"refresh":d=b.extend(d,{excludeCustomizedSaved:!0})}return d},czr_override_refresh_for_skope=function(){serverControlParams.isSkopOn&&(a.previewer.refresh=function(d){var f=b.Deferred(),g=function(b){var c,d=function(){return 0===a.state("processing").get()},g=function(){e.call(a.previewer,b).done(function(a){f.resolve(a)})};d()?g():(c=function(){d()&&(g(),a.state("processing").unbind(c))},a.state("processing").bind(c))};return g=c.debounce(g,a.previewer.refreshBuffer),g(d),f.promise()})}}(wp.customize,jQuery,_),function(a,b,c){serverControlParams.isSkopOn&&(a.dirtyValues=function(b){return a.czr_skopeBase.getSkopeDirties(a.czr_skopeBase.getGlobalSkopeId(),b)})}(wp.customize,jQuery,_),function(a,b,c){if(serverControlParams.isSkopOn&&a.czr_isChangeSetOn()){var d=a.requestChangesetUpdate;a.requestChangesetUpdate=function(e){var f=b.Deferred(),g=[],h=[],i=e||{},j=[],k=[],l=b.Deferred();if(!serverControlParams.isSkopOn)return d();(0===a._lastSavedRevision||c.isEmpty(a.state("changesetStatus")()))&&(i=c.extend(i,{blogname:{dummy_change:"dummy_change"}})),c.each(a.czr_currentSkopesCollection(),function(a){"global"!=a.skope&&g.push(a.id)});var m=function(d){if(c.isUndefined(g[d+1])&&h.length==g.length){if(c.isEmpty(j))l.resolve(k);else{var e=function(){var d=[];return c.each(j,function(b){d.push(a.czr_skopeBase.buildServerResponse(b))}),b.trim(d.join(" | "))};l.reject(e())}return!0}},n=function(b){return(c.isUndefined(b)||0==b)&&a.state("processing").set(1),b=b||0,c.isUndefined(g[b])?(a.consoleLog("Undefined Skope in changeset recursive call ",b,g,g[b]),l.resolve(k).promise()):(a._requestSkopeChangetsetUpdate(e,g[b]).always(function(){h.push(b)}).fail(function(c){j.push(c),a.consoleLog("CHANGESET UPDATE RECURSIVE FAIL FOR SKOPE : ",g[b]),m(b)||n(b+1)}).done(function(a){k.push(a),m(b)||n(b+1)}),l.promise())},o=a._lastSavedRevision;return d(i).fail(function(b){a.consoleLog("WP requestChangesetUpdateFail",b,a.czr_skopeBase.buildServerResponse(b)),a._lastSavedRevision=Math.max(a._latestRevision,a._lastSavedRevision),a.state("processing").set(0),f.reject(b),b=a.czr_skopeBase.buildServerResponse(b),a.czr_serverNotification({message:b,status:"error"})}).done(function(b){"pending"==a.czr_initialSkopeCollectionPopulated.state()&&f.resolve(b),a._lastSavedRevision=o,n().always(function(){a._lastSavedRevision=Math.max(a._latestRevision,a._lastSavedRevision),a.state("processing").set(0)}).fail(function(b){f.reject(b),a.consoleLog("CHANGESET UPDATE RECURSIVE PUSH FAIL",b,k),a.trigger("changeset-error",b),a.czr_serverNotification({message:b,status:"error"})}).done(function(){f.resolve(b)})}),f.promise()},a._requestSkopeChangetsetUpdate=function(d,e){if(c.isUndefined(e)||!a.czr_skope.has(e))throw new Error("In api._requestSkopeChangetsetUpdate() : a valid and registered skope_id must be provided");var f,g=new b.Deferred,h={};if(e=e||a.czr_activeSkopeId(),d&&c.extend(h,d),c.each(a.czr_skopeBase.getSkopeDirties(e),function(a,b){d&&null===d[b]||(h[b]=c.extend({},h[b]||{},{value:a}))}),c.isEmpty(h))return g.resolve({}),g.promise();if(a._latestRevision<=a._lastSavedRevision)return g.resolve({}),g.promise();a.trigger("skope-changeset-save",h);var i={skope_id:e,action:"changeset_update",opt_name:a.czr_skope(e).opt_name};return f=a.previewer.query(c.extend(i,{excludeCustomizedSaved:!0})),delete f.customized,c.extend(f,{nonce:a.settings.nonce.save,customize_changeset_data:JSON.stringify(h)}),wp.ajax.post("customize_skope_changeset_save",f).done(function(a){g.resolve(a)}).fail(function(b){a.consoleLog("SKOPE CHANGESET FAIL FOR SKOPE "+b.skope_id,b),g.reject(b)}).always(function(b){b.setting_validities&&a._handleSettingValidities({settingValidities:b.setting_validities})}),g.promise()}}}(wp.customize,jQuery,_),function(a,b,c){a.Setting.prototype.initialize=function(b,c,d){var e=this;a.Value.prototype.initialize.call(e,c,d),e.id=b,e.transport=e.transport||"refresh",e._dirty=d.dirty||!1,e.notifications=new a.Values({defaultConstructor:a.Notification}),e.bind(e.preview)},a.Setting.prototype.preview=function(d,e,f){var g,h=this,i=b.Deferred();return g=h.transport,serverControlParams.isSkopOn&&a.czr_isPreviewerSkopeAware&&"pending"==a.czr_isPreviewerSkopeAware.state()?(this.previewer.refresh(),i.resolve(arguments).promise()):c.isUndefined(e)||c.isEmpty(e)||c.isNull(e)||!c.isObject(f)||!0!==f.not_preview_sent?c.has(f,"silent")&&!1!==f.silent?i.resolve(arguments).promise():("postMessage"!==g||a.state("previewerAlive").get()||(g="refresh"),"postMessage"===g?(h.previewer.send("pre_setting",{set_id:h.id,data:f,value:d}),h.previewer.send("setting",[h.id,h()]),i.resolve(arguments)):"refresh"===g&&(serverControlParams.isSkopOn?h.previewer.refresh().always(function(){i.resolve(arguments)}):(h.previewer.refresh(),i.resolve(arguments))),i.promise()):i.resolve(arguments).promise()}}(wp.customize,jQuery,_),function(a,b,c){if("function"==typeof a.Section){var d=a.Section.prototype.initialize;a.Section.prototype.initialize=function(a,e){d.apply(this,[a,e]);var f=this;this.expanded.callbacks.add(function(a){if(a){var d=f.container.closest(".wp-full-overlay-sidebar-content"),e=f.container.find(".accordion-section-content");_resizeContentHeight=function(){e.css("height",d.innerHeight())},_resizeContentHeight(),b(window).on("resize.customizer-section",c.debounce(_resizeContentHeight,110))}})}}}(wp.customize,jQuery,_),function(a,b,c){a.CZR_Helpers=a.CZR_Helpers||{},a.CZR_Helpers=b.extend(a.CZR_Helpers,{getControlSettingId:function(b,d){return d="default",a.control.has(b)?!c.has(a.control(b),"settings")||c.isEmpty(a.control(b).settings)?b:c.has(a.control(b).settings,d)?c.isUndefined(a.control(b).settings[d].id)?(a.consoleLog("getControlSettingId : The requested control_id has no setting id assigned : "+b),b):a.control(b).settings[d].id:(a.consoleLog("getControlSettingId : The requested control_id does not have the requested setting type : "+b+" , "+d),b):(a.consoleLog("getControlSettingId : The requested control_id is not registered in the api yet : "+b),b)},getDocSearchLink:function(a){a=c.isString(a)?a:"";var b=a.replace(/ /g,"+"),d=[serverControlParams.docURL,"search?query=",b].join("");return['<a href="'+d+'" title="'+serverControlParams.i18n.readDocumentation+'" target="_blank">'," ",'<span class="fa fa-question-circle-o"></span>'].join("")},build_setId:function(a){return c.contains(serverControlParams.wpBuiltinSettings,a)?a:c.contains(serverControlParams.themeSettingList,a)&&-1==a.indexOf(serverControlParams.themeOptions)?[serverControlParams.themeOptions+"[",a,"]"].join(""):a},getOptionName:function(a){return-1==a.indexOf(serverControlParams.themeOptions)?a:a.replace(/\[|\]/g,"").replace(serverControlParams.themeOptions,"")},hasPartRefresh:function(b){if(c.has(a,"czr_partials"))return c.contains(c.map(a.czr_partials(),function(a,d){return c.contains(a.settings,b)}),!0)},getSectionControlIds:function(b){return b=b||a.czr_activeSectionId(),a.section.has(b)?c.map(a.section(b).controls(),function(a){return a.id}):[]},getSectionSettingIds:function(b){if(b=b||a.czr_activeSectionId(),a.section.has(b)){var d=this,e=[],f=d.getSectionControlIds(b);return c.each(f,function(b){c.each(a.control(b).settings,function(a,b){e.push(a.id)})}),e}},capitalize:function(a){return c.isString(a)?a.charAt(0).toUpperCase()+a.slice(1):a},truncate:function(a,b,d){if(!c.isString(a))return"";b=b||20;var e=a.length>b,f=e?a.substr(0,b-1):a;return f=d&&e?f.substr(0,f.lastIndexOf(" ")):f,e?f+"...":f},isMultiItemModule:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].crud||a.czrModuleMap[b].multi_item||!1}},isCrudModule:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].crud||!1}},hasModuleModOpt:function(b,d){if(!c.isUndefined(b)||c.isObject(d)){if(c.isObject(d)&&c.has(d,"module_type"))b=d.module_type;else if(c.isUndefined(b)||c.isNull(b))return;if(c.has(a.czrModuleMap,b))return a.czrModuleMap[b].has_mod_opt||!1}},setupInputCollectionFromDOM:function(){var d=this;if(!c.isFunction(d))throw new Error("setupInputCollectionFromDOM : inputParentInst is not valid.");var e=d.module,f=c.has(d(),"is_mod_opt");if(!c.has(d,"czr_Input")||c.isEmpty(d.inputCollection())){d.czr_Input=new a.Values,d.inputConstructor=f?e.inputModOptConstructor:e.inputConstructor;var g=f?d.defaultModOptModel:d.defaultItemModel;if(c.isEmpty(g)||c.isUndefined(g))throw new Error("No default model found in item or mod opt "+d.id+".");var h=b.extend(!0,{},d());h=c.isObject(h)?b.extend(g,h):g;var i={};return b("."+e.control.css_attr.sub_set_wrapper,d.container).each(function(g){var j=b(this).find("[data-type]").attr("data-type"),k=c.has(h,j)?h[j]:"";if(c.isUndefined(j)||c.isEmpty(j))return void a.consoleLog("setupInputCollectionFromDOM : missing data-type for "+e.id);if(!c.has(h,j))throw new Error("The item or mod opt property : "+j+" has been found in the DOM but not in the item or mod opt model : "+d.id+". The input can not be instantiated.");var l=b(this).attr("data-input-type"),m=b(this).attr("data-transport")||"inherit",n=c.has(e.inputOptions,l)?e.inputOptions[l]:{};d.czr_Input.add(j,new d.inputConstructor(j,{id:j,type:l,transport:m,input_value:k,input_options:n,container:b(this),input_parent:d,is_mod_opt:f,module:e})),d.czr_Input(j).ready(),i[j]=k}),d.inputCollection(i),d}},removeInputCollection:function(){var a=this;if(!c.isFunction(a))throw new Error("removeInputCollection : inputParentInst is not valid.");c.has(a,"czr_Input")&&(a.czr_Input.each(function(b){a.czr_Input.remove(b.id)}),a.inputCollection({}))},refreshModuleControl:function(c){var d=a.controlConstructor.czr_module,e=(a.control(c).params.type,a.settings.controls[c]);b.when(a.control(c).container.remove()).done(function(){a.control.remove(c),a.control.add(c,new d(c,{params:e,previewer:a.previewer}))})},hexToRgb:function(b){var c=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;try{b=b.replace(c,function(a,b,c,d){return b+b+c+c+d+d})}catch(d){return a.errorLog("Error in Helpers::hexToRgb : "+d),b}var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b);return e=e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:[],"rgb("+e.join(",")+")"},rgbToHex:function(a,b,c){var d=function(a){var b=a.toString(16);return 1==b.length?"0"+b:b};return"#"+d(a)+d(b)+d(c)}})}(wp.customize,jQuery,_),function(a,b,c){a.CZR_Helpers=a.CZR_Helpers||{},a.CZR_Helpers=b.extend(a.CZR_Helpers,{addActions:function(a,b,d){var e=this;d=d||e,d[a]=d[a]||[],new_event_map=c.clone(d[a]),d[a]=c.union(new_event_map,c.isArray(b)?b:[b])},doActions:function(a,b,c){b.trigger(a,c)},setupDOMListeners:function(d,e,f){var g=this,h={model:{},dom_el:{}};return f=f||g,c.isArray(d)?c.isObject(e)?(e=c.extend(h,e),!e.dom_el instanceof jQuery||1!=e.dom_el.length?void a.errorLog("setupDomListeners : dom element should be an existing dom element",e):void c.map(d,function(d){return!c.isString(d.selector)||c.isEmpty(d.selector)?void a.errorLog("setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : "+d.actions.join(",")):!c.isString(d.selector)||c.isEmpty(d.selector)?void a.errorLog("setupDOMListeners : selector must be a string not empty. Aborting setup of action(s) : "+d.actions.join(",")):void e.dom_el.on(d.trigger,d.selector,function(h,i){if(h.stopPropagation(),!a.utils.isKeydownButNotEnterEvent(h)){h.preventDefault();var j=b.extend(!0,{},e);if(c.has(j,"model")&&c.has(j.model,"id")&&(c.has(f,"get")?j.model=f():j.model=f.getModel(j.model.id)),b.extend(j,{event:d,dom_event:h}),b.extend(j,i),!c.has(j,"event")||!c.has(j.event,"actions"))return void a.errorLog("executeEventActionChain : missing obj.event or obj.event.actions");try{g.executeEventActionChain(j,f)}catch(k){a.errorLog("In setupDOMListeners : problem when trying to fire actions : "+j.event.actions),a.errorLog("Error : "+k)}}})})):void a.errorLog("setupDomListeners : args should be an object",d):void a.errorLog("setupDomListeners : event_map should be an array",e)},executeEventActionChain:function(a,b){var d=this;if("function"==typeof a.event.actions)return a.event.actions.call(b,a);c.isArray(a.event.actions)||(a.event.actions=[a.event.actions]);var e=!1;c.map(a.event.actions,function(f){if(!e){if("function"!=typeof b[f])throw new Error("executeEventActionChain : the action : "+f+" has not been found when firing event : "+a.event.selector);var g=c.has(a,"dom_el")&&-1!=a.dom_el.length?a.dom_el:d.container;g.trigger("before_"+f,c.omit(a,"event"));var h=b[f].call(b,a);!1===h&&(e=!0),g.trigger("after_"+f,c.omit(a,"event"))}})}})}(wp.customize,jQuery,_),function(a,b,c){a.czr_wpQueryDataReady=b.Deferred(),a.czr_wpQueryInfos=a.czr_wpQueryInfos||new a.Value,a.czr_partials=a.czr_partials||new a.Value,a.bind("ready",function(){a.previewer.bind("houston-widget-settings",function(b){var d=c.filter(b.registeredSidebars,function(a){return!c.findWhere(_wpCustomizeWidgetsSettings.registeredSidebars,{id:a.id})}),e=c.filter(b.registeredSidebars,function(a){return!c.has(b.renderedSidebars,a.id)});e=c.map(e,function(a){return a.id});var f=c.map(b.registeredSidebars,function(a){return a.id});a.czr_widgetZoneSettings=a.czr_widgetZoneSettings||new a.Value,a.czr_widgetZoneSettings.set({actives:b.renderedSidebars,inactives:e,registered:f,candidates:d,available_locations:b.availableWidgetLocations})}),a.previewer.bind("czr-query-data-ready",function(b){a.czr_wpQueryInfos(b),"pending"==a.czr_wpQueryDataReady.state()&&a.czr_wpQueryDataReady.resolve(b)}),a.previewer.bind("czr-partial-refresh-data",function(b){a.czr_partials.set(b)}),a.previewer.bind("czr-partial-refresh-done",function(b){if(c.has(b,"set_id")){var d=a.CZR_Helpers.build_setId(b.set_id);if(a.has(d)){var e=a.CZR_Helpers.getControlSettingId(d);a.control.has(e)&&a.control(e).trigger("czr-partial-refresh-done")}}})})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{initialize:function(d,e){if(c.isUndefined(e.input_parent)||c.isEmpty(e.input_parent))throw new Error("No input_parent assigned to input "+e.id+". Aborting");if(c.isUndefined(e.module))throw new Error("No module assigned to input "+e.id+". Aborting");a.Value.prototype.initialize.call(this,null,e);var f=this;if(b.extend(f,e||{}),f.isReady=b.Deferred(),c.isUndefined(e.input_value)||f.set(e.input_value),a.czrInputMap&&c.has(a.czrInputMap,f.type)){var g=a.czrInputMap[f.type];c.isFunction(f[g])&&f[g](e.input_options||null)}else a.consoleLog("Warning an input : "+f.id+" has no corresponding method defined in api.czrInputMap.");var h={text:"keyup",textarea:"keyup",password:"keyup",color:"colorpickerchange",range:"input propertychange"};f.input_event_map=[{trigger:b.trim(["change",h[f.type]||""].join(" ")),selector:"input[data-type], select[data-type], textarea[data-type]",name:"set_input_value",actions:function(a){if(!c.has(f.input_parent,"syncElements")||!c.has(f.input_parent.syncElements,f.id))throw new Error("WARNING : THE INPUT "+f.id+" HAS NO SYNCED ELEMENT.")}}],f.visible=new a.Value((!0)),f.isReady.done(function(){f.visible.bind(function(a){a?f.container.stop(!0,!0).slideDown(200):f.container.stop(!0,!0).slideUp(200)})})},ready:function(){var a=this;a.setupDOMListeners(a.input_event_map,{dom_el:a.container},a),a.callbacks.add(function(){return a.inputReact.apply(a,arguments)}),b.when(a.setupSynchronizer()).done(function(){a.isReady.resolve(a)})},setupSynchronizer:function(){var b=this,c=b.input_parent,d=b.container.find("[data-type]"),e=b.container.find("[data-type]").is("textarea");if(e)throw new Error("TO DO : THE TEXTAREA INPUT ARE NOT READY IN THE SYNCHRONIZER!");var f=new a.Element(d);c.syncElements=c.syncElements||{},c.syncElements[b.id]=f,f.sync(b),f.set(b())},inputReact:function(a,b,d){var e=this,f=e.input_parent(),g=c.clone(f),h=e.is_preItemInput;g=!c.isObject(g)||c.isEmpty(g)?{}:g,g[e.id]=a,e.input_parent.set(g,{input_changed:e.id,input_transport:e.transport,not_preview_sent:"postMessage"===e.transport}),h||(e.input_parent.trigger(e.id+":changed",a),c.isEmpty(b)&&(c.isUndefined(b)||"postMessage"!==e.transport)||e.module.sendInputToPreview({input_id:e.id,input_parent_id:e.input_parent.id,to:a,from:b}))},setupColorPicker:function(){var a=this;a.container.find("input").iris({palettes:!0,hide:!1,change:function(a,c){b(this).val(c.color.toString()).trigger("colorpickerchange").trigger("change")}})},setupSelect:function(){var a=this;b("select",a.container).not(".no-selecter-js").each(function(){b(this).selecter({})})},setupIcheck:function(a){var c=this;b("input[type=checkbox]",c.container).each(function(a){0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",checkedClass:"checked",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},setupStepper:function(a){var c=this;b('input[type="number"]',c.container).each(function(a){b(this).stepper()})},setupRangeSlider:function(a){var c,d=this,e=function(a,b){a.textContent=b+"%"};b(d.container).find("input").rangeslider({polyfill:!1,rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",onInit:function(){c=b(".rangeslider__handle",this.$range),b(".rangeslider__handle",this.$range),e(c[0],this.value)}}).on("input",function(){e(c[0],this.value)})}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupImageUploader:function(){var a=this,c=a();return a.attachment={},a.container?(this.tmplRendered=b.Deferred(),this.setupContentRendering(c,{}),void this.tmplRendered.done(function(){a.czrImgUploaderBinding()})):this},setupContentRendering:function(a,b){var d,e=this;e.attachment.id!=a&&b!==a?(a||(e.attachment={},e.renderImageUploaderTemplate()),d=wp.media.attachment(a),c.isObject(d)&&c.has(d,"attributes")&&c.has(d.attributes,"sizes")?(e.attachment=d.attributes,e.renderImageUploaderTemplate()):wp.media.attachment(a).fetch().done(function(){e.attachment=this.attributes,e.renderImageUploaderTemplate()})):e.attachment.id&&e.attachment.id!==a||e.renderImageUploaderTemplate()},czrImgUploaderBinding:function(){var a=this;c.bindAll(a,"czrImgUploadRemoveFile","czrImgUploadOpenFrame","czrImgUploadSelect"),a.container.on("click keydown",".upload-button",a.czrImgUploadOpenFrame),a.container.on("click keydown",".thumbnail-image img",a.czrImgUploadOpenFrame),a.container.on("click keydown",".remove-button",a.czrImgUploadRemoveFile),a.bind(a.id+":changed",function(c,d){a.tmplRendered=b.Deferred(),a.setupContentRendering(c,d)})},czrImgUploadOpenFrame:function(b){a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),this.frame||this.czrImgUploadInitFrame(),this.frame.open())},czrImgUploadInitFrame:function(){var a=this,b=this.getUploaderLabels();a.frame=wp.media({button:{text:b.frame_button},states:[new wp.media.controller.Library({title:b.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1})]}),a.frame.on("select",a.czrImgUploadSelect)},czrImgUploadRemoveFile:function(b){var c=this;a.utils.isKeydownButNotEnterEvent(b)||(b.preventDefault(),c.attachment={},c.set(""))},czrImgUploadSelect:function(){var a=this,b=a.frame.state().get("selection").first().toJSON();window._wpmejsSettings||{};a.attachment=b,a.set(b.id)},renderImageUploaderTemplate:function(){var a=this;if(0!==b("#tmpl-czr-input-img-uploader-view-content").length){var c=wp.template("czr-input-img-uploader-view-content");if(c&&a.container){var d=a.container.find("."+a.module.control.css_attr.img_upload_container);if(d.length){var e={button_labels:a.getUploaderLabels(),settings:a.id,attachment:a.attachment,canUpload:!0};return d.html(c(e)),a.tmplRendered.resolve(),a.container.trigger(a.id+":content_rendered"),!0}}}},getUploaderLabels:function(){var b=serverControlParams.i18n,d={select:b.select_image,change:b.change_image,remove:b.remove_image,"default":b.default_image,placeholder:b.placeholder_image,frame_title:b.frame_title_image,frame_button:b.frame_button_image};return c.each(d,function(b,d){if(c.isUndefined(b)){var e=this;return a.errorLog("A translated string is missing ( "+d+" ) for the image uploader input in module : "+e.module.id),""}}),d}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupContentPicker:function(d){var e=this,f=[];b.extend({post:"",taxonomy:""},c.isObject(d)?d:{}),e.wpObjectTypes=d,e.container.find(".czr-input").append('<select data-select-type="content-picker-select" class="js-example-basic-simple"></select>'),f=[{trigger:"change",selector:"select[data-select-type]",name:"set_input_value",actions:function(d){var f=b(d.dom_event.currentTarget,d.dom_el),g=b(f,d.dom_el).select2("data"),h={},i={id:"",type_label:"",title:"",object_type:"",url:""};return g=c.isArray(g)?g[0]:g,!c.isObject(g)||c.isEmpty(g)?void a.consoleLog("Content Picker Input : the picked value should be an object not empty."):(c.each(i,function(b,d){return"_custom_"===g.id||c.has(g,d)&&!c.isEmpty(g[d])?void(h[d]=g[d]):void a.consoleLog("content_picker : missing input param : "+d)}),void e.set(h))}}],e.setupDOMListeners(f,{dom_el:e.container},e),e.setupContentSelecter()},setupContentSelecter:function(){var a=this;a.container.find("select").select2({placeholder:{id:"-1",title:"Select"},data:a.setupSelectedContents(),ajax:{url:serverControlParams.AjaxUrl,type:"POST",dataType:"json",delay:250,debug:!0,data:function(b){var c=b.page?b.page-1:0;return c=b.term?b.page:c,{action:b.term?"search-available-content-items-customizer":"load-available-content-items-customizer",search:b.term,wp_customize:"on",page:c,wp_object_types:JSON.stringify(a.wpObjectTypes),CZRCpNonce:serverControlParams.CZRCpNonce}},processResults:function(b,d){if(a.defaultContentPickerOption=a.defaultContentPickerOption||[],!b.success)return{results:a.defaultContentPickerOption};var e=b.data.items,f=c.clone(a.defaultContentPickerOption);return c.each(e,function(a){f.push({id:a.id,title:a.title,type_label:a.type_label,object_type:a.object,url:a.url})}),{results:f,pagination:{more:10==b.data.items.length}}}},templateSelection:a.czrFormatContentSelected,templateResult:a.czrFormatContentSelected,escapeMarkup:function(a){return a}})},czrFormatContentSelected:function(a){if(a.loading)return a.text;var b="<div class='content-picker-item clearfix'><div class='content-item-bar'><span class='item-title'>"+a.title+"</span>";return a.type_label&&(b+="<span class='item-type'>"+a.type_label+"</span>"),b+="</div></div>"},setupSelectedContents:function(){var a=this,b=a();return b}})}(wp.customize,jQuery,_);var CZRInputMths=CZRInputMths||{};!function(a,b,c){b.extend(CZRInputMths,{setupTextEditor:function(){var c=this;c();if(!c.container)throw new Error("The input container is not set for WP text editor in module."+c.module.id);c.czrRenderInputTextEditorTemplate()&&(c.editor=tinyMCE("czr-customize-content_editor"),c.textarea=b("#czr-customize-content_editor"),c.editorPane=b("#czr-customize-content_editor-pane"),c.dragbar=b("#czr-customize-content_editor-dragbar"),c.editorFrame=b("#czr-customize-content_editor_ifr"),c.mceTools=b("#wp-czr-customize-content_editor-tools"),c.mceToolbar=c.editorPane.find(".mce-toolbar-grp"),c.mceStatusbar=c.editorPane.find(".mce-statusbar"),c.preview=b("#customize-preview"),c.collapse=b(".collapse-sidebar"),c.textpreview=c.container.find("textarea"),c.toggleButton=c.container.find("button.text_editor-button"),c.editorExpanded=new a.Value((!1)),c.czrUpdateTextPreview(),c.czrSetToggleButtonText(c.editorExpanded()),c.czrTextEditorBinding(),c.czrResizeEditorOnUserRequest())},czrTextEditorBinding:function(){var d=this,e=d.editor,f=d.textarea,g=d.toggleButton,h=(d.editorExpanded,d.editorPane);d.bind(d.id+":changed",d.czrUpdateTextPreview),c.bindAll(d,"czrOnVisualEditorChange","czrOnTextEditorChange","czrResizeEditorOnWindowResize"),g.on("click",function(){d.editorExpanded.set(!d.editorExpanded()),d.editorExpanded()&&e.focus()}),d.module.czr_ModuleState.bind(function(a){"expanded"!=a&&d.editorExpanded.set(!1)}),d.editorExpanded.bind(function(c){a.consoleLog("in input.editorExpanded",c,d()),e.locker&&e.locker!==d&&(e.locker.editorExpanded.set(!1),e.locker=null),e.locker&&e.locker!==d||(b(document.body).toggleClass("czr-customize-content_editor-pane-open",c),e.locker=d),d.czrSetToggleButtonText(c),c?(e.setContent(wp.editor.autop(d())),e.on("input change keyup",d.czrOnVisualEditorChange),f.on("input",d.czrOnTextEditorChange),d.czrResizeEditor(window.innerHeight-h.height()),b(window).on("resize",d.czrResizeEditorOnWindowResize)):(e.off("input change keyup",d.czrOnVisualEditorChange),f.off("input",d.czrOnTextEditorChange),b(window).off("resize",d.czrResizeEditorOnWindowResize),d.czrResizeReset())})},czrOnVisualEditorChange:function(){
15
+ var a,b=this,c=b.editor;a=wp.editor.removep(c.getContent()),b.set(a)},czrOnTextEditorChange:function(){var a,b=this,c=b.textarea;a=c.val(),b.set(a)},czrUpdateTextPreview:function(){var a,b=this,c=b();a=c.replace(/(<([^>]+)>)/gi,""),a.length>30&&(a=a.substring(0,34)+"..."),b.textpreview.val(a)},czrRenderInputTextEditorTemplate:function(){var c=this;if(0===b("#tmpl-czr-input-text_editor-view-content").length)throw new Error("Missing js template for text editor input in module : "+c.module.id);var d=wp.template("czr-input-text_editor-view-content"),e=c.container.find("input");if(d&&c.container)return a.consoleLog("Model injected in text editor tmpl : ",c()),e.after(d(c())),!0},czrIsEditorExpanded:function(){return b(document.body).hasClass("czr-customize-content_editor-pane-open")},czrResizeReset:function(){var a=this,b=a.preview,c=a.collapse,d=a.container.closest("ul.accordion-section-content");d.css("padding-bottom",""),b.css("bottom",""),c.css("bottom","")},czrResizeEditor:function(a){var b=window.innerHeight,d=window.innerWidth,e=40,f=1,g=782,h=56,i=8,j=4,k={},l=this,m=l.container.closest("ul.accordion-section-content"),n=l.mceTools,o=l.mceToolbar,p=l.mceStatusbar,q=l.preview,r=l.collapse,s=l.editorPane,t=l.editorFrame;l.editorExpanded()&&(c.isNaN(a)||(resizeHeight=b-a),k.height=resizeHeight,k.components=n.outerHeight()+o.outerHeight()+p.outerHeight(),resizeHeight<e&&(k.height=e),resizeHeight>b-f&&(k.height=b-f),b<s.outerHeight()&&(k.height=b),q.css("bottom",k.height),s.css("height",k.height),t.css("height",k.height-k.components),r.css("bottom",k.height+i),h>b-k.height&&r.css("bottom",p.outerHeight()+j),d<=g?m.css("padding-bottom",k.height):m.css("padding-bottom",""))},czrResizeEditorOnWindowResize:function(){var a=this,b=50,d=a.editorPane;a.editorExpanded()&&c.delay(function(){a.czrResizeEditor(window.innerHeight-d.height())},b)},czrResizeEditorOnUserRequest:function(){var a=this,c=a.dragbar,d=a.editorFrame;c.on("mousedown",function(){a.editorExpanded()&&b(document).on("mousemove.czr-customize-content_editor",function(c){c.preventDefault(),b(document.body).addClass("czr-customize-content_editor-pane-resize"),d.css("pointer-events","none"),a.czrResizeEditor(c.pageY)})}),c.on("mouseup",function(){a.editorExpanded()&&(b(document).off("mousemove.czr-customize-content_editor"),b(document.body).removeClass("czr-customize-content_editor-pane-resize"),d.css("pointer-events",""))})},czrSetToggleButtonText:function(a){var b=this;b.toggleButton.text(serverControlParams.i18n.mods.textEditor[a?"Close Editor":"Edit"])}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{initialize:function(d,e){if(c.isUndefined(e.module)||c.isEmpty(e.module))throw new Error("No module assigned to item "+d+". Aborting");var f=this;a.Value.prototype.initialize.call(f,null,e),f.isReady=b.Deferred(),f.embedded=b.Deferred(),f.container=null,f.contentContainer=null,f.inputCollection=new a.Value({}),f.viewState=new a.Value("closed"),f.removeDialogVisible=new a.Value((!1)),b.extend(f,e||{}),f.defaultItemModel=c.clone(e.defaultItemModel)||{id:"",title:""};var g=b.extend(f.defaultItemModel,e.initial_item_model);f.set(g),f.userEventMap=new a.Value([{trigger:"click keydown",selector:["."+f.module.control.css_attr.display_alert_btn,"."+f.module.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:function(){var a=this.removeDialogVisible();this.module.closeRemoveDialogs(),this.removeDialogVisible(!a)}},{trigger:"click keydown",selector:"."+f.module.control.css_attr.remove_view_btn,name:"remove_item",actions:["removeItem"]},{trigger:"click keydown",selector:["."+f.module.control.css_attr.edit_view_btn,"."+f.module.control.css_attr.item_title].join(","),name:"edit_view",actions:["setViewVisibility"]},{trigger:"click keydown",selector:".tabs nav li",name:"tab_nav",actions:function(a){this.module.toggleTabVisibility.call(this,a)}}]),f.isReady.done(function(){f.module.updateItemsCollection({item:f()}),f.callbacks.add(function(){return f.itemReact.apply(f,arguments)}),f.bind("contentRendered",function(){if(!c.has(f,"czr_Input")||c.isEmpty(f.inputCollection()))try{a.CZR_Helpers.setupInputCollectionFromDOM.call(f),f.module.setupTabNav.call(f)}catch(b){a.errorLog("In item.isReady.done : "+b)}}),f.bind("contentRemoved",function(){c.has(f,"czr_Input")&&a.CZR_Helpers.removeInputCollection.call(f)}),f.mayBeRenderItemWrapper(),f.embedded.done(function(){f.itemWrapperViewSetup(g)})})},ready:function(){this.isReady.resolve()},itemReact:function(a,b,c){var d=this,e=d.module;c=c||{},e.updateItemsCollection({item:a,data:c}).done(function(){d.writeItemViewTitle(a,c)})}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{_sendItem:function(a,b){var d=this,e=d.module,f=[];c.each(b,function(b,c){b!=a[c]&&f.push(c)}),c.each(f,function(b){e.control.previewer.send("sub_setting",{set_id:e.control.id,id:a.id,changed_prop:b,value:a[b]}),e.trigger("item_sent",{item:a,dom_el:d.container,changed_prop:b})})},removeItem:function(){var a=this,b=this.module,d=c.clone(b.itemCollection());b.trigger("pre_item_dom_remove",a()),a._destroyView(),d=c.without(d,c.findWhere(d,{id:a.id})),b.itemCollection.set(d),b.trigger("pre_item_api_remove",a()),b.czr_Item.remove(a.id)},getModel:function(a){return this()}})}(wp.customize,jQuery,_);var CZRItemMths=CZRItemMths||{};!function(a,b,c){b.extend(CZRItemMths,{mayBeRenderItemWrapper:function(){var a=this;"pending"==a.embedded.state()&&b.when(a.renderItemWrapper()).done(function(b){if(a.container=b,c.isUndefined(a.container)||!a.container.length)throw new Error("In mayBeRenderItemWrapper the Item view has not been rendered : "+a.id);a.embedded.resolve()})},itemWrapperViewSetup:function(d){var e=this,f=this.module;d=e()||e.initial_item_model,e.writeItemViewTitle();var g=function(a,b,d){if(c.isUndefined(a)||!1===a.length)throw new Error("Module : "+e.module.id+", the item content has not been rendered for "+e.id);e.trigger("contentRendered"),e.contentContainer=a,e.toggleItemExpansion(b,d)};e.module.isMultiItem()?e.viewState.callbacks.add(function(a,d){var h=-1!==a.indexOf("expanded");h?c.isObject(e.contentContainer)&&!1!==e.contentContainer.length?e.toggleItemExpansion(a,d):b.when(e.renderItemContent(e()||e.initial_item_model)).done(function(b){(g=c.debounce(g,50))(b,a,d)}):e.toggleItemExpansion(a,d).done(function(){c.isObject(e.contentContainer)&&!1!==e.contentContainer.length&&(e.trigger("beforeContenRemoved"),b("."+f.control.css_attr.item_content,e.container).children().each(function(){b(this).remove()}),b("."+f.control.css_attr.item_content,e.container).html(""),e.contentContainer=null,e.trigger("contentRemoved"))})}):(e.viewState.callbacks.add(function(a,b){e.toggleItemExpansion.apply(e,arguments)}),b.when(e.renderItemContent(d)).done(function(a){g(a,!0)})),a.CZR_Helpers.setupDOMListeners(e.userEventMap(),{model:d,dom_el:e.container},e),e.removeDialogVisible.bind(function(d){var f=e.module,g=b("."+f.control.css_attr.remove_alert_wrapper,e.container).first();if(d&&f.closeAllItems(),d&&f.hasModOpt()&&a.czr_ModOptVisible(!1),d&&c.has(f,"preItem")&&f.preItemExpanded(!1),b("."+f.control.css_attr.remove_alert_wrapper,e.container).not(g).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+f.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),d){if(!wp.template(f.AlertPart)||!e.container)return void a.consoleLog("No removal alert template available for items in module :"+f.id);g.html(wp.template(f.AlertPart)({title:e().title||e.id}))}var h=function(a){g.toggleClass("open",a),e.container.find("."+f.control.css_attr.display_alert_btn).toggleClass("active",a),a&&f._adjustScrollExpandedBlock(e.container)};d?g.stop(!0,!0).slideDown(200,function(){h(d)}):g.stop(!0,!0).slideUp(200,function(){h(d)})})},renderItemWrapper:function(a){var c=this,d=c.module;if(a=a||c(),$_view_el=b("<li>",{"class":d.control.css_attr.single_item,"data-id":a.id,id:a.id}),d.itemsWrapper.append($_view_el),d.isMultiItem()){var e=d.getTemplateEl("rudItemPart",a);if(0===b("#tmpl-"+e).length)throw new Error("Missing template for item "+c.id+". The provided template script has no been found : #tmpl-"+d.getTemplateEl("rudItemPart",a));$_view_el.append(b(wp.template(e)(a)))}return $_view_el.append(b("<div/>",{"class":d.control.css_attr.item_content})),$_view_el},renderItemContent:function(a){var c=this,d=this.module;if(a=a||c(),0===b("#tmpl-"+d.getTemplateEl("itemInputList",a)).length)throw new Error("No item content template defined for module "+d.id+". The template script id should be : #tmpl-"+d.getTemplateEl("itemInputList",a));var e=wp.template(d.getTemplateEl("itemInputList",a));return e?(b(e(a)).appendTo(b("."+d.control.css_attr.item_content,c.container)),b(b(e(a)),c.container)):this},writeItemViewTitle:function(d){var e=this,f=e.module,g=d||e(),h=c.has(g,"title")?a.CZR_Helpers.capitalize(g.title):g.id;h=a.CZR_Helpers.truncate(h,20),b("."+f.control.css_attr.item_title,e.container).text(h),a.CZR_Helpers.doActions("after_writeViewTitle",e.container,g,e)},setViewVisibility:function(a,b){var d=this,e=this.module;b?d.viewState.set("expanded_noscroll"):(e.closeAllItems(d.id),c.has(e,"preItem")&&e.preItemExpanded.set(!1),d.viewState.set("expanded"==d._getViewState()?"closed":"expanded"))},_getViewState:function(){return-1==this.viewState().indexOf("expanded")?"closed":"expanded"},toggleItemExpansion:function(a,c,d){var e="closed"!=a,f=this,g=this.module,h=b("."+g.control.css_attr.item_content,f.container).first(),i=b.Deferred(),j=function(b){f.container.toggleClass("open",b),b&&g.closeRemoveDialogs();var c=h.siblings().find("."+g.control.css_attr.edit_view_btn);c.toggleClass("active",b),b?c.removeClass("fa-pencil").addClass("fa-minus-square").attr("title",serverControlParams.i18n.close):c.removeClass("fa-minus-square").addClass("fa-pencil").attr("title",serverControlParams.i18n.edit),"expanded"==a&&g._adjustScrollExpandedBlock(f.container),i.resolve()};return e?h.stop(!0,!0).slideDown(d||200,function(){j(e)}):h.stop(!0,!0).slideUp(200,function(){j(e)}),i.promise()},_destroyView:function(a){this.container.fadeOut({duration:a||400,done:function(){b(this).remove()}})}})}(wp.customize,jQuery,_);var CZRModOptMths=CZRModOptMths||{};!function(a,b,c){b.extend(CZRModOptMths,{initialize:function(d){if(c.isUndefined(d.module)||c.isEmpty(d.module))throw new Error("No module assigned to modOpt.");var e=this;a.Value.prototype.initialize.call(e,null,d),e.isReady=b.Deferred(),e.container=null,e.inputCollection=new a.Value({}),b.extend(e,d||{}),e.defaultModOptModel=c.clone(d.defaultModOptModel)||{is_mod_opt:!0};var f=b.extend(e.defaultModOptModel,d.initial_modOpt_model),g=e.module.control;e.set(f),a.czr_ModOptVisible=new a.Value((!1)),a.czr_ModOptVisible.bind(function(c){c?(e.module.closeRemoveDialogs(),e.modOptWrapperViewSetup(f).done(function(b){e.container=b;try{a.CZR_Helpers.setupInputCollectionFromDOM.call(e).toggleModPanelView(c)}catch(d){a.consoleLog(d)}})):e.toggleModPanelView(c).done(function(){!1!==e.container.length?b.when(e.container.remove()).done(function(){a.CZR_Helpers.removeInputCollection.call(e)}):a.CZR_Helpers.removeInputCollection.call(e),e.container=null})}),e.isReady.done(function(){b("."+g.css_attr.edit_modopt_icon,g.container).length||b.when(g.container.find(".customize-control-title").first().append(b("<span/>",{"class":[g.css_attr.edit_modopt_icon,"fa fa-cog"].join(" "),title:serverControlParams.i18n.Settings}))).done(function(){b("."+g.css_attr.edit_modopt_icon,g.container).fadeIn(400)}),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:"."+g.css_attr.edit_modopt_icon,name:"toggle_mod_option",actions:function(){a.czr_ModOptVisible(!a.czr_ModOptVisible())}}],{dom_el:g.container},e)})},ready:function(){this.isReady.resolve()}})}(wp.customize,jQuery,_);var CZRModOptMths=CZRModOptMths||{};!function(a,b,c){b.extend(CZRModOptMths,{modOptWrapperViewSetup:function(d){var e=this,f=this.module,g=b.Deferred(),h=function(b){a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:"."+f.control.css_attr.close_modopt_icon,name:"close_mod_option",actions:function(){a.czr_ModOptVisible(!1)}},{trigger:"click keydown",selector:".tabs nav li",name:"tab_nav",actions:function(a){this.module.toggleTabVisibility.call(this,a)}}],{dom_el:b},e)};return d=e()||e.initial_modOpt_model,b.when(e.renderModOptContent(d)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module : "+e.module.id+", the modOpt content has not been rendered");h(a),g.resolve(a)}).then(function(){e.module.setupTabNav.call(e)}),g.promise()},renderModOptContent:function(c){var d=this,e=this.module;if(c=c||d(),0===b("#tmpl-"+e.getTemplateEl("modOptInputList",c)).length)return void a.errorLog("renderModOptContent : No modOpt content template defined for module "+e.id+". The template script id should be : #tmpl-"+e.getTemplateEl("modOptInputList",c));var f=wp.template(e.getTemplateEl("modOptInputList",c));if(!f)return this;var g="";try{g=[serverControlParams.i18n["Options for"],e.control.params.label].join(" ")}catch(h){a.errorLog("In renderModOptContent : "+h),g=serverControlParams.i18n.Settings}return b("#widgets-left").after(b("<div/>",{"class":e.control.css_attr.mod_opt_wrapper,html:[['<h2 class="mod-opt-title">',g,"</h2>"].join(""),'<span class="fa fa-times '+e.control.css_attr.close_modopt_icon+'" title="close"></span>'].join("")})),b("."+e.control.css_attr.mod_opt_wrapper).append(b(f(c))),b("."+e.control.css_attr.mod_opt_wrapper)},toggleModPanelView:function(a){var d=this.module,e=(d.control,b.Deferred());return d.control.container.toggleClass("czr-modopt-visible",a),b("body").toggleClass("czr-editing-modopt",a),c.delay(function(){e.resolve()},200),e.promise()}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{initialize:function(d,e){if(c.isUndefined(e.control)||c.isEmpty(e.control))throw new Error("No control assigned to module "+d);var f=this;a.Value.prototype.initialize.call(this,null,e),f.isReady=b.Deferred(),b.extend(f,e||{}),b.extend(f,{crudModulePart:"czr-crud-module-part",rudItemPart:"czr-rud-item-part",ruItemPart:"czr-ru-item-part",itemInputList:"",modOptInputList:"",AlertPart:"czr-rud-item-alert-part"}),f.embedded=b.Deferred(),f.isInSektion()||(f.container=b(f.control.selector),f.embedded.resolve()),f.embedded.done(function(){b.when(f.renderModuleParts()).done(function(a){if(!1===a.length)throw new Error("The items wrapper has not been rendered for module : "+f.id);f.itemsWrapper=a})}),f.defaultAPImodOptModel={initial_modOpt_model:{},defaultModOptModel:{},control:{},module:{}},f.defaultModOptModel={},f.modOptConstructor=a.CZRModOpt,f.itemCollection=new a.Value([]),f.defaultAPIitemModel={id:"",initial_item_model:{},defaultItemModel:{},control:{},module:{},is_added_by_user:!1},f.defaultItemModel={id:"",title:""},f.itemConstructor=a.CZRItem,f.czr_Item=new a.Values,f.inputConstructor=a.CZRInput,f.hasModOpt()&&(f.inputModOptConstructor=a.CZRInput),f.inputOptions={},f.isReady.done(function(){f.isDirty=new a.Value(e.dirty||!1),f.initializeModuleModel(e).done(function(a){f.set(a)}).fail(function(b){a.consoleLog("Module : "+f.id+" initialize module model failed : ",b)}).always(function(a){f.callbacks.add(function(){return f.moduleReact.apply(f,arguments)}),f.control.isModuleRegistered(f.id)||f.control.updateModulesCollection({module:e,is_registered:!1}),f.bind("items-collection-populated",function(a){f.itemCollection.callbacks.add(function(){return f.itemCollectionReact.apply(f,arguments)}),f.isMultiItem()&&f._makeItemsSortable()}),f.isInSektion()||f.populateSavedItemCollection(),f.hasModOpt()&&f.instantiateModOpt()})})},ready:function(){var a=this;a.isReady.resolve()},initializeModuleModel:function(a){var d=this,e=b.Deferred();if(!d.isMultiItem()&&!d.isCrud()&&c.isEmpty(a.items)){var f=c.clone(d.defaultItemModel);a.items=[b.extend(f,{id:d.id})]}return e.resolve(a).promise()},itemCollectionReact:function(a,c,d){var e=this,f=e(),g=b.extend(!0,{},f);g.items=a,e.isDirty.set(!0),e.set(g,d||{})},moduleReact:function(a,d,e){var f=this,g=f.control;c.size(d.items)==c.size(a.items)&&!c.isEmpty(c.difference(a.items,d.items)),a.column_id!=d.column_id;g.updateModulesCollection({module:b.extend(!0,{},a),data:e})},getModuleSection:function(){return this.section},isInSektion:function(){var a=this;return c.has(a,"sektion_id")},isMultiItem:function(){return a.CZR_Helpers.isMultiItemModule(null,this)},isCrud:function(){return a.CZR_Helpers.isCrudModule(null,this)},hasModOpt:function(){return a.CZR_Helpers.hasModuleModOpt(null,this)},instantiateModOpt:function(){var a=this,c=a.prepareModOptForAPI(a().modOpt||{});a.czr_ModOpt=new a.modOptConstructor(c),a.czr_ModOpt.ready(),a.czr_ModOpt.callbacks.add(function(c,d,e){var f=a(),g=b.extend(!0,{},f);g.modOpt=c,a.isDirty(!0),a(g,e)})},prepareModOptForAPI:function(a){var b=this,d={};return a=c.isObject(a)?a:{},c.each(b.defaultAPImodOptModel,function(e,f){a[f];switch(f){case"initial_modOpt_model":c.each(b.getDefaultModOptModel(),function(b,d){c.has(a,d)||(a[d]=b)}),d[f]=a;break;case"defaultModOptModel":d[f]=c.clone(b.defaultModOptModel);break;case"control":d[f]=b.control;break;case"module":d[f]=b}}),d},getDefaultModOptModel:function(a){var d=this;return b.extend(c.clone(d.defaultModOptModel),{is_mod_opt:!0})},sendInputToPreview:function(d){var e=this;d=c.extend({input_id:"",input_parent_id:"",to:null,from:null},d),c.isEqual(d.to,d.from)||(e.control.previewer.send("czr_input",{set_id:a.CZR_Helpers.getControlSettingId(e.control.id),module_id:e.id,module:{items:b.extend(!0,{},e().items),modOpt:e.hasModOpt()?b.extend(!0,{},e().modOpt):{}},input_parent_id:d.input_parent_id,input_id:d.input_id,value:d.to}),e.trigger("input_sent",{input:d.to,dom_el:e.container}))},sendModuleInputsToPreview:function(){var a=this,d=function(){var d=this,e=b.extend(!0,{},d());e=c.omit(e,"id"),c.each(e,function(b,c){a.sendInputToPreview({input_id:c,input_parent_id:d.id,to:b,from:null})})};a.czr_Item.each(function(a){d.call(a)}),a.hasModOpt()&&d.call(a.czr_ModOpt)}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{populateSavedItemCollection:function(){var b=this,d=[];return c.isArray(b().items)?(c.each(b().items,function(a,b){c.has(a,"id")&&!c.has(a,"is_mod_opt")&&d.push(a)}),c.each(d,function(c,d){try{b.instantiateItem(c).ready()}catch(e){a.errorLog("populateSavedItemCollection : "+e)}}),c.each(d,function(a){if(c.isUndefined(c.findWhere(b.itemCollection(),a.id)))throw new Error("populateSavedItemCollection : The saved items have not been properly populated in module : "+b.id)}),void b.trigger("items-collection-populated")):void a.errorLog("populateSavedItemCollection : The saved items collection must be an array in module :"+b.id)},instantiateItem:function(a,b){var d=this;if(item_candidate=d.prepareItemForAPI(a),!c.has(item_candidate,"id"))throw new Error("CZRModule::instantiateItem() : an item has no id and could not be added in the collection of : "+this.id);if(d.czr_Item.has(item_candidate.id))throw new Error("CZRModule::instantiateItem() : the following item id "+item_candidate.id+" already exists in module.czr_Item() for module "+this.id);if(d.czr_Item.add(item_candidate.id,new d.itemConstructor(item_candidate.id,item_candidate)),!d.czr_Item.has(item_candidate.id))throw new Error("CZRModule::instantiateItem() : instantiation failed for item id "+item_candidate.id+" for module "+this.id);return d.czr_Item(item_candidate.id)},prepareItemForAPI:function(a){var b=this,d={};return a=c.isObject(a)?a:{},c.each(b.defaultAPIitemModel,function(e,f){var g=a[f];switch(f){case"id":c.isEmpty(g)?d[f]=b.generateItemId(b.module_type):d[f]=g;break;case"initial_item_model":c.each(b.getDefaultItemModel(),function(b,d){c.has(a,d)||(a[d]=b)}),d[f]=a;break;case"defaultItemModel":d[f]=c.clone(b.defaultItemModel);break;case"control":d[f]=b.control;break;case"module":d[f]=b;break;case"is_added_by_user":d[f]=!!c.isBoolean(g)&&g}}),c.has(d,"id")||(d.id=b.generateItemId(b.module_type)),d.initial_item_model.id=d.id,d},generateItemId:function(a,b,d){if(d=d||1,d>100)throw new Error("Infinite loop when generating of a module id.");var e=this;b=b||e._getNextItemKeyInCollection();var f=a+"_"+b;if(!c.has(e,"itemCollection")||!c.isArray(e.itemCollection()))throw new Error("The item collection does not exist or is not properly set in module : "+e.id);return e.isItemRegistered(f)?(b++,d++,e.generateItemId(a,b,d)):f},_getNextItemKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.itemCollection())?d:(b=c.isArray(a.itemCollection())&&1===c.size(a.itemCollection())?a.itemCollection()[0]:c.max(a.itemCollection(),function(a){return c.isNumber(a.id.replace(/[^\/\d]/g,""))?parseInt(a.id.replace(/[^\/\d]/g,""),10):0}),!c.isUndefined(b)&&c.isNumber(b.id.replace(/[^\/\d]/g,""))&&(d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d)},isItemRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.itemCollection(),{id:a}))},updateItemsCollection:function(a){var d=this,e=d.itemCollection(),f=c.clone(e),g=b.Deferred();if(c.has(a,"collection"))return void d.itemCollection.set(a.collection);if(!c.has(a,"item"))throw new Error("updateItemsCollection, no item provided "+d.control.id+". Aborting");a=c.extend({data:{}},a);var h=c.clone(a.item);return c.findWhere(f,{id:h.id})?c.each(e,function(a,b){a.id==h.id&&(f[b]=h)}):f.push(h),d.itemCollection.set(f,a.data),g.resolve({collection:f,data:a.data}).promise()},_getSortedDOMItemCollection:function(){var a=this,d=c.clone(a.itemCollection()),e=[],f=b.Deferred();if(b("."+a.control.css_attr.single_item,a.container).each(function(a){var f=c.findWhere(d,{id:b(this).attr("data-id")});f&&(e[a]=f)}),d.length!=e.length)throw new Error("There was a problem when re-building the item collection from the DOM in module : "+a.id);return f.resolve(e).promise()},refreshItemCollection:function(){var c=this;c.czr_Item.each(function(a){b.when(c.czr_Item(a.id).container.remove()).done(function(){c.czr_Item.remove(a.id)})}),c.itemCollection=new a.Value([]),c.populateSavedItemCollection()}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{getDefaultItemModel:function(a){var d=this;return b.extend(c.clone(d.defaultItemModel),{id:a||""})},_initNewItem:function(a,d){var e,f=this,g={id:""};return d="undefined"!=typeof d?d:c.size(f.itemCollection()),c.isNumber(d)?e=f.module_type+"_"+d:(e=d,d=0),g=a&&!c.isEmpty(a)?b.extend(a,{id:e}):this.getDefaultItemModel(e),c.has(g,"id")&&f._isItemIdPossible(e)?(c.map(f.getDefaultItemModel(),function(a,b){c.has(g,b)||(g[b]=a)}),g):f._initNewItem(g,d+1)}})}(wp.customize,jQuery,_);var CZRModuleMths=CZRModuleMths||{};!function(a,b,c){b.extend(CZRModuleMths,{renderModuleParts:function(){var a=this,c=a.isInSektion()?b(a.container).find(".czr-mod-content"):b(a.container);if(a.isCrud()){if(0===b("#tmpl-"+a.crudModulePart).length)throw new Error("No crud Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.crudModulePart);c.append(b(wp.template(a.crudModulePart)({})))}var d=b("<ul/>",{"class":[a.control.css_attr.items_wrapper,a.module_type,a.isMultiItem()?"multi-item-mod":"mono-item-mod",a.isCrud()?"crud-mod":"not-crud-mod"].join(" ")});return c.append(d),b(d,c)},getTemplateEl:function(a,b){var d,e=this;switch(a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"modOptInputList":d=e.modOptInputList;break;case"itemInputList":d=e.itemInputList}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl() "+e.id+". Aborting");return d},getViewEl:function(a){var c=this;return b('[data-id = "'+a+'"]',c.container)},closeAllItems:function(a){var b=this,d=c.clone(b.itemCollection()),e=c.filter(d,function(b){return b.id!=a});return c.each(e,function(a){b.czr_Item.has(a.id)&&"expanded"==b.czr_Item(a.id)._getViewState(a.id)&&b.czr_Item(a.id).viewState.set("closed")}),this},_adjustScrollExpandedBlock:function(a,d){if(a.length&&!c.isUndefined(this.getModuleSection())){var e,f=this,g=b(".accordion-section-content",f.section.container),h=g.scrollTop(),i=d||90;setTimeout(function(){a.offset().top+a.height()+i>b(window.top).height()&&(e=a.offset().top+a.height()+i-b(window.top).height(),e>0&&g.animate({scrollTop:h+e},500))},50)}},closeRemoveDialogs:function(){var a=this;if(c.isArray(a.itemCollection()))return a.czr_Item.each(function(a){a.removeDialogVisible(!1)}),this},_makeItemsSortable:function(d){if(!wp.media.isTouchDevice&&b.fn.sortable){var e=this;b("."+e.control.css_attr.items_wrapper,e.container).sortable({handle:"."+e.control.css_attr.item_sort_handle,start:function(){c.has(a,"czrModulePanelState")&&a.czrModulePanelState.set(!1),c.has(a,"czrSekSettingsPanelState")&&a.czrSekSettingsPanelState.set(!1)},update:function(b,d){var f=function(){c.has(e,"preItem")&&e.preItemExpanded.set(!1),e.closeAllItems().closeRemoveDialogs();var b=function(){a.previewer.refresh()};"postMessage"!=a(e.control.id).transport||a.CZR_Helpers.hasPartRefresh(e.control.id)||(b=c.debounce(b,500))(),e.trigger("item-collection-sorted")};e._getSortedDOMItemCollection().done(function(a){e.itemCollection.set(a)}).then(function(){f()})}})}},toggleTabVisibility:function(a){var c=this,d=(b(c.container).find("li"),b(c.container).find("section"),b(a.dom_event.currentTarget,a.dom_el).attr("data-tab-id"));b(".tabs nav li",c.container).each(function(){b(this).removeClass("tab-current").addClass("tab-inactive")}),b(c.container).find('li[data-tab-id="'+d+'"]').addClass("tab-current").removeClass("tab-inactive"),b("section",c.container).each(function(){b(this).removeClass("content-current")}),b(c.container).find('section[id="'+d+'"]').addClass("content-current")},setupTabNav:function(){var a=this,c=function(){var c=b.Deferred(),d=b(".tabs nav li",a.container);d.each(function(){b(this).removeClass("tab-current").addClass("tab-inactive")}),d.first().addClass("tab-current").removeClass("tab-inactive"),b("section",a.container).first().addClass("content-current");var e=d.length;return d.each(function(){b(this).addClass(e>0?"cols-"+e:"")}),c.resolve().promise()};setTimeout(function(){c().done(function(){b(".tabs",a.container).fadeIn(450)})},20)}})}(wp.customize,jQuery,_);var CZRDynModuleMths=CZRDynModuleMths||{};!function(a,b,c){b.extend(CZRDynModuleMths,{initialize:function(c,d){var e=this;a.CZRModule.prototype.initialize.call(e,c,d),b.extend(e,{itemPreAddEl:""}),e.itemAddedMessage=serverControlParams.i18n.successMessage,e.userEventMap=new a.Value([{trigger:"click keydown",selector:["."+e.control.css_attr.open_pre_add_btn,"."+e.control.css_attr.cancel_pre_add_btn].join(","),name:"pre_add_item",actions:["closeAllItems","closeRemoveDialogs","renderPreItemView","setPreItemViewVisibility"]},{trigger:"click keydown",selector:"."+e.control.css_attr.add_new_btn,name:"add_item",actions:["closeRemoveDialogs","closeAllItems","addItem"]}])},ready:function(){var c=this;c.setupDOMListeners(c.userEventMap(),{dom_el:c.container}),c.preItem=new a.Value(c.getDefaultItemModel()),c.preItemEmbedded=b.Deferred(),c.preItemEmbedded.done(function(){c.setupPreItemInputCollection()}),c.preItemExpanded=new a.Value((!1)),c.preItemExpanded.callbacks.add(function(a,b){c._togglePreItemViewExpansion(a)}),a.CZRModule.prototype.ready.call(c)},setupPreItemInputCollection:function(){var c=this;c.preItem.czr_Input=new a.Values,b("."+c.control.css_attr.pre_add_wrapper,c.container).find("."+c.control.css_attr.sub_set_wrapper).each(function(a){var d=b(this).find("[data-type]").attr("data-type")||"sub_set_"+a;c.preItem.czr_Input.add(d,new c.inputConstructor(d,{id:d,type:b(this).attr("data-input-type"),container:b(this),input_parent:c.preItem,module:c,is_preItemInput:!0})),c.preItem.czr_Input(d).ready()})},addItem:function(b){var d=this,e=d.preItem(),f=function(){d.preItemExpanded.set(!1),d._resetPreItemInputs(),d.toggleSuccessMessage("off")};if(c.isEmpty(e)||!c.isObject(e))throw new Error("addItem : an item should be an object and not empty. In : "+d.id+". Aborted.");f=c.debounce(f,2e3),d.instantiateItem(e,!0).ready(),d.czr_Item(e.id).isReady.then(function(){d.toggleSuccessMessage("on"),f(),d.trigger("item_added",e),"postMessage"!=a(d.control.id).transport||!c.has(b,"dom_event")||c.has(b.dom_event,"isTrigger")||a.CZR_Helpers.hasPartRefresh(d.control.id)||d.control.previewer.refresh()})},_resetPreItemInputs:function(){var a=this;a.preItem.set(a.getDefaultItemModel()),a.preItem.czr_Input.each(function(b){var d=b.id;c.has(a.getDefaultItemModel(),d)&&b.set(a.getDefaultItemModel()._input_id)})}})}(wp.customize,jQuery,_);var CZRDynModuleMths=CZRDynModuleMths||{};!function(a,b,c){b.extend(CZRDynModuleMths,{renderPreItemView:function(a){var d=this;if("pending"==d.preItemEmbedded.state()){if(!c.has(d,"itemPreAddEl")||0===b("#tmpl-"+d.itemPreAddEl).length)return this;var e=wp.template(d.itemPreAddEl);if(!e||!d.container)return this;var f=b("."+d.control.css_attr.pre_add_item_content,d.container);f.prepend(e()),d.preItemEmbedded.resolve()}},_getPreItemView:function(){var a=this;return b("."+a.control.css_attr.pre_add_item_content,a.container)},setPreItemViewVisibility:function(a){var b=this;b.preItemExpanded.set(!b.preItemExpanded())},_togglePreItemViewExpansion:function(a){var c=this,d=b("."+c.control.css_attr.pre_add_item_content,c.container);d.slideToggle({duration:200,done:function(){var d=b("."+c.control.css_attr.open_pre_add_btn,c.container);b(this).toggleClass("open",a),a?d.find(".fa").removeClass("fa-plus-square").addClass("fa-minus-square"):d.find(".fa").removeClass("fa-minus-square").addClass("fa-plus-square"),d.toggleClass("active",a),b(c.container).toggleClass(c.control.css_attr.adding_new,a),c._adjustScrollExpandedBlock(b(this),120)}})},toggleSuccessMessage:function(a){var c=this,d=c.itemAddedMessage,e=b("."+c.control.css_attr.pre_add_wrapper,c.container);return $_success_wrapper=b("."+c.control.css_attr.pre_add_success,c.container),"on"==a?($_success_wrapper.find("p").text(d),$_success_wrapper.css("z-index",1000001).css("height",e.height()+"px").css("line-height",e.height()+"px")):$_success_wrapper.attr("style",""),c.container.toggleClass("czr-model-added","on"==a),this}})}(wp.customize,jQuery,_);var CZRSocialModuleMths=CZRSocialModuleMths||{};!function(a,b,c){b.extend(CZRSocialModuleMths,{initialize:function(d,e){var f=this;a.CZRDynModule.prototype.initialize.call(f,d,e),b.extend(f,{itemPreAddEl:"czr-module-social-pre-add-view-content",itemInputList:"czr-module-social-item-content",modOptInputList:"czr-module-social-mod-opt"}),this.social_icons=["500px","adn","amazon","android","angellist","apple","behance","behance-square","bitbucket","bitbucket-square","black-tie","btc","buysellads","chrome","codepen","codiepie","connectdevelop","contao","dashcube","delicious","deviantart","digg","dribbble","dropbox","drupal","edge","empire","envelope","envelope-o","envelope-square","expeditedssl","facebook","facebook-f (alias)","facebook-official","facebook-square","firefox","flickr","fonticons","fort-awesome","forumbee","foursquare","get-pocket","gg","gg-circle","git","github","github-alt","github-square","gitlab","git-square","google","google-plus","google-plus-circle","google-plus-official","google-plus-square","google-wallet","gratipay","hacker-news","houzz","instagram","internet-explorer","ioxhost","joomla","jsfiddle","lastfm","lastfm-square","leanpub","linkedin","linkedin-square","linux","maxcdn","meanpath","medium","mixcloud","mobile","modx","odnoklassniki","odnoklassniki-square","opencart","openid","opera","optin-monster","pagelines","paypal","phone","phone-square","pied-piper","pied-piper-alt","pinterest","pinterest-p","pinterest-square","product-hunt","qq","rebel","reddit","reddit-alien","reddit-square","renren","rss","rss-square","safari","scribd","sellsy","share-alt","share-alt-square","shirtsinbulk","simplybuilt","skyatlas","skype","slack","slideshare","snapchat","soundcloud","spotify","stack-exchange","stack-overflow","steam","steam-square","stumbleupon","stumbleupon-circle","telegram","tencent-weibo","trello","tripadvisor","tumblr","tumblr-square","twitch","twitter","twitter-square","usb","viacoin","vimeo","vimeo-square","vine","vk","weibo","weixin","whatsapp","wikipedia-w","windows","wordpress","xing","xing-square","yahoo","y-combinator","yelp","youtube","youtube-play","youtube-square"],
16
+ f.inputConstructor=a.CZRInput.extend(f.CZRSocialsInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZRSocialsItem||{}),this.defaultModOptModel={is_mod_opt:!0,module_id:f.id,"social-size":serverControlParams.social_el_params.defaultSocialSize||14},this.defaultItemModel={id:"",title:"","social-icon":"","social-link":"","social-color":serverControlParams.social_el_params.defaultSocialColor,"social-target":1},this.itemAddedMessage=serverControlParams.i18n.socialLinkAdded,c.has(a,"czr_activeSectionId")&&f.control.section()==a.czr_activeSectionId()&&"resolved"!=f.isReady.state()&&f.ready(),a.section(f.control.section()).expanded.bind(function(a){"resolved"!=f.isReady.state()&&f.ready()}),f.isReady.then(function(){f.preItem.bind(function(a,b){c.has(a,"social-icon")&&(c.isEqual(a["social-icon"],b["social-icon"])||f.updateItemModel(f.preItem,!0))})})},updateItemModel:function(a,d){var e=a;if(d=d||!1,c.has(e(),"social-icon")&&!c.isEmpty(e()["social-icon"])){var f,g,h;f=b.extend(!0,{},e()),g=this.getTitleFromIcon(f["social-icon"]),h=serverControlParams.social_el_params.defaultSocialColor,!d&&e.czr_Input.has("social-color")&&(h=e.czr_Input("social-color")()),g=[serverControlParams.i18n.followUs,g].join(" "),d?(f=b.extend(f,{title:g,"social-color":h}),e.set(f)):(e.czr_Input("title").set(g),e.czr_Input("social-color")&&e.czr_Input("social-color").set(h))}},getTitleFromIcon:function(b){return a.CZR_Helpers.capitalize(b.replace("fa-","").replace("envelope","email"))},getIconFromTitle:function(a){return"fa-".title.toLowerCase().replace("envelope","email")},CZRSocialsInputMths:{setupSelect:function(){function a(a){if(!a.id)return a.text;var c=b('<span class="fa '+a.element.value.toLowerCase()+'">&nbsp;&nbsp;'+a.text+"</span>");return c}var d=this,e=d.input_parent,f=d.module,g=f.social_icons,h=e(),i=c.isEmpty(h.id);i&&(g=c.union([serverControlParams.i18n.selectSocialIcon],g)),c.each(g,function(a,c){var e=i&&0===c?"":"fa-"+a.toLowerCase(),g={value:e,html:f.getTitleFromIcon(a)};e==h["social-icon"]&&b.extend(g,{selected:"selected"}),b('select[data-type="social-icon"]',d.container).append(b("<option>",g))}),b('select[data-type="social-icon"]',d.container).select2({templateResult:a,templateSelection:a})},setupColorPicker:function(a){var d=this,e=(d.input_parent,d.module),f=b('input[data-type="social-color"]',d.container);f.iris({palettes:!0,hide:!1,defaultColor:serverControlParams.social_el_params.defaultSocialColor||"rgba(255,255,255,0.7)",change:function(a,d){c.has(d,"color")&&16777215==d.color._color?b(this).val(serverControlParams.social_el_params.defaultSocialColor||"rgba(255,255,255,0.7)"):b(this).val(d.color.toString()),b(this).trigger("colorpickerchange").trigger("change")}}),f.closest("div").on("click keydown",function(){e._adjustScrollExpandedBlock(d.container)})}},CZRSocialsItem:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.bind("social-icon:changed",function(){b.module.updateItemModel(b)})},_buildTitle:function(b,c,d){var e=this,f=e.module;return b=b||("string"==typeof c?a.CZR_Helpers.capitalize(c.replace("fa-","")):""),b=a.CZR_Helpers.truncate(b,20),c=c||"fa-"+f.social_icons[0],d=d||serverControlParams.social_el_params.defaultSocialColor,'<div><span class="fa '+c+'" style="color:'+d+'"></span> '+b+"</div>"},writeItemViewTitle:function(a){var c=this,d=c.module,e=a||c(),f=d.getTitleFromIcon(e["social-icon"]);b("."+d.control.css_attr.item_title,c.container).html(c._buildTitle(f,e["social-icon"],e["social-color"]))}}})}(wp.customize,jQuery,_);var CZRWidgetAreaModuleMths=CZRWidgetAreaModuleMths||{};!function(a,b,c){b.extend(CZRWidgetAreaModuleMths,{initialize:function(d,e){var f=this;a.CZRDynModule.prototype.initialize.call(this,d,e),b.extend(f,{itemPreAddEl:"czr-module-widgets-pre-add-view-content",itemInputList:"czr-module-widgets-item-input-list",itemInputListReduced:"czr-module-widgets-item-input-list-reduced",ruItemPart:"czr-module-widgets-ru-item-part"}),f.inputConstructor=a.CZRInput.extend(f.CZRWZonesInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZRWZonesItem||{}),f.serverParams=serverControlParams.widget_area_el_params||{},f.contexts=c.has(f.serverParams,"sidebar_contexts")?f.serverParams.sidebar_contexts:{},f.context_match_map={is_404:"404",is_category:"archive-category",is_home:"home",is_page:"page",is_search:"search",is_single:"single"},f.locations=c.has(f.serverParams,"sidebar_locations")?f.serverParams.sidebar_locations:{},f.defaultItemModel={id:"",title:serverControlParams.i18n.widgetZone,contexts:c.without(c.keys(f.contexts),"_all_"),locations:[f.serverParams.defaultWidgetLocation],description:""},this.itemAddedMessage=serverControlParams.i18n.widgetZoneAdded,c.has(a,"sidebar_insights")||(a.sidebar_insights=new a.Values,a.sidebar_insights.create("candidates"),a.sidebar_insights.create("actives"),a.sidebar_insights.create("inactives"),a.sidebar_insights.create("registered"),a.sidebar_insights.create("available_locations")),this.listenToSidebarInsights(),a.czr_widgetZoneSettings=a.czr_widgetZoneSettings||new a.Value,a.czr_widgetZoneSettings.bind(function(b,d){f.isReady.then(function(){c.each(b,function(b,c){a.sidebar_insights(c).set(b)})})}),f.preItem_location_alert_view_state=new a.Value("closed"),f.preItem_location_alert_view_state.callbacks.add(function(a,b){f._toggleLocationAlertExpansion(f.container,a)}),f.bind("item_added",function(a){f.addWidgetSidebar(a)}),f.bind("pre_item_api_remove",function(a){f.removeWidgetSidebar(a)});var g=new a.Values;g.create("fixed_for_current_session"),g.create("value"),a.section(f.serverParams.dynWidgetSection).fixTopMargin=g,a.section(f.serverParams.dynWidgetSection).fixTopMargin("fixed_for_current_session").set(!1),a.panel("widgets").expanded.callbacks.add(function(a,b){f.widgetPanelReact(),"resolved"!=f.isReady.state()&&f.ready()})},ready:function(){var b=this;a.CZRDynModule.prototype.ready.call(b),b.preItemExpanded.callbacks.add(function(a,c){a&&(b.preItem.czr_Input("locations")._setupLocationSelect(!0),b.preItem.czr_Input("locations").mayBeDisplayModelAlert())})},initializeModuleModel:function(a){var d=this,e=b.Deferred();return a.items=c.union(c.has(d.serverParams,"default_zones")?d.serverParams.default_zones:[],a.items),e.resolve(a).promise()},CZRWZonesInputMths:{ready:function(){var b=this;b.bind("locations:changed",function(){b.mayBeDisplayModelAlert()}),a.CZRInput.prototype.ready.call(b)},setupSelect:function(){"locations"==this.id&&this._setupLocationSelect(),"contexts"==this.id&&this._setupContextSelect()},_setupContextSelect:function(){var a=this,d=a(),e=(a.input_parent,a.module);c.each(e.contexts,function(e,f){var g={value:f,html:e};(f==d||c.contains(d,f))&&b.extend(g,{selected:"selected"}),b('select[data-type="contexts"]',a.container).append(b("<option>",g))}),b('select[data-type="contexts"]',a.container).select2()},_setupLocationSelect:function(d){function e(a){if(!a.id)return a.text;if(c.contains(i,a.element.value))return a.text;var d=b('<span class="czr-unavailable-location fa fa-ban" title="'+serverControlParams.i18n.unavailableLocation+'">&nbsp;&nbsp;'+a.text+"</span>");return d}var f=this,g=f(),h=(f.input_parent,f.module),i=a.sidebar_insights("available_locations")();b('select[data-type="locations"]',f.container).children().length||c.each(h.locations,function(a,d){var e={value:d,html:a};(d==g||c.contains(g,d))&&b.extend(e,{selected:"selected"}),b('select[data-type="locations"]',f.container).append(b("<option>",e))}),d&&b('select[data-type="locations"]',f.container).select2("destroy"),b('select[data-type="locations"]',f.container).select2({templateResult:e,templateSelection:e})},mayBeDisplayModelAlert:function(){var d=this,e=d.input_parent,f=d.module;if(c.has(e(),"locations")&&!c.isEmpty(e().locations)){var g=b('select[data-type="locations"]',d.container).val(),h=a.sidebar_insights("available_locations")(),i=c.filter(g,function(a){return!c.contains(h,a)});!c.has(e(),"id")||c.isEmpty(e().id)?f.preItem_location_alert_view_state.set(c.isEmpty(i)?"closed":"expanded"):e.czr_itemLocationAlert.set(c.isEmpty(i)?"closed":"expanded")}}},CZRWZonesItem:{initialize:function(b,c){var d=this;d.module;d.czr_itemLocationAlert=new a.Value,a.CZRItem.prototype.initialize.call(d,null,c)},itemWrapperViewSetup:function(){var b=this,c=b.module;a.CZRItem.prototype.itemWrapperViewSetup.call(b),b.czr_itemLocationAlert.set("closed"),b.czr_itemLocationAlert.callbacks.add(function(a,d){c._toggleLocationAlertExpansion(b.container,a)}),b.writeSubtitleInfos(b()),b.viewState.callbacks.add(function(a,c){-1!=a.indexOf("expanded")&&b.bind("contentRendered",function(){b.czr_Input("locations")._setupLocationSelect(!0),b.czr_Input("locations").mayBeDisplayModelAlert()})})},itemReact:function(b,c){var d=this;a.CZRItem.prototype.itemReact.call(d,b,c),d.writeSubtitleInfos(b),d.updateSectionTitle(b).setModelUpdateTimer()},writeSubtitleInfos:function(a){var d=this,e=d.module,f=c.clone(a||d()),g=[],h=[],i="";if(!d.container.length)return this;f.locations=c.isString(f.locations)?[f.locations]:f.locations,c.each(f.locations,function(a){c.has(e.locations,a)?g.push(e.locations[a]):g.push(a)}),f.contexts=c.isString(f.contexts)?[f.contexts]:f.contexts,d._hasModelAllContexts(a)?h.push(e.contexts._all_):c.each(f.contexts,function(a){c.has(e.contexts,a)?h.push(e.contexts[a]):h.push(a)});var j=serverControlParams.i18n.locations,k=serverControlParams.i18n.contexts,l=serverControlParams.i18n.notset;if(g=c.isEmpty(g)?'<span style="font-weight: bold;">'+l+"</span>":g.join(", "),h=c.isEmpty(h)?'<span style="font-weight: bold;">'+l+"</span>":h.join(", "),i="<u>"+j+"</u> : "+g+" <strong>|</strong> <u>"+k+"</u> : "+h,b(".czr-zone-infos",d.container).length)b(".czr-zone-infos",d.container).html(i);else{var m=b("<div/>",{"class":["czr-zone-infos",e.control.css_attr.item_sort_handle].join(" "),html:i});b("."+e.control.css_attr.item_btns,d.container).after(m)}return this},updateSectionTitle:function(c){var d="sidebar-widgets-"+c.id,e=c.title;return a.section.has(d)?(b(".accordion-section-title",a.section(d).container).text(e),b(".customize-section-title h3",a.section(d).container).html('<span class="customize-action">'+a.section(d).params.customizeAction+"</span>"+e),this):this},setModelUpdateTimer:function(){var a=this,c=a.module;clearTimeout(b.data(this,"modelUpdateTimer")),b.data(this,"modelUpdateTimer",setTimeout(function(){c.control.refreshPreview()},1e3))},_hasModelAllContexts:function(a){var b=this,d=b.module,e=c.keys(d.contexts);if(a=a||this(),c.has(a,"contexts"))return!!c.contains(a.contexts,"_all_")||c.isEmpty(c.difference(c.without(e,"_all_"),a.contexts))},_getMatchingContexts:function(b){var d=this,e=a.czr_wpQueryInfos().conditional_tags||{},f=c.filter(d.context_match_map,function(a,b){return!0===e[b]});return c.isEmpty(f)?b:f}},addWidgetSidebar:function(d,e){if(!c.isObject(d)&&c.isEmpty(e))throw new Error("No valid input were provided to add a new Widget Zone.");var f=this,g=c.isEmpty(d)?e:c.clone(d),h=c.isEmpty(d)?e:b.extend(c.clone(c.findWhere(a.Widgets.data.registeredSidebars,{id:f.serverParams.defaultWidgetSidebar})),{name:g.title,id:g.id});a.Widgets.registeredSidebars.add(h);var i=b.extend(c.clone(a.section("sidebar-widgets-"+f.serverParams.defaultWidgetSidebar).params),{id:"sidebar-widgets-"+g.id,instanceNumber:c.max(a.settings.sections,function(a){return a.instanceNumber}).instanceNumber+1,sidebarId:h.id,title:h.name,description:"undefined"!=typeof e?e.description:a.section("sidebar-widgets-"+f.serverParams.defaultWidgetSidebar).params.description,priority:c.max(c.omit(a.settings.sections,f.serverParams.dynWidgetSection),function(a){return a.instanceNumber}).priority+1});a.section.add(i.id,new a.sectionConstructor[i.type](i.id,{params:i})),a.settings.sections[i.id]=i.id;var j="sidebars_widgets["+g.id+"]",k=b.extend(c.clone(a.settings.settin