Version Description
May 8th 2017 = * improved : better initialization process for the customizer preview when fired from appearance > themes
Download this release
Release Info
Developer | nikeo |
Plugin | Hueman Addons |
Version | 2.0.11 |
Comparing to | |
See all releases |
Code changes from version 2.0.10 to 2.0.11
- addons/assets/czr/js/czr-control-base.js +7 -20
- addons/assets/czr/js/czr-control-base.min.js +6 -6
- addons/assets/front/js/vendors/flickity.min.js +53 -53
- ha-fire.php +2 -2
- lang/en_US.po +1 -1
- readme.txt +4 -1
addons/assets/czr/js/czr-control-base.js
CHANGED
@@ -2370,16 +2370,11 @@ $.extend( CZRSkopeBaseMths, {
|
|
2370 |
throw new Error( 'Fail to process silent updates in _debouncedProcessSilentUpdates');
|
2371 |
})
|
2372 |
.done( function( _updatedSetIds ) {
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
.always( function() {
|
2379 |
-
dfd.resolve( _updatedSetIds );
|
2380 |
-
api.state( 'switching-skope' )( false );
|
2381 |
-
});
|
2382 |
-
}
|
2383 |
});
|
2384 |
};
|
2385 |
if ( _.has(api, 'czr_isModuleExpanded') && false !== api.czr_isModuleExpanded() ) {
|
@@ -5086,18 +5081,10 @@ $.extend( CZRSkopeMths, {
|
|
5086 |
if ( ! serverControlParams.isSkopOn ) {
|
5087 |
return dfd.resolve().promise();
|
5088 |
}
|
5089 |
-
|
5090 |
if ( ! _.has( api, 'czr_activeSkopeId') || _.isUndefined( api.czr_activeSkopeId() ) ) {
|
5091 |
api.consoleLog( 'The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method.');
|
5092 |
-
|
5093 |
-
|
5094 |
-
if ( 'resolved' != api.czr_skopeReady.state() ) {
|
5095 |
-
api.czr_skopeReady.done( function() {
|
5096 |
-
_new_refresh.apply( api.previewer, params );
|
5097 |
-
});
|
5098 |
-
coreRefresh.apply( previewer );
|
5099 |
-
return dfd.resolve().promise();
|
5100 |
-
}
|
5101 |
}
|
5102 |
previewer.send( 'loading-initiated' );
|
5103 |
|
2370 |
throw new Error( 'Fail to process silent updates in _debouncedProcessSilentUpdates');
|
2371 |
})
|
2372 |
.done( function( _updatedSetIds ) {
|
2373 |
+
api.previewer.refresh()
|
2374 |
+
.always( function() {
|
2375 |
+
dfd.resolve( _updatedSetIds );
|
2376 |
+
api.state( 'switching-skope' )( false );
|
2377 |
+
});
|
|
|
|
|
|
|
|
|
|
|
2378 |
});
|
2379 |
};
|
2380 |
if ( _.has(api, 'czr_isModuleExpanded') && false !== api.czr_isModuleExpanded() ) {
|
5081 |
if ( ! serverControlParams.isSkopOn ) {
|
5082 |
return dfd.resolve().promise();
|
5083 |
}
|
|
|
5084 |
if ( ! _.has( api, 'czr_activeSkopeId') || _.isUndefined( api.czr_activeSkopeId() ) ) {
|
5085 |
api.consoleLog( 'The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method.');
|
5086 |
+
coreRefresh.apply( previewer );
|
5087 |
+
return dfd.resolve().promise();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5088 |
}
|
5089 |
previewer.send( 'loading-initiated' );
|
5090 |
|
addons/assets/czr/js/czr-control-base.min.js
CHANGED
@@ -9,9 +9,9 @@ Array.from||(Array.from=function(){var a=Object.prototype.toString,b=function(b)
|
|
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">×</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">×</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.join(" ")),["%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(){if(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");var b=function(){a.czr_skopeBase.toggleTopNote(!0,{title:serverControlParams.i18n.skope["There was a problem when trying to load the customizer."],message:[serverControlParams.i18n.skope["Please refer to"],'<a href="http://docs.presscustomizr.com/article/285-there-was-a-problem-when-trying-to-load-the-customizer" target="_blank">',serverControlParams.i18n.skope["this documentation page"],"</a>",serverControlParams.i18n.skope["to understand how to fix the problem."]].join(" "),selfCloseAfter:4e4})};a.czr_skopeReady.done(function(){a.trigger("czr-skope-ready")}).fail(function(c){a.errorLog("Skope could not be instantiated : "+c),b(),serverControlParams.isSkopOn=!1}).always(function(){a.czr_isLoadingSkope(!1)}),"rejected"!=a.czr_skopeReady.state()&&setTimeout(function(){"pending"==a.czr_skopeReady.state()&&(b(),a.czr_isLoadingSkope(!1))},4e4)}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()};a.bind("ready",function(){a.previewedDevice&&a.previewedDevice.bind(function(b){a.previewer.send("previewed-device",b)})}),serverControlParams.isPro&&(c.each(["tc_font_customizer_settings","header_image_sec","content_blog_sec","static_front_page"],function(b){c.delay(function(){a.section.when(b,function(a){1>=a.headContainer.length&&a.headContainer.find(".accordion-section-title").prepend('<span class="pro-title-block">Pro</span>')})},1e3)}),c.each(["hu-header-panel","hu-content-panel"],function(b){a.panel.when(b,function(a){1>=a.headContainer.length&&a.headContainer.find(".accordion-section-title").prepend('<span class="pro-title-block">Pro</span>')})})),!serverControlParams.isPro&&c.isFunction(a.Section)&&(proSectionConstructor=a.Section.extend({active:!0,attachEvents:function(){},isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}}),b.extend(a.sectionConstructor,{"czr-customize-section-pro":proSectionConstructor}))}(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(39, 59, 88, 0.12)",local:"rgba(39, 59, 88, 0.28)"},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"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.reject(),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)}var h=function(){d._writeCurrentSkopeTitle(),a.czr_bottomInfosVisible()?d.renderBottomInfosTmpl():a.czr_bottomInfosVisible(!0)};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()),h()}).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 i=c.findWhere(f,{skope:"local"}).opt_name,j=c.findWhere(b.czr_skopes,{skope:"local"}).opt_name;j!==i&&"resolved"==a.czr_skopeReady.state()&&h()}})})}}),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)}),d._setupPreviewNotificationsBlocks(),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)})})})}};a.czr_bottomInfosVisible()?e.renderBottomInfosTmpl():a.czr_bottomInfosVisible(!0),c.delay(function(){f()},500)};a.czr_skopeReady.then(function(){f()})},_setupPreviewNotificationsBlocks:function(){var d=this;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)}),a.czr_bottomInfosVisible=new a.Value((!1)),a.czr_skopeReady.then(function(){a.czr_bottomInfosVisible.bind(function(a){var c={},e={title:"",message:"",actions:"",selfCloseAfter:2e4};return c=b.extend(e,{}),d.toggleBottomInfos(a,c)},{deferred:!0});var e=a.CZR_Helpers.build_setId("show-skope-infos");a.when(e,function(b){a.czr_bottomInfosVisible.validate=function(a){var c=b(),d=0!==c&&"0"!==c&&!1!==c&&"off"!==c;return!!d&&a},b.bind(function(b){a.czr_bottomInfosVisible(0!==b&&"0"!==b&&!1!==b&&"off"!==b)})}),c.delay(function(){a.czr_bottomInfosVisible(!0)},2e3)})}})}(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-preview-note-close",actions:function(){i().done(function(){a.czr_topNoteVisible(!1),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().done(function(){a.czr_topNoteVisible(!1)}),c.delay(function(){a.czr_topNoteVisible(!1)},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({
|
12 |
-
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,{toggleBottomInfos:function(d,e){e=c.isObject(e)?e:{};var f=this,g=b.Deferred(),h={title:"",message:"",actions:"",selfCloseAfter:2e4},i=a.CZR_Helpers.build_setId("show-skope-infos"),j=function(){var d=b.Deferred();return b.when(f.renderBottomInfosTmpl(e)).done(function(g){f.bottomInfosContainer=g,c.delay(function(){b("body").addClass("czr-bottom-infos-open"),d.resolve()},200),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:".czr-preview-note-close",actions:function(){k().done(function(){a.czr_bottomInfosVisible(!1),c.isFunction(e.actions)&&e.actions()})}},{trigger:"click keydown",selector:".czr-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-disable-bottom-infos",actions:function(b){a.control.has(i)&&a.control(i).focus()}}],{dom_el:f.bottomInfosContainer},f)}).fail(function(){d.resolve()}),d.promise()},k=function(){return b.Deferred(function(){var a=this;b("body").removeClass("czr-bottom-infos-open"),f.bottomInfosContainer.length?c.delay(function(){f.bottomInfosContainer.remove(),f.bottomInfosContainer=!1,a.resolve()},300):a.resolve()})};return e=b.extend(h,e),d?j().always(function(){g.resolve()}):k().done(function(){a.czr_bottomInfosVisible(!1),g.resolve()}),g.promise()},renderBottomInfosTmpl:function(d){d=d||{};var e=this,f="",g=a.czr_activeSkopeId();if(!a.czr_skope.has(g)||!c.isObject(a.czr_skope(g)()))return!1;var h=a.czr_skope(g)().long_title,i=a.czr_skope(g)().ctx_title;h=c.isString(h)?h:"",i=c.isString(i)?i:"";var j=d.title||["Customizing",i.toLowerCase()].join(" "),k=d.message||e._getSkopeInfosMessage(g),l=function(){return b.Deferred(function(){var c=this;try{f=wp.template("czr-bottom-infos")({title:j}),b("#customize-preview").after(b(f)),c.resolve()}catch(d){a.errorLog("Error when parsing the the bottom infos template : "+d),c.reject(d)}})};return c.isUndefined(this.bottomInfosContainer)||1!=this.bottomInfosContainer.length?l().done(function(){b(".czr-note-message","#czr-bottom-infos").html(k)}):b(".czr-note-content",e.bottomInfosContainer).fadeOut({duration:"fast",complete:function(){b("h2",e.bottomInfosContainer).html(["·",j,"·"].join(" ")),b(".czr-note-message",e.bottomInfosContainer).html(k),b(this).fadeIn("fast")}}),this.bottomInfosContainer&&1==this.bottomInfosContainer.length?this.bottomInfosContainer:b("#czr-bottom-infos")},_getSkopeInfosMessage:function(d){d=d||a.czr_activeSkopeId();var e=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(!a.czr_skope.has(d)||!c.isObject(a.czr_skope(d)())||c.isUndefined(e))return"";var f,g=this,h=a.czr_skope(d)().skope,i=g.getInheritedSkopeTitles(),j=g.getOverridenSkopeTitles(),k=a.czr_skope(e)().ctx_title;a.czr_skope(d)().long_title;switch(h){case"global":f=[serverControlParams.i18n.skope["The customizations made site wide are inherited by all other levels of customization."],"<br/>",serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized more specifically at the following level"]+"(s)",":",j+"."].join(" ");break;case"group":f=[serverControlParams.i18n.skope["The current customizations will be applied to"],a.czr_skope(d)().ctx_title.toLowerCase()+".","<br/>",serverControlParams.i18n.skope["The options not customized at this level will inherit their value from"],i,".<br/>",serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized more specifically at the following level"],":",j+"."].join(" ");break;case"local":f=[serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized with a specific set of options."],"<br/>",serverControlParams.i18n.skope["The options not customized at this level will inherit their value from"],i+"."].join(" ")}return b.trim(['<span class="czr-skope-bottom-infos">',f,"</span>"].join(" "))}})}(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,e,f;if(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,{skope:d}),f=c.isUndefined(e)?c.findWhere(b,{skope:"global"}).id:e.id,c.isUndefined(f))throw new Error("No default skope was found in getActiveSkopeId ",b);return f},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){c.isUndefined(e)&&a.czr_skope.has(d)&&"global"==a.czr_skope(d)().skope?(g.resolve(b),a.state("switching-skope")(!1)):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(){
|
13 |
-
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(" "),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,j=a.czr_activeSkopeId(),k=f.getInheritedSkopeId(b,j),l=f.getAppliedPrioritySkopeId(b,j),m=[];return h(b)?(k==l&&a.czr_skope.has(k)&&j==k&&(e=!c.isUndefined(a.czr_skope(j).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(j).dbValues()[b]),i=a.czr_skope(k)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),e?"global"==a.czr_skope(k)().skope?m.push([serverControlParams.i18n.skope["Customized. Will be applied sitewide once published."]].join(" ")):m.push([serverControlParams.i18n.skope["Customized. Will be applied to"],"<strong>"+i+"</strong>",serverControlParams.i18n.skope["once published."]].join(" ")):g?"global"==a.czr_skope(k)().skope?m.push([serverControlParams.i18n.skope["Customized and applied sitewide."]].join(" ")):m.push([serverControlParams.i18n.skope["Customized and applied to"],"<strong>"+i+".</strong>"].join(" ")):m.push(serverControlParams.i18n.skope["Default website value applied sitewide."])),k!==j&&a.czr_skope.has(k)&&(e=!c.isUndefined(a.czr_skope(k).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(k).dbValues()[b]),i=a.czr_skope(j)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),e||g?m.push([serverControlParams.i18n.skope["Currently inherited from"],f.buildSkopeLink(k)+".",serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+i+".</strong>"].join(" ")):m.push([serverControlParams.i18n.skope["Default website value."],serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+i+".</strong>"].join(" "))),l!==j&&a.czr_skope.has(l)&&(e=!c.isUndefined(a.czr_skope(l).dirtyValues()[b]),i=a.czr_skope(d)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),m.push([e?serverControlParams.i18n.skope["The value that will be applied to"]:serverControlParams.i18n.skope["The value currently applied to"],"<strong>"+i+"</strong>",e?serverControlParams.i18n.skope["is customized in"]:serverControlParams.i18n.skope["is set in"],f.buildSkopeLink(l),serverControlParams.i18n.skope["which has a higher priority than the current option scope"],"<strong>( "+a.czr_skope(j)().title+" ).</strong>"].join(" "))),m.join(" | ")):(m.push([serverControlParams.i18n.skope["This option is always customized sitewide and cannot be reset."]].join(" ")),m.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=[],j=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),i[b.id]||(i[b.id]={}),i[b.id][c.code]=c)})}),e=a.findControlsForSettings(h),!c.isEmpty(e)))return c.values(e)[0][0].focus(),j.rejectWith(f.previewer,[{setting_invalidities:i}]).promise();var k={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(k,{excludeCustomizedSaved:!1});var l=b.extend(f.previewer.query(k),{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&&(l.customize_changeset_date=f.saveArgs.date),f.saveArgs&&f.saveArgs.title&&(l.customize_changeset_title=f.saveArgs.title));var m=wp.ajax.post("global"!==l.skope?"customize_skope_changeset_save":"customize_save",l);return f.saveBtn.prop("disabled",!0),a.trigger("save",m),m.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),j.reject(b)}),m.done(function(a){j.resolve(a)}),j.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,{
|
14 |
-
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),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)})}),f.enabled=new a.Value((!0)),f.isReady.done(function(){f.enabled.bind(function(a){f.container.toggleClass("disabled",!a)})})},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;e.enabled()&&(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),
|
15 |
-
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.errorLog("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.errorLog("content_picker : missing input param : "+d)}),void e.set(h))}}],e.setupDOMListeners(f,{dom_el:e.container},e),e.isReady.done(function(){e.setupContentSelecter()})},setupContentSelecter:function(){var a=this;if(!c.isEmpty(a())){var d={value:a().id||"",title:a().title||"",selected:"selected"};a.container.find("select").append(b("<option>",d))}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: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=[];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:b.data.items.length>=10}}}},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='czr-picker-item-title'>"+a.title+"</span>";return a.type_label&&(b+="<span class='czr-picker-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(){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,d=this.module,e=c.clone(d.itemCollection());d.trigger("pre_item_dom_remove",a()),a._destroyView(),e=c.without(e,c.findWhere(e,{id:a.id})),d.itemCollection.set(e),d.trigger("pre_item_api_remove",a());var f=b.extend(!0,{},a());d.czr_Item.remove(a.id),d.trigger("item-removed",f)},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(d,h){var i=-1!==d.indexOf("expanded");f.hasModOpt()&&i&&a.czr_ModOptVisible(!1),i?c.isObject(e.contentContainer)&&!1!==e.contentContainer.length?e.toggleItemExpansion(d,h):b.when(e.renderItemContent(e()||e.initial_item_model)).done(function(a){(g=c.debounce(g,50))(a,d,h)}):e.toggleItemExpansion(d,h).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(d,g,h){h=h||{},d?(e.module.closeRemoveDialogs().closeAllItems(),e.modOptWrapperViewSetup(f).done(function(b){e.container=b;try{a.CZR_Helpers.setupInputCollectionFromDOM.call(e).toggleModPanelView(d)}catch(f){a.consoleLog(f)}h.module&&h.focus&&c.delay(function(){!c.isNull(h.module.czr_ModOpt.container)&&h.module.czr_ModOpt.container.find('[data-tab-id="'+h.focus+'"] a').length&&h.module.czr_ModOpt.container.find('[data-tab-id="'+h.focus+'"] a').trigger("click")},200)})):e.toggleModPanelView(d).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.itemsWrapper="",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,isPartialRefresh:d.isPartialRefresh}),e.trigger("input_sent",{input:d.to,dom_el:e.container}))},sendModuleInputsToPreview:function(a){var d=this,e=function(){var e=this,f=b.extend(!0,{},e());f=c.omit(f,"id"),c.each(f,function(b,c){d.sendInputToPreview({input_id:c,input_parent_id:e.id,to:b,from:null,isPartialRefresh:a.isPartialRefresh})})};d.czr_Item.each(function(a){e.call(a)}),d.hasModOpt()&&e.call(d.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(){
|
16 |
-
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.preItemsWrapper="",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(a){c.preItemsWrapper=a,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(d){var e=this,f=e.preItem(),g=function(){e.preItemExpanded.set(!1),e._resetPreItemInputs()},h=b.Deferred();return c.isEmpty(f)||!c.isObject(f)?(a.errorLog("addItem : an item should be an object and not empty. In : "+e.id+". Aborted."),h.resolve().promise()):(g=c.debounce(g,200),e.instantiateItem(f,!0).ready(),function(){return b.Deferred(function(){var b=this;e.czr_Item(f.id).isReady.then(function(){g(),e.trigger("item-added",f),"postMessage"!=a(e.control.id).transport||!c.has(d,"dom_event")||c.has(d.dom_event,"isTrigger")||a.CZR_Helpers.hasPartRefresh(e.control.id)?b.resolve():e.control.previewer.refresh().done(function(){b.resolve()})})}).promise()}().done(function(){e.czr_Item(f.id).viewState("expanded")}).always(function(){h.resolve()}),h.promise())},_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(f)}},_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"],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()+'"> '+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+'"> '+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.settings["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{value:[]});a.settings.settings[j]=k,a.create(j,j,k.value,{transport:k.transport,previewer:a.previewer,dirty:!1});var l=b.extend(c.clone(a.settings.controls["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{settings:{"default":j}}),m={};c.each(l,function(a,b){"string"==typeof a&&(a=a.replace(f.serverParams.defaultWidgetSidebar,g.id)),m[b]=a}),m.instanceNumber=c.max(a.settings.controls,function(a){return a.instanceNumber}).instanceNumber+1,a.settings.controls[j]=m,a.control.add(j,new a.controlConstructor[m.type](j,{params:m,previewer:a.previewer})),c.has(this,"container")&&this.container.trigger("widget_zone_created",{model:g,section_id:"sidebar-widgets-"+g.id,setting_id:j})},removeWidgetSidebar:function(d){var e=this;if(!c.isObject(d)||c.isEmpty(d))throw new Error("No valid data were provided to remove a Widget Zone.");a.Widgets.registeredSidebars.remove(d.id),a.section.has("sidebar-widgets-"+d.id)&&(a.section("sidebar-widgets-"+d.id).container.remove(),a.section.remove("sidebar-widgets-"+d.id),delete a.settings.sections["sidebar-widgets-"+d.id]),a.has("sidebars_widgets["+d.id+"]")&&(a.remove("sidebars_widgets["+d.id+"]"),delete a.settings.settings["sidebars_widgets["+d.id+"]"]),a.control.has("sidebars_widgets["+d.id+"]")&&(a.control("sidebars_widgets["+d.id+"]").container.remove(),a.control.remove("sidebars_widgets["+d.id+"]"),delete a.settings.controls["sidebars_widgets["+d.id+"]"]);var f=function(){a.previewer.refresh()};f=c.debounce(f,500),b.when(f()).done(function(){e.trigger("widget_zone_removed",{model:d,section_id:"sidebar-widgets-"+d.id,setting_id:"sidebars_widgets["+d.id+"]"})})},widgetPanelReact:function(){var b=this,d=a.panel("widgets").container.find(".control-panel-content").css("margin-top");a.section(b.serverParams.dynWidgetSection).fixTopMargin("value").set(d);var e=a.section(b.serverParams.dynWidgetSection).container.find(".accordion-section-content"),f=a.panel("widgets").container.find(".control-panel-content"),g=function(){e.css("margin-top",""),f.css("margin-top",a.section(b.serverParams.dynWidgetSection).fixTopMargin("value")())};a.bind("pane-contents-reflowed",c.debounce(function(){g()},150)),b.closeAllItems().closeRemoveDialogs(),c.has(b,"preItemExpanded")&&b.preItemExpanded.set(!1)},widgetSectionReact:function(c,d){var e=this,f=a.section(e.serverParams.dynWidgetSection),g=f.container.closest(".wp-full-overlay-sidebar-content"),h=f.container.find(".accordion-section-content"),i=f.container.closest(".wp-full-overlay"),j=(f.container.find(".customize-section-back"),f.container.find(".accordion-section-title").first());b("#customize-header-actions").height();c&&(i.removeClass("section-open"),h.css("height","auto"),j.attr("tabindex","0"),h.css("margin-top",""),g.scrollTop(0)),e.closeAllItems().closeRemoveDialogs(),h.slideToggle()},listenToSidebarInsights:function(){var d=this;a.sidebar_insights("registered").callbacks.add(function(a){var b=c.clone(d.itemCollection());c.each(b,function(b){d.getViewEl(b.id).length&&d.getViewEl(b.id).css("display",c.contains(a,b.id)?"block":"none")})}),a.sidebar_insights("inactives").callbacks.add(function(a){var e=c.clone(d.itemCollection());c.each(e,function(e){d.getViewEl(e.id).length&&(c.contains(a,e.id)?(d.getViewEl(e.id).addClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length||d.getViewEl(e.id).find(".czr-item-title").append(b("<span/>",{"class":"czr-inactive-alert",html:" [ "+serverControlParams.i18n.inactiveWidgetZone+" ]"}))):(d.getViewEl(e.id).removeClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length&&d.getViewEl(e.id).find(".czr-inactive-alert").remove()))})}),a.sidebar_insights("candidates").callbacks.add(function(b){c.isArray(b)&&c.each(b,function(b){c.isObject(b)&&(a.section.has("sidebar-widgets-"+b.id)||(d.addWidgetSidebar({},b),c.has(a.sidebar_insights("actives")(),b.id)&&a.section.has("sidebar-widgets-"+b.id)&&a.section("sidebar-widgets-"+b.id).activate()))})})},_adjustScrollExpandedBlock:function(a,c){if(a.length){var d,e=b(".wp-full-overlay-sidebar-content").scrollTop(),f=c||90;setTimeout(function(){a.offset().top+a.height()+f>b(window.top).height()&&(d=a.offset().top+a.height()+f-b(window.top).height(),b(".wp-full-overlay-sidebar-content").animate({scrollTop:e+d},600))},50)}},getDefaultItemModel:function(a){var d=this,e=d.itemCollection(),f=c.clone(d.defaultItemModel);f.contexts;return b.extend(f,{title:"Widget Zone "+(1*c.size(e)+1)})},getTemplateEl:function(a,b){var d,e=this;switch("rudItemPart"==a?a=c.has(b,"is_builtin")&&b.is_builtin?"ruItemPart":a:"itemInputList"==a&&(a=c.has(b,"is_builtin")&&b.is_builtin?"itemInputListReduced":a),a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"itemInputList":d=e.itemInputList;break;case"itemInputListReduced":d=e.itemInputListReduced}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl()");return d},_toggleLocationAlertExpansion:function(c,d){var e=c.find(".czr-location-alert");if(!e.length){var f=["<span>"+serverControlParams.i18n.locationWarning+"</span>",a.CZR_Helpers.getDocSearchLink(serverControlParams.i18n.locationWarning)].join("");e=b("<div/>",{"class":"czr-location-alert",html:f,style:"display:none"}),b('select[data-type="locations"]',c).closest("div").after(e)}e.toggle("expanded"==d)}})}(wp.customize,jQuery,_);var CZRBodyBgModuleMths=CZRBodyBgModuleMths||{};!function(a,b,c){b.extend(CZRBodyBgModuleMths,{initialize:function(d,e){var f=this;a.CZRModule.prototype.initialize.call(f,d,e),b.extend(f,{itemInputList:"czr-module-bodybg-item-content"}),f.inputConstructor=a.CZRInput.extend(f.CZRBodyBgInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZBodyBgItemMths||{}),f.defaultItemModel={"background-color":"#eaeaea","background-image":"","background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center center","background-size":"cover"},a.consoleLog("New module instantiated : ",f.id),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()})},CZRBodyBgInputMths:{setupSelect:function(){var a=this,d={"background-repeat":"bg_repeat_options","background-attachment":"bg_attachment_options","background-position":"bg_position_options"},e=(a.input_parent,serverControlParams.body_bg_module_params),f={};a.module;c.has(d,a.id)&&(c.isUndefined(e)||c.isUndefined(e[d[a.id]])||(f=e[d[a.id]],c.isEmpty(f)||(c.each(f,function(d,e){var f={value:e,html:d};(e==a()||c.contains(a(),e))&&b.extend(f,{selected:"selected"}),b("select[data-type]",a.container).append(b("<option>",f))}),b("select[data-type]",a.container).select2())))}},CZBodyBgItemMths:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.inputCollection.bind(function(a){!c.isEmpty(_col)&&b.czr_Input&&b.czr_Input.has("background-image")&&b.czr_Input("background-image").isReady.done(function(a){var d=function(a){var d=!c.isEmpty(a)||c.isNumber(a);c.each(["background-repeat","background-attachment","background-position","background-size"],function(a){b.czr_Input(a).container.toggle(d||!1)})};d(a()),b.bind("background-image:changed",function(){d(b.czr_Input("background-image")())})})})}}})}(wp.customize,jQuery,_),function(a,b,c){a.czrModuleMap=a.czrModuleMap||{},b.extend(a.czrModuleMap,{czr_widget_areas_module:{mthds:CZRWidgetAreaModuleMths,crud:!0,sektion_allowed:!1,name:"Widget Areas"},czr_social_module:{mthds:CZRSocialModuleMths,crud:!0,name:"Social Icons",has_mod_opt:!0},czr_background:{mthds:CZRBodyBgModuleMths,crud:!1,multi_item:!1,name:"Slider"}})}(wp.customize,jQuery,_);var CZRBaseControlMths=CZRBaseControlMths||{};!function(a,b,c){b.extend(CZRBaseControlMths,{initialize:function(b,d){var e=this;e.css_attr=c.has(serverControlParams,"css_attr")?serverControlParams.css_attr:{},a.Control.prototype.initialize.call(e,b,d),e.bind("czr-partial-refresh-done",function(){c.has(e,"czr_moduleCollection")&&c.each(e.czr_moduleCollection(),function(a){e.czr_Module(a.id)&&e.czr_Module(a.id).sendModuleInputsToPreview({isPartialRefresh:!0})})})},refreshPreview:function(a){this.previewer.refresh()}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{initialize:function(d,e){var f=this;f.czr_Module=new a.Values,f.czr_moduleCollection=new a.Value,f.czr_moduleCollection.set([]),f.moduleCollectionReady=b.Deferred(),f.moduleCollectionReady.done(function(a){!f.isMultiModuleControl(e.params),f.czr_moduleCollection.callbacks.add(function(){return f.moduleCollectionReact.apply(f,arguments)})}),f.isMultiModuleControl(e.params)&&(f.syncSektionModule=new a.Value),a.CZRBaseControl.prototype.initialize.call(f,d,e),a.section(f.section()).expanded.bind(function(a){f.czr_Module.each(function(a){a.closeAllItems().closeRemoveDialogs(),c.has(a,"preItem")&&a.preItemExpanded(!1)})})},ready:function(){var b=this;if(b.isMultiModuleControl())b.syncSektionModule.bind(function(a,c){"resolved"!=b.moduleCollectionReady.state()&&(b.registerModulesOnInit(a),b.moduleCollectionReady.resolve())});else{var d={};c.each(b.getSavedModules(),function(c,e){d=c;try{b.instantiateModule(c,{})}catch(f){return void a.errorLog("Failed to instantiate module "+c.id+" "+f)}b.container.attr("data-module",c.id)}),b.moduleCollectionReady.resolve(d)}b.bind("user-module-candidate",function(c){var d;try{d=b.instantiateModule(c,{})}catch(e){return void a.errorLog("Failed to instantiate module "+c.id+" "+e)}d.ready(c.is_added_by_user)})},getDefaultModuleApiModel:function(){var a={id:"",module_type:"",modOpt:{},items:[],crud:!1,multi_item:!1,sortable:!1,control:{}};return this.isMultiModuleControl()?b.extend(a,{column_id:"",sektion:{},sektion_id:"",is_added_by_user:!1,dirty:!1}):b.extend(a,{section:""})},getDefaultModuleDBModel:function(){var a={items:[]};return this.isMultiModuleControl()?b.extend(a,{id:"",module_type:"",column_id:"",sektion_id:"",dirty:!1}):a},isMultiModuleControl:function(a){return"czr_multi_module"==(a||this.params).type},getSyncCollectionControl:function(){var b=this;if(c.isUndefined(b.params.syncCollection))throw new Error("Control "+b.id+" has no synchronized sektion control defined.");return a.control(a.CZR_Helpers.build_setId(b.params.syncCollection))},getSavedModules:function(){var d=this,e=[],f=d.params.module_type,g=[],h=[],i={};return d.isMultiModuleControl()?e=b.extend(!0,[],a(d.id)()):(!a.CZR_Helpers.isMultiItemModule(f)||c.isEmpty(a(d.id)())||c.isObject(a(d.id)())||a.consoleLog("Module Control Init for "+d.id+" : a mono item module control value should be an object if not empty."),g=c.isArray(a(d.id)())?a(d.id)():[a(d.id)()],c.each(g,function(b,e){a.CZR_Helpers.hasModuleModOpt(f)&&0===e&&(c.has(b,"id")?a.consoleLog("getSavedModules : the module "+f+" in control "+d.id+" has no mod_opt defined while it should."):i=b),c.has(b,"id")&&!c.has(b,"is_mod_opt")&&h.push(b)}),e.push({id:a.CZR_Helpers.getOptionName(d.id)+"_"+d.params.type,module_type:d.params.module_type,section:d.section(),modOpt:b.extend(!0,{},i),items:b.extend(!0,[],h)})),e},isModuleRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.czr_moduleCollection(),{id:a}))}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{instantiateModule:function(a,b){if(!c.has(a,"id"))throw new Error("CZRModule::instantiateModule() : a module has no id and could not be added in the collection of : "+this.id+". Aborted.");var d=this;if((c.isUndefined(b)||c.isEmpty(b))&&(b=d.getModuleConstructor(a)),!c.isEmpty(a.id)&&d.czr_Module.has(a.id))throw new Error("The module id already exists in the collection in control : "+d.id);var e=d.prepareModuleForAPI(a);if(d.czr_Module.add(e.id,new b(e.id,e)),!d.czr_Module.has(e.id))throw new Error("instantiateModule() : instantiation failed for module id "+e.id+" in control "+d.id);return d.czr_Module(e.id)},getModuleConstructor:function(b){var d=this,e={},f={};if(!c.has(b,"module_type"))throw new Error("CZRModule::getModuleConstructor : no module type found for module "+b.id);if(!c.has(a.czrModuleMap,b.module_type))throw new Error("Module type "+b.module_type+" is not listed in the module map api.czrModuleMap.");var g=a.czrModuleMap[b.module_type].mthds,h=a.czrModuleMap[b.module_type].crud,i=h?a.CZRDynModule:a.CZRModule;if(c.isEmpty(b.sektion_id)?f=i.extend(g):(e=i.extend(g),f=e.extend(d.getMultiModuleExtender(e))),
|
17 |
-
c.isUndefined(f)||c.isEmpty(f)||!f)throw new Error("CZRModule::getModuleConstructor : no constructor found for module type : "+b.module_type+".");return f},prepareModuleForAPI:function(b){if(!c.isObject(b))throw new Error("prepareModuleForAPI : a module must be an object to be instantiated.");var d=this,e={};return c.each(d.getDefaultModuleApiModel(),function(f,g){var h=b[g];switch(g){case"id":c.isEmpty(h)?e[g]=d.generateModuleId(b.module_type):e[g]=h;break;case"module_type":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module type must a string not empty");e[g]=h;break;case"items":if(!c.isArray(h))throw new Error("prepareModuleForAPI : a module item list must be an array");e[g]=h;break;case"modOpt":if(!c.isObject(h))throw new Error("prepareModuleForAPI : a module modOpt property must be an object");e[g]=h;break;case"crud":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "crud" must be a boolean');e[g]=h||!1;break;case"multi_item":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "multi_item" must be a boolean');e[g]=h||!1;break;case"sortable":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].sortable||a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "sortable" must be a boolean');e[g]=h||!1;break;case"control":e[g]=d;break;case"section":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module section must be a string not empty");e[g]=h;break;case"column_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module column id must a string not empty");e[g]=h;break;case"sektion":if(!c.isObject(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion must be an object not empty");e[g]=h;break;case"sektion_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion id must be a string not empty");e[g]=h;break;case"is_added_by_user":if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "is_added_by_user" must be a boolean');e[g]=h||!1;break;case"dirty":e[g]=h||!1}}),e},generateModuleId: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._getNextModuleKeyInCollection();var f=a+"_"+b;if(!c.has(e,"czr_moduleCollection")||!c.isArray(e.czr_moduleCollection()))throw new Error("The module collection does not exist or is not properly set in control : "+e.id);return e.isModuleRegistered(f)?(b++,d++,e.generateModuleId(a,b,d)):f},_getNextModuleKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.czr_moduleCollection())||(b=c.max(a.czr_moduleCollection(),function(a){return parseInt(a.id.replace(/[^\/\d]/g,""),10)}),d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{registerModulesOnInit:function(d){var e=this,f=[];c.each(e.getSavedModules(),function(g,h){if(!d.czr_Item.has(g.sektion_id))return a.errorLog("Warning Module "+g.id+" is orphan : it has no sektion to be embedded to. It Must be removed."),void f.push(g);var i=d.czr_Item(g.sektion_id);if(c.isUndefined(i))throw new Error("sektion instance missing. Impossible to instantiate module : "+g.id);b.extend(g,{sektion:i}),e.updateModulesCollection({module:g})}),e.moduleCollectionReady.then(function(){c.isEmpty(f)||e.moduleCollectionReact(e.czr_moduleCollection(),[],{orphans_module_removal:f})})},updateModulesCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);if(c.has(a,"collection"))return void d.czr_moduleCollection.set(a.collection,a.data||{});if(!c.has(a,"module"))throw new Error("updateModulesCollection, no module provided "+d.id+". Aborting");var g=d.prepareModuleForAPI(c.clone(a.module));c.findWhere(f,{id:g.id})?c.each(e,function(a,b){a.id==g.id&&(f[b]=g)}):f.push(g);var h={};c.has(a,"data")&&(h=b.extend(!0,{},a.data),b.extend(h,{module:g})),d.czr_moduleCollection.set(f,h)},moduleCollectionReact:function(d,e,f){var g=this,h=c.size(d)>c.size(e),i=c.size(e)>c.size(d);c.size(e)==c.size(d);if(is_collection_sorted=!1,i){var j=c.filter(e,function(a){return c.isUndefined(c.findWhere(d,{id:a.id}))});j=j[0],g.czr_Module.remove(j.id)}c.isObject(f)&&c.has(f,"module")&&(f.module_id=f.module.id,f.module=g.prepareModuleForDB(b.extend(!0,{},f.module))),!g.isMultiModuleControl()&&h||a(this.id).set(g.filterModuleCollectionBeforeAjax(d),f)},filterModuleCollectionBeforeAjax:function(a){var d,e=this,f=b.extend(!0,[],a);if(c.each(a,function(a,c){var d=b.extend(!0,{},a);f[c]=e.prepareModuleForDB(d)}),e.isMultiModuleControl())return f;if(c.size(a)>1)throw new Error("There should not be several modules in the collection of control : "+e.id);if(!c.isArray(a)||c.isEmpty(a)||!c.has(a[0],"items"))throw new Error("The setting value could not be populated in control : "+e.id);var g=a[0].id;if(!e.czr_Module.has(g))throw new Error("The single module control ("+e.id+") has no module registered with the id "+g);var h=e.czr_Module(g);if(!c.isArray(h().items))throw new Error("The module "+g+" should be an array in control : "+e.id);return d=h.isMultiItem()?h().items:h().items[0]||[],h.hasModOpt()?c.union([h().modOpt],d):d},prepareModuleForDB:function(a){if(!c.isObject(a))throw new Error("MultiModule Control::prepareModuleForDB : a module must be an object. Aborting.");var b=this,d={};return c.each(b.getDefaultModuleDBModel(),function(e,f){if(!c.has(a,f))throw new Error("MultiModule Control::prepareModuleForDB : a module is missing the property : "+f+" . Aborting.");var g=a[f];switch(f){case"items":if(!c.isArray(g))throw new Error("prepareModuleForDB : a module item list must be an array");d[f]=g;break;case"id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module id must a string not empty");d[f]=g;break;case"module_type":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module type must a string not empty");d[f]=g;break;case"column_id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module column id must a string not empty");d[f]=g;break;case"sektion_id":if(!c.isObject(a.sektion)||!c.has(a.sektion,"id"))throw new Error("prepareModuleForDB : a module sektion must be an object with an id.");d[f]=a.sektion.id;break;case"dirty":if(b.czr_Module.has(a.id)?d[f]=b.czr_Module(a.id).isDirty():d[f]=g,!c.isBoolean(d[f]))throw new Error("prepareModuleForDB : a module dirty state must be a boolean.")}}),d}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{initialize:function(b,c){var d=this;a.consoleLog("IN MULTI MODULE INITIALIZE ? ",c),a(b).callbacks.add(function(){return d.syncColumn.apply(d,arguments)}),a.CZRBaseModuleControl.prototype.initialize.call(d,b,c)},ready:function(){var b=this;a.consoleLog("MODULE-COLLECTION CONTROL READY",this.id),a.CZRBaseModuleControl.prototype.ready.apply(b,arguments)},syncColumn:function(d,e,f){if(a.consoleLog("IN SYNC COLUMN",d,e,f),(c.isUndefined(f)||!f.silent)&&(a.consoleLog("IN SYNXXX",a.control("hu_theme_options[module-collection]").syncSektionModule()(),this.syncSektionModule()(),this.id),!c.has(f,"orphans_module_removal"))){var g=a.control(this.id),h=c.filter(d,function(a,b){return!c.findWhere(e,{id:a.id})});c.isEmpty(h)||(a.consoleLog("ADDED MODULE?",h),c.each(h,function(a){g.syncSektionModule().czr_Column(a.column_id).updateColumnModuleCollection({module:a})}));var i=c.filter(e,function(a,b){return!c.findWhere(d,{id:a.id})});c.isEmpty(i)||c.each(i,function(a){g.syncSektionModule().czr_Column(a.column_id).removeModuleFromColumnCollection(a)}),c.size(e)==c.size(d)&&c.has(f,"module")&&c.has(f,"source_column")&&c.has(f,"target_column")&&b.when(g.syncSektionModule().moveModuleFromTo(f.module,f.source_column,f.target_column)).done(function(){g.syncSektionModule().control.trigger("module-moved",{module:f.module,source_column:f.source_column,target_column:f.target_column})}),g.trigger("columns-synchronized",d)}},removeModule:function(a){var b=this;b.czr_Module.has(a.id)&&"resolved"==b.czr_Module(a.id).embedded.state()&&b.czr_Module(a.id).container.remove(),b.removeModuleFromCollection(a)},removeModuleFromCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);f=c.filter(f,function(b){return b.id!=a.id}),d.czr_moduleCollection.set(f)}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{getMultiModuleExtender:function(d){var e=this;return b.extend(e.CZRModuleExtended,{initialize:function(c,e){var f=this;d.prototype.initialize.call(f,c,e),a.consoleLog("MODULE INSTANTIATED : ",f.id),b.extend(f,{singleModuleWrapper:"czr-single-module-wrapper",sektionModuleTitle:"czr-module-sektion-title-part",ruModuleEl:"czr-ru-module-sektion-content"}),f.czr_ModuleState=new a.Value((!1)),f.isReady.done(function(){f.setupModuleView()}),f.moduleTitleEmbedded=b.Deferred(),f.modColumn=new a.Value,f.modColumn.set(e.column_id),f.modColumn.bind(function(c,d){a.consoleLog("MODULE "+f.id+" HAS BEEN MOVED TO COLUMN",c,f());var e=f(),g=b.extend(!0,{},e);g.column_id=c,f.set(g,{target_column:c,source_column:d})})},ready:function(e){var f=this;a.consoleLog("MODULE READY IN EXTENDED MODULE CLASS : ",f.id),b.when(f.renderModuleWrapper(e)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module container has not been embedded for module :"+f.id);f.container=a,f.embedded.resolve()}),d.prototype.ready.call(f)}}),e.CZRModuleExtended},CZRModuleExtended:{renderModuleWrapper:function(a){var c=this;if("resolved"==c.embedded.state())return c.container;if(0===b("#tmpl-"+c.singleModuleWrapper).length)throw new Error("No template for module "+c.id+". The template script id should be : #tmpl-"+c.singleModuleWrapper);var d=wp.template(c.singleModuleWrapper),e={id:c.id,type:c.module_type},f=b(d(e));return a?b.when(b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").after(f)).done(function(){b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").remove()}):b(".czr-module-collection-wrapper",c._getColumn().container).append(f),f},setupModuleView:function(){var b=this;b.view_event_map=[{trigger:"click keydown",selector:[".czr-remove-mod","."+b.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:["toggleModuleRemoveAlert"]},{trigger:"click keydown",selector:"."+b.control.css_attr.remove_view_btn,name:"remove_module",actions:["removeModule"]},{trigger:"click keydown",selector:".czr-edit-mod",name:"edit_module",actions:["setModuleViewVisibility","sendEditModule"]},{trigger:"click keydown",selector:".czr-module-back",name:"back_to_column",actions:["setModuleViewVisibility"]},{trigger:"mouseenter",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("start_hovering_module",{id:b.id})}},{trigger:"mouseleave",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("stop_hovering_module",{id:b.id})}}],b.embedded.done(function(){b.czr_ModuleState.callbacks.add(function(){return b.setupModuleViewStateListeners.apply(b,arguments)}),a.CZR_Helpers.setupDOMListeners(b.view_event_map,{module:{id:b.id},dom_el:b.container},b)})},setModuleViewVisibility:function(c,d){var e=this;e.czr_ModuleState(!e.czr_ModuleState()),a.czrModulePanelState.set(!1),a.czrSekSettingsPanelState.set(!1),e.control.syncSektionModule().closeAllOtherSektions(b(c.dom_event.currentTarget,c.dom_el))},sendEditModule:function(a){var b=this;b.control.previewer.send("edit_module",{id:b.id})},setupModuleViewStateListeners:function(c){var d=this;a.czr_isModuleExpanded=a.czr_isModuleExpanded||new a.Value,c?a.czr_isModuleExpanded(d):a.czr_isModuleExpanded(!1),b.when(d.toggleModuleViewExpansion(c)).done(function(){c?(d.renderModuleTitle(),d.populateSavedItemCollection()):d.czr_Item.each(function(a){a.viewState.set("closed"),a._destroyView(0),d.czr_Item.remove(a.id)})})},renderModuleTitle:function(){var a=this;if("resolved"!=a.moduleTitleEmbedded.state()){if(0===b("#tmpl-"+a.sektionModuleTitle).length)throw new Error("No sektion title Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.sektionModuleTitle);b.when(b(a.container).find(".czr-mod-content").prepend(b(wp.template(a.sektionModuleTitle)({id:a.id})))).done(function(){a.moduleTitleEmbedded.resolve()})}},toggleModuleViewExpansion:function(a,c){var d=this;b(".czr-mod-content",d.container).slideToggle({duration:c||200,done:function(){var b=d.container.closest(".wp-full-overlay"),c=d.container.find(".czr-module-back"),e=d.container.find(".czr-module-title");d.container.toggleClass("open",a),b.toggleClass("czr-module-open",a),e.attr("tabindex",a?"-1":"0"),c.attr("tabindex",a?"0":"-1"),a?c.focus():e.focus(),a&&d._adjustScrollExpandedBlock(d.container)}})},toggleModuleRemoveAlert:function(a){var d=this,e=this.control,f=b("."+d.control.css_attr.remove_alert_wrapper,d.container).first(),g=(a.dom_event,e.syncSektionModule().czr_Column(d.column_id).container);if(c.has(d,"preItem")&&e.syncSektionModule().preItemExpanded.set(!1),b("."+d.control.css_attr.remove_alert_wrapper,g).not(f).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+d.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),!wp.template(d.AlertPart)||!d.container)throw new Error("No removal alert template available for module :"+d.id);f.html(wp.template(d.AlertPart)({title:d().title||d.id})),f.slideToggle({duration:200,done:function(){var c=!b(this).hasClass("open")&&b(this).is(":visible");b(this).toggleClass("open",c),b(a.dom_el).find("."+d.control.css_attr.display_alert_btn).toggleClass("active",c),c&&d._adjustScrollExpandedBlock(d.container)}})},removeModule:function(a){this.control.removeModule(a.module)},_getColumn:function(){var a=this;return a.control.syncSektionModule().czr_Column(a.modColumn())},_getSektion:function(){}}})}(wp.customize,jQuery,_);var CZRMultiplePickerMths=CZRMultiplePickerMths||{};!function(a,b,c){b.extend(CZRMultiplePickerMths,{ready:function(){function a(a){return a.text.replace(/\u2013|\u2014/g,"")}var c=this,d=this.container.find("select");d.select2({closeOnSelect:!1,templateSelection:a}),d.on("change",function(a){0===b(this).find("option:selected").length&&c.setting.set([])})}})}(wp.customize,jQuery,_);var CZRCroppedImageMths=CZRCroppedImageMths||{};!function(a,b,c){"function"==typeof wp.media.controller.Cropper&&"function"==typeof a.CroppedImageControl&&(wp.media.controller.CZRCustomizeImageCropper=wp.media.controller.Cropper.extend({doCrop:function(a){var b=a.get("cropDetails"),c=this.get("control");return b.dst_width=c.params.dst_width,b.dst_height=c.params.dst_height,wp.ajax.post("crop-image",{wp_customize:"on",nonce:a.get("nonces").edit,id:a.get("id"),context:c.id,cropDetails:b})}}),b.extend(CZRCroppedImageMths,{initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CZRCustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON();return a.mime&&a.mime.indexOf("image")>-1?void(c.contains(["image/svg+xml","image/gif"],a.mime)||this.params.width===a.width&&this.params.height===a.height&&!this.params.flex_width&&!this.params.flex_height?(this.setImageFromAttachment(a),this.frame.close()):this.frame.setState("cropper")):void this.frame.trigger("content:error")}}))}(wp.customize,jQuery,_);var CZRUploadMths=CZRUploadMths||{};!function(a,b,c){b.extend(CZRUploadMths,{ready:function(){var c=this;this.params.removed=this.params.removed||"",this.success=b.proxy(this.success,this),this.uploader=b.extend({container:this.container,browser:this.container.find(".czr-upload"),success:this.success,plupload:{},params:{}},this.uploader||{}),c.params.extensions&&(c.uploader.plupload.filters=[{title:a.l10n.allowedFiles,extensions:c.params.extensions}]),c.params.context&&(c.uploader.params["post_data[context]"]=this.params.context),a.settings.theme.stylesheet&&(c.uploader.params["post_data[theme]"]=a.settings.theme.stylesheet),this.uploader=new wp.Uploader(this.uploader),this.remover=this.container.find(".remove"),this.remover.on("click keydown",function(a){"keydown"===a.type&&13!==a.which||(c.setting.set(c.params.removed),a.preventDefault())}),this.removerVisibility=b.proxy(this.removerVisibility,this),this.setting.bind(this.removerVisibility),this.removerVisibility(this.setting())},success:function(a){this.setting.set(a.get("id"))},removerVisibility:function(a){this.remover.toggle(a!=this.params.removed)}})}(wp.customize,jQuery,_);var CZRLayoutSelectMths=CZRLayoutSelectMths||{};!function(a,b,c){b.extend(CZRLayoutSelectMths,{ready:function(){this.setupSelect()},setupSelect:function(a){function d(a){if(!a.id)return a.text;if(c.has(e.params.layouts,a.element.value)){var d=e.params.layouts[a.element.value],f=d.src,g=d.label,h=b('<img src="'+f+'" class="czr-layout-img" title="'+g+'" /><span class="czr-layout-title">'+g+"</span>");return h}}var e=this;$_select=this.container.find("select"),$_select.select2({templateResult:d,templateSelection:d,minimumResultsForSearch:1/0})}})}(wp.customize,jQuery,_),function(a,b,c){b.extend(CZRBaseControlMths,a.Events),b.extend(a.Control.prototype,a.Events),b.extend(CZRModuleMths,a.Events),b.extend(CZRItemMths,a.Events),b.extend(CZRModOptMths,a.Events),b.extend(CZRSkopeBaseMths,a.Events),b.extend(CZRSkopeMths,a.Events),b.extend(CZRBaseControlMths,a.CZR_Helpers),b.extend(CZRInputMths,a.CZR_Helpers),b.extend(CZRModuleMths,a.CZR_Helpers),b.extend(CZRSkopeMths,a.CZR_Helpers),a.CZR_skopeBase=a.Class.extend(CZRSkopeBaseMths),a.CZR_skopeSave=a.Class.extend(CZRSkopeSaveMths),a.CZR_skopeReset=a.Class.extend(CZRSkopeResetMths),a.CZR_skope=a.Value.extend(CZRSkopeMths),c.has(a,"HeaderTool")&&(a.czr_HeaderTool=b.extend(!0,{},a.HeaderTool)),a.CZRInput=a.Value.extend(CZRInputMths),a.CZRItem=a.Value.extend(CZRItemMths),a.CZRModOpt=a.Value.extend(CZRModOptMths),a.CZRModule=a.Value.extend(CZRModuleMths),a.CZRDynModule=a.CZRModule.extend(CZRDynModuleMths),c.isUndefined(window.CZRColumnMths)||(a.CZRColumn=a.Value.extend(CZRColumnMths)),a.CZRBaseControl=a.Control.extend(CZRBaseControlMths),a.CZRBaseModuleControl=a.CZRBaseControl.extend(CZRBaseModuleControlMths),a.CZRMultiModuleControl=a.CZRBaseModuleControl.extend(CZRMultiModuleControlMths),a.CZRUploadControl=a.Control.extend(CZRUploadMths),a.CZRLayoutControl=a.Control.extend(CZRLayoutSelectMths),a.CZRMultiplePickerControl=a.Control.extend(CZRMultiplePickerMths),b.extend(a.controlConstructor,{czr_upload:a.CZRUploadControl,czr_module:a.CZRBaseModuleControl,czr_multi_module:a.CZRMultiModuleControl,czr_multiple_picker:a.CZRMultiplePickerControl,czr_layouts:a.CZRLayoutControl}),"function"==typeof a.CroppedImageControl&&(a.CZRCroppedImageControl=a.CroppedImageControl.extend(CZRCroppedImageMths),b.extend(a.controlConstructor,{czr_cropped_image:a.CZRCroppedImageControl})),a.czrInputMap=a.czrInputMap||{},b.extend(a.czrInputMap,{text:"",textarea:"",check:"setupIcheck",select:"setupSelect",number:"setupStepper",upload:"setupImageUploader",color:"setupColorPicker",content_picker:"setupContentPicker",text_editor:"setupTextEditor",password:"",range_slider:"setupRangeSlider"})}(wp.customize,jQuery,_),function(a,b,c){var d=serverControlParams.i18n||{};a.czr_CrtlDependenciesReady=b.Deferred(),a.bind("ready",function(){c.has(a,"czr_ctrlDependencies")||(serverControlParams.isSkopOn?"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.done(function(){a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()}):(a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()))}),a.CZR_ctrlDependencies=a.Class.extend({dominiDeps:[],initialize:function(){var b=this;if(this.defaultDominusParams={dominus:"",servi:[],visibility:null,actions:null,onSectionExpand:!0},this.dominiDeps=c.extend(this.dominiDeps,this._getControlDeps()),!c.isArray(b.dominiDeps))throw new Error("Visibilities : the dominos dependency array is not an array.");a.czr_activeSectionId.bind(function(d){if(!c.isEmpty(d)&&a.section.has(d))try{b.setServiDependencies(d)}catch(e){a.errorLog("In api.CZR_ctrlDependencies : "+e)}}),a.bind("awaken-section",function(d){if(serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase"))a.czr_skopeBase.processSilentUpdates({candidates:{},section_id:d.target,refresh:!1}).then(function(){try{b.setServiDependencies(d.target,d.source)}catch(c){a.errorLog("On awaken-section, ctrl deps : "+c)}});else try{b.setServiDependencies(d.target,d.source)}catch(e){a.errorLog("On awaken-section, ctrl deps : "+e)}}),this._handleFaviconNote()},setServiDependencies:function(d,e,f){var g=this,h=b.Deferred();if(f=f||!1,c.isUndefined(d)||!a.section.has(d))throw new Error("Control Dependencies : the targetSectionId is missing or not registered : "+d);if(a.section(d).czr_ctrlDependenciesReady=a.section(d).czr_ctrlDependenciesReady||b.Deferred(),!f&&"resolved"==a.section(d).czr_ctrlDependenciesReady.state())return h.resolve().promise();c.each(g.dominiDeps,function(b){if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))throw new Error("Control Dependencies : a dominus control id must be a not empty string.");var e=a.CZR_Helpers.build_setId(b.dominus);a.control.has(e)&&a.control(e).section()==d&&(b=g._prepareDominusParams(b),c.isEmpty(b)||g._processDominusCallbacks(b.dominus,b,f).fail(function(){a.consoleLog("self._processDominusCallbacks fail for section "+d),h.reject()}).done(function(){h.resolve()}))});var i=a.CZR_Helpers.getSectionControlIds(d),j=function(b){var d=[];return c.each(g.dominiDeps,function(e){if(!c.has(e,"servi")||!c.isArray(e.servi)||!c.has(e,"dominus")||c.isEmpty(e.dominus))return void a.errorLog("Control Dependencies : wrong params in _getServusDomini.");if(c.contains(e.servi,b)&&!c.contains(d,e.dominus)){if(e=g._prepareDominusParams(e),c.isEmpty(e))return;d.push(e.dominus)}}),c.isArray(d)?d:[]},k=[];return c.each(i,function(a){c.isEmpty(j(a))||(k=c.union(k,j(a)))}),c.each(k,function(b){var c=a.CZR_Helpers.build_setId(b);a.control(c).section()!=d&&e!=a.control(c).section()&&a.trigger("awaken-section",{target:a.control(c).section(),source:d})}),h.always(function(){a.section(d).czr_ctrlDependenciesReady.resolve()}),h.promise()},_deferCallbackForControl:function(d,e,f){var g=b.Deferred();if(c.isEmpty(d)||!c.isString(d))throw new Error("_deferCallbackForControl : the control id is missing.");if(!c.isFunction(e))throw new Error("_deferCallbackForControl : callback must be a funtion.");return f=c.isUndefined(f)||!c.isArray(f)?[]:f,a.control.has(d)?"resolved"==a.control(d).deferred.embedded.state()?b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()}):a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})}):a.control.when(d,function(){a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})})}),g.promise()},_processDominusCallbacks:function(d,e,f){var g=this,h=a.CZR_Helpers.build_setId(d),i=a(h),j=b.Deferred(),k=!1;return c.each(e.servi,function(b){if(a.control.has(a.CZR_Helpers.build_setId(b))){var d=function(a,b,d,e){var f=arguments;c.each(d,function(a,b){switch(b){case"visibility":g._setVisibility.apply(null,f);break;case"actions":c.isFunction(a)&&a.apply(null,f)}})},f=function(c){c=c||i();var f=a.CZR_Helpers.build_setId(b);g._deferCallbackForControl(f,d,[c,b,e]).always(function(){k=!0}).fail(function(){j.reject()}).done(function(){j.resolve()})};f(),c.has(i,"czr_visibilityServi")||(i.czr_visibilityServi=new a.Value([]));var h=i.czr_visibilityServi();c.contains(h,b)||(i.bind(function(a){f(a)}),i.czr_visibilityServi(c.union(h,[b])))}}),k?j.promise():j.resolve().promise()},_setVisibility:function(b,d,e,f){var g=a.CZR_Helpers.build_setId(d),h=e.visibility(b,d,e.dominus);if(f=f||!1,c.isBoolean(h)&&("unchanged"!=h||f)){var i=function(){a.state.has("silent-update-processing")&&a.state("silent-update-processing")()||(a.control(g,function(a){var b={duration:"fast",completeCallback:function(){},unchanged:!1};c.has(a,"active")&&(h=h&&a.active()),c.has(a,"defaultActiveArguments")&&(b=control.defaultActiveArguments),a.onChangeActive(h,a.defaultActiveArguments)}),a.state.has("silent-update-processing")&&a.state("silent-update-processing").unbind(i))};a.state.has("silent-update-processing")&&a.state("silent-update-processing")()?a.state("silent-update-processing").bind(i):i()}},_getControlDeps:function(){return{}},_prepareDominusParams:function(b){var d=this,e={};if(!c.isObject(b))return a.errorLog("Visibilities : a dominus param definition must be an object."),e;if(!c.has(b,"visibility")&&!c.has(b,"actions"))return a.errorLog("Visibilities : a dominus definition must include a visibility or an actions callback."),e;if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))return a.errorLog("Visibilities : a dominus control id must be a not empty string."),e;var f=a.CZR_Helpers.build_setId(b.dominus);return a.control.has(f)?!c.has(b,"servi")||c.isUndefined(b.servi)||!c.isArray(b.servi)||c.isEmpty(b.servi)?(a.errorLog("Visibilities : servi must be set as an array not empty."),e):(c.each(d.defaultDominusParams,function(a,d){var f=b[d];switch(d){case"visibility":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus visibility callback must be a function : "+b.dominus);break;case"actions":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus actions callback must be a function : "+b.dominus);break;case"onSectionExpand":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isBoolean(f))throw new Error("Visibilities : a dominus onSectionExpand param must be a boolean : "+b.dominus)}e[d]=f}),e):(a.errorLog("Visibilities : a dominus control id is not registered : "+f),e)},_handleFaviconNote:function(){var b=this,c=a.CZR_Helpers.build_setId(serverControlParams.faviconOptionName);if(!(!a.has("site_icon")||!a.control("site_icon")||a.has(c)&&0===+a(c)()||+a("site_icon")()>0)){var e=a.control("site_icon").params.description;_newDes=["<strong>",d.faviconNote||"","</strong><br/><br/>"].join("")+e,b._printFaviconNote(_newDes),a("site_icon").callbacks.add(function(d){+d>0?(a.control("site_icon").container.find(".description").text(e),a.has(c)&&a(c).set("")):b._printFaviconNote(_newDes)})}},_printFaviconNote:function(b){a.control("site_icon").container.find(".description").html(b)}})}(wp.customize,jQuery,_),function(a,b){b(function(b){function c(a){var c=a.siblings(".open");0!==c.length&&c.offset().top<0&&b(".wp-full-overlay-sidebar-content").animate({scrollTop:-b("#customize-theme-controls").offset().top-c.height()+a.offset().top+b(".wp-full-overlay-sidebar-content").offset().top},700)}var d=a.customize||d;b(".accordion-section").not(".control-panel").click(function(){c(b(this))}),d.czrSetupCheckbox=function(a,c){b("input[type=checkbox]",d.control(a).container).each(function(){0===b(this).val()||"0"==b(this).val()||"off"==b(this).val()||_.isEmpty(b(this).val())?b(this).prop("checked",!1):b(this).prop("checked",!0),0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},d.czrSetupSelect=function(a,c){b("select[data-customize-setting-link]",d.control(a).container).not(".no-selecter-js").each(function(){b(this).selecter({})})},d.czrSetupStepper=function(a,c){b('input[type="number"]',d.control(a).container).each(function(){b(this).stepper()})},d.control.each(function(a){_.has(a,"id")&&("widget_"!=a.id.substring(0,"widget_".length)&&"nav_menu"!=a.id.substring(0,"nav_menu".length)&&d.czrSetupCheckbox(a.id),"nav_menu_locations"!=a.id.substring(0,"nav_menu_locations".length)&&d.czrSetupSelect(a.id),d.czrSetupStepper(a.id))});var e=function(){var a=b("<span/>",{"class":"customize-controls-home fa fa-home",html:'<span class="screen-reader-text">Home</span>'});b.when(b("#customize-header-actions").append(a)).done(function(){a.keydown(function(a){9!==a.which&&(13===a.which&&this.click(),a.preventDefault())}).on("click.customize-controls-home",function(){d.section.has(d.czr_activeSectionId())?d.section(d.czr_activeSectionId()).expanded(!1):d.section.each(function(a){a.expanded(!1)}),d.panel.each(function(a){a.expanded(!1)})})})};e()})}(wp,jQuery);
|
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">×</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">×</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.join(" ")),["%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(){if(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");var b=function(){a.czr_skopeBase.toggleTopNote(!0,{title:serverControlParams.i18n.skope["There was a problem when trying to load the customizer."],message:[serverControlParams.i18n.skope["Please refer to"],'<a href="http://docs.presscustomizr.com/article/285-there-was-a-problem-when-trying-to-load-the-customizer" target="_blank">',serverControlParams.i18n.skope["this documentation page"],"</a>",serverControlParams.i18n.skope["to understand how to fix the problem."]].join(" "),selfCloseAfter:4e4})};a.czr_skopeReady.done(function(){a.trigger("czr-skope-ready")}).fail(function(c){a.errorLog("Skope could not be instantiated : "+c),b(),serverControlParams.isSkopOn=!1}).always(function(){a.czr_isLoadingSkope(!1)}),"rejected"!=a.czr_skopeReady.state()&&setTimeout(function(){"pending"==a.czr_skopeReady.state()&&(b(),a.czr_isLoadingSkope(!1))},4e4)}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()};a.bind("ready",function(){a.previewedDevice&&a.previewedDevice.bind(function(b){a.previewer.send("previewed-device",b)})}),serverControlParams.isPro&&(c.each(["tc_font_customizer_settings","header_image_sec","content_blog_sec","static_front_page"],function(b){c.delay(function(){a.section.when(b,function(a){1>=a.headContainer.length&&a.headContainer.find(".accordion-section-title").prepend('<span class="pro-title-block">Pro</span>')})},1e3)}),c.each(["hu-header-panel","hu-content-panel"],function(b){a.panel.when(b,function(a){1>=a.headContainer.length&&a.headContainer.find(".accordion-section-title").prepend('<span class="pro-title-block">Pro</span>')})})),!serverControlParams.isPro&&c.isFunction(a.Section)&&(proSectionConstructor=a.Section.extend({active:!0,attachEvents:function(){},isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}}),b.extend(a.sectionConstructor,{"czr-customize-section-pro":proSectionConstructor}))}(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(39, 59, 88, 0.12)",local:"rgba(39, 59, 88, 0.28)"},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"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.reject(),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)}var h=function(){d._writeCurrentSkopeTitle(),a.czr_bottomInfosVisible()?d.renderBottomInfosTmpl():a.czr_bottomInfosVisible(!0)};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()),h()}).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 i=c.findWhere(f,{skope:"local"}).opt_name,j=c.findWhere(b.czr_skopes,{skope:"local"}).opt_name;j!==i&&"resolved"==a.czr_skopeReady.state()&&h()}})})}}),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)}),d._setupPreviewNotificationsBlocks(),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)})})})}};a.czr_bottomInfosVisible()?e.renderBottomInfosTmpl():a.czr_bottomInfosVisible(!0),c.delay(function(){f()},500)};a.czr_skopeReady.then(function(){f()})},_setupPreviewNotificationsBlocks:function(){var d=this;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)}),a.czr_bottomInfosVisible=new a.Value((!1)),a.czr_skopeReady.then(function(){a.czr_bottomInfosVisible.bind(function(a){var c={},e={title:"",message:"",actions:"",selfCloseAfter:2e4};return c=b.extend(e,{}),d.toggleBottomInfos(a,c)},{deferred:!0});var e=a.CZR_Helpers.build_setId("show-skope-infos");a.when(e,function(b){a.czr_bottomInfosVisible.validate=function(a){var c=b(),d=0!==c&&"0"!==c&&!1!==c&&"off"!==c;return!!d&&a},b.bind(function(b){a.czr_bottomInfosVisible(0!==b&&"0"!==b&&!1!==b&&"off"!==b)})}),c.delay(function(){a.czr_bottomInfosVisible(!0)},2e3)})}})}(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-preview-note-close",actions:function(){i().done(function(){a.czr_topNoteVisible(!1),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().done(function(){a.czr_topNoteVisible(!1)}),c.delay(function(){a.czr_topNoteVisible(!1)},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({
|
12 |
+
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,{toggleBottomInfos:function(d,e){e=c.isObject(e)?e:{};var f=this,g=b.Deferred(),h={title:"",message:"",actions:"",selfCloseAfter:2e4},i=a.CZR_Helpers.build_setId("show-skope-infos"),j=function(){var d=b.Deferred();return b.when(f.renderBottomInfosTmpl(e)).done(function(g){f.bottomInfosContainer=g,c.delay(function(){b("body").addClass("czr-bottom-infos-open"),d.resolve()},200),a.CZR_Helpers.setupDOMListeners([{trigger:"click keydown",selector:".czr-preview-note-close",actions:function(){k().done(function(){a.czr_bottomInfosVisible(!1),c.isFunction(e.actions)&&e.actions()})}},{trigger:"click keydown",selector:".czr-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-disable-bottom-infos",actions:function(b){a.control.has(i)&&a.control(i).focus()}}],{dom_el:f.bottomInfosContainer},f)}).fail(function(){d.resolve()}),d.promise()},k=function(){return b.Deferred(function(){var a=this;b("body").removeClass("czr-bottom-infos-open"),f.bottomInfosContainer.length?c.delay(function(){f.bottomInfosContainer.remove(),f.bottomInfosContainer=!1,a.resolve()},300):a.resolve()})};return e=b.extend(h,e),d?j().always(function(){g.resolve()}):k().done(function(){a.czr_bottomInfosVisible(!1),g.resolve()}),g.promise()},renderBottomInfosTmpl:function(d){d=d||{};var e=this,f="",g=a.czr_activeSkopeId();if(!a.czr_skope.has(g)||!c.isObject(a.czr_skope(g)()))return!1;var h=a.czr_skope(g)().long_title,i=a.czr_skope(g)().ctx_title;h=c.isString(h)?h:"",i=c.isString(i)?i:"";var j=d.title||["Customizing",i.toLowerCase()].join(" "),k=d.message||e._getSkopeInfosMessage(g),l=function(){return b.Deferred(function(){var c=this;try{f=wp.template("czr-bottom-infos")({title:j}),b("#customize-preview").after(b(f)),c.resolve()}catch(d){a.errorLog("Error when parsing the the bottom infos template : "+d),c.reject(d)}})};return c.isUndefined(this.bottomInfosContainer)||1!=this.bottomInfosContainer.length?l().done(function(){b(".czr-note-message","#czr-bottom-infos").html(k)}):b(".czr-note-content",e.bottomInfosContainer).fadeOut({duration:"fast",complete:function(){b("h2",e.bottomInfosContainer).html(["·",j,"·"].join(" ")),b(".czr-note-message",e.bottomInfosContainer).html(k),b(this).fadeIn("fast")}}),this.bottomInfosContainer&&1==this.bottomInfosContainer.length?this.bottomInfosContainer:b("#czr-bottom-infos")},_getSkopeInfosMessage:function(d){d=d||a.czr_activeSkopeId();var e=c.findWhere(a.czr_currentSkopesCollection(),{skope:"local"}).id;if(!a.czr_skope.has(d)||!c.isObject(a.czr_skope(d)())||c.isUndefined(e))return"";var f,g=this,h=a.czr_skope(d)().skope,i=g.getInheritedSkopeTitles(),j=g.getOverridenSkopeTitles(),k=a.czr_skope(e)().ctx_title;a.czr_skope(d)().long_title;switch(h){case"global":f=[serverControlParams.i18n.skope["The customizations made site wide are inherited by all other levels of customization."],"<br/>",serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized more specifically at the following level"]+"(s)",":",j+"."].join(" ");break;case"group":f=[serverControlParams.i18n.skope["The current customizations will be applied to"],a.czr_skope(d)().ctx_title.toLowerCase()+".","<br/>",serverControlParams.i18n.skope["The options not customized at this level will inherit their value from"],i,".<br/>",serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized more specifically at the following level"],":",j+"."].join(" ");break;case"local":f=[serverControlParams.i18n.skope["The current context"],["(",k,")"].join(" "),serverControlParams.i18n.skope["can be customized with a specific set of options."],"<br/>",serverControlParams.i18n.skope["The options not customized at this level will inherit their value from"],i+"."].join(" ")}return b.trim(['<span class="czr-skope-bottom-infos">',f,"</span>"].join(" "))}})}(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,e,f;if(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,{skope:d}),f=c.isUndefined(e)?c.findWhere(b,{skope:"global"}).id:e.id,c.isUndefined(f))throw new Error("No default skope was found in getActiveSkopeId ",b);return f},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(){
|
13 |
+
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(" "),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,j=a.czr_activeSkopeId(),k=f.getInheritedSkopeId(b,j),l=f.getAppliedPrioritySkopeId(b,j),m=[];return h(b)?(k==l&&a.czr_skope.has(k)&&j==k&&(e=!c.isUndefined(a.czr_skope(j).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(j).dbValues()[b]),i=a.czr_skope(k)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),e?"global"==a.czr_skope(k)().skope?m.push([serverControlParams.i18n.skope["Customized. Will be applied sitewide once published."]].join(" ")):m.push([serverControlParams.i18n.skope["Customized. Will be applied to"],"<strong>"+i+"</strong>",serverControlParams.i18n.skope["once published."]].join(" ")):g?"global"==a.czr_skope(k)().skope?m.push([serverControlParams.i18n.skope["Customized and applied sitewide."]].join(" ")):m.push([serverControlParams.i18n.skope["Customized and applied to"],"<strong>"+i+".</strong>"].join(" ")):m.push(serverControlParams.i18n.skope["Default website value applied sitewide."])),k!==j&&a.czr_skope.has(k)&&(e=!c.isUndefined(a.czr_skope(k).dirtyValues()[b]),g=!c.isUndefined(a.czr_skope(k).dbValues()[b]),i=a.czr_skope(j)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),e||g?m.push([serverControlParams.i18n.skope["Currently inherited from"],f.buildSkopeLink(k)+".",serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+i+".</strong>"].join(" ")):m.push([serverControlParams.i18n.skope["Default website value."],serverControlParams.i18n.skope["You can customize this specifically for"],"<strong>"+i+".</strong>"].join(" "))),l!==j&&a.czr_skope.has(l)&&(e=!c.isUndefined(a.czr_skope(l).dirtyValues()[b]),i=a.czr_skope(d)().ctx_title,i=(c.isString(i)?i:"").toLowerCase(),m.push([e?serverControlParams.i18n.skope["The value that will be applied to"]:serverControlParams.i18n.skope["The value currently applied to"],"<strong>"+i+"</strong>",e?serverControlParams.i18n.skope["is customized in"]:serverControlParams.i18n.skope["is set in"],f.buildSkopeLink(l),serverControlParams.i18n.skope["which has a higher priority than the current option scope"],"<strong>( "+a.czr_skope(j)().title+" ).</strong>"].join(" "))),m.join(" | ")):(m.push([serverControlParams.i18n.skope["This option is always customized sitewide and cannot be reset."]].join(" ")),m.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=[],j=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),i[b.id]||(i[b.id]={}),i[b.id][c.code]=c)})}),e=a.findControlsForSettings(h),!c.isEmpty(e)))return c.values(e)[0][0].focus(),j.rejectWith(f.previewer,[{setting_invalidities:i}]).promise();var k={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(k,{excludeCustomizedSaved:!1});var l=b.extend(f.previewer.query(k),{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&&(l.customize_changeset_date=f.saveArgs.date),f.saveArgs&&f.saveArgs.title&&(l.customize_changeset_title=f.saveArgs.title));var m=wp.ajax.post("global"!==l.skope?"customize_skope_changeset_save":"customize_save",l);return f.saveBtn.prop("disabled",!0),a.trigger("save",m),m.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),j.reject(b)}),m.done(function(a){j.resolve(a)}),j.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="";
|
14 |
+
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),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(e){e=c.extend({waitSkopeSynced:!0,the_dirties:{}},e);var f=this,g=b.Deferred();if(!serverControlParams.isSkopOn)return g.resolve().promise();if(!c.has(a,"czr_activeSkopeId")||c.isUndefined(a.czr_activeSkopeId()))return a.consoleLog("The api.czr_activeSkopeId() is undefined in the api.previewer._new_refresh() method."),d.apply(f),g.resolve().promise();f.send("loading-initiated"),f.abort();var h=a.czr_getSkopeQueryParams({skope_id:a.czr_activeSkopeId(),action:"refresh",the_dirties:e.the_dirties||{}});return f.loading=new a.PreviewFrame({url:f.url(),previewUrl:f.previewUrl(),query:f.query(h)||{},container:f.container,signature:"WP_CUSTOMIZER_SIGNATURE"}),f.settingsModifiedWhileLoading={},onSettingChange=function(a){f.settingsModifiedWhileLoading[a.id]=!0},a.bind("change",onSettingChange),f.loading.always(function(){a.unbind("change",onSettingChange)}),a.czr_isChangeSetOn()||(f._previousPreview=f._previousPreview||f.preview),f.loading.done(function(b){var c,d=this;f.preview=d,f.targetWindow(d.targetWindow()),f.channel(d.channel()),c=function(b){d.unbind("synced",c),d.unbind("czr-skopes-synced",c),f._previousPreview?f._previousPreview.destroy():f.preview&&f.preview.destroy(),f._previousPreview=f.preview,f.deferred.active.resolve(),delete f.loading,a.trigger("pre_refresh_done",{previewer:f,skopesServerData:b||{}}),g.resolve({previewer:f,skopesServerData:b||{}})},a.czr_isChangeSetOn()||f.send("sync",{scroll:f.scroll,settings:a.get()}),e.waitSkopeSynced?d.bind("czr-skopes-synced",c):d.bind("synced",c),f.trigger("ready",b)}),f.loading.fail(function(b,c){a.consoleLog("LOADING FAILED : ",arguments),f.send("loading-failed"),a.czr_isChangeSetOn()||"redirect"===b&&c&&f.previewUrl(c),"logged out"===b&&(f.preview&&(f.preview.destroy(),delete f.preview),f.login().done(f.refresh)),"cheatin"===b&&f.cheatin(),g.reject(b)}),g.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)})}),f.enabled=new a.Value((!0)),f.isReady.done(function(){f.enabled.bind(function(a){f.container.toggleClass("disabled",!a)})})},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;e.enabled()&&(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(),
|
15 |
+
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.errorLog("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.errorLog("content_picker : missing input param : "+d)}),void e.set(h))}}],e.setupDOMListeners(f,{dom_el:e.container},e),e.isReady.done(function(){e.setupContentSelecter()})},setupContentSelecter:function(){var a=this;if(!c.isEmpty(a())){var d={value:a().id||"",title:a().title||"",selected:"selected"};a.container.find("select").append(b("<option>",d))}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: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=[];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:b.data.items.length>=10}}}},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='czr-picker-item-title'>"+a.title+"</span>";return a.type_label&&(b+="<span class='czr-picker-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(){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,d=this.module,e=c.clone(d.itemCollection());d.trigger("pre_item_dom_remove",a()),a._destroyView(),e=c.without(e,c.findWhere(e,{id:a.id})),d.itemCollection.set(e),d.trigger("pre_item_api_remove",a());var f=b.extend(!0,{},a());d.czr_Item.remove(a.id),d.trigger("item-removed",f)},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(d,h){var i=-1!==d.indexOf("expanded");f.hasModOpt()&&i&&a.czr_ModOptVisible(!1),i?c.isObject(e.contentContainer)&&!1!==e.contentContainer.length?e.toggleItemExpansion(d,h):b.when(e.renderItemContent(e()||e.initial_item_model)).done(function(a){(g=c.debounce(g,50))(a,d,h)}):e.toggleItemExpansion(d,h).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(d,g,h){h=h||{},d?(e.module.closeRemoveDialogs().closeAllItems(),e.modOptWrapperViewSetup(f).done(function(b){e.container=b;try{a.CZR_Helpers.setupInputCollectionFromDOM.call(e).toggleModPanelView(d)}catch(f){a.consoleLog(f)}h.module&&h.focus&&c.delay(function(){!c.isNull(h.module.czr_ModOpt.container)&&h.module.czr_ModOpt.container.find('[data-tab-id="'+h.focus+'"] a').length&&h.module.czr_ModOpt.container.find('[data-tab-id="'+h.focus+'"] a').trigger("click")},200)})):e.toggleModPanelView(d).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.itemsWrapper="",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,isPartialRefresh:d.isPartialRefresh}),e.trigger("input_sent",{input:d.to,dom_el:e.container}))},sendModuleInputsToPreview:function(a){var d=this,e=function(){var e=this,f=b.extend(!0,{},e());f=c.omit(f,"id"),c.each(f,function(b,c){d.sendInputToPreview({input_id:c,input_parent_id:e.id,to:b,from:null,isPartialRefresh:a.isPartialRefresh})})};d.czr_Item.each(function(a){e.call(a)}),d.hasModOpt()&&e.call(d.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){
|
16 |
+
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.preItemsWrapper="",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(a){c.preItemsWrapper=a,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(d){var e=this,f=e.preItem(),g=function(){e.preItemExpanded.set(!1),e._resetPreItemInputs()},h=b.Deferred();return c.isEmpty(f)||!c.isObject(f)?(a.errorLog("addItem : an item should be an object and not empty. In : "+e.id+". Aborted."),h.resolve().promise()):(g=c.debounce(g,200),e.instantiateItem(f,!0).ready(),function(){return b.Deferred(function(){var b=this;e.czr_Item(f.id).isReady.then(function(){g(),e.trigger("item-added",f),"postMessage"!=a(e.control.id).transport||!c.has(d,"dom_event")||c.has(d.dom_event,"isTrigger")||a.CZR_Helpers.hasPartRefresh(e.control.id)?b.resolve():e.control.previewer.refresh().done(function(){b.resolve()})})}).promise()}().done(function(){e.czr_Item(f.id).viewState("expanded")}).always(function(){h.resolve()}),h.promise())},_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(f)}},_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"],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()+'"> '+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+'"> '+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.settings["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{value:[]});a.settings.settings[j]=k,a.create(j,j,k.value,{transport:k.transport,previewer:a.previewer,dirty:!1});var l=b.extend(c.clone(a.settings.controls["sidebars_widgets["+f.serverParams.defaultWidgetSidebar+"]"]),{settings:{"default":j}}),m={};c.each(l,function(a,b){"string"==typeof a&&(a=a.replace(f.serverParams.defaultWidgetSidebar,g.id)),m[b]=a}),m.instanceNumber=c.max(a.settings.controls,function(a){return a.instanceNumber}).instanceNumber+1,a.settings.controls[j]=m,a.control.add(j,new a.controlConstructor[m.type](j,{params:m,previewer:a.previewer})),c.has(this,"container")&&this.container.trigger("widget_zone_created",{model:g,section_id:"sidebar-widgets-"+g.id,setting_id:j})},removeWidgetSidebar:function(d){var e=this;if(!c.isObject(d)||c.isEmpty(d))throw new Error("No valid data were provided to remove a Widget Zone.");a.Widgets.registeredSidebars.remove(d.id),a.section.has("sidebar-widgets-"+d.id)&&(a.section("sidebar-widgets-"+d.id).container.remove(),a.section.remove("sidebar-widgets-"+d.id),delete a.settings.sections["sidebar-widgets-"+d.id]),a.has("sidebars_widgets["+d.id+"]")&&(a.remove("sidebars_widgets["+d.id+"]"),delete a.settings.settings["sidebars_widgets["+d.id+"]"]),a.control.has("sidebars_widgets["+d.id+"]")&&(a.control("sidebars_widgets["+d.id+"]").container.remove(),a.control.remove("sidebars_widgets["+d.id+"]"),delete a.settings.controls["sidebars_widgets["+d.id+"]"]);var f=function(){a.previewer.refresh()};f=c.debounce(f,500),b.when(f()).done(function(){e.trigger("widget_zone_removed",{model:d,section_id:"sidebar-widgets-"+d.id,setting_id:"sidebars_widgets["+d.id+"]"})})},widgetPanelReact:function(){var b=this,d=a.panel("widgets").container.find(".control-panel-content").css("margin-top");a.section(b.serverParams.dynWidgetSection).fixTopMargin("value").set(d);var e=a.section(b.serverParams.dynWidgetSection).container.find(".accordion-section-content"),f=a.panel("widgets").container.find(".control-panel-content"),g=function(){e.css("margin-top",""),f.css("margin-top",a.section(b.serverParams.dynWidgetSection).fixTopMargin("value")())};a.bind("pane-contents-reflowed",c.debounce(function(){g()},150)),b.closeAllItems().closeRemoveDialogs(),c.has(b,"preItemExpanded")&&b.preItemExpanded.set(!1)},widgetSectionReact:function(c,d){var e=this,f=a.section(e.serverParams.dynWidgetSection),g=f.container.closest(".wp-full-overlay-sidebar-content"),h=f.container.find(".accordion-section-content"),i=f.container.closest(".wp-full-overlay"),j=(f.container.find(".customize-section-back"),f.container.find(".accordion-section-title").first());b("#customize-header-actions").height();c&&(i.removeClass("section-open"),h.css("height","auto"),j.attr("tabindex","0"),h.css("margin-top",""),g.scrollTop(0)),e.closeAllItems().closeRemoveDialogs(),h.slideToggle()},listenToSidebarInsights:function(){var d=this;a.sidebar_insights("registered").callbacks.add(function(a){var b=c.clone(d.itemCollection());c.each(b,function(b){d.getViewEl(b.id).length&&d.getViewEl(b.id).css("display",c.contains(a,b.id)?"block":"none")})}),a.sidebar_insights("inactives").callbacks.add(function(a){var e=c.clone(d.itemCollection());c.each(e,function(e){d.getViewEl(e.id).length&&(c.contains(a,e.id)?(d.getViewEl(e.id).addClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length||d.getViewEl(e.id).find(".czr-item-title").append(b("<span/>",{"class":"czr-inactive-alert",html:" [ "+serverControlParams.i18n.inactiveWidgetZone+" ]"}))):(d.getViewEl(e.id).removeClass("inactive"),d.getViewEl(e.id).find(".czr-inactive-alert").length&&d.getViewEl(e.id).find(".czr-inactive-alert").remove()))})}),a.sidebar_insights("candidates").callbacks.add(function(b){c.isArray(b)&&c.each(b,function(b){c.isObject(b)&&(a.section.has("sidebar-widgets-"+b.id)||(d.addWidgetSidebar({},b),c.has(a.sidebar_insights("actives")(),b.id)&&a.section.has("sidebar-widgets-"+b.id)&&a.section("sidebar-widgets-"+b.id).activate()))})})},_adjustScrollExpandedBlock:function(a,c){if(a.length){var d,e=b(".wp-full-overlay-sidebar-content").scrollTop(),f=c||90;setTimeout(function(){a.offset().top+a.height()+f>b(window.top).height()&&(d=a.offset().top+a.height()+f-b(window.top).height(),b(".wp-full-overlay-sidebar-content").animate({scrollTop:e+d},600))},50)}},getDefaultItemModel:function(a){var d=this,e=d.itemCollection(),f=c.clone(d.defaultItemModel);f.contexts;return b.extend(f,{title:"Widget Zone "+(1*c.size(e)+1)})},getTemplateEl:function(a,b){var d,e=this;switch("rudItemPart"==a?a=c.has(b,"is_builtin")&&b.is_builtin?"ruItemPart":a:"itemInputList"==a&&(a=c.has(b,"is_builtin")&&b.is_builtin?"itemInputListReduced":a),a){case"rudItemPart":d=e.rudItemPart;break;case"ruItemPart":d=e.ruItemPart;break;case"itemInputList":d=e.itemInputList;break;case"itemInputListReduced":d=e.itemInputListReduced}if(c.isEmpty(d))throw new Error("No valid template has been found in getTemplateEl()");return d},_toggleLocationAlertExpansion:function(c,d){var e=c.find(".czr-location-alert");if(!e.length){var f=["<span>"+serverControlParams.i18n.locationWarning+"</span>",a.CZR_Helpers.getDocSearchLink(serverControlParams.i18n.locationWarning)].join("");e=b("<div/>",{"class":"czr-location-alert",html:f,style:"display:none"}),b('select[data-type="locations"]',c).closest("div").after(e)}e.toggle("expanded"==d)}})}(wp.customize,jQuery,_);var CZRBodyBgModuleMths=CZRBodyBgModuleMths||{};!function(a,b,c){b.extend(CZRBodyBgModuleMths,{initialize:function(d,e){var f=this;a.CZRModule.prototype.initialize.call(f,d,e),b.extend(f,{itemInputList:"czr-module-bodybg-item-content"}),f.inputConstructor=a.CZRInput.extend(f.CZRBodyBgInputMths||{}),f.itemConstructor=a.CZRItem.extend(f.CZBodyBgItemMths||{}),f.defaultItemModel={"background-color":"#eaeaea","background-image":"","background-repeat":"no-repeat","background-attachment":"fixed","background-position":"center center","background-size":"cover"},a.consoleLog("New module instantiated : ",f.id),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()})},CZRBodyBgInputMths:{setupSelect:function(){var a=this,d={"background-repeat":"bg_repeat_options","background-attachment":"bg_attachment_options","background-position":"bg_position_options"},e=(a.input_parent,serverControlParams.body_bg_module_params),f={};a.module;c.has(d,a.id)&&(c.isUndefined(e)||c.isUndefined(e[d[a.id]])||(f=e[d[a.id]],c.isEmpty(f)||(c.each(f,function(d,e){var f={value:e,html:d};(e==a()||c.contains(a(),e))&&b.extend(f,{selected:"selected"}),b("select[data-type]",a.container).append(b("<option>",f))}),b("select[data-type]",a.container).select2())))}},CZBodyBgItemMths:{ready:function(){var b=this;a.CZRItem.prototype.ready.call(b),b.inputCollection.bind(function(a){!c.isEmpty(_col)&&b.czr_Input&&b.czr_Input.has("background-image")&&b.czr_Input("background-image").isReady.done(function(a){var d=function(a){var d=!c.isEmpty(a)||c.isNumber(a);c.each(["background-repeat","background-attachment","background-position","background-size"],function(a){b.czr_Input(a).container.toggle(d||!1)})};d(a()),b.bind("background-image:changed",function(){d(b.czr_Input("background-image")())})})})}}})}(wp.customize,jQuery,_),function(a,b,c){a.czrModuleMap=a.czrModuleMap||{},b.extend(a.czrModuleMap,{czr_widget_areas_module:{mthds:CZRWidgetAreaModuleMths,crud:!0,sektion_allowed:!1,name:"Widget Areas"},czr_social_module:{mthds:CZRSocialModuleMths,crud:!0,name:"Social Icons",has_mod_opt:!0},czr_background:{mthds:CZRBodyBgModuleMths,crud:!1,multi_item:!1,name:"Slider"}})}(wp.customize,jQuery,_);var CZRBaseControlMths=CZRBaseControlMths||{};!function(a,b,c){b.extend(CZRBaseControlMths,{initialize:function(b,d){var e=this;e.css_attr=c.has(serverControlParams,"css_attr")?serverControlParams.css_attr:{},a.Control.prototype.initialize.call(e,b,d),e.bind("czr-partial-refresh-done",function(){c.has(e,"czr_moduleCollection")&&c.each(e.czr_moduleCollection(),function(a){e.czr_Module(a.id)&&e.czr_Module(a.id).sendModuleInputsToPreview({isPartialRefresh:!0})})})},refreshPreview:function(a){this.previewer.refresh()}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{initialize:function(d,e){var f=this;f.czr_Module=new a.Values,f.czr_moduleCollection=new a.Value,f.czr_moduleCollection.set([]),f.moduleCollectionReady=b.Deferred(),f.moduleCollectionReady.done(function(a){!f.isMultiModuleControl(e.params),f.czr_moduleCollection.callbacks.add(function(){return f.moduleCollectionReact.apply(f,arguments)})}),f.isMultiModuleControl(e.params)&&(f.syncSektionModule=new a.Value),a.CZRBaseControl.prototype.initialize.call(f,d,e),a.section(f.section()).expanded.bind(function(a){f.czr_Module.each(function(a){a.closeAllItems().closeRemoveDialogs(),c.has(a,"preItem")&&a.preItemExpanded(!1)})})},ready:function(){var b=this;if(b.isMultiModuleControl())b.syncSektionModule.bind(function(a,c){"resolved"!=b.moduleCollectionReady.state()&&(b.registerModulesOnInit(a),b.moduleCollectionReady.resolve())});else{var d={};c.each(b.getSavedModules(),function(c,e){d=c;try{b.instantiateModule(c,{})}catch(f){return void a.errorLog("Failed to instantiate module "+c.id+" "+f)}b.container.attr("data-module",c.id)}),b.moduleCollectionReady.resolve(d)}b.bind("user-module-candidate",function(c){var d;try{d=b.instantiateModule(c,{})}catch(e){return void a.errorLog("Failed to instantiate module "+c.id+" "+e)}d.ready(c.is_added_by_user)})},getDefaultModuleApiModel:function(){var a={id:"",module_type:"",modOpt:{},items:[],crud:!1,multi_item:!1,sortable:!1,control:{}};return this.isMultiModuleControl()?b.extend(a,{column_id:"",sektion:{},sektion_id:"",is_added_by_user:!1,dirty:!1}):b.extend(a,{section:""})},getDefaultModuleDBModel:function(){var a={items:[]};return this.isMultiModuleControl()?b.extend(a,{id:"",module_type:"",column_id:"",sektion_id:"",dirty:!1}):a},isMultiModuleControl:function(a){return"czr_multi_module"==(a||this.params).type},getSyncCollectionControl:function(){var b=this;if(c.isUndefined(b.params.syncCollection))throw new Error("Control "+b.id+" has no synchronized sektion control defined.");return a.control(a.CZR_Helpers.build_setId(b.params.syncCollection))},getSavedModules:function(){var d=this,e=[],f=d.params.module_type,g=[],h=[],i={};return d.isMultiModuleControl()?e=b.extend(!0,[],a(d.id)()):(!a.CZR_Helpers.isMultiItemModule(f)||c.isEmpty(a(d.id)())||c.isObject(a(d.id)())||a.consoleLog("Module Control Init for "+d.id+" : a mono item module control value should be an object if not empty."),g=c.isArray(a(d.id)())?a(d.id)():[a(d.id)()],c.each(g,function(b,e){a.CZR_Helpers.hasModuleModOpt(f)&&0===e&&(c.has(b,"id")?a.consoleLog("getSavedModules : the module "+f+" in control "+d.id+" has no mod_opt defined while it should."):i=b),c.has(b,"id")&&!c.has(b,"is_mod_opt")&&h.push(b)}),e.push({id:a.CZR_Helpers.getOptionName(d.id)+"_"+d.params.type,module_type:d.params.module_type,section:d.section(),modOpt:b.extend(!0,{},i),items:b.extend(!0,[],h)})),e},isModuleRegistered:function(a){var b=this;return!c.isUndefined(c.findWhere(b.czr_moduleCollection(),{id:a}))}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{instantiateModule:function(a,b){if(!c.has(a,"id"))throw new Error("CZRModule::instantiateModule() : a module has no id and could not be added in the collection of : "+this.id+". Aborted.");var d=this;if((c.isUndefined(b)||c.isEmpty(b))&&(b=d.getModuleConstructor(a)),!c.isEmpty(a.id)&&d.czr_Module.has(a.id))throw new Error("The module id already exists in the collection in control : "+d.id);var e=d.prepareModuleForAPI(a);if(d.czr_Module.add(e.id,new b(e.id,e)),!d.czr_Module.has(e.id))throw new Error("instantiateModule() : instantiation failed for module id "+e.id+" in control "+d.id);return d.czr_Module(e.id)},getModuleConstructor:function(b){var d=this,e={},f={};if(!c.has(b,"module_type"))throw new Error("CZRModule::getModuleConstructor : no module type found for module "+b.id);if(!c.has(a.czrModuleMap,b.module_type))throw new Error("Module type "+b.module_type+" is not listed in the module map api.czrModuleMap.");var g=a.czrModuleMap[b.module_type].mthds,h=a.czrModuleMap[b.module_type].crud,i=h?a.CZRDynModule:a.CZRModule;if(c.isEmpty(b.sektion_id)?f=i.extend(g):(e=i.extend(g),f=e.extend(d.getMultiModuleExtender(e))),c.isUndefined(f)||c.isEmpty(f)||!f)throw new Error("CZRModule::getModuleConstructor : no constructor found for module type : "+b.module_type+".");return f},prepareModuleForAPI:function(b){
|
17 |
+
if(!c.isObject(b))throw new Error("prepareModuleForAPI : a module must be an object to be instantiated.");var d=this,e={};return c.each(d.getDefaultModuleApiModel(),function(f,g){var h=b[g];switch(g){case"id":c.isEmpty(h)?e[g]=d.generateModuleId(b.module_type):e[g]=h;break;case"module_type":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module type must a string not empty");e[g]=h;break;case"items":if(!c.isArray(h))throw new Error("prepareModuleForAPI : a module item list must be an array");e[g]=h;break;case"modOpt":if(!c.isObject(h))throw new Error("prepareModuleForAPI : a module modOpt property must be an object");e[g]=h;break;case"crud":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "crud" must be a boolean');e[g]=h||!1;break;case"multi_item":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "multi_item" must be a boolean');e[g]=h||!1;break;case"sortable":if(c.has(a.czrModuleMap,b.module_type))h=a.czrModuleMap[b.module_type].sortable||a.czrModuleMap[b.module_type].crud||a.czrModuleMap[b.module_type].multi_item;else if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "sortable" must be a boolean');e[g]=h||!1;break;case"control":e[g]=d;break;case"section":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module section must be a string not empty");e[g]=h;break;case"column_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module column id must a string not empty");e[g]=h;break;case"sektion":if(!c.isObject(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion must be an object not empty");e[g]=h;break;case"sektion_id":if(!c.isString(h)||c.isEmpty(h))throw new Error("prepareModuleForAPI : a module sektion id must be a string not empty");e[g]=h;break;case"is_added_by_user":if(!c.isUndefined(h)&&!c.isBoolean(h))throw new Error('prepareModuleForAPI : the module param "is_added_by_user" must be a boolean');e[g]=h||!1;break;case"dirty":e[g]=h||!1}}),e},generateModuleId: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._getNextModuleKeyInCollection();var f=a+"_"+b;if(!c.has(e,"czr_moduleCollection")||!c.isArray(e.czr_moduleCollection()))throw new Error("The module collection does not exist or is not properly set in control : "+e.id);return e.isModuleRegistered(f)?(b++,d++,e.generateModuleId(a,b,d)):f},_getNextModuleKeyInCollection:function(){var a=this,b={},d=0;return c.isEmpty(a.czr_moduleCollection())||(b=c.max(a.czr_moduleCollection(),function(a){return parseInt(a.id.replace(/[^\/\d]/g,""),10)}),d=parseInt(b.id.replace(/[^\/\d]/g,""),10)+1),d}})}(wp.customize,jQuery,_);var CZRBaseModuleControlMths=CZRBaseModuleControlMths||{};!function(a,b,c){b.extend(CZRBaseModuleControlMths,{registerModulesOnInit:function(d){var e=this,f=[];c.each(e.getSavedModules(),function(g,h){if(!d.czr_Item.has(g.sektion_id))return a.errorLog("Warning Module "+g.id+" is orphan : it has no sektion to be embedded to. It Must be removed."),void f.push(g);var i=d.czr_Item(g.sektion_id);if(c.isUndefined(i))throw new Error("sektion instance missing. Impossible to instantiate module : "+g.id);b.extend(g,{sektion:i}),e.updateModulesCollection({module:g})}),e.moduleCollectionReady.then(function(){c.isEmpty(f)||e.moduleCollectionReact(e.czr_moduleCollection(),[],{orphans_module_removal:f})})},updateModulesCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);if(c.has(a,"collection"))return void d.czr_moduleCollection.set(a.collection,a.data||{});if(!c.has(a,"module"))throw new Error("updateModulesCollection, no module provided "+d.id+". Aborting");var g=d.prepareModuleForAPI(c.clone(a.module));c.findWhere(f,{id:g.id})?c.each(e,function(a,b){a.id==g.id&&(f[b]=g)}):f.push(g);var h={};c.has(a,"data")&&(h=b.extend(!0,{},a.data),b.extend(h,{module:g})),d.czr_moduleCollection.set(f,h)},moduleCollectionReact:function(d,e,f){var g=this,h=c.size(d)>c.size(e),i=c.size(e)>c.size(d);c.size(e)==c.size(d);if(is_collection_sorted=!1,i){var j=c.filter(e,function(a){return c.isUndefined(c.findWhere(d,{id:a.id}))});j=j[0],g.czr_Module.remove(j.id)}c.isObject(f)&&c.has(f,"module")&&(f.module_id=f.module.id,f.module=g.prepareModuleForDB(b.extend(!0,{},f.module))),!g.isMultiModuleControl()&&h||a(this.id).set(g.filterModuleCollectionBeforeAjax(d),f)},filterModuleCollectionBeforeAjax:function(a){var d,e=this,f=b.extend(!0,[],a);if(c.each(a,function(a,c){var d=b.extend(!0,{},a);f[c]=e.prepareModuleForDB(d)}),e.isMultiModuleControl())return f;if(c.size(a)>1)throw new Error("There should not be several modules in the collection of control : "+e.id);if(!c.isArray(a)||c.isEmpty(a)||!c.has(a[0],"items"))throw new Error("The setting value could not be populated in control : "+e.id);var g=a[0].id;if(!e.czr_Module.has(g))throw new Error("The single module control ("+e.id+") has no module registered with the id "+g);var h=e.czr_Module(g);if(!c.isArray(h().items))throw new Error("The module "+g+" should be an array in control : "+e.id);return d=h.isMultiItem()?h().items:h().items[0]||[],h.hasModOpt()?c.union([h().modOpt],d):d},prepareModuleForDB:function(a){if(!c.isObject(a))throw new Error("MultiModule Control::prepareModuleForDB : a module must be an object. Aborting.");var b=this,d={};return c.each(b.getDefaultModuleDBModel(),function(e,f){if(!c.has(a,f))throw new Error("MultiModule Control::prepareModuleForDB : a module is missing the property : "+f+" . Aborting.");var g=a[f];switch(f){case"items":if(!c.isArray(g))throw new Error("prepareModuleForDB : a module item list must be an array");d[f]=g;break;case"id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module id must a string not empty");d[f]=g;break;case"module_type":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module type must a string not empty");d[f]=g;break;case"column_id":if(!c.isString(g)||c.isEmpty(g))throw new Error("prepareModuleForDB : a module column id must a string not empty");d[f]=g;break;case"sektion_id":if(!c.isObject(a.sektion)||!c.has(a.sektion,"id"))throw new Error("prepareModuleForDB : a module sektion must be an object with an id.");d[f]=a.sektion.id;break;case"dirty":if(b.czr_Module.has(a.id)?d[f]=b.czr_Module(a.id).isDirty():d[f]=g,!c.isBoolean(d[f]))throw new Error("prepareModuleForDB : a module dirty state must be a boolean.")}}),d}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{initialize:function(b,c){var d=this;a.consoleLog("IN MULTI MODULE INITIALIZE ? ",c),a(b).callbacks.add(function(){return d.syncColumn.apply(d,arguments)}),a.CZRBaseModuleControl.prototype.initialize.call(d,b,c)},ready:function(){var b=this;a.consoleLog("MODULE-COLLECTION CONTROL READY",this.id),a.CZRBaseModuleControl.prototype.ready.apply(b,arguments)},syncColumn:function(d,e,f){if(a.consoleLog("IN SYNC COLUMN",d,e,f),(c.isUndefined(f)||!f.silent)&&(a.consoleLog("IN SYNXXX",a.control("hu_theme_options[module-collection]").syncSektionModule()(),this.syncSektionModule()(),this.id),!c.has(f,"orphans_module_removal"))){var g=a.control(this.id),h=c.filter(d,function(a,b){return!c.findWhere(e,{id:a.id})});c.isEmpty(h)||(a.consoleLog("ADDED MODULE?",h),c.each(h,function(a){g.syncSektionModule().czr_Column(a.column_id).updateColumnModuleCollection({module:a})}));var i=c.filter(e,function(a,b){return!c.findWhere(d,{id:a.id})});c.isEmpty(i)||c.each(i,function(a){g.syncSektionModule().czr_Column(a.column_id).removeModuleFromColumnCollection(a)}),c.size(e)==c.size(d)&&c.has(f,"module")&&c.has(f,"source_column")&&c.has(f,"target_column")&&b.when(g.syncSektionModule().moveModuleFromTo(f.module,f.source_column,f.target_column)).done(function(){g.syncSektionModule().control.trigger("module-moved",{module:f.module,source_column:f.source_column,target_column:f.target_column})}),g.trigger("columns-synchronized",d)}},removeModule:function(a){var b=this;b.czr_Module.has(a.id)&&"resolved"==b.czr_Module(a.id).embedded.state()&&b.czr_Module(a.id).container.remove(),b.removeModuleFromCollection(a)},removeModuleFromCollection:function(a){var d=this,e=d.czr_moduleCollection(),f=b.extend(!0,[],e);f=c.filter(f,function(b){return b.id!=a.id}),d.czr_moduleCollection.set(f)}})}(wp.customize,jQuery,_);var CZRMultiModuleControlMths=CZRMultiModuleControlMths||{};!function(a,b,c){b.extend(CZRMultiModuleControlMths,{getMultiModuleExtender:function(d){var e=this;return b.extend(e.CZRModuleExtended,{initialize:function(c,e){var f=this;d.prototype.initialize.call(f,c,e),a.consoleLog("MODULE INSTANTIATED : ",f.id),b.extend(f,{singleModuleWrapper:"czr-single-module-wrapper",sektionModuleTitle:"czr-module-sektion-title-part",ruModuleEl:"czr-ru-module-sektion-content"}),f.czr_ModuleState=new a.Value((!1)),f.isReady.done(function(){f.setupModuleView()}),f.moduleTitleEmbedded=b.Deferred(),f.modColumn=new a.Value,f.modColumn.set(e.column_id),f.modColumn.bind(function(c,d){a.consoleLog("MODULE "+f.id+" HAS BEEN MOVED TO COLUMN",c,f());var e=f(),g=b.extend(!0,{},e);g.column_id=c,f.set(g,{target_column:c,source_column:d})})},ready:function(e){var f=this;a.consoleLog("MODULE READY IN EXTENDED MODULE CLASS : ",f.id),b.when(f.renderModuleWrapper(e)).done(function(a){if(c.isUndefined(a)||!1===a.length)throw new Error("Module container has not been embedded for module :"+f.id);f.container=a,f.embedded.resolve()}),d.prototype.ready.call(f)}}),e.CZRModuleExtended},CZRModuleExtended:{renderModuleWrapper:function(a){var c=this;if("resolved"==c.embedded.state())return c.container;if(0===b("#tmpl-"+c.singleModuleWrapper).length)throw new Error("No template for module "+c.id+". The template script id should be : #tmpl-"+c.singleModuleWrapper);var d=wp.template(c.singleModuleWrapper),e={id:c.id,type:c.module_type},f=b(d(e));return a?b.when(b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").after(f)).done(function(){b(".czr-module-collection-wrapper",c._getColumn().container).find(".czr-module-candidate").remove()}):b(".czr-module-collection-wrapper",c._getColumn().container).append(f),f},setupModuleView:function(){var b=this;b.view_event_map=[{trigger:"click keydown",selector:[".czr-remove-mod","."+b.control.css_attr.cancel_alert_btn].join(","),name:"toggle_remove_alert",actions:["toggleModuleRemoveAlert"]},{trigger:"click keydown",selector:"."+b.control.css_attr.remove_view_btn,name:"remove_module",actions:["removeModule"]},{trigger:"click keydown",selector:".czr-edit-mod",name:"edit_module",actions:["setModuleViewVisibility","sendEditModule"]},{trigger:"click keydown",selector:".czr-module-back",name:"back_to_column",actions:["setModuleViewVisibility"]},{trigger:"mouseenter",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("start_hovering_module",{id:b.id})}},{trigger:"mouseleave",selector:".czr-mod-header",name:"hovering_module",actions:function(a){b.control.previewer.send("stop_hovering_module",{id:b.id})}}],b.embedded.done(function(){b.czr_ModuleState.callbacks.add(function(){return b.setupModuleViewStateListeners.apply(b,arguments)}),a.CZR_Helpers.setupDOMListeners(b.view_event_map,{module:{id:b.id},dom_el:b.container},b)})},setModuleViewVisibility:function(c,d){var e=this;e.czr_ModuleState(!e.czr_ModuleState()),a.czrModulePanelState.set(!1),a.czrSekSettingsPanelState.set(!1),e.control.syncSektionModule().closeAllOtherSektions(b(c.dom_event.currentTarget,c.dom_el))},sendEditModule:function(a){var b=this;b.control.previewer.send("edit_module",{id:b.id})},setupModuleViewStateListeners:function(c){var d=this;a.czr_isModuleExpanded=a.czr_isModuleExpanded||new a.Value,c?a.czr_isModuleExpanded(d):a.czr_isModuleExpanded(!1),b.when(d.toggleModuleViewExpansion(c)).done(function(){c?(d.renderModuleTitle(),d.populateSavedItemCollection()):d.czr_Item.each(function(a){a.viewState.set("closed"),a._destroyView(0),d.czr_Item.remove(a.id)})})},renderModuleTitle:function(){var a=this;if("resolved"!=a.moduleTitleEmbedded.state()){if(0===b("#tmpl-"+a.sektionModuleTitle).length)throw new Error("No sektion title Module Part template for module "+a.id+". The template script id should be : #tmpl-"+a.sektionModuleTitle);b.when(b(a.container).find(".czr-mod-content").prepend(b(wp.template(a.sektionModuleTitle)({id:a.id})))).done(function(){a.moduleTitleEmbedded.resolve()})}},toggleModuleViewExpansion:function(a,c){var d=this;b(".czr-mod-content",d.container).slideToggle({duration:c||200,done:function(){var b=d.container.closest(".wp-full-overlay"),c=d.container.find(".czr-module-back"),e=d.container.find(".czr-module-title");d.container.toggleClass("open",a),b.toggleClass("czr-module-open",a),e.attr("tabindex",a?"-1":"0"),c.attr("tabindex",a?"0":"-1"),a?c.focus():e.focus(),a&&d._adjustScrollExpandedBlock(d.container)}})},toggleModuleRemoveAlert:function(a){var d=this,e=this.control,f=b("."+d.control.css_attr.remove_alert_wrapper,d.container).first(),g=(a.dom_event,e.syncSektionModule().czr_Column(d.column_id).container);if(c.has(d,"preItem")&&e.syncSektionModule().preItemExpanded.set(!1),b("."+d.control.css_attr.remove_alert_wrapper,g).not(f).each(function(){b(this).hasClass("open")&&b(this).slideToggle({duration:200,done:function(){b(this).toggleClass("open",!1),b(this).siblings().find("."+d.control.css_attr.display_alert_btn).toggleClass("active",!1)}})}),!wp.template(d.AlertPart)||!d.container)throw new Error("No removal alert template available for module :"+d.id);f.html(wp.template(d.AlertPart)({title:d().title||d.id})),f.slideToggle({duration:200,done:function(){var c=!b(this).hasClass("open")&&b(this).is(":visible");b(this).toggleClass("open",c),b(a.dom_el).find("."+d.control.css_attr.display_alert_btn).toggleClass("active",c),c&&d._adjustScrollExpandedBlock(d.container)}})},removeModule:function(a){this.control.removeModule(a.module)},_getColumn:function(){var a=this;return a.control.syncSektionModule().czr_Column(a.modColumn())},_getSektion:function(){}}})}(wp.customize,jQuery,_);var CZRMultiplePickerMths=CZRMultiplePickerMths||{};!function(a,b,c){b.extend(CZRMultiplePickerMths,{ready:function(){function a(a){return a.text.replace(/\u2013|\u2014/g,"")}var c=this,d=this.container.find("select");d.select2({closeOnSelect:!1,templateSelection:a}),d.on("change",function(a){0===b(this).find("option:selected").length&&c.setting.set([])})}})}(wp.customize,jQuery,_);var CZRCroppedImageMths=CZRCroppedImageMths||{};!function(a,b,c){"function"==typeof wp.media.controller.Cropper&&"function"==typeof a.CroppedImageControl&&(wp.media.controller.CZRCustomizeImageCropper=wp.media.controller.Cropper.extend({doCrop:function(a){var b=a.get("cropDetails"),c=this.get("control");return b.dst_width=c.params.dst_width,b.dst_height=c.params.dst_height,wp.ajax.post("crop-image",{wp_customize:"on",nonce:a.get("nonces").edit,id:a.get("id"),context:c.id,cropDetails:b})}}),b.extend(CZRCroppedImageMths,{initFrame:function(){var a=_wpMediaViewsL10n;this.frame=wp.media({button:{text:a.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CZRCustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var a=this.frame.state().get("selection").first().toJSON();return a.mime&&a.mime.indexOf("image")>-1?void(c.contains(["image/svg+xml","image/gif"],a.mime)||this.params.width===a.width&&this.params.height===a.height&&!this.params.flex_width&&!this.params.flex_height?(this.setImageFromAttachment(a),this.frame.close()):this.frame.setState("cropper")):void this.frame.trigger("content:error")}}))}(wp.customize,jQuery,_);var CZRUploadMths=CZRUploadMths||{};!function(a,b,c){b.extend(CZRUploadMths,{ready:function(){var c=this;this.params.removed=this.params.removed||"",this.success=b.proxy(this.success,this),this.uploader=b.extend({container:this.container,browser:this.container.find(".czr-upload"),success:this.success,plupload:{},params:{}},this.uploader||{}),c.params.extensions&&(c.uploader.plupload.filters=[{title:a.l10n.allowedFiles,extensions:c.params.extensions}]),c.params.context&&(c.uploader.params["post_data[context]"]=this.params.context),a.settings.theme.stylesheet&&(c.uploader.params["post_data[theme]"]=a.settings.theme.stylesheet),this.uploader=new wp.Uploader(this.uploader),this.remover=this.container.find(".remove"),this.remover.on("click keydown",function(a){"keydown"===a.type&&13!==a.which||(c.setting.set(c.params.removed),a.preventDefault())}),this.removerVisibility=b.proxy(this.removerVisibility,this),this.setting.bind(this.removerVisibility),this.removerVisibility(this.setting())},success:function(a){this.setting.set(a.get("id"))},removerVisibility:function(a){this.remover.toggle(a!=this.params.removed)}})}(wp.customize,jQuery,_);var CZRLayoutSelectMths=CZRLayoutSelectMths||{};!function(a,b,c){b.extend(CZRLayoutSelectMths,{ready:function(){this.setupSelect()},setupSelect:function(a){function d(a){if(!a.id)return a.text;if(c.has(e.params.layouts,a.element.value)){var d=e.params.layouts[a.element.value],f=d.src,g=d.label,h=b('<img src="'+f+'" class="czr-layout-img" title="'+g+'" /><span class="czr-layout-title">'+g+"</span>");return h}}var e=this;$_select=this.container.find("select"),$_select.select2({templateResult:d,templateSelection:d,minimumResultsForSearch:1/0})}})}(wp.customize,jQuery,_),function(a,b,c){b.extend(CZRBaseControlMths,a.Events),b.extend(a.Control.prototype,a.Events),b.extend(CZRModuleMths,a.Events),b.extend(CZRItemMths,a.Events),b.extend(CZRModOptMths,a.Events),b.extend(CZRSkopeBaseMths,a.Events),b.extend(CZRSkopeMths,a.Events),b.extend(CZRBaseControlMths,a.CZR_Helpers),b.extend(CZRInputMths,a.CZR_Helpers),b.extend(CZRModuleMths,a.CZR_Helpers),b.extend(CZRSkopeMths,a.CZR_Helpers),a.CZR_skopeBase=a.Class.extend(CZRSkopeBaseMths),a.CZR_skopeSave=a.Class.extend(CZRSkopeSaveMths),a.CZR_skopeReset=a.Class.extend(CZRSkopeResetMths),a.CZR_skope=a.Value.extend(CZRSkopeMths),c.has(a,"HeaderTool")&&(a.czr_HeaderTool=b.extend(!0,{},a.HeaderTool)),a.CZRInput=a.Value.extend(CZRInputMths),a.CZRItem=a.Value.extend(CZRItemMths),a.CZRModOpt=a.Value.extend(CZRModOptMths),a.CZRModule=a.Value.extend(CZRModuleMths),a.CZRDynModule=a.CZRModule.extend(CZRDynModuleMths),c.isUndefined(window.CZRColumnMths)||(a.CZRColumn=a.Value.extend(CZRColumnMths)),a.CZRBaseControl=a.Control.extend(CZRBaseControlMths),a.CZRBaseModuleControl=a.CZRBaseControl.extend(CZRBaseModuleControlMths),a.CZRMultiModuleControl=a.CZRBaseModuleControl.extend(CZRMultiModuleControlMths),a.CZRUploadControl=a.Control.extend(CZRUploadMths),a.CZRLayoutControl=a.Control.extend(CZRLayoutSelectMths),a.CZRMultiplePickerControl=a.Control.extend(CZRMultiplePickerMths),b.extend(a.controlConstructor,{czr_upload:a.CZRUploadControl,czr_module:a.CZRBaseModuleControl,czr_multi_module:a.CZRMultiModuleControl,czr_multiple_picker:a.CZRMultiplePickerControl,czr_layouts:a.CZRLayoutControl}),"function"==typeof a.CroppedImageControl&&(a.CZRCroppedImageControl=a.CroppedImageControl.extend(CZRCroppedImageMths),b.extend(a.controlConstructor,{czr_cropped_image:a.CZRCroppedImageControl})),a.czrInputMap=a.czrInputMap||{},b.extend(a.czrInputMap,{text:"",textarea:"",check:"setupIcheck",select:"setupSelect",number:"setupStepper",upload:"setupImageUploader",color:"setupColorPicker",content_picker:"setupContentPicker",text_editor:"setupTextEditor",password:"",range_slider:"setupRangeSlider"})}(wp.customize,jQuery,_),function(a,b,c){var d=serverControlParams.i18n||{};a.czr_CrtlDependenciesReady=b.Deferred(),a.bind("ready",function(){c.has(a,"czr_ctrlDependencies")||(serverControlParams.isSkopOn?"resolved"!=a.czr_skopeReady.state()&&a.czr_skopeReady.done(function(){a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()}):(a.czr_ctrlDependencies=new a.CZR_ctrlDependencies,a.czr_CrtlDependenciesReady.resolve()))}),a.CZR_ctrlDependencies=a.Class.extend({dominiDeps:[],initialize:function(){var b=this;if(this.defaultDominusParams={dominus:"",servi:[],visibility:null,actions:null,onSectionExpand:!0},this.dominiDeps=c.extend(this.dominiDeps,this._getControlDeps()),!c.isArray(b.dominiDeps))throw new Error("Visibilities : the dominos dependency array is not an array.");a.czr_activeSectionId.bind(function(d){if(!c.isEmpty(d)&&a.section.has(d))try{b.setServiDependencies(d)}catch(e){a.errorLog("In api.CZR_ctrlDependencies : "+e)}}),a.bind("awaken-section",function(d){if(serverControlParams.isSkopOn&&c.has(a,"czr_skopeBase"))a.czr_skopeBase.processSilentUpdates({candidates:{},section_id:d.target,refresh:!1}).then(function(){try{b.setServiDependencies(d.target,d.source)}catch(c){a.errorLog("On awaken-section, ctrl deps : "+c)}});else try{b.setServiDependencies(d.target,d.source)}catch(e){a.errorLog("On awaken-section, ctrl deps : "+e)}}),this._handleFaviconNote()},setServiDependencies:function(d,e,f){var g=this,h=b.Deferred();if(f=f||!1,c.isUndefined(d)||!a.section.has(d))throw new Error("Control Dependencies : the targetSectionId is missing or not registered : "+d);if(a.section(d).czr_ctrlDependenciesReady=a.section(d).czr_ctrlDependenciesReady||b.Deferred(),!f&&"resolved"==a.section(d).czr_ctrlDependenciesReady.state())return h.resolve().promise();c.each(g.dominiDeps,function(b){if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))throw new Error("Control Dependencies : a dominus control id must be a not empty string.");var e=a.CZR_Helpers.build_setId(b.dominus);a.control.has(e)&&a.control(e).section()==d&&(b=g._prepareDominusParams(b),c.isEmpty(b)||g._processDominusCallbacks(b.dominus,b,f).fail(function(){a.consoleLog("self._processDominusCallbacks fail for section "+d),h.reject()}).done(function(){h.resolve()}))});var i=a.CZR_Helpers.getSectionControlIds(d),j=function(b){var d=[];return c.each(g.dominiDeps,function(e){if(!c.has(e,"servi")||!c.isArray(e.servi)||!c.has(e,"dominus")||c.isEmpty(e.dominus))return void a.errorLog("Control Dependencies : wrong params in _getServusDomini.");if(c.contains(e.servi,b)&&!c.contains(d,e.dominus)){if(e=g._prepareDominusParams(e),c.isEmpty(e))return;d.push(e.dominus)}}),c.isArray(d)?d:[]},k=[];return c.each(i,function(a){c.isEmpty(j(a))||(k=c.union(k,j(a)))}),c.each(k,function(b){var c=a.CZR_Helpers.build_setId(b);a.control(c).section()!=d&&e!=a.control(c).section()&&a.trigger("awaken-section",{target:a.control(c).section(),source:d})}),h.always(function(){a.section(d).czr_ctrlDependenciesReady.resolve()}),h.promise()},_deferCallbackForControl:function(d,e,f){var g=b.Deferred();if(c.isEmpty(d)||!c.isString(d))throw new Error("_deferCallbackForControl : the control id is missing.");if(!c.isFunction(e))throw new Error("_deferCallbackForControl : callback must be a funtion.");return f=c.isUndefined(f)||!c.isArray(f)?[]:f,a.control.has(d)?"resolved"==a.control(d).deferred.embedded.state()?b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()}):a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})}):a.control.when(d,function(){a.control(d).deferred.embedded.then(function(){b.when(e.apply(null,f)).fail(function(){g.reject()}).done(function(){g.resolve()})})}),g.promise()},_processDominusCallbacks:function(d,e,f){var g=this,h=a.CZR_Helpers.build_setId(d),i=a(h),j=b.Deferred(),k=!1;return c.each(e.servi,function(b){if(a.control.has(a.CZR_Helpers.build_setId(b))){var d=function(a,b,d,e){var f=arguments;c.each(d,function(a,b){switch(b){case"visibility":g._setVisibility.apply(null,f);break;case"actions":c.isFunction(a)&&a.apply(null,f)}})},f=function(c){c=c||i();var f=a.CZR_Helpers.build_setId(b);g._deferCallbackForControl(f,d,[c,b,e]).always(function(){k=!0}).fail(function(){j.reject()}).done(function(){j.resolve()})};f(),c.has(i,"czr_visibilityServi")||(i.czr_visibilityServi=new a.Value([]));var h=i.czr_visibilityServi();c.contains(h,b)||(i.bind(function(a){f(a)}),i.czr_visibilityServi(c.union(h,[b])))}}),k?j.promise():j.resolve().promise()},_setVisibility:function(b,d,e,f){var g=a.CZR_Helpers.build_setId(d),h=e.visibility(b,d,e.dominus);if(f=f||!1,c.isBoolean(h)&&("unchanged"!=h||f)){var i=function(){a.state.has("silent-update-processing")&&a.state("silent-update-processing")()||(a.control(g,function(a){var b={duration:"fast",completeCallback:function(){},unchanged:!1};c.has(a,"active")&&(h=h&&a.active()),c.has(a,"defaultActiveArguments")&&(b=control.defaultActiveArguments),a.onChangeActive(h,a.defaultActiveArguments)}),a.state.has("silent-update-processing")&&a.state("silent-update-processing").unbind(i))};a.state.has("silent-update-processing")&&a.state("silent-update-processing")()?a.state("silent-update-processing").bind(i):i()}},_getControlDeps:function(){return{}},_prepareDominusParams:function(b){var d=this,e={};if(!c.isObject(b))return a.errorLog("Visibilities : a dominus param definition must be an object."),e;if(!c.has(b,"visibility")&&!c.has(b,"actions"))return a.errorLog("Visibilities : a dominus definition must include a visibility or an actions callback."),e;if(!c.has(b,"dominus")||!c.isString(b.dominus)||c.isEmpty(b.dominus))return a.errorLog("Visibilities : a dominus control id must be a not empty string."),e;var f=a.CZR_Helpers.build_setId(b.dominus);return a.control.has(f)?!c.has(b,"servi")||c.isUndefined(b.servi)||!c.isArray(b.servi)||c.isEmpty(b.servi)?(a.errorLog("Visibilities : servi must be set as an array not empty."),e):(c.each(d.defaultDominusParams,function(a,d){var f=b[d];switch(d){case"visibility":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus visibility callback must be a function : "+b.dominus);break;case"actions":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isFunction(f))throw new Error("Visibilities : a dominus actions callback must be a function : "+b.dominus);break;case"onSectionExpand":if(!c.isUndefined(f)&&!c.isEmpty(f)&&!c.isBoolean(f))throw new Error("Visibilities : a dominus onSectionExpand param must be a boolean : "+b.dominus)}e[d]=f}),e):(a.errorLog("Visibilities : a dominus control id is not registered : "+f),e)},_handleFaviconNote:function(){var b=this,c=a.CZR_Helpers.build_setId(serverControlParams.faviconOptionName);if(!(!a.has("site_icon")||!a.control("site_icon")||a.has(c)&&0===+a(c)()||+a("site_icon")()>0)){var e=a.control("site_icon").params.description;_newDes=["<strong>",d.faviconNote||"","</strong><br/><br/>"].join("")+e,b._printFaviconNote(_newDes),a("site_icon").callbacks.add(function(d){+d>0?(a.control("site_icon").container.find(".description").text(e),a.has(c)&&a(c).set("")):b._printFaviconNote(_newDes)})}},_printFaviconNote:function(b){a.control("site_icon").container.find(".description").html(b)}})}(wp.customize,jQuery,_),function(a,b){b(function(b){function c(a){var c=a.siblings(".open");0!==c.length&&c.offset().top<0&&b(".wp-full-overlay-sidebar-content").animate({scrollTop:-b("#customize-theme-controls").offset().top-c.height()+a.offset().top+b(".wp-full-overlay-sidebar-content").offset().top},700)}var d=a.customize||d;b(".accordion-section").not(".control-panel").click(function(){c(b(this))}),d.czrSetupCheckbox=function(a,c){b("input[type=checkbox]",d.control(a).container).each(function(){0===b(this).val()||"0"==b(this).val()||"off"==b(this).val()||_.isEmpty(b(this).val())?b(this).prop("checked",!1):b(this).prop("checked",!0),0===b(this).closest('div[class^="icheckbox"]').length&&b(this).iCheck({checkboxClass:"icheckbox_flat-grey",radioClass:"iradio_flat-grey"}).on("ifChanged",function(a){b(this).val(!1===b(this).is(":checked")?0:1),b(a.currentTarget).trigger("change")})})},d.czrSetupSelect=function(a,c){b("select[data-customize-setting-link]",d.control(a).container).not(".no-selecter-js").each(function(){b(this).selecter({})})},d.czrSetupStepper=function(a,c){b('input[type="number"]',d.control(a).container).each(function(){b(this).stepper()})},d.control.each(function(a){_.has(a,"id")&&("widget_"!=a.id.substring(0,"widget_".length)&&"nav_menu"!=a.id.substring(0,"nav_menu".length)&&d.czrSetupCheckbox(a.id),"nav_menu_locations"!=a.id.substring(0,"nav_menu_locations".length)&&d.czrSetupSelect(a.id),d.czrSetupStepper(a.id))});var e=function(){var a=b("<span/>",{"class":"customize-controls-home fa fa-home",html:'<span class="screen-reader-text">Home</span>'});b.when(b("#customize-header-actions").append(a)).done(function(){a.keydown(function(a){9!==a.which&&(13===a.which&&this.click(),a.preventDefault())}).on("click.customize-controls-home",function(){d.section.has(d.czr_activeSectionId())?d.section(d.czr_activeSectionId()).expanded(!1):d.section.each(function(a){a.expanded(!1)}),d.panel.each(function(a){a.expanded(!1)})})})};e()})}(wp,jQuery);
|
addons/assets/front/js/vendors/flickity.min.js
CHANGED
@@ -1,54 +1,54 @@
|
|
1 |
-
/*!
|
2 |
-
* Flickity PACKAGED v2.0.5
|
3 |
-
* Touch, responsive, flickable carousels
|
4 |
-
*
|
5 |
-
* Licensed GPLv3 for open source use
|
6 |
-
* or Flickity Commercial License for commercial use
|
7 |
-
*
|
8 |
-
* http://flickity.metafizzy.co
|
9 |
-
* Copyright 2016 Metafizzy
|
10 |
-
*/
|
11 |
-
!function(a,b){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("jquery")):a.jQueryBridget=b(a,a.jQuery)}(window,function(a,b){"use strict";function c(c,f,h){function i(a,b,d){var e,f="$()."+c+'("'+b+'")';return a.each(function(a,i){var j=h.data(i,c);if(!j)return void g(c+" not initialized. Cannot call methods, i.e. "+f);var k=j[b];if(!k||"_"==b.charAt(0))return void g(f+" is not a valid method");var l=k.apply(j,d);e=void 0===e?l:e}),void 0!==e?e:a}function j(a,b){a.each(function(a,d){var e=h.data(d,c);e?(e.option(b),e._init()):(e=new f(d,b),h.data(d,c,e))})}h=h||b||a.jQuery,h&&(f.prototype.option||(f.prototype.option=function(a){h.isPlainObject(a)&&(this.options=h.extend(!0,this.options,a))}),h.fn[c]=function(a){if("string"==typeof a){var b=e.call(arguments,1);return i(this,a,b)}return j(this,a),this},d(h))}function d(a){!a||a&&a.bridget||(a.bridget=c)}var e=Array.prototype.slice,f=a.console,g="undefined"==typeof f?function(){}:function(a){f.error(a)};return d(b||a.jQuery),c}),function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}("undefined"!=typeof window?window:this,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{},d=c[a]=c[a]||[];return d.indexOf(b)==-1&&d.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{},d=c[a]=c[a]||{};return d[b]=!0,this}},b.off=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=c.indexOf(b);return d!=-1&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=0,e=c[d];b=b||[];for(var f=this._onceEvents&&this._onceEvents[a];e;){var g=f&&f[e];g&&(this.off(a,e),delete f[e]),e.apply(this,b),d+=g?0:1,e=c[d]}return this}},a}),/*!
|
12 |
-
* getSize v2.0.2
|
13 |
-
* measure size of elements
|
14 |
-
* MIT license
|
15 |
-
*/
|
16 |
-
function(a,b){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return b()}):"object"==typeof module&&module.exports?module.exports=b():a.getSize=b()}(window,function(){"use strict";function a(a){var b=parseFloat(a),c=a.indexOf("%")==-1&&!isNaN(b);return c&&b}function b(){}function c(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0;b<j;b++){var c=i[b];a[c]=0}return a}function d(a){var b=getComputedStyle(a);return b||h("Style returned "+b+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),b}function e(){if(!k){k=!0;var b=document.createElement("div");b.style.width="200px",b.style.padding="1px 2px 3px 4px",b.style.borderStyle="solid",b.style.borderWidth="1px 2px 3px 4px",b.style.boxSizing="border-box";var c=document.body||document.documentElement;c.appendChild(b);var e=d(b);f.isBoxSizeOuter=g=200==a(e.width),c.removeChild(b)}}function f(b){if(e(),"string"==typeof b&&(b=document.querySelector(b)),b&&"object"==typeof b&&b.nodeType){var f=d(b);if("none"==f.display)return c();var h={};h.width=b.offsetWidth,h.height=b.offsetHeight;for(var k=h.isBorderBox="border-box"==f.boxSizing,l=0;l<j;l++){var m=i[l],n=f[m],o=parseFloat(n);h[m]=isNaN(o)?0:o}var p=h.paddingLeft+h.paddingRight,q=h.paddingTop+h.paddingBottom,r=h.marginLeft+h.marginRight,s=h.marginTop+h.marginBottom,t=h.borderLeftWidth+h.borderRightWidth,u=h.borderTopWidth+h.borderBottomWidth,v=k&&g,w=a(f.width);w!==!1&&(h.width=w+(v?0:p+t));var x=a(f.height);return x!==!1&&(h.height=x+(v?0:q+u)),h.innerWidth=h.width-(p+t),h.innerHeight=h.height-(q+u),h.outerWidth=h.width+r,h.outerHeight=h.height+s,h}}var g,h="undefined"==typeof console?b:function(a){console.error(a)},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],j=i.length,k=!1;return f}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",b):"object"==typeof module&&module.exports?module.exports=b():a.matchesSelector=b()}(window,function(){"use strict";var a=function(){var a=Element.prototype;if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0;c<b.length;c++){var d=b[c],e=d+"MatchesSelector";if(a[e])return e}}();return function(b,c){return b[a](c)}}),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.matchesSelector)}(window,function(a,b){var c={};c.extend=function(a,b){for(var c in b)a[c]=b[c];return a},c.modulo=function(a,b){return(a%b+b)%b},c.makeArray=function(a){var b=[];if(Array.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0;c<a.length;c++)b.push(a[c]);else b.push(a);return b},c.removeFrom=function(a,b){var c=a.indexOf(b);c!=-1&&a.splice(c,1)},c.getParent=function(a,c){for(;a!=document.body;)if(a=a.parentNode,b(a,c))return a},c.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},c.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},c.filterFindElements=function(a,d){a=c.makeArray(a);var e=[];return a.forEach(function(a){if(a instanceof HTMLElement){if(!d)return void e.push(a);b(a,d)&&e.push(a);for(var c=a.querySelectorAll(d),f=0;f<c.length;f++)e.push(c[f])}}),e},c.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},c.docReady=function(a){var b=document.readyState;"complete"==b||"interactive"==b?setTimeout(a):document.addEventListener("DOMContentLoaded",a)},c.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var d=a.console;return c.htmlInit=function(b,e){c.docReady(function(){var f=c.toDashed(e),g="data-"+f,h=document.querySelectorAll("["+g+"]"),i=document.querySelectorAll(".js-"+f),j=c.makeArray(h).concat(c.makeArray(i)),k=g+"-options",l=a.jQuery;j.forEach(function(a){var c,f=a.getAttribute(g)||a.getAttribute(k);try{c=f&&JSON.parse(f)}catch(h){return void(d&&d.error("Error parsing "+g+" on "+a.className+": "+h))}var i=new b(a,c);l&&l.data(a,e,i)})})},c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/cell",["get-size/get-size"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("get-size")):(a.Flickity=a.Flickity||{},a.Flickity.Cell=b(a,a.getSize))}(window,function(a,b){function c(a,b){this.element=a,this.parent=b,this.create()}var d=c.prototype;return d.create=function(){this.element.style.position="absolute",this.x=0,this.shift=0},d.destroy=function(){this.element.style.position="";var a=this.parent.originSide;this.element.style[a]=""},d.getSize=function(){this.size=b(this.element)},d.setPosition=function(a){this.x=a,this.updateTarget(),this.renderPosition(a)},d.updateTarget=d.setDefaultTarget=function(){var a="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[a]+this.size.width*this.parent.cellAlign},d.renderPosition=function(a){var b=this.parent.originSide;this.element.style[b]=this.parent.getPositionValue(a)},d.wrapShift=function(a){this.shift=a,this.renderPosition(this.x+this.parent.slideableWidth*a)},d.remove=function(){this.element.parentNode.removeChild(this.element)},c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/slide",b):"object"==typeof module&&module.exports?module.exports=b():(a.Flickity=a.Flickity||{},a.Flickity.Slide=b())}(window,function(){"use strict";function a(a){this.parent=a,this.isOriginLeft="left"==a.originSide,this.cells=[],this.outerWidth=0,this.height=0}var b=a.prototype;return b.addCell=function(a){if(this.cells.push(a),this.outerWidth+=a.size.outerWidth,this.height=Math.max(a.size.outerHeight,this.height),1==this.cells.length){this.x=a.x;var b=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=a.size[b]}},b.updateTarget=function(){var a=this.isOriginLeft?"marginRight":"marginLeft",b=this.getLastCell(),c=b?b.size[a]:0,d=this.outerWidth-(this.firstMargin+c);this.target=this.x+this.firstMargin+d*this.parent.cellAlign},b.getLastCell=function(){return this.cells[this.cells.length-1]},b.select=function(){this.changeSelectedClass("add")},b.unselect=function(){this.changeSelectedClass("remove")},b.changeSelectedClass=function(a){this.cells.forEach(function(b){b.element.classList[a]("is-selected")})},b.getCellElements=function(){return this.cells.map(function(a){return a.element})},a}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/animate",["fizzy-ui-utils/utils"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("fizzy-ui-utils")):(a.Flickity=a.Flickity||{},a.Flickity.animatePrototype=b(a,a.fizzyUIUtils))}(window,function(a,b){var c=a.requestAnimationFrame||a.webkitRequestAnimationFrame,d=0;c||(c=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-d)),e=setTimeout(a,c);return d=b+c,e});var e={};e.startAnimation=function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},e.animate=function(){this.applyDragForce(),this.applySelectedAttraction();var a=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(a),this.isAnimating){var b=this;c(function(){b.animate()})}};var f=function(){var a=document.documentElement.style;return"string"==typeof a.transform?"transform":"WebkitTransform"}();return e.positionSlider=function(){var a=this.x;this.options.wrapAround&&this.cells.length>1&&(a=b.modulo(a,this.slideableWidth),a-=this.slideableWidth,this.shiftWrapCells(a)),a+=this.cursorPosition,a=this.options.rightToLeft&&f?-a:a;var c=this.getPositionValue(a);this.slider.style[f]=this.isAnimating?"translate3d("+c+",0,0)":"translateX("+c+")";var d=this.slides[0];if(d){var e=-this.x-d.target,g=e/this.slidesWidth;this.dispatchEvent("scroll",null,[g,e])}},e.positionSliderAtSelected=function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.positionSlider())},e.getPositionValue=function(a){return this.options.percentPosition?.01*Math.round(a/this.size.innerWidth*1e4)+"%":Math.round(a)+"px"},e.settle=function(a){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*a)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle"))},e.shiftWrapCells=function(a){var b=this.cursorPosition+a;this._shiftCells(this.beforeShiftCells,b,-1);var c=this.size.innerWidth-(a+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,c,1)},e._shiftCells=function(a,b,c){for(var d=0;d<a.length;d++){var e=a[d],f=b>0?c:0;e.wrapShift(f),b-=e.size.outerWidth}},e._unshiftCells=function(a){if(a&&a.length)for(var b=0;b<a.length;b++)a[b].wrapShift(0)},e.integratePhysics=function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},e.applyForce=function(a){this.velocity+=a},e.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},e.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())},e.applyDragForce=function(){if(this.isPointerDown){var a=this.dragX-this.x,b=a-this.velocity;this.applyForce(b)}},e.applySelectedAttraction=function(){if(!this.isPointerDown&&!this.isFreeScrolling&&this.cells.length){var a=this.selectedSlide.target*-1-this.x,b=a*this.options.selectedAttraction;this.applyForce(b)}},e}),function(a,b){if("function"==typeof define&&define.amd)define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)});else if("object"==typeof module&&module.exports)module.exports=b(a,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"));else{var c=a.Flickity;a.Flickity=b(a,a.EvEmitter,a.getSize,a.fizzyUIUtils,c.Cell,c.Slide,c.animatePrototype)}}(window,function(a,b,c,d,e,f,g){function h(a,b){for(a=d.makeArray(a);a.length;)b.appendChild(a.shift())}function i(a,b){var c=d.getQueryElement(a);if(!c)return void(l&&l.error("Bad element for Flickity: "+(c||a)));if(this.element=c,this.element.flickityGUID){var e=n[this.element.flickityGUID];return e.option(b),e}j&&(this.$element=j(this.element)),this.options=d.extend({},this.constructor.defaults),this.option(b),this._create()}var j=a.jQuery,k=a.getComputedStyle,l=a.console,m=0,n={};i.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},i.createMethods=[];var o=i.prototype;d.extend(o,b.prototype),o._create=function(){var b=this.guid=++m;this.element.flickityGUID=b,n[b]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&a.addEventListener("resize",this),i.createMethods.forEach(function(a){this[a]()},this),this.options.watchCSS?this.watchCSS():this.activate()},o.option=function(a){d.extend(this.options,a)},o.activate=function(){if(!this.isActive){this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();var a=this._filterFindCellElements(this.element.children);h(a,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate");var b,c=this.options.initialIndex;b=this.isInitActivated?this.selectedIndex:void 0!==c&&this.cells[c]?c:0,this.select(b,!1,!0),this.isInitActivated=!0}},o._createSlider=function(){var a=document.createElement("div");a.className="flickity-slider",a.style[this.originSide]=0,this.slider=a},o._filterFindCellElements=function(a){return d.filterFindElements(a,this.options.cellSelector)},o.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},o._makeCells=function(a){var b=this._filterFindCellElements(a),c=b.map(function(a){return new e(a,this)},this);return c},o.getLastCell=function(){return this.cells[this.cells.length-1]},o.getLastSlide=function(){return this.slides[this.slides.length-1]},o.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},o._positionCells=function(a){a=a||0,this.maxCellHeight=a?this.maxCellHeight||0:0;var b=0;if(a>0){var c=this.cells[a-1];b=c.x+c.size.outerWidth}for(var d=this.cells.length,e=a;e<d;e++){var f=this.cells[e];f.setPosition(b),b+=f.size.outerWidth,this.maxCellHeight=Math.max(f.size.outerHeight,this.maxCellHeight)}this.slideableWidth=b,this.updateSlides(),this._containSlides(),this.slidesWidth=d?this.getLastSlide().target-this.slides[0].target:0},o._sizeCells=function(a){a.forEach(function(a){a.getSize()})},o.updateSlides=function(){if(this.slides=[],this.cells.length){var a=new f(this);this.slides.push(a);var b="left"==this.originSide,c=b?"marginRight":"marginLeft",d=this._getCanCellFit();this.cells.forEach(function(b,e){if(!a.cells.length)return void a.addCell(b);var g=a.outerWidth-a.firstMargin+(b.size.outerWidth-b.size[c]);d.call(this,e,g)?a.addCell(b):(a.updateTarget(),a=new f(this),this.slides.push(a),a.addCell(b))},this),a.updateTarget(),this.updateSelectedSlide()}},o._getCanCellFit=function(){var a=this.options.groupCells;if(!a)return function(){return!1};if("number"==typeof a){var b=parseInt(a,10);return function(a){return a%b!==0}}var c="string"==typeof a&&a.match(/^(\d+)%$/),d=c?parseInt(c[1],10)/100:1;return function(a,b){return b<=(this.size.innerWidth+1)*d}},o._init=o.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},o.getSize=function(){this.size=c(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var p={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};return o.setCellAlign=function(){var a=p[this.options.cellAlign];this.cellAlign=a?a[this.originSide]:this.options.cellAlign},o.setGallerySize=function(){if(this.options.setGallerySize){var a=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=a+"px"}},o._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var a=this.cursorPosition,b=this.cells.length-1;this.beforeShiftCells=this._getGapCells(a,b,-1),a=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(a,0,1)}},o._getGapCells=function(a,b,c){for(var d=[];a>0;){var e=this.cells[b];if(!e)break;d.push(e),b+=c,a-=e.size.outerWidth}return d},o._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var a=this.options.rightToLeft,b=a?"marginRight":"marginLeft",c=a?"marginLeft":"marginRight",d=this.slideableWidth-this.getLastCell().size[c],e=d<this.size.innerWidth,f=this.cursorPosition+this.cells[0].size[b],g=d-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(a){e?a.target=d*this.cellAlign:(a.target=Math.max(a.target,f),a.target=Math.min(a.target,g))},this)}},o.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),j&&this.$element){a+=this.options.namespaceJQueryEvents?".flickity":"";var e=a;if(b){var f=j.Event(b);f.type=a,e=f}this.$element.trigger(e,c)}},o.select=function(a,b,c){this.isActive&&(a=parseInt(a,10),this._wrapSelect(a),(this.options.wrapAround||b)&&(a=d.modulo(a,this.slides.length)),this.slides[a]&&(this.selectedIndex=a,this.updateSelectedSlide(),c?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select"),this.dispatchEvent("cellSelect")))},o._wrapSelect=function(a){var b=this.slides.length,c=this.options.wrapAround&&b>1;if(!c)return a;var e=d.modulo(a,b),f=Math.abs(e-this.selectedIndex),g=Math.abs(e+b-this.selectedIndex),h=Math.abs(e-b-this.selectedIndex);!this.isDragSelect&&g<f?a+=b:!this.isDragSelect&&h<f&&(a-=b),a<0?this.x-=this.slideableWidth:a>=b&&(this.x+=this.slideableWidth)},o.previous=function(a,b){this.select(this.selectedIndex-1,a,b)},o.next=function(a,b){this.select(this.selectedIndex+1,a,b)},o.updateSelectedSlide=function(){var a=this.slides[this.selectedIndex];a&&(this.unselectSelectedSlide(),this.selectedSlide=a,a.select(),this.selectedCells=a.cells,this.selectedElements=a.getCellElements(),this.selectedCell=a.cells[0],this.selectedElement=this.selectedElements[0])},o.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},o.selectCell=function(a,b,c){var d;"number"==typeof a?d=this.cells[a]:("string"==typeof a&&(a=this.element.querySelector(a)),d=this.getCell(a));for(var e=0;d&&e<this.slides.length;e++){var f=this.slides[e],g=f.cells.indexOf(d);if(g!=-1)return void this.select(e,b,c)}},o.getCell=function(a){for(var b=0;b<this.cells.length;b++){var c=this.cells[b];if(c.element==a)return c}},o.getCells=function(a){a=d.makeArray(a);var b=[];return a.forEach(function(a){var c=this.getCell(a);c&&b.push(c)},this),b},o.getCellElements=function(){return this.cells.map(function(a){return a.element})},o.getParentCell=function(a){var b=this.getCell(a);return b?b:(a=d.getParent(a,".flickity-slider > *"),this.getCell(a))},o.getAdjacentCellElements=function(a,b){if(!a)return this.selectedSlide.getCellElements();b=void 0===b?this.selectedIndex:b;var c=this.slides.length;if(1+2*a>=c)return this.getCellElements();for(var e=[],f=b-a;f<=b+a;f++){var g=this.options.wrapAround?d.modulo(f,c):f,h=this.slides[g];h&&(e=e.concat(h.getCellElements()))}return e},o.uiChange=function(){this.emitEvent("uiChange")},o.childUIPointerDown=function(a){this.emitEvent("childUIPointerDown",[a])},o.onresize=function(){this.watchCSS(),this.resize()},d.debounceMethod(i,"onresize",150),o.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=d.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var a=this.selectedElements&&this.selectedElements[0];this.selectCell(a,!1,!0)}},o.watchCSS=function(){var a=this.options.watchCSS;if(a){var b=k(this.element,":after").content;b.indexOf("flickity")!=-1?this.activate():this.deactivate()}},o.onkeydown=function(a){if(this.options.accessibility&&(!document.activeElement||document.activeElement==this.element))if(37==a.keyCode){var b=this.options.rightToLeft?"next":"previous";this.uiChange(),this[b]()}else if(39==a.keyCode){var c=this.options.rightToLeft?"previous":"next";this.uiChange(),this[c]()}},o.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.cells.forEach(function(a){a.destroy()}),this.unselectSelectedSlide(),this.element.removeChild(this.viewport),h(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},o.destroy=function(){this.deactivate(),a.removeEventListener("resize",this),this.emitEvent("destroy"),j&&this.$element&&j.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete n[this.guid]},d.extend(o,g),i.data=function(a){a=d.getQueryElement(a);var b=a&&a.flickityGUID;return b&&n[b]},d.htmlInit(i,"flickity"),j&&j.bridget&&j.bridget("flickity",i),i.Cell=e,i}),/*!
|
17 |
-
* Unipointer v2.1.0
|
18 |
-
* base class for doing one thing with pointer event
|
19 |
-
* MIT license
|
20 |
-
*/
|
21 |
-
function(a,b){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.Unipointer=b(a,a.EvEmitter)}(window,function(a,b){function c(){}function d(){}var e=d.prototype=Object.create(b.prototype);e.bindStartEvent=function(a){this._bindStartEvent(a,!0)},e.unbindStartEvent=function(a){this._bindStartEvent(a,!1)},e._bindStartEvent=function(b,c){c=void 0===c||!!c;var d=c?"addEventListener":"removeEventListener";a.navigator.pointerEnabled?b[d]("pointerdown",this):a.navigator.msPointerEnabled?b[d]("MSPointerDown",this):(b[d]("mousedown",this),b[d]("touchstart",this))},e.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},e.getTouch=function(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.identifier==this.pointerIdentifier)return c}},e.onmousedown=function(a){var b=a.button;b&&0!==b&&1!==b||this._pointerDown(a,a)},e.ontouchstart=function(a){this._pointerDown(a,a.changedTouches[0])},e.onMSPointerDown=e.onpointerdown=function(a){this._pointerDown(a,a)},e._pointerDown=function(a,b){this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==b.pointerId?b.pointerId:b.identifier,this.pointerDown(a,b))},e.pointerDown=function(a,b){this._bindPostStartEvents(a),this.emitEvent("pointerDown",[a,b])};var f={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"],MSPointerDown:["MSPointerMove","MSPointerUp","MSPointerCancel"]};return e._bindPostStartEvents=function(b){if(b){var c=f[b.type];c.forEach(function(b){a.addEventListener(b,this)},this),this._boundPointerEvents=c}},e._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(b){a.removeEventListener(b,this)},this),delete this._boundPointerEvents)},e.onmousemove=function(a){this._pointerMove(a,a)},e.onMSPointerMove=e.onpointermove=function(a){a.pointerId==this.pointerIdentifier&&this._pointerMove(a,a)},e.ontouchmove=function(a){var b=this.getTouch(a.changedTouches);b&&this._pointerMove(a,b)},e._pointerMove=function(a,b){this.pointerMove(a,b)},e.pointerMove=function(a,b){this.emitEvent("pointerMove",[a,b])},e.onmouseup=function(a){this._pointerUp(a,a)},e.onMSPointerUp=e.onpointerup=function(a){a.pointerId==this.pointerIdentifier&&this._pointerUp(a,a)},e.ontouchend=function(a){var b=this.getTouch(a.changedTouches);b&&this._pointerUp(a,b)},e._pointerUp=function(a,b){this._pointerDone(),this.pointerUp(a,b)},e.pointerUp=function(a,b){this.emitEvent("pointerUp",[a,b])},e._pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this._unbindPostStartEvents(),this.pointerDone()},e.pointerDone=c,e.onMSPointerCancel=e.onpointercancel=function(a){a.pointerId==this.pointerIdentifier&&this._pointerCancel(a,a)},e.ontouchcancel=function(a){var b=this.getTouch(a.changedTouches);b&&this._pointerCancel(a,b)},e._pointerCancel=function(a,b){this._pointerDone(),this.pointerCancel(a,b)},e.pointerCancel=function(a,b){this.emitEvent("pointerCancel",[a,b])},d.getPointerPoint=function(a){return{x:a.pageX,y:a.pageY}},d}),/*!
|
22 |
-
* Unidragger v2.1.0
|
23 |
-
* Draggable base class
|
24 |
-
* MIT license
|
25 |
-
*/
|
26 |
-
function(a,b){"function"==typeof define&&define.amd?define("unidragger/unidragger",["unipointer/unipointer"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("unipointer")):a.Unidragger=b(a,a.Unipointer)}(window,function(a,b){function c(){}function d(){}var e=d.prototype=Object.create(b.prototype);e.bindHandles=function(){this._bindHandles(!0)},e.unbindHandles=function(){this._bindHandles(!1)};var f=a.navigator;return e._bindHandles=function(a){a=void 0===a||!!a;var b;b=f.pointerEnabled?function(b){b.style.touchAction=a?"none":""}:f.msPointerEnabled?function(b){b.style.msTouchAction=a?"none":""}:c;for(var d=a?"addEventListener":"removeEventListener",e=0;e<this.handles.length;e++){var g=this.handles[e];this._bindStartEvent(g,a),b(g),g[d]("click",this)}},e.pointerDown=function(a,b){if("INPUT"==a.target.nodeName&&"range"==a.target.type)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(a,b);var c=document.activeElement;c&&c.blur&&c.blur(),this._bindPostStartEvents(a),this.emitEvent("pointerDown",[a,b])},e._dragPointerDown=function(a,c){this.pointerDownPoint=b.getPointerPoint(c);var d=this.canPreventDefaultOnPointerDown(a,c);d&&a.preventDefault()},e.canPreventDefaultOnPointerDown=function(a){return"SELECT"!=a.target.nodeName},e.pointerMove=function(a,b){var c=this._dragPointerMove(a,b);this.emitEvent("pointerMove",[a,b,c]),this._dragMove(a,b,c)},e._dragPointerMove=function(a,c){var d=b.getPointerPoint(c),e={x:d.x-this.pointerDownPoint.x,y:d.y-this.pointerDownPoint.y};return!this.isDragging&&this.hasDragStarted(e)&&this._dragStart(a,c),e},e.hasDragStarted=function(a){return Math.abs(a.x)>3||Math.abs(a.y)>3},e.pointerUp=function(a,b){this.emitEvent("pointerUp",[a,b]),this._dragPointerUp(a,b)},e._dragPointerUp=function(a,b){this.isDragging?this._dragEnd(a,b):this._staticClick(a,b)},e._dragStart=function(a,c){this.isDragging=!0,this.dragStartPoint=b.getPointerPoint(c),this.isPreventingClicks=!0,this.dragStart(a,c)},e.dragStart=function(a,b){this.emitEvent("dragStart",[a,b])},e._dragMove=function(a,b,c){this.isDragging&&this.dragMove(a,b,c)},e.dragMove=function(a,b,c){a.preventDefault(),this.emitEvent("dragMove",[a,b,c])},e._dragEnd=function(a,b){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(a,b)},e.dragEnd=function(a,b){this.emitEvent("dragEnd",[a,b])},e.onclick=function(a){this.isPreventingClicks&&a.preventDefault()},e._staticClick=function(a,b){if(!this.isIgnoringMouseUp||"mouseup"!=a.type){var c=a.target.nodeName;"INPUT"!=c&&"TEXTAREA"!=c||a.target.focus(),this.staticClick(a,b),"mouseup"!=a.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400))}},e.staticClick=function(a,b){this.emitEvent("staticClick",[a,b])},d.getPointerPoint=b.getPointerPoint,d}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(c,d,e){return b(a,c,d,e)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("unidragger"),require("fizzy-ui-utils")):a.Flickity=b(a,a.Flickity,a.Unidragger,a.fizzyUIUtils)}(window,function(a,b,c,d){function e(){return{x:a.pageXOffset,y:a.pageYOffset}}d.extend(b.defaults,{draggable:!0,dragThreshold:3}),b.createMethods.push("_createDrag");var f=b.prototype;d.extend(f,c.prototype);var g="createTouch"in document,h=!1;f._createDrag=function(){this.on("activate",this.bindDrag),this.on("uiChange",this._uiChangeDrag),this.on("childUIPointerDown",this._childUIPointerDownDrag),this.on("deactivate",this.unbindDrag),g&&!h&&(a.addEventListener("touchmove",function(){}),h=!0)},f.bindDrag=function(){this.options.draggable&&!this.isDragBound&&(this.element.classList.add("is-draggable"),this.handles=[this.viewport],this.bindHandles(),this.isDragBound=!0)},f.unbindDrag=function(){this.isDragBound&&(this.element.classList.remove("is-draggable"),this.unbindHandles(),delete this.isDragBound)},f._uiChangeDrag=function(){delete this.isFreeScrolling},f._childUIPointerDownDrag=function(a){a.preventDefault(),this.pointerDownFocus(a)};var i={TEXTAREA:!0,INPUT:!0,OPTION:!0},j={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};f.pointerDown=function(b,c){var d=i[b.target.nodeName]&&!j[b.target.type];if(d)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(b,c);var f=document.activeElement;f&&f.blur&&f!=this.element&&f!=document.body&&f.blur(),this.pointerDownFocus(b),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this._bindPostStartEvents(b),this.pointerDownScroll=e(),a.addEventListener("scroll",this),this.dispatchEvent("pointerDown",b,[c])};var k={touchstart:!0,MSPointerDown:!0},l={INPUT:!0,SELECT:!0};return f.pointerDownFocus=function(b){if(this.options.accessibility&&!k[b.type]&&!l[b.target.nodeName]){var c=a.pageYOffset;this.element.focus(),a.pageYOffset!=c&&a.scrollTo(a.pageXOffset,c)}},f.canPreventDefaultOnPointerDown=function(a){var b="touchstart"==a.type,c=a.target.nodeName;return!b&&"SELECT"!=c},f.hasDragStarted=function(a){return Math.abs(a.x)>this.options.dragThreshold},f.pointerUp=function(a,b){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",a,[b]),this._dragPointerUp(a,b)},f.pointerDone=function(){a.removeEventListener("scroll",this),delete this.pointerDownScroll},f.dragStart=function(b,c){this.dragStartPosition=this.x,this.startAnimation(),a.removeEventListener("scroll",this),this.dispatchEvent("dragStart",b,[c])},f.pointerMove=function(a,b){var c=this._dragPointerMove(a,b);this.dispatchEvent("pointerMove",a,[b,c]),this._dragMove(a,b,c)},f.dragMove=function(a,b,c){a.preventDefault(),this.previousDragX=this.dragX;var d=this.options.rightToLeft?-1:1,e=this.dragStartPosition+c.x*d;if(!this.options.wrapAround&&this.slides.length){var f=Math.max(-this.slides[0].target,this.dragStartPosition);e=e>f?.5*(e+f):e;var g=Math.min(-this.getLastSlide().target,this.dragStartPosition);e=e<g?.5*(e+g):e}this.dragX=e,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",a,[b,c])},f.dragEnd=function(a,b){this.options.freeScroll&&(this.isFreeScrolling=!0);var c=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var d=this.getRestingPosition();this.isFreeScrolling=-d>this.slides[0].target&&-d<this.getLastSlide().target}else this.options.freeScroll||c!=this.selectedIndex||(c+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(c),delete this.isDragSelect,this.dispatchEvent("dragEnd",a,[b])},f.dragEndRestingSelect=function(){var a=this.getRestingPosition(),b=Math.abs(this.getSlideDistance(-a,this.selectedIndex)),c=this._getClosestResting(a,b,1),d=this._getClosestResting(a,b,-1),e=c.distance<d.distance?c.index:d.index;return e},f._getClosestResting=function(a,b,c){for(var d=this.selectedIndex,e=1/0,f=this.options.contain&&!this.options.wrapAround?function(a,b){return a<=b}:function(a,b){return a<b};f(b,e)&&(d+=c,e=b,b=this.getSlideDistance(-a,d),null!==b);)b=Math.abs(b);return{distance:e,index:d-c}},f.getSlideDistance=function(a,b){var c=this.slides.length,e=this.options.wrapAround&&c>1,f=e?d.modulo(b,c):b,g=this.slides[f];if(!g)return null;var h=e?this.slideableWidth*Math.floor(b/c):0;return a-(g.target+h)},f.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var a=this.getSlideDistance(-this.dragX,this.selectedIndex),b=this.previousDragX-this.dragX;return a>0&&b>0?1:a<0&&b<0?-1:0},f.staticClick=function(a,b){var c=this.getParentCell(a.target),d=c&&c.element,e=c&&this.cells.indexOf(c);this.dispatchEvent("staticClick",a,[b,d,e])},f.onscroll=function(){var a=e(),b=this.pointerDownScroll.x-a.x,c=this.pointerDownScroll.y-a.y;(Math.abs(b)>3||Math.abs(c)>3)&&this._pointerDone()},b}),/*!
|
27 |
-
* Tap listener v2.0.0
|
28 |
-
* listens to taps
|
29 |
-
* MIT license
|
30 |
-
*/
|
31 |
-
function(a,b){"function"==typeof define&&define.amd?define("tap-listener/tap-listener",["unipointer/unipointer"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("unipointer")):a.TapListener=b(a,a.Unipointer)}(window,function(a,b){function c(a){this.bindTap(a)}var d=c.prototype=Object.create(b.prototype);return d.bindTap=function(a){a&&(this.unbindTap(),this.tapElement=a,this._bindStartEvent(a,!0))},d.unbindTap=function(){this.tapElement&&(this._bindStartEvent(this.tapElement,!0),delete this.tapElement)},d.pointerUp=function(c,d){if(!this.isIgnoringMouseUp||"mouseup"!=c.type){var e=b.getPointerPoint(d),f=this.tapElement.getBoundingClientRect(),g=a.pageXOffset,h=a.pageYOffset,i=e.x>=f.left+g&&e.x<=f.right+g&&e.y>=f.top+h&&e.y<=f.bottom+h;if(i&&this.emitEvent("tap",[c,d]),"mouseup"!=c.type){this.isIgnoringMouseUp=!0;var j=this;setTimeout(function(){delete j.isIgnoringMouseUp},400)}}},d.destroy=function(){this.pointerDone(),this.unbindTap()},c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/prev-next-button",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(c,d,e){return b(a,c,d,e)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):b(a,a.Flickity,a.TapListener,a.fizzyUIUtils)}(window,function(a,b,c,d){"use strict";function e(a,b){this.direction=a,this.parent=b,this._create()}function f(a){return"string"==typeof a?a:"M "+a.x0+",50 L "+a.x1+","+(a.y1+50)+" L "+a.x2+","+(a.y2+50)+" L "+a.x3+",50 L "+a.x2+","+(50-a.y2)+" L "+a.x1+","+(50-a.y1)+" Z"}var g="http://www.w3.org/2000/svg";e.prototype=new c,e.prototype._create=function(){this.isEnabled=!0,this.isPrevious=this.direction==-1;var a=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==a;var b=this.element=document.createElement("button");b.className="flickity-prev-next-button",b.className+=this.isPrevious?" previous":" next",b.setAttribute("type","button"),this.disable(),b.setAttribute("aria-label",this.isPrevious?"previous":"next");var c=this.createSVG();b.appendChild(c),this.on("tap",this.onTap),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},e.prototype.activate=function(){this.bindTap(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},e.prototype.deactivate=function(){this.parent.element.removeChild(this.element),c.prototype.destroy.call(this),this.element.removeEventListener("click",this)},e.prototype.createSVG=function(){var a=document.createElementNS(g,"svg");a.setAttribute("viewBox","0 0 100 100");var b=document.createElementNS(g,"path"),c=f(this.parent.options.arrowShape);return b.setAttribute("d",c),b.setAttribute("class","arrow"),this.isLeft||b.setAttribute("transform","translate(100, 100) rotate(180) "),a.appendChild(b),a},e.prototype.onTap=function(){if(this.isEnabled){this.parent.uiChange();var a=this.isPrevious?"previous":"next";this.parent[a]()}},e.prototype.handleEvent=d.handleEvent,e.prototype.onclick=function(){var a=document.activeElement;a&&a==this.element&&this.onTap()},e.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},e.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},e.prototype.update=function(){var a=this.parent.slides;if(this.parent.options.wrapAround&&a.length>1)return void this.enable();var b=a.length?a.length-1:0,c=this.isPrevious?0:b,d=this.parent.selectedIndex==c?"disable":"enable";this[d]()},e.prototype.destroy=function(){this.deactivate()},d.extend(b.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),b.createMethods.push("_createPrevNextButtons");var h=b.prototype;return h._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new e((-1),this),this.nextButton=new e(1,this),this.on("activate",this.activatePrevNextButtons))},h.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},h.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},b.PrevNextButton=e,b}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/page-dots",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(c,d,e){return b(a,c,d,e)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):b(a,a.Flickity,a.TapListener,a.fizzyUIUtils)}(window,function(a,b,c,d){function e(a){this.parent=a,this._create()}e.prototype=new c,e.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.on("tap",this.onTap),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},e.prototype.activate=function(){this.setDots(),this.bindTap(this.holder),this.parent.element.appendChild(this.holder)},e.prototype.deactivate=function(){this.parent.element.removeChild(this.holder),c.prototype.destroy.call(this)},e.prototype.setDots=function(){var a=this.parent.slides.length-this.dots.length;a>0?this.addDots(a):a<0&&this.removeDots(-a)},e.prototype.addDots=function(a){for(var b=document.createDocumentFragment(),c=[];a;){var d=document.createElement("li");d.className="dot",b.appendChild(d),c.push(d),a--}this.holder.appendChild(b),this.dots=this.dots.concat(c)},e.prototype.removeDots=function(a){var b=this.dots.splice(this.dots.length-a,a);b.forEach(function(a){this.holder.removeChild(a)},this)},e.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot"),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected")},e.prototype.onTap=function(a){var b=a.target;if("LI"==b.nodeName){this.parent.uiChange();var c=this.dots.indexOf(b);this.parent.select(c)}},e.prototype.destroy=function(){this.deactivate()},b.PageDots=e,d.extend(b.defaults,{pageDots:!0}),b.createMethods.push("_createPageDots");var f=b.prototype;return f._createPageDots=function(){this.options.pageDots&&(this.pageDots=new e(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))},f.activatePageDots=function(){this.pageDots.activate()},f.updateSelectedPageDots=function(){this.pageDots.updateSelected()},f.updatePageDots=function(){this.pageDots.setDots()},f.deactivatePageDots=function(){this.pageDots.deactivate()},b.PageDots=e,b}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(a,c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity")):b(a.EvEmitter,a.fizzyUIUtils,a.Flickity)}(window,function(a,b,c){function d(a){this.parent=a,this.state="stopped",f&&(this.onVisibilityChange=function(){this.visibilityChange()}.bind(this),this.onVisibilityPlay=function(){this.visibilityPlay()}.bind(this))}var e,f;"hidden"in document?(e="hidden",f="visibilitychange"):"webkitHidden"in document&&(e="webkitHidden",f="webkitvisibilitychange"),d.prototype=Object.create(a.prototype),d.prototype.play=function(){if("playing"!=this.state){var a=document[e];if(f&&a)return void document.addEventListener(f,this.onVisibilityPlay);this.state="playing",f&&document.addEventListener(f,this.onVisibilityChange),this.tick()}},d.prototype.tick=function(){if("playing"==this.state){var a=this.parent.options.autoPlay;a="number"==typeof a?a:3e3;var b=this;this.clear(),this.timeout=setTimeout(function(){b.parent.next(!0),b.tick()},a)}},d.prototype.stop=function(){this.state="stopped",this.clear(),f&&document.removeEventListener(f,this.onVisibilityChange)},d.prototype.clear=function(){clearTimeout(this.timeout)},d.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},d.prototype.unpause=function(){"paused"==this.state&&this.play()},d.prototype.visibilityChange=function(){var a=document[e];this[a?"pause":"unpause"]()},d.prototype.visibilityPlay=function(){this.play(),document.removeEventListener(f,this.onVisibilityPlay)},b.extend(c.defaults,{pauseAutoPlayOnHover:!0}),c.createMethods.push("_createPlayer");var g=c.prototype;return g._createPlayer=function(){this.player=new d(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},g.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},g.playPlayer=function(){this.player.play()},g.stopPlayer=function(){this.player.stop()},g.pausePlayer=function(){this.player.pause()},g.unpausePlayer=function(){this.player.unpause()},g.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},g.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},g.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},c.Player=d,c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("fizzy-ui-utils")):b(a,a.Flickity,a.fizzyUIUtils)}(window,function(a,b,c){function d(a){var b=document.createDocumentFragment();return a.forEach(function(a){b.appendChild(a.element)}),b}var e=b.prototype;return e.insert=function(a,b){var c=this._makeCells(a);if(c&&c.length){var e=this.cells.length;b=void 0===b?e:b;var f=d(c),g=b==e;if(g)this.slider.appendChild(f);else{var h=this.cells[b].element;this.slider.insertBefore(f,h)}if(0===b)this.cells=c.concat(this.cells);else if(g)this.cells=this.cells.concat(c);else{var i=this.cells.splice(b,e-b);this.cells=this.cells.concat(c).concat(i)}this._sizeCells(c);var j=b>this.selectedIndex?0:c.length;this._cellAddedRemoved(b,j)}},e.append=function(a){this.insert(a,this.cells.length)},e.prepend=function(a){this.insert(a,0)},e.remove=function(a){var b,d,e=this.getCells(a),f=0,g=e.length;for(b=0;b<g;b++){d=e[b];var h=this.cells.indexOf(d)<this.selectedIndex;f-=h?1:0}for(b=0;b<g;b++)d=e[b],d.remove(),c.removeFrom(this.cells,d);e.length&&this._cellAddedRemoved(0,f)},e._cellAddedRemoved=function(a,b){b=b||0,this.selectedIndex+=b,this.selectedIndex=Math.max(0,Math.min(this.slides.length-1,this.selectedIndex)),this.cellChange(a,!0),this.emitEvent("cellAddedRemoved",[a,b])},e.cellSizeChange=function(a){var b=this.getCell(a);if(b){b.getSize();var c=this.cells.indexOf(b);this.cellChange(c)}},e.cellChange=function(a,b){var c=this.slideableWidth;if(this._positionCells(a),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("cellChange",[a]),this.options.freeScroll){var d=c-this.slideableWidth;this.x+=d*this.cellAlign,this.positionSlider()}else b&&this.positionSliderAtSelected(),this.select(this.selectedIndex)},b}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("fizzy-ui-utils")):b(a,a.Flickity,a.fizzyUIUtils)}(window,function(a,b,c){"use strict";function d(a){if("IMG"==a.nodeName&&a.getAttribute("data-flickity-lazyload"))return[a];var b=a.querySelectorAll("img[data-flickity-lazyload]");return c.makeArray(b)}function e(a,b){this.img=a,this.flickity=b,this.load()}b.createMethods.push("_createLazyload");var f=b.prototype;return f._createLazyload=function(){this.on("select",this.lazyLoad)},f.lazyLoad=function(){var a=this.options.lazyLoad;if(a){var b="number"==typeof a?a:0,c=this.getAdjacentCellElements(b),f=[];c.forEach(function(a){var b=d(a);f=f.concat(b)}),f.forEach(function(a){new e(a,this)},this)}},e.prototype.handleEvent=c.handleEvent,e.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.img.getAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload")},e.prototype.onload=function(a){this.complete(a,"flickity-lazyloaded")},e.prototype.onerror=function(a){this.complete(a,"flickity-lazyerror")},e.prototype.complete=function(a,b){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var c=this.flickity.getParentCell(this.img),d=c&&c.element;this.flickity.cellSizeChange(d),this.img.classList.add(b),this.flickity.dispatchEvent("lazyLoad",a,d)},b.LazyLoader=e,b}),/*!
|
32 |
-
* Flickity v2.0.5
|
33 |
-
* Touch, responsive, flickable carousels
|
34 |
-
*
|
35 |
-
* Licensed GPLv3 for open source use
|
36 |
-
* or Flickity Commercial License for commercial use
|
37 |
-
*
|
38 |
-
* http://flickity.metafizzy.co
|
39 |
-
* Copyright 2016 Metafizzy
|
40 |
-
*/
|
41 |
-
function(a,b){"function"==typeof define&&define.amd?define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],b):"object"==typeof module&&module.exports&&(module.exports=b(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload")))}(window,function(a){return a}),/*!
|
42 |
-
* Flickity asNavFor v2.0.1
|
43 |
-
* enable asNavFor for Flickity
|
44 |
-
*/
|
45 |
-
function(a,b){"function"==typeof define&&define.amd?define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],b):"object"==typeof module&&module.exports?module.exports=b(require("flickity"),require("fizzy-ui-utils")):a.Flickity=b(a.Flickity,a.fizzyUIUtils)}(window,function(a,b){function c(a,b,c){return(b-a)*c+a}a.createMethods.push("_createAsNavFor");var d=a.prototype;return d._createAsNavFor=function(){this.on("activate",this.activateAsNavFor),this.on("deactivate",this.deactivateAsNavFor),this.on("destroy",this.destroyAsNavFor);var a=this.options.asNavFor;if(a){var b=this;setTimeout(function(){b.setNavCompanion(a)})}},d.setNavCompanion=function(c){c=b.getQueryElement(c);var d=a.data(c);if(d&&d!=this){this.navCompanion=d;var e=this;this.onNavCompanionSelect=function(){e.navCompanionSelect()},d.on("select",this.onNavCompanionSelect),this.on("staticClick",this.onNavStaticClick),this.navCompanionSelect(!0)}},d.navCompanionSelect=function(a){if(this.navCompanion){var b=this.navCompanion.selectedCells[0],d=this.navCompanion.cells.indexOf(b),e=d+this.navCompanion.selectedCells.length-1,f=Math.floor(c(d,e,this.navCompanion.cellAlign));if(this.selectCell(f,!1,a),this.removeNavSelectedElements(),!(f>=this.cells.length)){var g=this.cells.slice(d,e+1);this.navSelectedElements=g.map(function(a){return a.element}),this.changeNavSelectedClass("add")}}},d.changeNavSelectedClass=function(a){this.navSelectedElements.forEach(function(b){b.classList[a]("is-nav-selected")})},d.activateAsNavFor=function(){this.navCompanionSelect(!0)},d.removeNavSelectedElements=function(){this.navSelectedElements&&(this.changeNavSelectedClass("remove"),delete this.navSelectedElements)},d.onNavStaticClick=function(a,b,c,d){"number"==typeof d&&this.navCompanion.selectCell(d)},d.deactivateAsNavFor=function(){this.removeNavSelectedElements()},d.destroyAsNavFor=function(){this.navCompanion&&(this.navCompanion.off("select",this.onNavCompanionSelect),this.off("staticClick",this.onNavStaticClick),delete this.navCompanion)},a}),/*!
|
46 |
-
* imagesLoaded v4.1.1
|
47 |
-
* JavaScript is all like "You images are done yet or what?"
|
48 |
-
* MIT License
|
49 |
-
*/
|
50 |
-
function(a,b){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.imagesLoaded=b(a,a.EvEmitter)}(window,function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){var b=[];if(Array.isArray(a))b=a;else if("number"==typeof a.length)for(var c=0;c<a.length;c++)b.push(a[c]);else b.push(a);return b}function e(a,b,f){return this instanceof e?("string"==typeof a&&(a=document.querySelectorAll(a)),this.elements=d(a),this.options=c({},this.options),"function"==typeof b?f=b:c(this.options,b),f&&this.on("always",f),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(function(){this.check()}.bind(this))):new e(a,b,f)}function f(a){this.img=a}function g(a,b){this.url=a,this.element=b,this.img=new Image}var h=a.jQuery,i=a.console;e.prototype=Object.create(b.prototype),e.prototype.options={},e.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},e.prototype.addElementImages=function(a){"IMG"==a.nodeName&&this.addImage(a),this.options.background===!0&&this.addElementBackgroundImages(a);var b=a.nodeType;if(b&&j[b]){for(var c=a.querySelectorAll("img"),d=0;d<c.length;d++){var e=c[d];this.addImage(e)}if("string"==typeof this.options.background){var f=a.querySelectorAll(this.options.background);for(d=0;d<f.length;d++){var g=f[d];this.addElementBackgroundImages(g)}}}};var j={1:!0,9:!0,11:!0};return e.prototype.addElementBackgroundImages=function(a){var b=getComputedStyle(a);if(b)for(var c=/url\((['"])?(.*?)\1\)/gi,d=c.exec(b.backgroundImage);null!==d;){var e=d&&d[2];e&&this.addBackground(e,a),d=c.exec(b.backgroundImage)}},e.prototype.addImage=function(a){var b=new f(a);this.images.push(b)},e.prototype.addBackground=function(a,b){var c=new g(a,b);this.images.push(c)},e.prototype.check=function(){function a(a,c,d){setTimeout(function(){b.progress(a,c,d)})}var b=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(b){b.once("progress",a),b.check()}):void this.complete()},e.prototype.progress=function(a,b,c){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!a.isLoaded,this.emitEvent("progress",[this,a,b]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,a),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&i&&i.log("progress: "+c,a,b)},e.prototype.complete=function(){var a=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(a,[this]),this.emitEvent("always",[this]),this.jqDeferred){var b=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[b](this)}},f.prototype=Object.create(b.prototype),f.prototype.check=function(){var a=this.getIsImageComplete();return a?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},f.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},f.prototype.confirm=function(a,b){this.isLoaded=a,this.emitEvent("progress",[this,this.img,b])},f.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},f.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},f.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},f.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},g.prototype=Object.create(f.prototype),g.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var a=this.getIsImageComplete();a&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},g.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},g.prototype.confirm=function(a,b){this.isLoaded=a,this.emitEvent("progress",[this,this.element,b])},e.makeJQueryPlugin=function(b){b=b||a.jQuery,b&&(h=b,h.fn.imagesLoaded=function(a,b){var c=new e(this,a,b);return c.jqDeferred.promise(h(this))})},e.makeJQueryPlugin(),e}),/*!
|
51 |
-
* Flickity imagesLoaded v2.0.0
|
52 |
-
* enables imagesLoaded option for Flickity
|
53 |
-
*/
|
54 |
function(a,b){"function"==typeof define&&define.amd?define(["flickity/js/index","imagesloaded/imagesloaded"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("flickity"),require("imagesloaded")):a.Flickity=b(a,a.Flickity,a.imagesLoaded)}(window,function(a,b,c){"use strict";b.createMethods.push("_createImagesLoaded");var d=b.prototype;return d._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)},d.imagesLoaded=function(){function a(a,c){var d=b.getParentCell(c.img);b.cellSizeChange(d&&d.element),b.options.freeScroll||b.positionSliderAtSelected()}if(this.options.imagesLoaded){var b=this;c(this.slider).on("progress",a)}},b});
|
1 |
+
/*!
|
2 |
+
* Flickity PACKAGED v2.0.5
|
3 |
+
* Touch, responsive, flickable carousels
|
4 |
+
*
|
5 |
+
* Licensed GPLv3 for open source use
|
6 |
+
* or Flickity Commercial License for commercial use
|
7 |
+
*
|
8 |
+
* http://flickity.metafizzy.co
|
9 |
+
* Copyright 2016 Metafizzy
|
10 |
+
*/
|
11 |
+
!function(a,b){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("jquery")):a.jQueryBridget=b(a,a.jQuery)}(window,function(a,b){"use strict";function c(c,f,h){function i(a,b,d){var e,f="$()."+c+'("'+b+'")';return a.each(function(a,i){var j=h.data(i,c);if(!j)return void g(c+" not initialized. Cannot call methods, i.e. "+f);var k=j[b];if(!k||"_"==b.charAt(0))return void g(f+" is not a valid method");var l=k.apply(j,d);e=void 0===e?l:e}),void 0!==e?e:a}function j(a,b){a.each(function(a,d){var e=h.data(d,c);e?(e.option(b),e._init()):(e=new f(d,b),h.data(d,c,e))})}h=h||b||a.jQuery,h&&(f.prototype.option||(f.prototype.option=function(a){h.isPlainObject(a)&&(this.options=h.extend(!0,this.options,a))}),h.fn[c]=function(a){if("string"==typeof a){var b=e.call(arguments,1);return i(this,a,b)}return j(this,a),this},d(h))}function d(a){!a||a&&a.bridget||(a.bridget=c)}var e=Array.prototype.slice,f=a.console,g="undefined"==typeof f?function(){}:function(a){f.error(a)};return d(b||a.jQuery),c}),function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}("undefined"!=typeof window?window:this,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{},d=c[a]=c[a]||[];return d.indexOf(b)==-1&&d.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{},d=c[a]=c[a]||{};return d[b]=!0,this}},b.off=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=c.indexOf(b);return d!=-1&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=0,e=c[d];b=b||[];for(var f=this._onceEvents&&this._onceEvents[a];e;){var g=f&&f[e];g&&(this.off(a,e),delete f[e]),e.apply(this,b),d+=g?0:1,e=c[d]}return this}},a}),/*!
|
12 |
+
* getSize v2.0.2
|
13 |
+
* measure size of elements
|
14 |
+
* MIT license
|
15 |
+
*/
|
16 |
+
function(a,b){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return b()}):"object"==typeof module&&module.exports?module.exports=b():a.getSize=b()}(window,function(){"use strict";function a(a){var b=parseFloat(a),c=a.indexOf("%")==-1&&!isNaN(b);return c&&b}function b(){}function c(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0;b<j;b++){var c=i[b];a[c]=0}return a}function d(a){var b=getComputedStyle(a);return b||h("Style returned "+b+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),b}function e(){if(!k){k=!0;var b=document.createElement("div");b.style.width="200px",b.style.padding="1px 2px 3px 4px",b.style.borderStyle="solid",b.style.borderWidth="1px 2px 3px 4px",b.style.boxSizing="border-box";var c=document.body||document.documentElement;c.appendChild(b);var e=d(b);f.isBoxSizeOuter=g=200==a(e.width),c.removeChild(b)}}function f(b){if(e(),"string"==typeof b&&(b=document.querySelector(b)),b&&"object"==typeof b&&b.nodeType){var f=d(b);if("none"==f.display)return c();var h={};h.width=b.offsetWidth,h.height=b.offsetHeight;for(var k=h.isBorderBox="border-box"==f.boxSizing,l=0;l<j;l++){var m=i[l],n=f[m],o=parseFloat(n);h[m]=isNaN(o)?0:o}var p=h.paddingLeft+h.paddingRight,q=h.paddingTop+h.paddingBottom,r=h.marginLeft+h.marginRight,s=h.marginTop+h.marginBottom,t=h.borderLeftWidth+h.borderRightWidth,u=h.borderTopWidth+h.borderBottomWidth,v=k&&g,w=a(f.width);w!==!1&&(h.width=w+(v?0:p+t));var x=a(f.height);return x!==!1&&(h.height=x+(v?0:q+u)),h.innerWidth=h.width-(p+t),h.innerHeight=h.height-(q+u),h.outerWidth=h.width+r,h.outerHeight=h.height+s,h}}var g,h="undefined"==typeof console?b:function(a){console.error(a)},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],j=i.length,k=!1;return f}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",b):"object"==typeof module&&module.exports?module.exports=b():a.matchesSelector=b()}(window,function(){"use strict";var a=function(){var a=Element.prototype;if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0;c<b.length;c++){var d=b[c],e=d+"MatchesSelector";if(a[e])return e}}();return function(b,c){return b[a](c)}}),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.matchesSelector)}(window,function(a,b){var c={};c.extend=function(a,b){for(var c in b)a[c]=b[c];return a},c.modulo=function(a,b){return(a%b+b)%b},c.makeArray=function(a){var b=[];if(Array.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0;c<a.length;c++)b.push(a[c]);else b.push(a);return b},c.removeFrom=function(a,b){var c=a.indexOf(b);c!=-1&&a.splice(c,1)},c.getParent=function(a,c){for(;a!=document.body;)if(a=a.parentNode,b(a,c))return a},c.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},c.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},c.filterFindElements=function(a,d){a=c.makeArray(a);var e=[];return a.forEach(function(a){if(a instanceof HTMLElement){if(!d)return void e.push(a);b(a,d)&&e.push(a);for(var c=a.querySelectorAll(d),f=0;f<c.length;f++)e.push(c[f])}}),e},c.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},c.docReady=function(a){var b=document.readyState;"complete"==b||"interactive"==b?setTimeout(a):document.addEventListener("DOMContentLoaded",a)},c.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var d=a.console;return c.htmlInit=function(b,e){c.docReady(function(){var f=c.toDashed(e),g="data-"+f,h=document.querySelectorAll("["+g+"]"),i=document.querySelectorAll(".js-"+f),j=c.makeArray(h).concat(c.makeArray(i)),k=g+"-options",l=a.jQuery;j.forEach(function(a){var c,f=a.getAttribute(g)||a.getAttribute(k);try{c=f&&JSON.parse(f)}catch(h){return void(d&&d.error("Error parsing "+g+" on "+a.className+": "+h))}var i=new b(a,c);l&&l.data(a,e,i)})})},c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/cell",["get-size/get-size"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("get-size")):(a.Flickity=a.Flickity||{},a.Flickity.Cell=b(a,a.getSize))}(window,function(a,b){function c(a,b){this.element=a,this.parent=b,this.create()}var d=c.prototype;return d.create=function(){this.element.style.position="absolute",this.x=0,this.shift=0},d.destroy=function(){this.element.style.position="";var a=this.parent.originSide;this.element.style[a]=""},d.getSize=function(){this.size=b(this.element)},d.setPosition=function(a){this.x=a,this.updateTarget(),this.renderPosition(a)},d.updateTarget=d.setDefaultTarget=function(){var a="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[a]+this.size.width*this.parent.cellAlign},d.renderPosition=function(a){var b=this.parent.originSide;this.element.style[b]=this.parent.getPositionValue(a)},d.wrapShift=function(a){this.shift=a,this.renderPosition(this.x+this.parent.slideableWidth*a)},d.remove=function(){this.element.parentNode.removeChild(this.element)},c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/slide",b):"object"==typeof module&&module.exports?module.exports=b():(a.Flickity=a.Flickity||{},a.Flickity.Slide=b())}(window,function(){"use strict";function a(a){this.parent=a,this.isOriginLeft="left"==a.originSide,this.cells=[],this.outerWidth=0,this.height=0}var b=a.prototype;return b.addCell=function(a){if(this.cells.push(a),this.outerWidth+=a.size.outerWidth,this.height=Math.max(a.size.outerHeight,this.height),1==this.cells.length){this.x=a.x;var b=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=a.size[b]}},b.updateTarget=function(){var a=this.isOriginLeft?"marginRight":"marginLeft",b=this.getLastCell(),c=b?b.size[a]:0,d=this.outerWidth-(this.firstMargin+c);this.target=this.x+this.firstMargin+d*this.parent.cellAlign},b.getLastCell=function(){return this.cells[this.cells.length-1]},b.select=function(){this.changeSelectedClass("add")},b.unselect=function(){this.changeSelectedClass("remove")},b.changeSelectedClass=function(a){this.cells.forEach(function(b){b.element.classList[a]("is-selected")})},b.getCellElements=function(){return this.cells.map(function(a){return a.element})},a}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/animate",["fizzy-ui-utils/utils"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("fizzy-ui-utils")):(a.Flickity=a.Flickity||{},a.Flickity.animatePrototype=b(a,a.fizzyUIUtils))}(window,function(a,b){var c=a.requestAnimationFrame||a.webkitRequestAnimationFrame,d=0;c||(c=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-d)),e=setTimeout(a,c);return d=b+c,e});var e={};e.startAnimation=function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},e.animate=function(){this.applyDragForce(),this.applySelectedAttraction();var a=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(a),this.isAnimating){var b=this;c(function(){b.animate()})}};var f=function(){var a=document.documentElement.style;return"string"==typeof a.transform?"transform":"WebkitTransform"}();return e.positionSlider=function(){var a=this.x;this.options.wrapAround&&this.cells.length>1&&(a=b.modulo(a,this.slideableWidth),a-=this.slideableWidth,this.shiftWrapCells(a)),a+=this.cursorPosition,a=this.options.rightToLeft&&f?-a:a;var c=this.getPositionValue(a);this.slider.style[f]=this.isAnimating?"translate3d("+c+",0,0)":"translateX("+c+")";var d=this.slides[0];if(d){var e=-this.x-d.target,g=e/this.slidesWidth;this.dispatchEvent("scroll",null,[g,e])}},e.positionSliderAtSelected=function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.positionSlider())},e.getPositionValue=function(a){return this.options.percentPosition?.01*Math.round(a/this.size.innerWidth*1e4)+"%":Math.round(a)+"px"},e.settle=function(a){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*a)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle"))},e.shiftWrapCells=function(a){var b=this.cursorPosition+a;this._shiftCells(this.beforeShiftCells,b,-1);var c=this.size.innerWidth-(a+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,c,1)},e._shiftCells=function(a,b,c){for(var d=0;d<a.length;d++){var e=a[d],f=b>0?c:0;e.wrapShift(f),b-=e.size.outerWidth}},e._unshiftCells=function(a){if(a&&a.length)for(var b=0;b<a.length;b++)a[b].wrapShift(0)},e.integratePhysics=function(){this.x+=this.velocity,this.velocity*=this.getFrictionFactor()},e.applyForce=function(a){this.velocity+=a},e.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},e.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())},e.applyDragForce=function(){if(this.isPointerDown){var a=this.dragX-this.x,b=a-this.velocity;this.applyForce(b)}},e.applySelectedAttraction=function(){if(!this.isPointerDown&&!this.isFreeScrolling&&this.cells.length){var a=this.selectedSlide.target*-1-this.x,b=a*this.options.selectedAttraction;this.applyForce(b)}},e}),function(a,b){if("function"==typeof define&&define.amd)define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)});else if("object"==typeof module&&module.exports)module.exports=b(a,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"));else{var c=a.Flickity;a.Flickity=b(a,a.EvEmitter,a.getSize,a.fizzyUIUtils,c.Cell,c.Slide,c.animatePrototype)}}(window,function(a,b,c,d,e,f,g){function h(a,b){for(a=d.makeArray(a);a.length;)b.appendChild(a.shift())}function i(a,b){var c=d.getQueryElement(a);if(!c)return void(l&&l.error("Bad element for Flickity: "+(c||a)));if(this.element=c,this.element.flickityGUID){var e=n[this.element.flickityGUID];return e.option(b),e}j&&(this.$element=j(this.element)),this.options=d.extend({},this.constructor.defaults),this.option(b),this._create()}var j=a.jQuery,k=a.getComputedStyle,l=a.console,m=0,n={};i.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},i.createMethods=[];var o=i.prototype;d.extend(o,b.prototype),o._create=function(){var b=this.guid=++m;this.element.flickityGUID=b,n[b]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&a.addEventListener("resize",this),i.createMethods.forEach(function(a){this[a]()},this),this.options.watchCSS?this.watchCSS():this.activate()},o.option=function(a){d.extend(this.options,a)},o.activate=function(){if(!this.isActive){this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize();var a=this._filterFindCellElements(this.element.children);h(a,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate");var b,c=this.options.initialIndex;b=this.isInitActivated?this.selectedIndex:void 0!==c&&this.cells[c]?c:0,this.select(b,!1,!0),this.isInitActivated=!0}},o._createSlider=function(){var a=document.createElement("div");a.className="flickity-slider",a.style[this.originSide]=0,this.slider=a},o._filterFindCellElements=function(a){return d.filterFindElements(a,this.options.cellSelector)},o.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},o._makeCells=function(a){var b=this._filterFindCellElements(a),c=b.map(function(a){return new e(a,this)},this);return c},o.getLastCell=function(){return this.cells[this.cells.length-1]},o.getLastSlide=function(){return this.slides[this.slides.length-1]},o.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},o._positionCells=function(a){a=a||0,this.maxCellHeight=a?this.maxCellHeight||0:0;var b=0;if(a>0){var c=this.cells[a-1];b=c.x+c.size.outerWidth}for(var d=this.cells.length,e=a;e<d;e++){var f=this.cells[e];f.setPosition(b),b+=f.size.outerWidth,this.maxCellHeight=Math.max(f.size.outerHeight,this.maxCellHeight)}this.slideableWidth=b,this.updateSlides(),this._containSlides(),this.slidesWidth=d?this.getLastSlide().target-this.slides[0].target:0},o._sizeCells=function(a){a.forEach(function(a){a.getSize()})},o.updateSlides=function(){if(this.slides=[],this.cells.length){var a=new f(this);this.slides.push(a);var b="left"==this.originSide,c=b?"marginRight":"marginLeft",d=this._getCanCellFit();this.cells.forEach(function(b,e){if(!a.cells.length)return void a.addCell(b);var g=a.outerWidth-a.firstMargin+(b.size.outerWidth-b.size[c]);d.call(this,e,g)?a.addCell(b):(a.updateTarget(),a=new f(this),this.slides.push(a),a.addCell(b))},this),a.updateTarget(),this.updateSelectedSlide()}},o._getCanCellFit=function(){var a=this.options.groupCells;if(!a)return function(){return!1};if("number"==typeof a){var b=parseInt(a,10);return function(a){return a%b!==0}}var c="string"==typeof a&&a.match(/^(\d+)%$/),d=c?parseInt(c[1],10)/100:1;return function(a,b){return b<=(this.size.innerWidth+1)*d}},o._init=o.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},o.getSize=function(){this.size=c(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var p={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};return o.setCellAlign=function(){var a=p[this.options.cellAlign];this.cellAlign=a?a[this.originSide]:this.options.cellAlign},o.setGallerySize=function(){if(this.options.setGallerySize){var a=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=a+"px"}},o._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var a=this.cursorPosition,b=this.cells.length-1;this.beforeShiftCells=this._getGapCells(a,b,-1),a=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(a,0,1)}},o._getGapCells=function(a,b,c){for(var d=[];a>0;){var e=this.cells[b];if(!e)break;d.push(e),b+=c,a-=e.size.outerWidth}return d},o._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var a=this.options.rightToLeft,b=a?"marginRight":"marginLeft",c=a?"marginLeft":"marginRight",d=this.slideableWidth-this.getLastCell().size[c],e=d<this.size.innerWidth,f=this.cursorPosition+this.cells[0].size[b],g=d-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(a){e?a.target=d*this.cellAlign:(a.target=Math.max(a.target,f),a.target=Math.min(a.target,g))},this)}},o.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),j&&this.$element){a+=this.options.namespaceJQueryEvents?".flickity":"";var e=a;if(b){var f=j.Event(b);f.type=a,e=f}this.$element.trigger(e,c)}},o.select=function(a,b,c){this.isActive&&(a=parseInt(a,10),this._wrapSelect(a),(this.options.wrapAround||b)&&(a=d.modulo(a,this.slides.length)),this.slides[a]&&(this.selectedIndex=a,this.updateSelectedSlide(),c?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select"),this.dispatchEvent("cellSelect")))},o._wrapSelect=function(a){var b=this.slides.length,c=this.options.wrapAround&&b>1;if(!c)return a;var e=d.modulo(a,b),f=Math.abs(e-this.selectedIndex),g=Math.abs(e+b-this.selectedIndex),h=Math.abs(e-b-this.selectedIndex);!this.isDragSelect&&g<f?a+=b:!this.isDragSelect&&h<f&&(a-=b),a<0?this.x-=this.slideableWidth:a>=b&&(this.x+=this.slideableWidth)},o.previous=function(a,b){this.select(this.selectedIndex-1,a,b)},o.next=function(a,b){this.select(this.selectedIndex+1,a,b)},o.updateSelectedSlide=function(){var a=this.slides[this.selectedIndex];a&&(this.unselectSelectedSlide(),this.selectedSlide=a,a.select(),this.selectedCells=a.cells,this.selectedElements=a.getCellElements(),this.selectedCell=a.cells[0],this.selectedElement=this.selectedElements[0])},o.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},o.selectCell=function(a,b,c){var d;"number"==typeof a?d=this.cells[a]:("string"==typeof a&&(a=this.element.querySelector(a)),d=this.getCell(a));for(var e=0;d&&e<this.slides.length;e++){var f=this.slides[e],g=f.cells.indexOf(d);if(g!=-1)return void this.select(e,b,c)}},o.getCell=function(a){for(var b=0;b<this.cells.length;b++){var c=this.cells[b];if(c.element==a)return c}},o.getCells=function(a){a=d.makeArray(a);var b=[];return a.forEach(function(a){var c=this.getCell(a);c&&b.push(c)},this),b},o.getCellElements=function(){return this.cells.map(function(a){return a.element})},o.getParentCell=function(a){var b=this.getCell(a);return b?b:(a=d.getParent(a,".flickity-slider > *"),this.getCell(a))},o.getAdjacentCellElements=function(a,b){if(!a)return this.selectedSlide.getCellElements();b=void 0===b?this.selectedIndex:b;var c=this.slides.length;if(1+2*a>=c)return this.getCellElements();for(var e=[],f=b-a;f<=b+a;f++){var g=this.options.wrapAround?d.modulo(f,c):f,h=this.slides[g];h&&(e=e.concat(h.getCellElements()))}return e},o.uiChange=function(){this.emitEvent("uiChange")},o.childUIPointerDown=function(a){this.emitEvent("childUIPointerDown",[a])},o.onresize=function(){this.watchCSS(),this.resize()},d.debounceMethod(i,"onresize",150),o.resize=function(){if(this.isActive){this.getSize(),this.options.wrapAround&&(this.x=d.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var a=this.selectedElements&&this.selectedElements[0];this.selectCell(a,!1,!0)}},o.watchCSS=function(){var a=this.options.watchCSS;if(a){var b=k(this.element,":after").content;b.indexOf("flickity")!=-1?this.activate():this.deactivate()}},o.onkeydown=function(a){if(this.options.accessibility&&(!document.activeElement||document.activeElement==this.element))if(37==a.keyCode){var b=this.options.rightToLeft?"next":"previous";this.uiChange(),this[b]()}else if(39==a.keyCode){var c=this.options.rightToLeft?"previous":"next";this.uiChange(),this[c]()}},o.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.cells.forEach(function(a){a.destroy()}),this.unselectSelectedSlide(),this.element.removeChild(this.viewport),h(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},o.destroy=function(){this.deactivate(),a.removeEventListener("resize",this),this.emitEvent("destroy"),j&&this.$element&&j.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete n[this.guid]},d.extend(o,g),i.data=function(a){a=d.getQueryElement(a);var b=a&&a.flickityGUID;return b&&n[b]},d.htmlInit(i,"flickity"),j&&j.bridget&&j.bridget("flickity",i),i.Cell=e,i}),/*!
|
17 |
+
* Unipointer v2.1.0
|
18 |
+
* base class for doing one thing with pointer event
|
19 |
+
* MIT license
|
20 |
+
*/
|
21 |
+
function(a,b){"function"==typeof define&&define.amd?define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.Unipointer=b(a,a.EvEmitter)}(window,function(a,b){function c(){}function d(){}var e=d.prototype=Object.create(b.prototype);e.bindStartEvent=function(a){this._bindStartEvent(a,!0)},e.unbindStartEvent=function(a){this._bindStartEvent(a,!1)},e._bindStartEvent=function(b,c){c=void 0===c||!!c;var d=c?"addEventListener":"removeEventListener";a.navigator.pointerEnabled?b[d]("pointerdown",this):a.navigator.msPointerEnabled?b[d]("MSPointerDown",this):(b[d]("mousedown",this),b[d]("touchstart",this))},e.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},e.getTouch=function(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.identifier==this.pointerIdentifier)return c}},e.onmousedown=function(a){var b=a.button;b&&0!==b&&1!==b||this._pointerDown(a,a)},e.ontouchstart=function(a){this._pointerDown(a,a.changedTouches[0])},e.onMSPointerDown=e.onpointerdown=function(a){this._pointerDown(a,a)},e._pointerDown=function(a,b){this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==b.pointerId?b.pointerId:b.identifier,this.pointerDown(a,b))},e.pointerDown=function(a,b){this._bindPostStartEvents(a),this.emitEvent("pointerDown",[a,b])};var f={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"],MSPointerDown:["MSPointerMove","MSPointerUp","MSPointerCancel"]};return e._bindPostStartEvents=function(b){if(b){var c=f[b.type];c.forEach(function(b){a.addEventListener(b,this)},this),this._boundPointerEvents=c}},e._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(b){a.removeEventListener(b,this)},this),delete this._boundPointerEvents)},e.onmousemove=function(a){this._pointerMove(a,a)},e.onMSPointerMove=e.onpointermove=function(a){a.pointerId==this.pointerIdentifier&&this._pointerMove(a,a)},e.ontouchmove=function(a){var b=this.getTouch(a.changedTouches);b&&this._pointerMove(a,b)},e._pointerMove=function(a,b){this.pointerMove(a,b)},e.pointerMove=function(a,b){this.emitEvent("pointerMove",[a,b])},e.onmouseup=function(a){this._pointerUp(a,a)},e.onMSPointerUp=e.onpointerup=function(a){a.pointerId==this.pointerIdentifier&&this._pointerUp(a,a)},e.ontouchend=function(a){var b=this.getTouch(a.changedTouches);b&&this._pointerUp(a,b)},e._pointerUp=function(a,b){this._pointerDone(),this.pointerUp(a,b)},e.pointerUp=function(a,b){this.emitEvent("pointerUp",[a,b])},e._pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this._unbindPostStartEvents(),this.pointerDone()},e.pointerDone=c,e.onMSPointerCancel=e.onpointercancel=function(a){a.pointerId==this.pointerIdentifier&&this._pointerCancel(a,a)},e.ontouchcancel=function(a){var b=this.getTouch(a.changedTouches);b&&this._pointerCancel(a,b)},e._pointerCancel=function(a,b){this._pointerDone(),this.pointerCancel(a,b)},e.pointerCancel=function(a,b){this.emitEvent("pointerCancel",[a,b])},d.getPointerPoint=function(a){return{x:a.pageX,y:a.pageY}},d}),/*!
|
22 |
+
* Unidragger v2.1.0
|
23 |
+
* Draggable base class
|
24 |
+
* MIT license
|
25 |
+
*/
|
26 |
+
function(a,b){"function"==typeof define&&define.amd?define("unidragger/unidragger",["unipointer/unipointer"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("unipointer")):a.Unidragger=b(a,a.Unipointer)}(window,function(a,b){function c(){}function d(){}var e=d.prototype=Object.create(b.prototype);e.bindHandles=function(){this._bindHandles(!0)},e.unbindHandles=function(){this._bindHandles(!1)};var f=a.navigator;return e._bindHandles=function(a){a=void 0===a||!!a;var b;b=f.pointerEnabled?function(b){b.style.touchAction=a?"none":""}:f.msPointerEnabled?function(b){b.style.msTouchAction=a?"none":""}:c;for(var d=a?"addEventListener":"removeEventListener",e=0;e<this.handles.length;e++){var g=this.handles[e];this._bindStartEvent(g,a),b(g),g[d]("click",this)}},e.pointerDown=function(a,b){if("INPUT"==a.target.nodeName&&"range"==a.target.type)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(a,b);var c=document.activeElement;c&&c.blur&&c.blur(),this._bindPostStartEvents(a),this.emitEvent("pointerDown",[a,b])},e._dragPointerDown=function(a,c){this.pointerDownPoint=b.getPointerPoint(c);var d=this.canPreventDefaultOnPointerDown(a,c);d&&a.preventDefault()},e.canPreventDefaultOnPointerDown=function(a){return"SELECT"!=a.target.nodeName},e.pointerMove=function(a,b){var c=this._dragPointerMove(a,b);this.emitEvent("pointerMove",[a,b,c]),this._dragMove(a,b,c)},e._dragPointerMove=function(a,c){var d=b.getPointerPoint(c),e={x:d.x-this.pointerDownPoint.x,y:d.y-this.pointerDownPoint.y};return!this.isDragging&&this.hasDragStarted(e)&&this._dragStart(a,c),e},e.hasDragStarted=function(a){return Math.abs(a.x)>3||Math.abs(a.y)>3},e.pointerUp=function(a,b){this.emitEvent("pointerUp",[a,b]),this._dragPointerUp(a,b)},e._dragPointerUp=function(a,b){this.isDragging?this._dragEnd(a,b):this._staticClick(a,b)},e._dragStart=function(a,c){this.isDragging=!0,this.dragStartPoint=b.getPointerPoint(c),this.isPreventingClicks=!0,this.dragStart(a,c)},e.dragStart=function(a,b){this.emitEvent("dragStart",[a,b])},e._dragMove=function(a,b,c){this.isDragging&&this.dragMove(a,b,c)},e.dragMove=function(a,b,c){a.preventDefault(),this.emitEvent("dragMove",[a,b,c])},e._dragEnd=function(a,b){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(a,b)},e.dragEnd=function(a,b){this.emitEvent("dragEnd",[a,b])},e.onclick=function(a){this.isPreventingClicks&&a.preventDefault()},e._staticClick=function(a,b){if(!this.isIgnoringMouseUp||"mouseup"!=a.type){var c=a.target.nodeName;"INPUT"!=c&&"TEXTAREA"!=c||a.target.focus(),this.staticClick(a,b),"mouseup"!=a.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400))}},e.staticClick=function(a,b){this.emitEvent("staticClick",[a,b])},d.getPointerPoint=b.getPointerPoint,d}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(c,d,e){return b(a,c,d,e)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("unidragger"),require("fizzy-ui-utils")):a.Flickity=b(a,a.Flickity,a.Unidragger,a.fizzyUIUtils)}(window,function(a,b,c,d){function e(){return{x:a.pageXOffset,y:a.pageYOffset}}d.extend(b.defaults,{draggable:!0,dragThreshold:3}),b.createMethods.push("_createDrag");var f=b.prototype;d.extend(f,c.prototype);var g="createTouch"in document,h=!1;f._createDrag=function(){this.on("activate",this.bindDrag),this.on("uiChange",this._uiChangeDrag),this.on("childUIPointerDown",this._childUIPointerDownDrag),this.on("deactivate",this.unbindDrag),g&&!h&&(a.addEventListener("touchmove",function(){}),h=!0)},f.bindDrag=function(){this.options.draggable&&!this.isDragBound&&(this.element.classList.add("is-draggable"),this.handles=[this.viewport],this.bindHandles(),this.isDragBound=!0)},f.unbindDrag=function(){this.isDragBound&&(this.element.classList.remove("is-draggable"),this.unbindHandles(),delete this.isDragBound)},f._uiChangeDrag=function(){delete this.isFreeScrolling},f._childUIPointerDownDrag=function(a){a.preventDefault(),this.pointerDownFocus(a)};var i={TEXTAREA:!0,INPUT:!0,OPTION:!0},j={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};f.pointerDown=function(b,c){var d=i[b.target.nodeName]&&!j[b.target.type];if(d)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(b,c);var f=document.activeElement;f&&f.blur&&f!=this.element&&f!=document.body&&f.blur(),this.pointerDownFocus(b),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this._bindPostStartEvents(b),this.pointerDownScroll=e(),a.addEventListener("scroll",this),this.dispatchEvent("pointerDown",b,[c])};var k={touchstart:!0,MSPointerDown:!0},l={INPUT:!0,SELECT:!0};return f.pointerDownFocus=function(b){if(this.options.accessibility&&!k[b.type]&&!l[b.target.nodeName]){var c=a.pageYOffset;this.element.focus(),a.pageYOffset!=c&&a.scrollTo(a.pageXOffset,c)}},f.canPreventDefaultOnPointerDown=function(a){var b="touchstart"==a.type,c=a.target.nodeName;return!b&&"SELECT"!=c},f.hasDragStarted=function(a){return Math.abs(a.x)>this.options.dragThreshold},f.pointerUp=function(a,b){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",a,[b]),this._dragPointerUp(a,b)},f.pointerDone=function(){a.removeEventListener("scroll",this),delete this.pointerDownScroll},f.dragStart=function(b,c){this.dragStartPosition=this.x,this.startAnimation(),a.removeEventListener("scroll",this),this.dispatchEvent("dragStart",b,[c])},f.pointerMove=function(a,b){var c=this._dragPointerMove(a,b);this.dispatchEvent("pointerMove",a,[b,c]),this._dragMove(a,b,c)},f.dragMove=function(a,b,c){a.preventDefault(),this.previousDragX=this.dragX;var d=this.options.rightToLeft?-1:1,e=this.dragStartPosition+c.x*d;if(!this.options.wrapAround&&this.slides.length){var f=Math.max(-this.slides[0].target,this.dragStartPosition);e=e>f?.5*(e+f):e;var g=Math.min(-this.getLastSlide().target,this.dragStartPosition);e=e<g?.5*(e+g):e}this.dragX=e,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",a,[b,c])},f.dragEnd=function(a,b){this.options.freeScroll&&(this.isFreeScrolling=!0);var c=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var d=this.getRestingPosition();this.isFreeScrolling=-d>this.slides[0].target&&-d<this.getLastSlide().target}else this.options.freeScroll||c!=this.selectedIndex||(c+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(c),delete this.isDragSelect,this.dispatchEvent("dragEnd",a,[b])},f.dragEndRestingSelect=function(){var a=this.getRestingPosition(),b=Math.abs(this.getSlideDistance(-a,this.selectedIndex)),c=this._getClosestResting(a,b,1),d=this._getClosestResting(a,b,-1),e=c.distance<d.distance?c.index:d.index;return e},f._getClosestResting=function(a,b,c){for(var d=this.selectedIndex,e=1/0,f=this.options.contain&&!this.options.wrapAround?function(a,b){return a<=b}:function(a,b){return a<b};f(b,e)&&(d+=c,e=b,b=this.getSlideDistance(-a,d),null!==b);)b=Math.abs(b);return{distance:e,index:d-c}},f.getSlideDistance=function(a,b){var c=this.slides.length,e=this.options.wrapAround&&c>1,f=e?d.modulo(b,c):b,g=this.slides[f];if(!g)return null;var h=e?this.slideableWidth*Math.floor(b/c):0;return a-(g.target+h)},f.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var a=this.getSlideDistance(-this.dragX,this.selectedIndex),b=this.previousDragX-this.dragX;return a>0&&b>0?1:a<0&&b<0?-1:0},f.staticClick=function(a,b){var c=this.getParentCell(a.target),d=c&&c.element,e=c&&this.cells.indexOf(c);this.dispatchEvent("staticClick",a,[b,d,e])},f.onscroll=function(){var a=e(),b=this.pointerDownScroll.x-a.x,c=this.pointerDownScroll.y-a.y;(Math.abs(b)>3||Math.abs(c)>3)&&this._pointerDone()},b}),/*!
|
27 |
+
* Tap listener v2.0.0
|
28 |
+
* listens to taps
|
29 |
+
* MIT license
|
30 |
+
*/
|
31 |
+
function(a,b){"function"==typeof define&&define.amd?define("tap-listener/tap-listener",["unipointer/unipointer"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("unipointer")):a.TapListener=b(a,a.Unipointer)}(window,function(a,b){function c(a){this.bindTap(a)}var d=c.prototype=Object.create(b.prototype);return d.bindTap=function(a){a&&(this.unbindTap(),this.tapElement=a,this._bindStartEvent(a,!0))},d.unbindTap=function(){this.tapElement&&(this._bindStartEvent(this.tapElement,!0),delete this.tapElement)},d.pointerUp=function(c,d){if(!this.isIgnoringMouseUp||"mouseup"!=c.type){var e=b.getPointerPoint(d),f=this.tapElement.getBoundingClientRect(),g=a.pageXOffset,h=a.pageYOffset,i=e.x>=f.left+g&&e.x<=f.right+g&&e.y>=f.top+h&&e.y<=f.bottom+h;if(i&&this.emitEvent("tap",[c,d]),"mouseup"!=c.type){this.isIgnoringMouseUp=!0;var j=this;setTimeout(function(){delete j.isIgnoringMouseUp},400)}}},d.destroy=function(){this.pointerDone(),this.unbindTap()},c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/prev-next-button",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(c,d,e){return b(a,c,d,e)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):b(a,a.Flickity,a.TapListener,a.fizzyUIUtils)}(window,function(a,b,c,d){"use strict";function e(a,b){this.direction=a,this.parent=b,this._create()}function f(a){return"string"==typeof a?a:"M "+a.x0+",50 L "+a.x1+","+(a.y1+50)+" L "+a.x2+","+(a.y2+50)+" L "+a.x3+",50 L "+a.x2+","+(50-a.y2)+" L "+a.x1+","+(50-a.y1)+" Z"}var g="http://www.w3.org/2000/svg";e.prototype=new c,e.prototype._create=function(){this.isEnabled=!0,this.isPrevious=this.direction==-1;var a=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==a;var b=this.element=document.createElement("button");b.className="flickity-prev-next-button",b.className+=this.isPrevious?" previous":" next",b.setAttribute("type","button"),this.disable(),b.setAttribute("aria-label",this.isPrevious?"previous":"next");var c=this.createSVG();b.appendChild(c),this.on("tap",this.onTap),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},e.prototype.activate=function(){this.bindTap(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},e.prototype.deactivate=function(){this.parent.element.removeChild(this.element),c.prototype.destroy.call(this),this.element.removeEventListener("click",this)},e.prototype.createSVG=function(){var a=document.createElementNS(g,"svg");a.setAttribute("viewBox","0 0 100 100");var b=document.createElementNS(g,"path"),c=f(this.parent.options.arrowShape);return b.setAttribute("d",c),b.setAttribute("class","arrow"),this.isLeft||b.setAttribute("transform","translate(100, 100) rotate(180) "),a.appendChild(b),a},e.prototype.onTap=function(){if(this.isEnabled){this.parent.uiChange();var a=this.isPrevious?"previous":"next";this.parent[a]()}},e.prototype.handleEvent=d.handleEvent,e.prototype.onclick=function(){var a=document.activeElement;a&&a==this.element&&this.onTap()},e.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},e.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},e.prototype.update=function(){var a=this.parent.slides;if(this.parent.options.wrapAround&&a.length>1)return void this.enable();var b=a.length?a.length-1:0,c=this.isPrevious?0:b,d=this.parent.selectedIndex==c?"disable":"enable";this[d]()},e.prototype.destroy=function(){this.deactivate()},d.extend(b.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),b.createMethods.push("_createPrevNextButtons");var h=b.prototype;return h._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new e((-1),this),this.nextButton=new e(1,this),this.on("activate",this.activatePrevNextButtons))},h.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},h.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},b.PrevNextButton=e,b}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/page-dots",["./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(c,d,e){return b(a,c,d,e)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):b(a,a.Flickity,a.TapListener,a.fizzyUIUtils)}(window,function(a,b,c,d){function e(a){this.parent=a,this._create()}e.prototype=new c,e.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.on("tap",this.onTap),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},e.prototype.activate=function(){this.setDots(),this.bindTap(this.holder),this.parent.element.appendChild(this.holder)},e.prototype.deactivate=function(){this.parent.element.removeChild(this.holder),c.prototype.destroy.call(this)},e.prototype.setDots=function(){var a=this.parent.slides.length-this.dots.length;a>0?this.addDots(a):a<0&&this.removeDots(-a)},e.prototype.addDots=function(a){for(var b=document.createDocumentFragment(),c=[];a;){var d=document.createElement("li");d.className="dot",b.appendChild(d),c.push(d),a--}this.holder.appendChild(b),this.dots=this.dots.concat(c)},e.prototype.removeDots=function(a){var b=this.dots.splice(this.dots.length-a,a);b.forEach(function(a){this.holder.removeChild(a)},this)},e.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot"),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected")},e.prototype.onTap=function(a){var b=a.target;if("LI"==b.nodeName){this.parent.uiChange();var c=this.dots.indexOf(b);this.parent.select(c)}},e.prototype.destroy=function(){this.deactivate()},b.PageDots=e,d.extend(b.defaults,{pageDots:!0}),b.createMethods.push("_createPageDots");var f=b.prototype;return f._createPageDots=function(){this.options.pageDots&&(this.pageDots=new e(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))},f.activatePageDots=function(){this.pageDots.activate()},f.updateSelectedPageDots=function(){this.pageDots.updateSelected()},f.updatePageDots=function(){this.pageDots.setDots()},f.deactivatePageDots=function(){this.pageDots.deactivate()},b.PageDots=e,b}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(a,c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity")):b(a.EvEmitter,a.fizzyUIUtils,a.Flickity)}(window,function(a,b,c){function d(a){this.parent=a,this.state="stopped",f&&(this.onVisibilityChange=function(){this.visibilityChange()}.bind(this),this.onVisibilityPlay=function(){this.visibilityPlay()}.bind(this))}var e,f;"hidden"in document?(e="hidden",f="visibilitychange"):"webkitHidden"in document&&(e="webkitHidden",f="webkitvisibilitychange"),d.prototype=Object.create(a.prototype),d.prototype.play=function(){if("playing"!=this.state){var a=document[e];if(f&&a)return void document.addEventListener(f,this.onVisibilityPlay);this.state="playing",f&&document.addEventListener(f,this.onVisibilityChange),this.tick()}},d.prototype.tick=function(){if("playing"==this.state){var a=this.parent.options.autoPlay;a="number"==typeof a?a:3e3;var b=this;this.clear(),this.timeout=setTimeout(function(){b.parent.next(!0),b.tick()},a)}},d.prototype.stop=function(){this.state="stopped",this.clear(),f&&document.removeEventListener(f,this.onVisibilityChange)},d.prototype.clear=function(){clearTimeout(this.timeout)},d.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},d.prototype.unpause=function(){"paused"==this.state&&this.play()},d.prototype.visibilityChange=function(){var a=document[e];this[a?"pause":"unpause"]()},d.prototype.visibilityPlay=function(){this.play(),document.removeEventListener(f,this.onVisibilityPlay)},b.extend(c.defaults,{pauseAutoPlayOnHover:!0}),c.createMethods.push("_createPlayer");var g=c.prototype;return g._createPlayer=function(){this.player=new d(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},g.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},g.playPlayer=function(){this.player.play()},g.stopPlayer=function(){this.player.stop()},g.pausePlayer=function(){this.player.pause()},g.unpausePlayer=function(){this.player.unpause()},g.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},g.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},g.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},c.Player=d,c}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("fizzy-ui-utils")):b(a,a.Flickity,a.fizzyUIUtils)}(window,function(a,b,c){function d(a){var b=document.createDocumentFragment();return a.forEach(function(a){b.appendChild(a.element)}),b}var e=b.prototype;return e.insert=function(a,b){var c=this._makeCells(a);if(c&&c.length){var e=this.cells.length;b=void 0===b?e:b;var f=d(c),g=b==e;if(g)this.slider.appendChild(f);else{var h=this.cells[b].element;this.slider.insertBefore(f,h)}if(0===b)this.cells=c.concat(this.cells);else if(g)this.cells=this.cells.concat(c);else{var i=this.cells.splice(b,e-b);this.cells=this.cells.concat(c).concat(i)}this._sizeCells(c);var j=b>this.selectedIndex?0:c.length;this._cellAddedRemoved(b,j)}},e.append=function(a){this.insert(a,this.cells.length)},e.prepend=function(a){this.insert(a,0)},e.remove=function(a){var b,d,e=this.getCells(a),f=0,g=e.length;for(b=0;b<g;b++){d=e[b];var h=this.cells.indexOf(d)<this.selectedIndex;f-=h?1:0}for(b=0;b<g;b++)d=e[b],d.remove(),c.removeFrom(this.cells,d);e.length&&this._cellAddedRemoved(0,f)},e._cellAddedRemoved=function(a,b){b=b||0,this.selectedIndex+=b,this.selectedIndex=Math.max(0,Math.min(this.slides.length-1,this.selectedIndex)),this.cellChange(a,!0),this.emitEvent("cellAddedRemoved",[a,b])},e.cellSizeChange=function(a){var b=this.getCell(a);if(b){b.getSize();var c=this.cells.indexOf(b);this.cellChange(c)}},e.cellChange=function(a,b){var c=this.slideableWidth;if(this._positionCells(a),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("cellChange",[a]),this.options.freeScroll){var d=c-this.slideableWidth;this.x+=d*this.cellAlign,this.positionSlider()}else b&&this.positionSliderAtSelected(),this.select(this.selectedIndex)},b}),function(a,b){"function"==typeof define&&define.amd?define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("./flickity"),require("fizzy-ui-utils")):b(a,a.Flickity,a.fizzyUIUtils)}(window,function(a,b,c){"use strict";function d(a){if("IMG"==a.nodeName&&a.getAttribute("data-flickity-lazyload"))return[a];var b=a.querySelectorAll("img[data-flickity-lazyload]");return c.makeArray(b)}function e(a,b){this.img=a,this.flickity=b,this.load()}b.createMethods.push("_createLazyload");var f=b.prototype;return f._createLazyload=function(){this.on("select",this.lazyLoad)},f.lazyLoad=function(){var a=this.options.lazyLoad;if(a){var b="number"==typeof a?a:0,c=this.getAdjacentCellElements(b),f=[];c.forEach(function(a){var b=d(a);f=f.concat(b)}),f.forEach(function(a){new e(a,this)},this)}},e.prototype.handleEvent=c.handleEvent,e.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.img.getAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload")},e.prototype.onload=function(a){this.complete(a,"flickity-lazyloaded")},e.prototype.onerror=function(a){this.complete(a,"flickity-lazyerror")},e.prototype.complete=function(a,b){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var c=this.flickity.getParentCell(this.img),d=c&&c.element;this.flickity.cellSizeChange(d),this.img.classList.add(b),this.flickity.dispatchEvent("lazyLoad",a,d)},b.LazyLoader=e,b}),/*!
|
32 |
+
* Flickity v2.0.5
|
33 |
+
* Touch, responsive, flickable carousels
|
34 |
+
*
|
35 |
+
* Licensed GPLv3 for open source use
|
36 |
+
* or Flickity Commercial License for commercial use
|
37 |
+
*
|
38 |
+
* http://flickity.metafizzy.co
|
39 |
+
* Copyright 2016 Metafizzy
|
40 |
+
*/
|
41 |
+
function(a,b){"function"==typeof define&&define.amd?define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],b):"object"==typeof module&&module.exports&&(module.exports=b(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload")))}(window,function(a){return a}),/*!
|
42 |
+
* Flickity asNavFor v2.0.1
|
43 |
+
* enable asNavFor for Flickity
|
44 |
+
*/
|
45 |
+
function(a,b){"function"==typeof define&&define.amd?define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],b):"object"==typeof module&&module.exports?module.exports=b(require("flickity"),require("fizzy-ui-utils")):a.Flickity=b(a.Flickity,a.fizzyUIUtils)}(window,function(a,b){function c(a,b,c){return(b-a)*c+a}a.createMethods.push("_createAsNavFor");var d=a.prototype;return d._createAsNavFor=function(){this.on("activate",this.activateAsNavFor),this.on("deactivate",this.deactivateAsNavFor),this.on("destroy",this.destroyAsNavFor);var a=this.options.asNavFor;if(a){var b=this;setTimeout(function(){b.setNavCompanion(a)})}},d.setNavCompanion=function(c){c=b.getQueryElement(c);var d=a.data(c);if(d&&d!=this){this.navCompanion=d;var e=this;this.onNavCompanionSelect=function(){e.navCompanionSelect()},d.on("select",this.onNavCompanionSelect),this.on("staticClick",this.onNavStaticClick),this.navCompanionSelect(!0)}},d.navCompanionSelect=function(a){if(this.navCompanion){var b=this.navCompanion.selectedCells[0],d=this.navCompanion.cells.indexOf(b),e=d+this.navCompanion.selectedCells.length-1,f=Math.floor(c(d,e,this.navCompanion.cellAlign));if(this.selectCell(f,!1,a),this.removeNavSelectedElements(),!(f>=this.cells.length)){var g=this.cells.slice(d,e+1);this.navSelectedElements=g.map(function(a){return a.element}),this.changeNavSelectedClass("add")}}},d.changeNavSelectedClass=function(a){this.navSelectedElements.forEach(function(b){b.classList[a]("is-nav-selected")})},d.activateAsNavFor=function(){this.navCompanionSelect(!0)},d.removeNavSelectedElements=function(){this.navSelectedElements&&(this.changeNavSelectedClass("remove"),delete this.navSelectedElements)},d.onNavStaticClick=function(a,b,c,d){"number"==typeof d&&this.navCompanion.selectCell(d)},d.deactivateAsNavFor=function(){this.removeNavSelectedElements()},d.destroyAsNavFor=function(){this.navCompanion&&(this.navCompanion.off("select",this.onNavCompanionSelect),this.off("staticClick",this.onNavStaticClick),delete this.navCompanion)},a}),/*!
|
46 |
+
* imagesLoaded v4.1.1
|
47 |
+
* JavaScript is all like "You images are done yet or what?"
|
48 |
+
* MIT License
|
49 |
+
*/
|
50 |
+
function(a,b){"use strict";"function"==typeof define&&define.amd?define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.imagesLoaded=b(a,a.EvEmitter)}(window,function(a,b){function c(a,b){for(var c in b)a[c]=b[c];return a}function d(a){var b=[];if(Array.isArray(a))b=a;else if("number"==typeof a.length)for(var c=0;c<a.length;c++)b.push(a[c]);else b.push(a);return b}function e(a,b,f){return this instanceof e?("string"==typeof a&&(a=document.querySelectorAll(a)),this.elements=d(a),this.options=c({},this.options),"function"==typeof b?f=b:c(this.options,b),f&&this.on("always",f),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(function(){this.check()}.bind(this))):new e(a,b,f)}function f(a){this.img=a}function g(a,b){this.url=a,this.element=b,this.img=new Image}var h=a.jQuery,i=a.console;e.prototype=Object.create(b.prototype),e.prototype.options={},e.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},e.prototype.addElementImages=function(a){"IMG"==a.nodeName&&this.addImage(a),this.options.background===!0&&this.addElementBackgroundImages(a);var b=a.nodeType;if(b&&j[b]){for(var c=a.querySelectorAll("img"),d=0;d<c.length;d++){var e=c[d];this.addImage(e)}if("string"==typeof this.options.background){var f=a.querySelectorAll(this.options.background);for(d=0;d<f.length;d++){var g=f[d];this.addElementBackgroundImages(g)}}}};var j={1:!0,9:!0,11:!0};return e.prototype.addElementBackgroundImages=function(a){var b=getComputedStyle(a);if(b)for(var c=/url\((['"])?(.*?)\1\)/gi,d=c.exec(b.backgroundImage);null!==d;){var e=d&&d[2];e&&this.addBackground(e,a),d=c.exec(b.backgroundImage)}},e.prototype.addImage=function(a){var b=new f(a);this.images.push(b)},e.prototype.addBackground=function(a,b){var c=new g(a,b);this.images.push(c)},e.prototype.check=function(){function a(a,c,d){setTimeout(function(){b.progress(a,c,d)})}var b=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(b){b.once("progress",a),b.check()}):void this.complete()},e.prototype.progress=function(a,b,c){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!a.isLoaded,this.emitEvent("progress",[this,a,b]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,a),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&i&&i.log("progress: "+c,a,b)},e.prototype.complete=function(){var a=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(a,[this]),this.emitEvent("always",[this]),this.jqDeferred){var b=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[b](this)}},f.prototype=Object.create(b.prototype),f.prototype.check=function(){var a=this.getIsImageComplete();return a?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},f.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},f.prototype.confirm=function(a,b){this.isLoaded=a,this.emitEvent("progress",[this,this.img,b])},f.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},f.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},f.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},f.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},g.prototype=Object.create(f.prototype),g.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var a=this.getIsImageComplete();a&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},g.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},g.prototype.confirm=function(a,b){this.isLoaded=a,this.emitEvent("progress",[this,this.element,b])},e.makeJQueryPlugin=function(b){b=b||a.jQuery,b&&(h=b,h.fn.imagesLoaded=function(a,b){var c=new e(this,a,b);return c.jqDeferred.promise(h(this))})},e.makeJQueryPlugin(),e}),/*!
|
51 |
+
* Flickity imagesLoaded v2.0.0
|
52 |
+
* enables imagesLoaded option for Flickity
|
53 |
+
*/
|
54 |
function(a,b){"function"==typeof define&&define.amd?define(["flickity/js/index","imagesloaded/imagesloaded"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("flickity"),require("imagesloaded")):a.Flickity=b(a,a.Flickity,a.imagesLoaded)}(window,function(a,b,c){"use strict";b.createMethods.push("_createImagesLoaded");var d=b.prototype;return d._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)},d.imagesLoaded=function(){function a(a,c){var d=b.getParentCell(c.img);b.cellSizeChange(d&&d.element),b.options.freeScroll||b.positionSliderAtSelected()}if(this.options.imagesLoaded){var b=this;c(this.slider).on("progress",a)}},b});
|
ha-fire.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Hueman Addons
|
4 |
* Plugin URI: http://presscustomizr.com
|
5 |
* Description: Hueman Theme Addons
|
6 |
-
* Version: 2.0.
|
7 |
* Text Domain: hueman-addons
|
8 |
* Author: Press Customizr
|
9 |
* Author URI: http://presscustomizr.com
|
@@ -11,7 +11,7 @@
|
|
11 |
*/
|
12 |
|
13 |
//last version sync
|
14 |
-
if( ! defined( 'LAST_THEME_VERSION_FMK_SYNC' ) ) define( 'LAST_THEME_VERSION_FMK_SYNC' , '3.3.
|
15 |
if( ! defined( 'MINIMAL_AUTHORIZED_THEME_VERSION' ) ) define( 'MINIMAL_AUTHORIZED_THEME_VERSION' , '3.3.0' );
|
16 |
if( ! defined( 'IS_HUEMAN_ADDONS' ) ) define( 'IS_HUEMAN_ADDONS' , true );
|
17 |
if( ! defined( 'HU_IS_PRO_ADDONS' ) ) define( 'HU_IS_PRO_ADDONS' , false );
|
3 |
* Plugin Name: Hueman Addons
|
4 |
* Plugin URI: http://presscustomizr.com
|
5 |
* Description: Hueman Theme Addons
|
6 |
+
* Version: 2.0.11
|
7 |
* Text Domain: hueman-addons
|
8 |
* Author: Press Customizr
|
9 |
* Author URI: http://presscustomizr.com
|
11 |
*/
|
12 |
|
13 |
//last version sync
|
14 |
+
if( ! defined( 'LAST_THEME_VERSION_FMK_SYNC' ) ) define( 'LAST_THEME_VERSION_FMK_SYNC' , '3.3.11' );
|
15 |
if( ! defined( 'MINIMAL_AUTHORIZED_THEME_VERSION' ) ) define( 'MINIMAL_AUTHORIZED_THEME_VERSION' , '3.3.0' );
|
16 |
if( ! defined( 'IS_HUEMAN_ADDONS' ) ) define( 'IS_HUEMAN_ADDONS' , true );
|
17 |
if( ! defined( 'HU_IS_PRO_ADDONS' ) ) define( 'HU_IS_PRO_ADDONS' , false );
|
lang/en_US.po
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: Hueman Addons v2.0.
|
4 |
"POT-Creation-Date: 2016-12-19 18:13+0100\n"
|
5 |
"PO-Revision-Date: 2016-12-19 18:14+0100\n"
|
6 |
"Last-Translator: \n"
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: Hueman Addons v2.0.11\n"
|
4 |
"POT-Creation-Date: 2016-12-19 18:13+0100\n"
|
5 |
"PO-Revision-Date: 2016-12-19 18:14+0100\n"
|
6 |
"Last-Translator: \n"
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wordpress.org/plugins/hueman-addons/
|
|
5 |
Tags: hueman theme, hueman
|
6 |
Requires at least: 3.4
|
7 |
Tested up to: 4.7.4
|
8 |
-
Stable tag: 2.0.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -37,6 +37,9 @@ The plugin has been designed specifically for the Hueman WordPress theme. Lightw
|
|
37 |
|
38 |
|
39 |
== Changelog ==
|
|
|
|
|
|
|
40 |
= 2.0.10 April 28th 2017 =
|
41 |
* added : customizer help blocks
|
42 |
* improved : customizer performance on load
|
5 |
Tags: hueman theme, hueman
|
6 |
Requires at least: 3.4
|
7 |
Tested up to: 4.7.4
|
8 |
+
Stable tag: 2.0.11
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
37 |
|
38 |
|
39 |
== Changelog ==
|
40 |
+
= 2.0.11 May 8th 2017 =
|
41 |
+
* improved : better initialization process for the customizer preview when fired from appearance > themes
|
42 |
+
|
43 |
= 2.0.10 April 28th 2017 =
|
44 |
* added : customizer help blocks
|
45 |
* improved : customizer performance on load
|