Nimble Page Builder - Version 2.2.2

Version Description

February 18th, 2021 = * fixed : [character encoding] some characters like ( quotemarks , and ) can break rich text editor content

Download this release

Release Info

Developer nikeo
Plugin Icon 128x128 Nimble Page Builder
Version 2.2.2
Comparing to
See all releases

Code changes from version 2.2.1 to 2.2.2

assets/czr/sek/js/ccat-sek-control.js CHANGED
@@ -307,6 +307,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
307
  api.bind( 'save-request-params', function( query ) {
308
  $.extend( query, {
309
  local_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
 
310
  active_locations : api.czr_sektions.activeLocations()
311
  });
312
  });
@@ -954,6 +955,25 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
954
 
955
  // Schedule the accordion behaviour
956
  self.scheduleModuleAccordion.call( _section_, { expand_first_control : true } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
957
  });
958
  });
959
  }//isSiteTemplateEnabled
@@ -983,6 +1003,9 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
983
  // set the localSectionsSettingId now, and update it on skope change
984
  sektionsData = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local');
985
  if ( sektionsLocalizedData.isDevMode ) {
 
 
 
986
  api.infoLog( '::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ', sektionsData );
987
  }
988
  if ( _.isEmpty( sektionsData ) ) {
@@ -3727,10 +3750,30 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
3727
  // Note : only the collection is set to self.getDefaultSektionSettingValue( 'local' )
3728
  // @see php function which defines the defaults sek_get_default_location_model()
3729
  resetCollectionSetting : function( scope ) {
3730
- var self = this;
3731
  if ( _.isEmpty( scope ) || !_.contains(['local', 'global'], scope ) ) {
3732
  throw new Error( 'resetCollectionSetting => invalid scope provided.', scope );
3733
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3734
  return $.extend( true, {}, self.getDefaultSektionSettingValue( scope ) );
3735
  }
3736
  });//$.extend()
@@ -6670,7 +6713,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
6670
  generateUIforSiteTmplOptions : function( params, dfd ) {
6671
  var self = this,
6672
  // only the site_template option will be saved ( see php constant NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS ) not the setting used to populate it
6673
- _id_ = sektionsLocalizedData.prefixForSettingsNotSaved + sektionsLocalizedData.optNameForSiteTmplOptions;//__nimble__ + __site_templates__
6674
 
6675
  // Is the UI currently displayed the one that is being requested ?
6676
  // If so, visually remind the user that a module should be dragged
307
  api.bind( 'save-request-params', function( query ) {
308
  $.extend( query, {
309
  local_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
310
+ group_skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id', 'group' ),//<= feb 2021, added for #478
311
  active_locations : api.czr_sektions.activeLocations()
312
  });
313
  });
955
 
956
  // Schedule the accordion behaviour
957
  self.scheduleModuleAccordion.call( _section_, { expand_first_control : true } );
958
+
959
+ // FORCE PREVIEW URL TO HOME WHEN PICKING SITE TEMPLATES
960
+ // when picking site templates, make sure the preview loads home page
961
+ // => otherwise, for example if a page site template is applied to a page with no local sections, which is currently being previewed, the site template sections will be set as the local setting value, and therefore published as local sections, which we don't want.
962
+ var _doThingsAfterRefresh = function() {
963
+ setTimeout( function() {
964
+ _section_.expanded(true);
965
+ var _ctrl_ = _.first( _section_.controls() );
966
+ if ( _ctrl_ && _ctrl_.id ) {
967
+ api.control( _ctrl_.id ).container.find('.customize-control-title').trigger('click');
968
+ }
969
+ }, 500 );
970
+
971
+ api.czr_currentSkopesCollection.unbind( _doThingsAfterRefresh );
972
+ };
973
+ _section_.container.find('.accordion-section-title').first().on('click', function() {
974
+ api.czr_currentSkopesCollection.bind( _doThingsAfterRefresh );
975
+ api.previewer.previewUrl( api.settings.url.home );
976
+ });
977
  });
978
  });
979
  }//isSiteTemplateEnabled
1003
  // set the localSectionsSettingId now, and update it on skope change
1004
  sektionsData = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local');
1005
  if ( sektionsLocalizedData.isDevMode ) {
1006
+ if ( sektionsLocalizedData.isSiteTemplateEnabled ) {
1007
+ api.infoLog( 'TO DO SITE TEMPLATES => 1) PHP create a site template mapping : skope => site_template option that applies, 2) Include this mapping in the localized customizer params 3) use it on local reset to set the new value');
1008
+ }
1009
  api.infoLog( '::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ', sektionsData );
1010
  }
1011
  if ( _.isEmpty( sektionsData ) ) {
3750
  // Note : only the collection is set to self.getDefaultSektionSettingValue( 'local' )
3751
  // @see php function which defines the defaults sek_get_default_location_model()
3752
  resetCollectionSetting : function( scope ) {
3753
+ var self = this, newSettingValue;
3754
  if ( _.isEmpty( scope ) || !_.contains(['local', 'global'], scope ) ) {
3755
  throw new Error( 'resetCollectionSetting => invalid scope provided.', scope );
3756
  }
3757
+
3758
+ if ( sektionsLocalizedData.isSiteTmplEnabled ) {
3759
+ // Feb 2021 : do we have group template that applies to this context ?
3760
+ var site_tmpl_opts = api(sektionsLocalizedData.optNameForSiteTmplOptions)(),
3761
+ group_skope_id = api.czr_skopeBase.getSkopeProperty( 'skope_id' ,'group'),
3762
+ group_skope_sektions = api.czr_skopeBase.getSkopeProperty( 'group_sektions' ,'group');
3763
+
3764
+ console.log('ALORS ?', site_tmpl_opts, group_skope_id, group_skope_sektions );
3765
+
3766
+ // FEB 2021 => TEST FOR ALL PAGE SKOPE
3767
+ if ( _.isObject( site_tmpl_opts ) && site_tmpl_opts.site_templates && _.isObject( site_tmpl_opts.site_templates ) && site_tmpl_opts.site_templates.pages ) {
3768
+ if ( 'skp__all_page' === group_skope_id ) {
3769
+ if ( group_skope_sektions && group_skope_sektions.db_values ) {
3770
+ console.log('SET GROUP SKOPE SEKTION ?');
3771
+ newSettingValue = self.validateSettingValue( _.isObject( group_skope_sektions.db_value ) ? group_skope_sektions.db_value : self.getDefaultSektionSettingValue( 'local' ), 'local' );
3772
+ }
3773
+ }
3774
+ }
3775
+ }
3776
+
3777
  return $.extend( true, {}, self.getDefaultSektionSettingValue( scope ) );
3778
  }
3779
  });//$.extend()
6713
  generateUIforSiteTmplOptions : function( params, dfd ) {
6714
  var self = this,
6715
  // only the site_template option will be saved ( see php constant NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS ) not the setting used to populate it
6716
+ _id_ = sektionsLocalizedData.prefixForSettingsNotSaved + sektionsLocalizedData.optNameForSiteTmplOptions;//__nimble__ + nimble_site_templates
6717
 
6718
  // Is the UI currently displayed the one that is being requested ?
6719
  // If so, visually remind the user that a module should be dragged
assets/czr/sek/js/ccat-sek-control.min.js CHANGED
@@ -1 +1 @@
1
- !function(u,m){u.CZR_Helpers.getInputSubTemplate=function(e){return 0<m("#tmpl-nimble-subtemplate___"+e).length?wp.template("nimble-subtemplate___"+e):(u.errare("problem in api.czr_sektions.getInputSubTemplate(), missing js template in the DOM for template_name : "+e),null)};var f=u.CZR_Helpers.getModuleTmpl;u.CZR_Helpers.getModuleTmpl=function(n){if(-1===(n=_.extend({tmpl:"",module_type:"",module_id:"",cache:!0,nonce:u.settings.nonce.save},n)).module_id.indexOf("__nimble__"))return f(n);var o=m.Deferred();if((_.isEmpty(n.tmpl)||_.isEmpty(n.module_type))&&o.reject("api.CZR_Helpers.getModuleTmpl => missing tmpl or module_type param"),!u.czr_sektions.isModuleRegistered(n.module_type))return o.reject("api.CZR_Helpers.getModuleTmpl => module type not registered"),o.resolve(),f(n);if(_.contains([],n.module_type))return o.resolve(),f(n);var e=u.czr_sektions.getRegisteredModuleProperty(n.module_type,"tmpl"),t=_.isObject(e)&&e[n.tmpl]?e[n.tmpl]:{};!_.isEmpty(t)&&_.isObject(t)||(u.errare("getModuleTmpl => Error empty or invalid input map for module : ",n.module_type),o.reject("getModuleTmpl => Error empty or invalid input map for module : ",n.module_type));var r=n.item_model,i=m.extend(!0,{},u.czr_sektions.getDefaultItemModelFromRegisteredModuleData(n.module_type)),s=m.extend(!0,{},i);r=m.extend(s,r),_.isEmpty(r)&&(u.errare("getModuleTmpl => Error invalid item model for module : ",n.module_type),o.reject("getModuleTmpl => Error invalid item model for module : ",n.module_type));var a,l="",c=function(e){var i="";return _.each(e,function(e,t){a=e.input_type;try{i+=wp.template("nimble-input-wrapper")({input_type:a,input_data:e,input_id:t,item_model:r,input_tmpl:function(e){var t=e;switch(e){case"czr_layouts":case"select":case"simpleselect":case"fa_icon_picker":case"font_picker":case"animation_picker":t="simpleselect";break;case"simpleselectWithDeviceSwitcher":t="simpleselect_deviceswitcher";break;case"multiselect":case"category_picker":t="multiselect";break;case"h_alignment":case"horizAlignmentWithDeviceSwitcher":t="h_alignment";break;case"h_text_alignment":case"horizTextAlignmentWithDeviceSwitcher":t="h_text_alignment";break;case"range_simple":case"range_simple_device_switcher":t="range_simple";break;case"number_simple":t="number_simple";break;case"font_size":case"line_height":case"range_with_unit_picker":case"range_with_unit_picker_device_switcher":t="range_with_unit_picker";break;case"spacing":case"spacingWithDeviceSwitcher":t="spacing";break;case"upload":case"upload_url":t="upload";break;case"bg_position":case"bgPositionWithDeviceSwitcher":t="bg_position";break;case"verticalAlignWithDeviceSwitcher":t="v_alignment"}return 0<m("#tmpl-nimble-input___"+t).length?wp.template("nimble-input___"+t):(u.errare("problem in getInputTemplate(), missing js template in the DOM for input_type : "+e),null)}(a),control_id:n.control_id})}catch(e){return u.errare("getModuleTmpl => Error when parsing the nimble-input-wrapper template",e),o.reject("getModuleTmpl => Error when parsing the nimble-input-wrapper template"),!1}}),i};if(t.tabs){var d="",p="";_.each(t.tabs,function(e,t){var i=m.extend(!0,{},e);i=m.extend({inputs:{},title:""},i);var n=_.isEmpty(i.attributes)?"":i.attributes;d+='<li data-tab-id="section-topline-'+(+t+1)+'" '+n+'><a href="#" title="'+i.title+'"><span>'+i.title+"</span></a></li>";var o=c(i.inputs);p+='<section id="section-topline-'+(+t+1)+'">'+o+"</section>"}),l+=['<div class="tabs tabs-style-topline">',"<nav>","<ul>",d,"</ul>","</nav>",'<div class="content-wrap">',p,"</div>","</div>"].join("")}else l=c(t);return o.resolve(l).promise()}}(wp.customize,jQuery);var CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{cachedElements:{$body:s("body"),$window:s(window)},initialize:function(){var e=this;if(_.isUndefined(window.sektionsLocalizedData))throw new Error("CZRSeksPrototype => missing localized server params sektionsLocalizedData");if(!_.isFunction(r.czr_activeSkopes))throw new Error("CZRSeksPrototype => api.czr_activeSkopes");e.SECTION_ID_FOR_GLOBAL_OPTIONS="__globalOptionsSectionId",e.SECTION_ID_FOR_LOCAL_OPTIONS="__localOptionsSection",e.SECTION_ID_FOR_CONTENT_PICKER="__content_picker__",e.SECTION_ID_FOR_SITE_TMPL="__siteTmplSection",e.MAX_NUMBER_OF_COLUMNS=12,e.SETTING_UPDATE_BUFFER=100,e.TINYMCE_EDITOR_HEIGHT=100,e.defaultLocalSektionSettingValue=e.getDefaultSektionSettingValue("local"),e.localSectionsSettingId=new r.Value({}),e.registered=new r.Value([]),wp.customize.apiIsReady?e.doSektionThinksOnApiReady():r.bind("ready",function(){e.doSektionThinksOnApiReady()}),r.bind("save-request-params",function(e){s.extend(e,{local_skope_id:r.czr_skopeBase.getSkopeProperty("skope_id"),active_locations:r.czr_sektions.activeLocations()})});var t=function(){_.isArray(r.czrActiveWPEditors)&&(_.each(r.czrActiveWPEditors,function(e){wp.editor.remove(e)}),r.czrActiveWPEditors=[])};r.bind("sek-before-clean-registered",t),r.bind("czr-all-items-closed",t)},doSektionThinksOnApiReady:function(){var o=this;o.registerAndSetupDefaultPanelSectionOptions(),o.localSectionsSettingId.callbacks.add(function(e,t){try{o.setupSettingsToBeSaved()}catch(e){r.errare("Error in self.localSectionsSettingId.callbacks => self.setupSettingsToBeSaved()",e)}o.initializeHistoryLogWhenSettingsRegistered(),r.previewer.send("sek-request-active-locations")});var i=function(e,t){o.setContextualCollectionSettingIdWhenSkopeSet(e,t),r.section(o.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){e.deferred.embedded.done(function(){!0!==e.boundForLocalOptionGeneration&&(e.boundForLocalOptionGeneration=!0,e.expanded.bind(function(e){!0===e&&o.generateUI({action:"sek-generate-local-skope-options-ui"})}))})}),sektionsLocalizedData.isSiteTemplateEnabled&&r.section(o.SECTION_ID_FOR_SITE_TMPL,function(e){e.deferred.embedded.done(function(){!0!==e.siteTmplOptionsGenerated&&(e.siteTmplOptionsGenerated=!0,e.expanded.bind(function(e){!0===e&&o.generateUI({action:"sek-generate-site-tmpl-options-ui"})}))})}),r.section(o.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){!0!==e.nimbleGlobalOptionGenerated&&(o.generateUI({action:"sek-generate-global-options-ui"}),e.nimbleGlobalOptionGenerated=!0)}),o.nb_is_ready=!0,r.trigger("nimble-ready-for-current-skope")};_.isEmpty(r.czr_activeSkopes().local)||i(),r.czr_activeSkopes.callbacks.add(function(e,t){i(e,t)}),o.reactToPreviewMsg(),o.setupDnd(),o.setupTinyMceEditor(),o.schedulePrintSectionJson(),r.previewedDevice.bind(function(t){var e=_.filter(o.registered(),function(e){return"control"==e.what});_.each(e||[],function(e){r.control(e.id,function(e){e.container.find('[data-sek-device="'+t+'"]').each(function(){s(this).trigger("click")})})})}),s("#customize-notifications-area").on("click",'[data-sek-reset="true"]',function(){r.previewer.trigger("sek-reset-collection",{scope:"local"})}),o.bind("sek-ui-pre-removal",function(e){"control"==e.what&&-1<e.id.indexOf("draggable")&&r.control(e.id,function(e){e.container.find("[draggable]").each(function(){s(this).off("dragstart dragend")})}),"control"==e.what&&r.control(e.id,function(e){e.container.find("select").each(function(){_.isUndefined(s(this).data("czrSelect2"))||s(this).czrSelect2("destroy")})})}),r.bind("czr-new-registered",function(e){if(_.isUndefined(e.origin))throw new Error("czr-new-registered event => missing params.origin");if("nimble"===e.origin&&!1!==e.track){var t=o.registered(),i=s.extend(!0,[],t),n=_.findWhere(i,{id:e.id});if(!_.isEmpty(n)&&_.isEqual(n,e))throw new Error("register => duplicated element in self.registered() collection "+e.id);i.push(e),o.registered(i)}}),o.activeLocations=new r.Value([]),o.activeLocationsInfo=new r.Value([]),r.previewer.bind("sek-active-locations-in-preview",function(e){o.activeLocations(_.isObject(e)&&_.isArray(e.active_locations)?e.active_locations:[]),o.activeLocationsInfo(_.isObject(e)&&_.isArray(e.active_locs_info)?e.active_locs_info:[])}),o.setupTopBar(),o.setupSaveSectionUI(),o.setupSaveTmplUI(),o.lastClickedTargetInPreview=new r.Value,o.lastClickedTargetInPreview.bind(function(e,t){_.isObject(e)&&e.id?r.previewer.send("sek-set-double-click-target",e):r.previewer.send("sek-reset-double-click-target"),clearTimeout(o.cachedElements.$window.data("_preview_target_timer_")),o.cachedElements.$window.data("_preview_target_timer_",setTimeout(function(){o.lastClickedTargetInPreview({}),r.previewer.send("sek-reset-double-click-target")},2e4))}),r.previewer.bind("sek-clean-target-drop-zone",function(){o.lastClickedTargetInPreview({})}),s(document).keydown(function(e){e&&27===e.keyCode&&o.lastClickedTargetInPreview({})}),sektionsLocalizedData.hasActiveCachePlugin&&_.delay(function(){r.previewer.trigger("sek-notify",{notif_id:"has-active-cache-plugin",type:"info",duration:2e4,message:['<span style="color:#0075a2">',sektionsLocalizedData.i18n["You seem to be using a cache plugin."],!_.isString(sektionsLocalizedData.hasActiveCachePlugin)||sektionsLocalizedData.hasActiveCachePlugin.length<2?"":"<strong> ("+sektionsLocalizedData.hasActiveCachePlugin+")</strong><br/>"," <strong>",sektionsLocalizedData.i18n["It is recommended to disable your cache plugin when customizing your website."],"</strong>","</span>"].join("")})},2e3),r.previewer.bind("multi-items-module-refreshed",function(t){_.isUndefined(t.apiParams.control_id)||r.control(t.apiParams.control_id,function(e){_.isUndefined(e.params.sek_registration_params)||r.control(e.id).params.sek_registration_params.module_id===t.apiParams.id&&e.czr_Module.each(function(e){e.czr_Item.each(function(e){"expanded"===e.viewState()&&e.trigger("sek-request-item-focus-in-preview")})})})}),o.setupTemplateGallery()},registerAndSetupDefaultPanelSectionOptions:function(){var n=this,e=r.Panel.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}});r.panel(sektionsLocalizedData.sektionsPanelId,function(n){n.deferred.embedded.done(function(){var e=n.container.first().find("h3.accordion-section-title"),t=(n.container.first().find(".panel-meta .accordion-section-title"),['<img class="sek-nimble-logo" alt="'+n.params.title+'" src="',sektionsLocalizedData.baseUrl,"/assets/img/nimble/nimble_horizontal.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join(""));if(sektionsLocalizedData.isPro&&(t+=['<img class="sek-nimble-logo sek-pro-pastil" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_white.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),0<e.length){var i=e.find("span");e.addClass("sek-side-nimble-logo-wrapper").html(t).append(i)}})}),r.CZR_Helpers.register({origin:"nimble",what:"panel",id:sektionsLocalizedData.sektionsPanelId,title:sektionsLocalizedData.i18n["Nimble Builder"],priority:-1e3,constructWith:e,track:!1}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:n.SECTION_ID_FOR_GLOBAL_OPTIONS,title:sektionsLocalizedData.i18n["Site wide options"],panel:sektionsLocalizedData.sektionsPanelId,priority:20,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(n.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-globe sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-globe sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:n.SECTION_ID_FOR_LOCAL_OPTIONS,title:sektionsLocalizedData.i18n["Current page options"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(n.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForGlobalOptions,dirty:!1,value:sektionsLocalizedData.globalOptionDBValues,transport:"postMessage",type:"option"}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForSiteTmplOptions,dirty:!1,value:sektionsLocalizedData.siteTmplOptionDBValues,transport:"postMessage",type:"option"}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:n.SECTION_ID_FOR_CONTENT_PICKER,title:sektionsLocalizedData.i18n["Content Picker"],panel:sektionsLocalizedData.sektionsPanelId,priority:30,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(n.SECTION_ID_FOR_CONTENT_PICKER,function(e){"resolved"!=r.czr_initialSkopeCollectionPopulated.state()?r.czr_initialSkopeCollectionPopulated.done(function(){r.previewer.trigger("sek-pick-content",{focus:!1})}):r.previewer.trigger("sek-pick-content",{focus:!1})})}),sektionsLocalizedData.isSiteTemplateEnabled&&r.CZR_Helpers.register({origin:"nimble",what:"section",id:n.SECTION_ID_FOR_SITE_TMPL,title:sektionsLocalizedData.i18n["Site templates"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(n.SECTION_ID_FOR_SITE_TMPL,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e,{expand_first_control:!0})})})},setContextualCollectionSettingIdWhenSkopeSet:function(e,t){t=t||{},!_.isEmpty(t.local)&&r.panel(sektionsLocalizedData.sektionsPanelId).expanded()&&r.previewer.trigger("sek-pick-content"),sektionsData=r.czr_skopeBase.getSkopeProperty("sektions","local"),sektionsLocalizedData.isDevMode&&r.infoLog("::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ",sektionsData),_.isEmpty(sektionsData)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData"),_.isEmpty(sektionsData.setting_id)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id"),this.localSectionsSettingId(sektionsData.setting_id)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{setupTopBar:function(){var t=this;t.topBarId="#nimble-top-bar",t.topBarVisible=new r.Value(!1),t.topBarVisible.bind(function(e){t.levelTreeExpanded()||t.toggleTopBar(e)}),t.mouseMovedRecently=new r.Value({}),t.mouseMovedRecently.bind(function(e){t.topBarVisible(!_.isEmpty(e))});var e=function(e){t.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(t.cachedElements.$window.data("_scroll_move_timer_")),t.cachedElements.$window.data("_scroll_move_timer_",setTimeout(function(){t.mouseMovedRecently.set({})},4e3))};t.cachedElements.$window.on("mousemove scroll,",_.throttle(e,50)),r.previewer.bind("ready",function(){s(r.previewer.targetWindow().document).on("mousemove scroll,",_.throttle(e,50))}),t.setupLevelTree()},toggleTopBar:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?s.when(i.renderAndSetupTopBarTmpl({})).done(function(e){i.topBarContainer=e,_.delay(function(){i.cachedElements.$body.addClass("nimble-top-bar-visible")},200)}):(t=s.Deferred(),i.cachedElements.$body.removeClass("nimble-top-bar-visible"),i.topBarContainer&&i.topBarContainer.length?_.delay(function(){t.resolve()},300):t.resolve(),t.promise()).done(function(){i.topBarVisible(!1)})},renderAndSetupTopBarTmpl:function(e){var t,i=this;if(0<s(i.topBarId).length)return s(i.topBarId);try{t=wp.template("nimble-top-bar")({})}catch(e){return r.errare("Error when parsing the the top note template",e),!1}s("#customize-preview").after(s(t)),s(document).keydown(function(e){if(e.ctrlKey&&_.contains([89,90],e.keyCode))try{i.navigateHistory(90===e.keyCode?"undo":"redo")}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-add-content",i.topBarId).on("click",function(e){e.preventDefault(),r.previewer.trigger("sek-pick-content",{content_type:"module"})}),s(".sek-level-tree",i.topBarId).on("click",function(e){e.preventDefault(),i.levelTreeExpanded(!i.levelTreeExpanded())}),s("[data-nimble-history]",i.topBarId).on("click",function(e){try{i.navigateHistory(s(this).data("nimble-history"))}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-settings",i.topBarId).on("click",function(e){r.panel(sektionsLocalizedData.sektionsPanelId,function(e){i.rootPanelFocus(),e.focus()})}),s(".sek-nimble-doc",i.topBarId).on("click",function(e){e.preventDefault(),window.open(s(this).data("doc-href"),"_blank")}),s(".sek-tmpl-saving",i.topBarId).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!i.tmplDialogVisible())});var n=function(e){s(i.topBarId).length<1||sektionsLocalizedData.isDebugMode||(_.isObject(e)&&e.local_template&&"default"!==e.local_template?s(i.topBarId).find(".sek-notifications").html(['<span class="fas fa-info-circle"></span>',sektionsLocalizedData.i18n["This page uses a custom template."]].join(" ")):s(i.topBarId).find(".sek-notifications").html(""))},o=function(){r(i.localSectionsSettingId(),function(e){var t=e(),i=_.isObject(t)&&t.local_options&&t.local_options.template?t.local_options.template:null;n(i)}),r(i.getLocalSkopeOptionId()+"__template",function(e){e.bind(function(e,t){n(e)})})};return o(),r.bind("nimble-ready-for-current-skope",function(){o()}),s(i.topBarId)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{initializeHistoryLogWhenSettingsRegistered:function(){this.historyLog=new c.Value([{status:"current",value:{local:c(this.localSectionsSettingId())(),global:c(this.getGlobalSectionsSettingId())()},action:"initial"}]),this.historyLog.bind(function(e){if(!_.isEmpty(e)){var t=_.findKey(e,{status:"current"});t=Number(t),d("#nimble-top-bar").find("[data-nimble-history]").each(function(){"undo"===d(this).data("nimble-history")?d(this).attr("data-nimble-state",t<=0?"disabled":"enabled"):d(this).attr("data-nimble-state",e.length<=t+1?"disabled":"enabled")})}})},trackHistoryLog:function(e,t){var i=this,n=e.id===i.getGlobalSectionsSettingId();if(!_.isObject(t)||!_.isFunction(i.historyLog)||!_.isArray(i.historyLog()))throw c.errare("params, self.historyLog() ",t,i.historyLog()),new Error("trackHistoryLog => invalid params or historyLog value");var o,r=[],s=d.extend(!0,[],i.historyLog());_.isEmpty(t.in_sektion)?_.isEmpty(t.to_sektion)||(o=t.to_sektion):o=t.in_sektion,_.each(s,function(e){"future"!=e.status&&(d.extend(e,{status:"previous"}),r.push(e))}),r.push({status:"current",value:n?{global:e()}:{local:e()},action:_.isObject(t)&&t.action||"",sektionToRefresh:o}),i.historyLog(r)},navigateHistory:function(i){var t,n,o,r,e=this,s=d.extend(!0,[],e.historyLog()),a=[];if(_.each(s,function(e){if(_.isEmpty(r)){switch(e.status){case"previous":t=e;break;case"current":n=e;break;case"future":o=e}switch(i){case"undo":_.isEmpty(n)||_.isEmpty(t)||(r=t.value,n.sektionToRefresh,t.sektionToRefresh);break;case"redo":_.isEmpty(o)||(r=o.value,n.sektionToRefresh,o.sektionToRefresh)}}}),!_.isUndefined(r)){_.isEmpty(r.local)||(c(e.localSectionsSettingId())(e.validateSettingValue(r.local,"local"),{navigatingHistoryLogs:!0}),c.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0})),_.isEmpty(r.global)||c(e.getGlobalSectionsSettingId())(e.validateSettingValue(r.global,"global"),{navigatingHistoryLogs:!0});c.previewer.refresh(),c.previewer.trigger("sek-pick-content",{}),e.cleanRegistered(),e.cleanRegisteredLevelSettingsAfterHistoryNavigation()}var l=_.findKey(s,{status:"current"});l=Number(l),_.isNumber(l)?(_.each(s,function(e,t){switch(newLog=d.extend(!0,{},e),t=Number(t),i){case"undo":0<l&&(t===l-1?newLog.status="current":t===l&&(newLog.status="future"));break;case"redo":s.length>l+1&&(t===l?newLog.status="previous":t===l+1&&(newLog.status="current"))}a.push(newLog)}),e.historyLog(a)):c.errare("Error when navigating the history log, the current key should be a number")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(b,I){I.extend(CZRSeksPrototype,{setupLevelTree:function(){var i=this;i.levelTree=new b.Value([]),i.levelTree.bind(function(){i.levelTreeExpanded()&&i.renderOrRefreshTree()}),i.levelTreeExpanded=new b.Value(!1),i.levelTreeExpanded.bind(function(e){if(i.cachedElements.$body.toggleClass("sek-level-tree-expanded",e),e){if(i.templateGalleryExpanded(!1),i.tmplDialogVisible(!1),i.saveSectionDialogVisible&&i.saveSectionDialogVisible(!1),i.setLevelTreeValue(),_.isEmpty(i.levelTree()))return b.previewer.trigger("sek-notify",{type:"info",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["No sections to navigate"]+"</strong>","</span>"].join("")}),void i.levelTreeExpanded(!1);I("#customize-preview iframe").css("z-index",1),i.renderOrRefreshTree()}else 0<I("#nimble-level-tree").length&&_.delay(function(){I("#nimble-level-tree").remove(),I("#customize-preview iframe").css("z-index","")},300)}),i.activeLocations.bind(function(){_.isEmpty(i.levelTree())||i.renderOrRefreshTree()}),b.previewer.bind("ready",function(){i.localSectionsSettingId.callbacks.add(function(){i.levelTreeExpanded(!1),_.each([i.getGlobalSectionsSettingId(),i.localSectionsSettingId(),sektionsLocalizedData.optNameForGlobalOptions],function(e){b(e)._isBoundForNimbleLevelTree||(b(e).bind(function(e){i.setLevelTreeValue()}),b(e)._isBoundForNimbleLevelTree=!0)})})}),i.cachedElements.$body.on("click","#nimble-level-tree [data-nimb-level]",function(e){e.preventDefault(),e.stopPropagation();var i=I(e.target).closest("[data-nimb-level]");b.previewer.send("sek-animate-to-level",{id:i.data("nimb-id")}),b.previewer.send("sek-clean-level-uis"),_.delay(function(){b.previewer.send("sek-display-level-ui",{id:i.data("nimb-id")});var e=i.data("nimb-id"),t=i.data("nimb-level");"column"===t||"section"===t?b.previewer.trigger("sek-edit-options",{id:e,level:t}):"module"===t&&b.previewer.trigger("sek-edit-module",{id:e,level:t})},100)}),i.cachedElements.$body.on("click","#nimble-level-tree .sek-remove-level",function(e){e.preventDefault(),e.stopPropagation();var t=I(e.target).closest("[data-nimb-level]");b.previewer.trigger("sek-remove",{level:t.data("nimb-level"),id:t.data("nimb-id"),location:t.closest('[data-nimb-level="location"]').data("nimb-id"),in_sektion:t.closest('[data-nimb-level="section"]').data("nimb-id"),in_column:t.closest('[data-nimb-level="column"]').data("nimb-id")}),t.fadeOut("slow"),i.renderOrRefreshTree()}),i.cachedElements.$body.on("click",".sek-close-level-tree",function(e){e.preventDefault(),i.levelTreeExpanded(!1)})},setLevelTreeValue:function(){var e,t,i,n,o,r=this.getGlobalSectionsSettingId(),s=this.localSectionsSettingId(),a=sektionsLocalizedData.optNameForGlobalOptions,l=!1;if(_.each([r,s,a],function(e){b.has(e)||(l=e)}),!1===l){e=b(r)(),i=_.isObject(e)?I.extend(!0,{},e):{},i=_.isEmpty(i.collection)?[]:i.collection,i=_.isArray(i)?i:[],t=b(s)(),t=_.isObject(t)?t:{},n=I.extend(!0,{},t),n=_.isEmpty(n.collection)?[]:n.collection,n=_.isArray(n)?n:[];var c,d=_.union(i,n),p=!1,u=!1;o=b(a)(),o=_.isObject(o)?o:{},t.local_options&&t.local_options.local_header_footer&&(p="nimble_local"===(c=t.local_options.local_header_footer["header-footer"])),o.global_header_footer&&!p&&"theme"!==c&&(u="nimble_global"===o.global_header_footer["header-footer"]||"nimble_global"===c);var m,f,g=I.extend(!0,[],d);g=_.filter(g,function(e,t){return!_.contains(["nimble_global_header","nimble_global_footer","nimble_local_header","nimble_local_footer"],e.id)});var h=function(e){m=_.findWhere(d,{id:"nimble_"+e+"_header"}),f=_.findWhere(d,{id:"nimble_"+e+"_footer"}),g.unshift(m),g.push(f)};p?h("local"):u&&h("global");var v,k=this.activeLocations(),y=[];_.isEmpty(k)?y=g:_.each(k,function(e){v=_.findWhere(g,{id:e}),_.isUndefined(v)||y.push(v)}),this.levelTree(y)}else b.errare("::setLevelTreeValue => a setting id is not registered ")},renderOrRefreshTree:function(){var e;if(I("#nimble-level-tree").length<1){try{e=wp.template("nimble-level-tree")({})}catch(e){return b.errare("Error when parsing the nimble-level-tree template",e),!1}I("#customize-preview").after(I(e))}I("#nimble-level-tree").find(".sek-tree-wrap").html(this.getLevelTreeHtml())},getLevelTreeHtml:function(e,t){var i=this;e=e||i.levelTree();var n,o,r,s=!1;if(!_.isArray(e)||_.isEmpty(e))return b.errare("::buildLevelTree => invalid collection param",e),r;var a='<i class="material-icons sek-remove-level" title="'+sektionsLocalizedData.i18n["Remove this element"]+'">delete_forever</i>';return r="<ul>",_.each(e,function(e){_.isUndefined(e.level)?b.errare("::buildLevelTree => missing level property",e):_.isUndefined(e.id)?b.errare("::buildLevelTree => missing id property",e):(n=e.level,"location"===(o=n)&&(s=!_.contains(i.activeLocations(),e.id)),s||(sektionsLocalizedData.i18n[n]&&(o=sektionsLocalizedData.i18n[n]),!0===e.is_nested&&(o=sektionsLocalizedData.i18n["nested section"]),a="location"!==n?a:"",r+='<li data-nimb-level="'+n+'" data-nimb-id="'+e.id+'">',r+='<div class="sek-level-infos"><div class="sek-inner-level-infos">',"module"===n&&(r+=[i.getTreeModuleIcon(e.module_type),i.getTreeModuleTitle(e.module_type)].join(" ")),r+=[" ",o,"( id :",e.id,")",a].join(" "),r+="</div></div>",_.isArray(e.collection)&&!_.isEmpty(e.collection)&&(r+=i.getLevelTreeHtml(e.collection,t)),r+="</li>"))}),r+="</ul>"},getTreeModuleIcon:function(t){var i,n={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(n)&&t===e["content-id"]&&(_.isEmpty(e.icon)||(i="http"===e.icon.substring(0,4)?e.icon:sektionsLocalizedData.moduleIconPath+e.icon,n={svg:e.icon?i:"",font:e.font_icon?e.font_icon:""}))}),_.isEmpty(n.svg)?_.isEmpty(n.font)?void 0:n.font:'<img class="sek-svg-mod-icon" src="'+n.svg+'"/>'},getTreeModuleTitle:function(t){var i={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(i)&&t===e["content-id"]&&(i=e.title)}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{setupSaveSectionUI:function(){var r=this;r.saveSectionDialogVisible=new c.Value(!1),r.saveSectionDialogVisible.bind(function(e){e&&(r.templateGalleryExpanded(!1),r.levelTreeExpanded(!1),r.tmplDialogVisible&&r.tmplDialogVisible(!1)),r.toggleSaveSectionUI(e)}),r.allSavedSections=new c.Value("_not_populated_"),r.allSavedSections.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,r.refreshSectionPickerHtml(e)):c.errare("error setupSaveSectionUI => section collection should be an object")}),r.saveSectionDialogMode=new c.Value("hidden"),r.saveSectionDialogMode.bind(function(e){_.contains(["hidden","save","update","remove","edit"],e)||(c.errare("error setupSaveSectionUI => unknown section dialog mode",e),e="save");var t,i=d("#nimble-top-section-save-ui"),n=i.find("#sek-saved-section-title"),o=i.find("#sek-saved-section-description");switch(i.find("[data-section-mode-switcher]").attr("aria-pressed",!1),i.find('[data-section-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-section-save-ui").attr("data-sek-section-dialog-mode",e),i.removeClass("sek-removal-confirmation-opened"),e){case"save":n.val(""),o.val("");break;case"update":case"edit":(t=i.find(".sek-saved-section-picker")).val("none").trigger("change"),r.setSavedSectionCollection().done(function(e){r.refreshSectionPickerHtml(),t.val(r.userSectionToEdit||"none").trigger("change"),r.userSectionToEdit=null});break;case"remove":console.log("sOOO ?",r.userSectionToRemove),(t=i.find(".sek-saved-section-picker")).val("none").trigger("change"),r.setSavedSectionCollection().done(function(e){r.refreshSectionPickerHtml(),t.val(r.userSectionToRemove||"none").trigger("change"),r.userSectionToRemove=null})}"remove"===e&&_.isEmpty(r.idOfSectionToSave)?i.addClass("sek-is-removal-only"):i.removeClass("sek-is-removal-only")})},refreshSectionPickerHtml:function(e){e=e||this.allSavedSections();var t=d("#nimble-top-section-save-ui"),i=t.find(".sek-saved-section-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var n,o,r="";_.each(e,function(e,t){_.isObject(e)&&(o=e.last_modified_date?e.last_modified_date:"",n=e.title?e.title:"section title not set",r+='<option value="'+t+'">'+[n,sektionsLocalizedData.i18n["Last modified"]+" : "+o].join(" | ")+"</option>")}),i.append(r),t.addClass("section-collection-populated")},renderSectionSaveUI:function(e){if(0<d("#nimble-top-section-save-ui").length)return d("#nimble-top-section-save-ui");try{_tmpl=wp.template("nimble-top-section-save-ui")({})}catch(e){return c.errare("Error when parsing nimble-top-section-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-section-save-ui")},maybeScheduleSectionSaveDOMEvents:function(){var i=this,n=d("#nimble-top-section-save-ui");n.data("nimble-sec-save-dom-events-scheduled")||(n.on("click","[data-section-mode-switcher]",function(e){e.preventDefault(),i.saveSectionDialogMode(d(this).data("section-mode-switcher"))}).on("change",".sek-saved-section-picker",function(e){i.reactOnSectionSelection(e,d(this))}).on("click",".sek-do-save-section",function(e){n.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e).done(function(e){n.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}))})}).on("click",".sek-do-update-section",function(e){var t=n.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e,t).done(function(e){n.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}).done(function(e){i.refreshSectionPickerHtml()}))}))}).on("click",".sek-open-remove-confirmation",function(e){n.addClass("sek-removal-confirmation-opened")}).on("click",".sek-do-remove-section",function(e){var t=n.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-section-processing-ajax"),i.removeSavedSection(e,t).done(function(e){n.removeClass("nimble-section-processing-ajax"),n.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedSectionCollection({refresh:!0})}))}).on("click",".sek-cancel-remove-section",function(e){n.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",n).on("click",function(e){e.preventDefault(),i.saveSectionDialogVisible(!1)}),n.data("nimble-sec-save-dom-events-scheduled",!0))},reactOnSectionSelection:function(e,t){var i=d("#nimble-top-section-save-ui"),n=t.val(),o=i.find("#sek-saved-section-title"),r=i.find("#sek-saved-section-description"),s="update"===this.saveSectionDialogMode()?"sek-section-update-selected":"sek-section-remove-selected";if("none"===n)o.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedSections();(a=_.isObject(a)&&!_.isArray(a)?a:{})[n]=d.extend({title:"",description:"",last_modified_date:""},a[n]||{}),o.val(a[n].title),r.val(a[n].description),i.addClass(s)}},saveOrUpdateSavedSection:function(e,t){var i=this,n=d.Deferred(),o="edit"===i.saveSectionDialogMode();if(!o&&(!i.idOfSectionToSave||_.isEmpty(i.idOfSectionToSave)))return c.errare("saveOrUpdateSavedSection => error => missing section id"),n.resolve({success:!1});e.preventDefault();var r,s=d("#sek-saved-section-title"),a=s.val(),l=d("#sek-saved-section-description").val();if(!o){if("no_match"==(r=d.extend(!0,{},i.getLevelModel(i.idOfSectionToSave))))return c.errare("saveOrUpdateSavedSection => error => no section model with id "+i.idOfSectionToSave),n.resolve({success:!1});if(r=i.preProcessSection(r),!_.isObject(r))return c.errare("::saveOrUpdateSavedSection => error => invalid sectionModel"),n.resolve({success:!1})}return _.isEmpty(a)?(s.addClass("error"),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),n.resolve({success:!1})):(d("#sek-saved-section-title").removeClass("error"),wp.ajax.post("sek_save_user_section",{nonce:c.settings.nonce.save,section_data:o?"":JSON.stringify(r),section_title:a,section_description:l,section_post_name:t||"",skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),edit_metas_only:o?"yes":"no"}).done(function(e){n.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){n.resolve({success:!1}),c.errorLog("ajax sek_save_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),n)},preProcessSection:function(e){if(!_.isObject(e))return null;var t=d.extend({},!0,e);return _.has(t,"is_nested")&&(t=_.omit(t,"is_nested")),t},removeSavedSection:function(e,t){var i=this,n=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_section",{nonce:c.settings.nonce.save,section_post_name:t}).done(function(e){n.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){n.resolve({success:!1}),c.errorLog("ajax sek_remove_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),n},toggleSaveSectionUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderSectionSaveUI({})).done(function(e){i.maybeScheduleSectionSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.saveSectionDialogMode("save"),i.cachedElements.$body.addClass("sek-save-section-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-section-ui-visible"),0<d("#nimble-top-section-save-ui").length?_.delay(function(){i.saveSectionDialogMode=i.saveSectionDialogMode?i.saveSectionDialogMode:new c.Value,i.saveSectionDialogMode("hidden"),i.saveUIContainer.remove(),i.idOfSectionToSave=null,t.resolve()},250):t.resolve(),t.promise()).done(function(){i.saveSectionDialogVisible(!1)})},setSavedSectionCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedSections()?((t.sectionCollectionPromise&&"pending"===t.sectionCollectionPromise.state()?t.sectionCollectionPromise:t.getSavedSectionCollection(e)).done(function(e){t.allSavedSections(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedSections())},getSavedSectionCollection:function(e){var t=this;return e=e||{refresh:!1},t.sectionCollectionPromise=d.Deferred(),e.refresh||"_not_populated_"===t.allSavedSections()?wp.ajax.post("sek_get_all_saved_sections",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.sectionCollectionPromise.resolve(e):(t.sectionCollectionPromise.resolve({}),_.isEmpty(e)||c.errorLog("control::getSavedSectionCollection => collection is empty or invalid"))}).fail(function(e){c.errorLog("ajax sek_get_all_saved_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.sectionCollectionPromise.resolve({})}):t.sectionCollectionPromise.resolve(t.allSavedSections()),t.sectionCollectionPromise}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{setupSaveTmplUI:function(){var r=this;r.tmplDialogVisible=new c.Value(!1),sektionsLocalizedData.isTemplateSaveEnabled&&(r.tmplDialogVisible.bind(function(e){e&&(r.templateGalleryExpanded(!1),r.levelTreeExpanded(!1),r.saveSectionDialogVisible&&r.saveSectionDialogVisible(!1)),r.toggleSaveTmplUI(e)}),r.allSavedTemplates=new c.Value("_not_populated_"),r.allSavedTemplates.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,r.refreshTmplPickerHtml(e)):c.errare("error setupSaveTmplUI => tmpl collection should be an object")}),r.allApiTemplates=new c.Value("_not_populated_"),r.tmplDialogMode=new c.Value("hidden"),r.tmplDialogMode.bind(function(e){_.contains(["hidden","save","update","remove","edit"],e)||(c.errare("::setupSaveTmplUI => unknown tmpl dialog mode",e),e="save");var t,i=d("#nimble-top-tmpl-save-ui"),n=i.find("#sek-saved-tmpl-title"),o=i.find("#sek-saved-tmpl-description");switch(i.find("[data-tmpl-mode-switcher]").attr("aria-pressed",!1),i.find('[data-tmpl-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-tmpl-save-ui").attr("data-sek-tmpl-dialog-mode",e),i.removeClass("sek-removal-confirmation-opened"),e){case"save":n.val(""),o.val("");break;case"update":case"remove":(t=i.find(".sek-saved-tmpl-picker")).val("none").trigger("change"),r.setSavedTmplCollection().done(function(e){r.refreshTmplPickerHtml(),t.val(r.tmplToRemove||"none").trigger("change"),r.tmplToRemove=null});break;case"edit":(t=i.find(".sek-saved-tmpl-picker")).val("none").trigger("change"),r.setSavedTmplCollection().done(function(e){r.refreshTmplPickerHtml(),t.val(r.tmplToEdit||"none").trigger("change"),r.tmplToEdit=null})}}))},refreshTmplPickerHtml:function(e){e=e||this.allSavedTemplates();var t=d("#nimble-top-tmpl-save-ui"),i=t.find(".sek-saved-tmpl-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var n,o,r="";_.each(e,function(e,t){_.isObject(e)&&(o=e.last_modified_date?e.last_modified_date:"",n=e.title?e.title:"template title not set",r+='<option value="'+t+'">'+[n,sektionsLocalizedData.i18n["Last modified"]+" : "+o].join(" | ")+"</option>")}),i.append(r),t.addClass("tmpl-collection-populated")},renderTmplUI:function(e){if(0<d("#nimble-top-tmpl-save-ui").length)return d("#nimble-top-tmpl-save-ui");try{_tmpl=wp.template("nimble-top-tmpl-save-ui")({})}catch(e){return c.errare("Error when parsing nimble-top-tmpl-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-tmpl-save-ui")},scheduleTmplSaveDOMEvents:function(){var i=this,n=d("#nimble-top-tmpl-save-ui");n.data("nimble-tmpl-dom-events-scheduled")||(n.on("click","[data-tmpl-mode-switcher]",function(e){e.preventDefault(),i.tmplDialogMode(d(this).data("tmpl-mode-switcher"))}),n.on("change",".sek-saved-tmpl-picker",function(e){i.reactOnTemplateSelection(e,d(this))}),n.on("click",".sek-do-save-tmpl",function(e){n.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e).done(function(e){n.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}))})}),n.on("click",".sek-do-update-tmpl",function(e){var t=n.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e,t).done(function(e){n.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}).done(function(e){i.refreshTmplPickerHtml()}))}))}),n.on("click",".sek-open-remove-confirmation",function(e){n.addClass("sek-removal-confirmation-opened")}),n.on("click",".sek-do-remove-tmpl",function(e){var t=n.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-tmpl-processing-ajax"),i.removeTemplate(e,t).done(function(e){n.removeClass("nimble-tmpl-processing-ajax"),n.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedTmplCollection({refresh:!0})}))}),n.on("click",".sek-cancel-remove-tmpl",function(e){n.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",n).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!1)}),n.data("nimble-tmpl-dom-events-scheduled",!0))},reactOnTemplateSelection:function(e,t){var i=d("#nimble-top-tmpl-save-ui"),n=t.val(),o=i.find("#sek-saved-tmpl-title"),r=i.find("#sek-saved-tmpl-description"),s="update"===this.tmplDialogMode()?"sek-tmpl-update-selected":"sek-tmpl-remove-selected";if("none"===n)o.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedTemplates();(a=_.isObject(a)&&!_.isArray(a)?a:{})[n]=d.extend({title:"",description:"",last_modified_date:""},a[n]||{}),o.val(a[n].title),r.val(a[n].description),i.addClass(s)}},saveOrUpdateTemplate:function(e,t){var i=this,n=d.Deferred();e.preventDefault();var o,r=d("#sek-saved-tmpl-title"),s=r.val(),a=d("#sek-saved-tmpl-description").val(),l=i.localSectionsSettingId();try{o=i.preProcessTmpl(c(l)())}catch(e){c.errorLog("error in ::saveOrUpdateTemplate",e),n.resolve({success:!1})}return _.isEmpty(s)?(r.addClass("error"),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),n.resolve({success:!1})):(d("#sek-saved-tmpl-title").removeClass("error"),wp.ajax.post("sek_save_user_template",{nonce:c.settings.nonce.save,tmpl_data:"edit"===i.tmplDialogMode()?"":JSON.stringify(o),tmpl_title:s,tmpl_description:a,tmpl_post_name:t||"",edit_metas_only:"edit"===i.tmplDialogMode()?"yes":"no",skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),tmpl_locations:i.getActiveLocationsForTmpl(o),tmpl_header_location:i.getHeaderOrFooterLocationIdForTmpl("header",o),tmpl_footer_location:i.getHeaderOrFooterLocationIdForTmpl("footer",o)}).done(function(e){n.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){n.resolve({success:!1}),c.errorLog("ajax sek_save_template => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}),n)},getActiveLocationsForTmpl:function(e){if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var t=[];return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&"location"===e.level&&t.push(e.id)}),t},getHeaderOrFooterLocationIdForTmpl:function(t,e){var i=this;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var n="";return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&("header"===t&&i.isHeaderLocation(e.id)||"footer"===t&&i.isFooterLocation(e.id))&&(n=e.id)}),n},preProcessTmpl:function(e){var t,i;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");return(t=d.extend(!0,{},e)).collection=[],i=this.activeLocations(),_.each(e.collection,function(e){_.isObject(e)&&e.id&&e.collection&&_.contains(i,e.id)&&!_.isEmpty(e.collection)&&t.collection.push(e)}),t},removeTemplate:function(e,t){var i=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_template",{nonce:c.settings.nonce.save,tmpl_post_name:t}).done(function(e){i.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){i.resolve({success:!1}),c.errorLog("ajax sek_remove_template => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}),i},toggleSaveTmplUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderTmplUI({})).done(function(e){i.scheduleTmplSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.tmplDialogMode("save"),i.cachedElements.$body.addClass("sek-save-tmpl-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-tmpl-ui-visible"),0<d("#nimble-top-tmpl-save-ui").length?_.delay(function(){i.tmplDialogMode=i.tmplDialogMode?i.tmplDialogMode:new c.Value,i.tmplDialogMode("hidden"),i.saveUIContainer.remove(),t.resolve()},250):t.resolve(),t.promise()).done(function(){i.tmplDialogVisible(!1)})},setSavedTmplCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedTemplates()?((t.templateCollectionPromise&&"pending"===t.templateCollectionPromise.state()?t.templateCollectionPromise:t.getSavedTmplCollection()).done(function(e){t.allSavedTemplates(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedTemplates())},getSavedTmplCollection:function(){var t=this;return t.templateCollectionPromise=d.Deferred(),wp.ajax.post("sek_get_all_saved_tmpl",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.templateCollectionPromise.resolve(e):(t.templateCollectionPromise.resolve({}),_.isEmpty(e)||c.errare("control::getSavedTmplCollection => error => tmpl collection is invalid",e))}).fail(function(e){c.errorLog("ajax sek_get_all_saved_tmpl => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.templateCollectionPromise.resolve({})}),t.templateCollectionPromise},getApiTmplCollection:function(){var t=this,i=d.Deferred(),n={};return"_not_populated_"!==t.allApiTemplates()?i.resolve(t.allApiTemplates()):sektionsLocalizedData.useAPItemplates?wp.ajax.post("sek_get_all_api_tmpl",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?n=e:c.errare("control::getApiTmplCollection => error => tmpl collection is invalid",e),t.allApiTemplates(n),i.resolve(n)}).fail(function(e){c.errorLog("ajax sek_get_all_api_tmpl => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),i.resolve({})}):(t.allApiTemplates([]),i.resolve([])),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,r){r.extend(CZRSeksPrototype,{getTmplJsonFromUserTmpl:function(e){var t=r.Deferred();return wp.ajax.post("sek_get_user_tmpl_json",{nonce:o.settings.nonce.save,tmpl_post_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),o.errorLog("ajax getTmplJsonFromUserTmpl => error",e),o.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>error when fetching the template</strong>","</span>"].join("")})}),t},getTmplJsonFromApi:function(e){var t=r.Deferred();return wp.ajax.post("sek_get_api_tmpl_json",{nonce:o.settings.nonce.save,api_tmpl_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),o.errorLog("ajax getTmplJsonFromApiTmpl => error",e),o.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>error when fetching the template</strong>","</span>"].join("")})}),t},get_gallery_tmpl_json_and_inject:function(t){var e,i=this,n=(t=r.extend({tmpl_name:"",tmpl_source:"user",tmpl_inject_mode:"replace"},t||{})).tmpl_name;!_.isEmpty(n)&&_.isString(n)||o.errare("::tmpl inject => error => invalid template name"),(e="api_tmpl"===t.tmpl_source?i.getTmplJsonFromApi(n):i.getTmplJsonFromUserTmpl(n)).done(function(e){e.success&&i.inject_tmpl_from_gallery({tmpl_name:n,template_data:e.tmpl_json,tmpl_inject_mode:t.tmpl_inject_mode})}),_.delay(function(){"pending"===e.state()&&o.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>","Template import failed","</strong>","</span>"].join("")})},3e4)},inject_tmpl_from_gallery:function(e){e=e||{};if(!(e=r.extend({tmpl_inject_mode:"replace"},e)).template_data)throw new Error("::inject_tmpl => missing remote template data");o.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),o.czr_sektions.isImportedContentEligibleForAPI({success:!0,data:e.template_data},e)?(e.template_data.data.collection=this.setIdsForImportedTmpl(e.template_data.data.collection),o.czr_sektions.doUpdateApiSettingAfter_TmplGalleryImport({success:!0,data:e.template_data},e)):o.infoLog("::inject_tmpl problem => !api.czr_sektions.isImportedContentEligibleForAPI",e)},doUpdateApiSettingAfter_TmplGalleryImport:function(e,t){if(t=t||{},o.czr_sektions.isImportedContentEligibleForAPI(e,t)){o.czr_sektions.updateAPISetting({action:"sek-inject-tmpl-from-gallery",scope:"local",injected_content:e.data,tmpl_inject_mode:t.tmpl_inject_mode}).done(function(){o.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),o.previewer.refresh(),o.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Template successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){o.errare("::doUpdateApiSettingAfter_TmplGalleryImport => error when firing ::updateAPISetting",e),o.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),o.previewer.refresh()}else o.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,e){jQuery.extend(CZRSeksPrototype,{getRevisionHistory:function(e){return wp.ajax.post("sek_get_revision_history",{nonce:r.settings.nonce.save,skope_id:e.is_local?r.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId})},setSingleRevision:function(i){var n=this,o=function(e,t){r.previewer.trigger("sek-notify",{notif_id:"restore-revision-error",type:t||"info",duration:1e4,message:['<span style="">',"<strong>",e||"","</strong>","</span>"].join("")})};wp.ajax.post("sek_get_single_revision",{nonce:r.settings.nonce.save,revision_post_id:i.revision_post_id}).done(function(e){var t=i.is_local?n.localSectionsSettingId():n.getGlobalSectionsSettingId();_.isEqual(r(t)(),e)?o(sektionsLocalizedData.i18n["This is the current version."],"info"):n.updateAPISetting({action:"sek-restore-revision",is_global_location:!i.is_local,revision_value:e}).done(function(){r.previewer.refresh()}).fail(function(e){r.errare("::setSingleRevision error when firing ::updateAPISetting",e),o(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}).fail(function(e){r.errare("::setSingleRevision ajax error",e),o(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}})}(wp.customize);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,c){c.extend(CZRSeksPrototype,{setupSettingsToBeSaved:function(){var i,o=this,e={local:{collectionSettingId:o.localSectionsSettingId()},global:{collectionSettingId:o.getGlobalSectionsSettingId()}};_.each(e,function(e,t){if(i=l.czr_skopeBase.getSkopeProperty("sektions",t).db_values,_.isEmpty(e.collectionSettingId))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");if(!l.has(e.collectionSettingId)){l.CZR_Helpers.register({what:"setting",id:e.collectionSettingId,value:o.validateSettingValue(_.isObject(i)?i:o.getDefaultSektionSettingValue(t),t),transport:"postMessage",type:"option",track:!1,origin:"nimble"});l(e.collectionSettingId,function(n){n.bind(_.debounce(function(e,t,i){if(!_.isObject(i)||!0!==i.navigatingHistoryLogs)try{o.trackHistoryLog(n,i)}catch(e){l.errare("setupSettingsToBeSaved => trackHistoryLog",e)}},1e3))})}})},validateSettingValue:function(i,n){if(!_.isObject(i))return l.errare("::validateSettingValue => validation error => the setting should be an object",i),null;if(!_.isEmpty(n)&&_.contains(["local","global"],n)){var o={},r=!1,e=[],s=function(e){l.errare(e,i),sektionsLocalizedData.isDevMode&&l.previewer.trigger("sek-notify",{type:"error",duration:6e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")}),r=!0},a=function(t){if(!r)if(_.isUndefined(t)&&_.isEmpty(o)){if(t=c.extend(!0,{},i),_.isUndefined(t.id)||_.isUndefined(t.level)){if(_.isUndefined(t.collection))return void s("validation error => the root level is missing the collection of locations");if(!_.isEmpty(t.level)||!_.isEmpty(t.id))return void s('validation error => the root level should not have a "level" or an "id" property');_.each(t,function(e,t){switch(n){case"local":if(!_.contains(["collection","local_options","fonts"],t))return void s("validation error => unauthorized option group for local setting value => "+t);break;case"global":if(!_.contains(["collection","fonts"],t))return void s("validation error => unauthorized option group for global setting value => "+t)}}),_.each(i.collection,function(e){o=t,a(e)})}}else{if(_.isUndefined(t)||!_.isObject(t))return void s("validation error => a level is invalid");if(_.isEmpty(t.id)||!_.isString(t.id))return void s("validation error => a "+t.level+" level must have a valid id");if(_.contains(e,t.id))return void s("validation error => duplicated level id : "+t.id);if(e.push(t.id),_.isEmpty(t.level)||!_.isString(t.level))return void s("validation error => a "+t.level+" level must have a level property");if(!_.contains(["location","section","column","module"],t.level))return void s('validation error => the level "'+t.level+'" is not authorized');if("module"==t.level){if(!_.isUndefined(t.collection))return void s("validation error => a module can not have a collection property")}else if(_.isUndefined(t.collection))return void s("validation error => missing collection property for level => "+t.level+" "+t.id);switch(_.isUndefined(t.ver_ini)&&l.errare("validateSettingValue() => validation error => a "+t.level+' should have a version property : "ver_ini"'),t.level){case"location":if(!_.isEmpty(o.level))return void s("validation error => the parent of location "+t.id+" should have no level set");break;case"section":if(t.is_nested&&"column"!=o.level)return void s("validation error => the nested section "+t.id+" must be child of a column");if(!t.is_nested&&"location"!=o.level)return void s("validation error => the section "+t.id+" must be child of a location");break;case"column":if("section"!=o.level)return void s("validation error => the column "+t.id+" must be child of a section");break;case"module":if("column"!=o.level)return void s("validation error => the module "+t.id+" must be child of a column")}"module"!=t.level&&_.each(t.collection,function(e){o=c.extend(!0,{},t),_.isUndefined(e)?s("validation error => undefined level "):a(e)})}};return a(),r?null:i}l.errare("::validateSettingValue => invalid scope provided.",n)},resetCollectionSetting:function(e){if(_.isEmpty(e)||!_.contains(["local","global"],e))throw new Error("resetCollectionSetting => invalid scope provided.",e);return c.extend(!0,{},this.getDefaultSektionSettingValue(e))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,n){n.extend(CZRSeksPrototype,{reactToPreviewMsg:function(){var o=this,r={},s={},a=!0,e={"sek-add-section":{callback:function(e){return l.previewedDevice("desktop"),a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},r={action:"sek-add-section",id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),before_section:e.before_section,after_section:e.after_section,is_first_section:e.is_first_section},o.updateAPISetting(r)},complete:function(e){e.apiParams.is_first_section&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),l.previewer.trigger("sek-pick-content",{id:e.apiParams?e.apiParams.id:"",content_type:"section"}),l.previewer.send("sek-animate-to-level",{id:e.apiParams.id})}},"sek-add-column":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),action:"sek-add-column",in_sektion:e.in_sektion,autofocus:e.autofocus},o.updateAPISetting(r)},complete:function(e){!1!==e.apiParams.autofocus&&l.previewer.trigger("sek-pick-content",{})}},"sek-add-module":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),action:"sek-add-module",in_sektion:e.in_sektion,in_column:e.in_column,module_type:e.content_id,before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section},o.updateAPISetting(r)},complete:function(e){l.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)}),l.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_column,location_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-remove":{callback:function(e){switch(a=!0,s={},e.level){case"section":var t=o.getLevelModel(e.id);if("no_match"===t){l.errare("reactToPreviewMsg => sek-remove-section => no sektionToRemove matched");break}r={action:"sek-remove-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:t.is_nested};break;case"column":r={action:"sek-remove-column",id:e.id,in_sektion:e.in_sektion};break;case"module":r={action:"sek-remove-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;default:l.errare("::reactToPreviewMsg => sek-remove => missing level ",e)}return o.updateAPISetting(r)},complete:function(e){if(l.previewer.trigger("sek-pick-content",{}),o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)}),"sek-remove-section"===e.apiParams.action){var t=o.getLevelModel(e.apiParams.location);_.isEmpty(t.collection)&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}}},"sek-move":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-move-section",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),newOrder:e.newOrder,from_location:e.from_location,to_location:e.to_location};break;case"column":r={action:"sek-move-column",id:e.id,newOrder:e.newOrder,from_sektion:e.from_sektion,to_sektion:e.to_sektion};break;case"module":r={action:"sek-move-module",id:e.id,newOrder:e.newOrder,from_column:e.from_column,to_column:e.to_column,from_sektion:e.from_sektion,to_sektion:e.to_sektion}}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-move-section":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),e.apiParams.from_location!=e.apiParams.to_location&&(l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.to_location}),l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.from_location}));break;case"sek-move-column":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-refresh-modules-in-column":l.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}}},"sek-move-section-up":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"up",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},o.updateAPISetting(r)},complete:function(e){l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-up",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-move-section-down":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"down",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},o.updateAPISetting(r)},complete:function(e){l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-duplicate":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-duplicate-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-duplicate-column",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;case"module":r={action:"sek-duplicate-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return o.updateAPISetting(r)},complete:function(e){var t;switch(e.apiParams.action){case"sek-duplicate-section":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),t=e.apiParams.location,e.apiParams.is_nested&&l.previewer.refresh(),l.previewer.send("sek-animate-to-level",{id:e.apiParams.id});break;case"sek-duplicate-column":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_sektion;break;case"sek-duplicate-module":l.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_column}l.previewer.trigger("sek-refresh-stylesheet",{id:t,location_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-resize-columns":function(e){return a=!0,s={},r=e,o.updateAPISetting(r)},"sek-add-content-in-new-sektion":{callback:function(e){switch(a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},(r=e).action="sek-add-content-in-new-sektion",r.id=sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),e.content_type){case"module":r.droppedModuleId=sektionsLocalizedData.prefixForSettingsNotSaved+o.guid();break;case"preset_section":l.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),l.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0})}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.content_type){case"module":l.previewer.trigger("sek-edit-module",{level:"module",id:e.apiParams.droppedModuleId});break;case"preset_section":l.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)});var t=e.location_skope_id;_.isUndefined(t)&&(t=!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:l.czr_skopeBase.getSkopeProperty("skope_id")),l.previewer.trigger("sek-refresh-stylesheet",{location_skope_id:t,is_global_location:o.isGlobalLocation(e.apiParams)}),e.apiParams.is_first_section&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),e.apiParams.sektion_to_replace&&l.previewer.trigger("sek-remove",{id:e.apiParams.sektion_to_replace,location:e.apiParams.location,in_column:e.apiParams.in_column,level:"section"})}},"sek-add-preset-section-in-new-nested-sektion":{callback:function(e){return a=!1,s={},(r=e).action="sek-add-preset-section-in-new-nested-sektion",l.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),o.updateAPISetting(r)},complete:function(e){o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)}),l.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_sektion,location_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id")}),l.previewer.trigger("sek-refresh-level",{level:"section",id:e.apiParams.in_sektion})}},"sek-pick-content":function(e){return e=_.isObject(e)?e:{},l.czr_sektions.currentContentPickerType=l.czr_sektions.currentContentPickerType||new l.Value,_.isObject(e)&&e.id&&o.lastClickedTargetInPreview({id:e.id}),a=!0,r={},s={action:"sek-generate-draggable-candidates-picker-ui",content_type:(e=e||{}).content_type||"module",was_triggered:!_.has(e,"was_triggered")||e.was_triggered,focus:!_.has(e,"focus")||e.focus},o.generateUI(s)},"sek-edit-options":function(e){return a=!0,r={},_.isEmpty(e.id)?n.Deferred(function(){this.reject("missing id")}):(s={action:"sek-generate-level-options-ui",location:e.location,level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(s))},"sek-edit-module":function(e){return a=!0,r={},s={action:"sek-generate-module-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(s)},"sek-notify":function(t){a=!1;var i=t.notif_id||"sek-notify";return o.lastNimbleNotificationId&&l.notifications.remove(o.lastNimbleNotificationId),n.Deferred(function(){l.panel(sektionsLocalizedData.sektionsPanelId,function(e){l.notifications.add(new l.Notification(i,{type:t.type||"info",message:t.message,dismissible:!0})),o.lastNimbleNotificationId=i,_.delay(function(){l.notifications.remove(i)},t.duration||5e3)}),this.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-refresh-level":function(t){return a=!0,n.Deferred(function(e){r={action:"sek-refresh-level",level:t.level,id:t.id,original_action:t.original_action,moved_level_id:t.moved_level_id},s={},e.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-refresh-stylesheet":function(t){return a=!0,t=t||{},n.Deferred(function(e){r={id:t.id},s={},e.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-toggle-save-section-ui":function(t){return a=!1,o.idOfSectionToSave=t.id,o.saveSectionDialogVisible(!0),n.Deferred(function(e){r={},s={},e.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-reset-collection":{callback:function(e){return a=!1,s={},(r=e).action="sek-reset-collection",r.scope=e.scope,o.updateAPISetting(r)},complete:function(e){l.previewer.refresh(),l.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}}};_.each(e,function(i,n){l.previewer.bind(n,function(t){var e;if(_.isFunction(i))e=i;else{if(!_.isFunction(i.callback))return void l.errare("::reactToPreviewMsg => invalid callback for action "+n);e=i.callback}"sek-notify"!==n&&(o.templateGalleryExpanded(!1),o.tmplDialogVisible(!1));try{e(t).done(function(e){e=e||{},a?l.previewer.send(n,{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:l.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:r,uiParams:s,cloneId:!_.isEmpty(e.cloneId)&&e.cloneId,all_params:t}):l.previewer.trigger([n,"done"].join("_"),{apiParams:r,uiParams:s}),o.trigger([n,"done"].join("_"),t)}).fail(function(e){l.errare("reactToPreviewMsg => problem or error when running action "+n,e),!_.isEmpty(e)&&sektionsLocalizedData.isDevMode&&l.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")})})}catch(e){l.errare("reactToPreviewMsg => error when receiving "+n,e)}})}),_.each(e,function(t,i){l.previewer.bind([i,"done"].join("_"),function(e){if(_.isFunction(t.complete))try{t.complete(e)}catch(e){l.errare("reactToPreviewMsg done => error when receiving "+[i,"done"].join("_"),e)}})})},schedulePrintSectionJson:function(){var i=this;l.previewer.bind("sek-to-json",function(e){var t=n.extend(!0,{},i.getLevelModel(e.id));console.log(JSON.stringify(i.cleanIds(t)))})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(k,y){y.extend(CZRSeksPrototype,{generateUI:function(e){var t=this,i=y.Deferred();switch(_.isEmpty(e.action)&&i.reject("generateUI => missing action"),e.action){case"sek-generate-module-ui":try{i=t.generateUIforFrontModules(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-level-options-ui":try{i=t.generateUIforLevelOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-draggable-candidates-picker-ui":t.cleanRegistered();try{i=t.generateUIforDraggableContent(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}k.czr_sektions.currentContentPickerType(e.content_type||"module");break;case"sek-generate-local-skope-options-ui":t.cleanRegistered();try{i=t.generateUIforLocalSkopeOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-site-tmpl-options-ui":t.cleanRegistered();try{i=t.generateUIforSiteTmplOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-global-options-ui":t.cleanRegistered();try{i=t.generateUIforGlobalOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}}return"pending"==i.state()?i.resolve().promise():i.promise()},updateAPISettingAndExecutePreviewActions:function(a){if(!_.isEmpty(a.settingParams)&&_.has(a.settingParams,"to")){var l,c=this,e=a.settingParams.to,t=null,d=!1;if(!_.isEmpty(a.settingParams.args)&&_.has(a.settingParams.args,"moduleRegistrationParams")){var p=a.settingParams.args.moduleRegistrationParams.control,i=a.settingParams.args.moduleRegistrationParams.id,n=p.czr_Module(i);if(_.isEmpty(n)?k.errare("updateAPISettingAndExecutePreviewActions => missing parentModuleInstance",a):(t=n.module_type,d=n.isMultiItem()),!d&&_.isObject(e)?l=c.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!1}):(l=[],_.each(e,function(e){l.push(c.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!0}))})),_.isEmpty(a.defaultPreviewAction))k.errare("updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.",a);else{var u,m="refresh_stylesheet"===a.defaultPreviewAction,f="refresh_markup"===a.defaultPreviewAction,g="refresh_fonts"===a.defaultPreviewAction,h="refresh_preview"===a.defaultPreviewAction,o=a.settingParams.args.input_changed,v=function(){return u&&_.isString(u.refresh_markup)&&"true"!==u.refresh_markup&&"false"!==u.refresh_markup};_.isUndefined(o)||(u=c.getInputRegistrationParams(o,t),_.isUndefined(u.refresh_stylesheet)||(m=Boolean(u.refresh_stylesheet)),_.isUndefined(u.refresh_markup)||(f=v()?u.refresh_markup:Boolean(u.refresh_markup)),_.isUndefined(u.refresh_fonts)||(g=Boolean(u.refresh_fonts)),_.isUndefined(u.refresh_preview)||(h=Boolean(u.refresh_preview)));var r=function(){if(!0===a.isGlobalOptions){if(_.isEmpty(a.options_type))return void k.errare("updateAPISettingAndExecutePreviewActions => error when updating the global options => missing options_type");var e=k(sektionsLocalizedData.optNameForGlobalOptions)(),t=y.extend(!0,{},_.isObject(e)?e:{}),i={};if(_.each(l||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(i[t]=e)}),t[a.options_type]=i,k(sektionsLocalizedData.optNameForGlobalOptions)(t),!1!==h&&k.previewer.refresh(),!0===g){var n=a.settingParams.args.input_value;if(!_.isString(n))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",n);c.updateGlobalGFonts(n)}!0===m&&k.previewer.send("sek-refresh-stylesheet",{local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),location_skope_id:sektionsLocalizedData.globalSkopeId})}else{if(!0!==a.isSiteTemplateOptions)return c.updateAPISetting({action:a.uiParams.action,id:a.uiParams.id,value:l,in_column:a.uiParams.in_column,in_sektion:a.uiParams.in_sektion,options_type:a.options_type,settingParams:a.settingParams}).done(function(e){var t;!0===m&&k.previewer.send("sek-refresh-stylesheet",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-stylesheet",id:a.uiParams.id,level:a.uiParams.level}}),d&&a.settingParams.args.inputRegistrationParams&&_.isFunction(a.settingParams.args.inputRegistrationParams.input_parent)&&(t=a.settingParams.args.inputRegistrationParams.input_parent.id);var i=function(){k.previewer.send("sek-refresh-level",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-level",id:a.uiParams.id,level:a.uiParams.level,changed_item_id:t,control_id:p.id,is_multi_items:d},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})};if(!0===f&&i(),v()){var n=a.settingParams.args.input_value;if(!_.isString(n))throw new Error("::updateAPISettingAndExecutePreviewActions => _doUpdateWithRequestedAction => refreshMarkupWhenNeededForInput => html content is not a string.");c.htmlIncludesElementsThatNeedAnAjaxRefresh(n)?i():k.previewer.send("sek-update-html-in-selector",{selector:u.refresh_markup,changed_item_id:t,is_multi_items:d,html:n,id:a.uiParams.id,location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-update-html-in-selector",id:a.uiParams.id,level:a.uiParams.level},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})}!0===h&&k.previewer.refresh()}).fail(function(e){k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated",e),k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated => params ",a)});if(_.isEmpty(a.options_type))return void k.errare("updateAPISettingAndExecutePreviewActions => error when updating the site template options => missing options_type");var o=k(sektionsLocalizedData.optNameForSiteTmplOptions)(),r=y.extend(!0,{},_.isObject(o)?o:{}),s={};_.each(l||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(s[t]=e)}),r[a.options_type]=s,k(sektionsLocalizedData.optNameForSiteTmplOptions)(r),!1!==h&&k.previewer.refresh()}};if(!0===g){var s=a.settingParams.args.input_value;if(!_.isString(s))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",s);!0===a.isGlobalOptions?r():c.updateAPISetting({action:"sek-update-fonts",font_family:s,is_global_location:c.isGlobalLocation(a.uiParams)}).always(function(){r().then(function(){c.updateAPISetting({action:"sek-update-fonts",is_global_location:c.isGlobalLocation(a.uiParams)})})})}else r()}}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated",a)}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated",a)},updateGlobalGFonts:function(e){var t=k(sektionsLocalizedData.optNameForGlobalOptions)(),i=y.extend(!0,{},_.isObject(t)?t:{}),n=this.sniffGlobalGFonts(i);!_.isEmpty(e)&&_.isString(e)&&-1<e.indexOf("gfont")&&!_.contains(n,e)&&n.push(e),i.fonts=n,k(sektionsLocalizedData.optNameForGlobalOptions)(i)},sniffGlobalGFonts:function(e){var i=[],n=function(e){_.each(e,function(e,t){"fonts"!==t&&(_.isString(t)&&-1<t.indexOf("font_family")&&-1<e.indexOf("gfont")&&!_.contains(i,e)&&i.push(e),(_.isArray(e)||_.isObject(e))&&n(e))})};return(_.isArray(e)||_.isObject(e))&&n(e),i},normalizeAndSanitizeSingleItemInputValues:function(o){var i,r={},n={},s=null,a=this;return _.each(o.item_value,function(e,t){var i,n;"title"!==t&&((o.is_multi_items||"id"!==t)&&(null!==o.parent_module_type&&"id"!==t&&"no_default_value_specified"===(s=a.getInputDefaultValue(t,o.parent_module_type))&&k.infoLog("::normalizeAndSanitizeSingleItemInputValues => missing default value for input "+t+" in module "+o.parent_module_type),i=e,n=s,(_.isBoolean(i)||_.isBoolean(n)?Boolean(i)===Boolean(n):_.isNumber(i)||_.isNumber(n)?Number(i)===Number(n):_.isString(i)||_.isString(n)?i+""==n+"":_.isObject(i)&&_.isObject(n)?_.isEqual(i,n):_.isArray(i)&&_.isArray(n)?JSON.stringify(i.sort())===JSON.stringify(n.sort()):i===n)||(_.isString(e)||_.isObject(e))&&_.isEmpty(e)||(r[t]=e)))}),_.each(r,function(e,t){switch(a.getInputType(t,o.parent_module_type)){case"text":case"textarea":case"check":case"gutencheck":case"select":case"radio":case"number":case"upload":case"upload_url":case"color":case"wp_color_alpha":case"wp_color":case"content_picker":case"detached_tinymce_editor":case"nimble_tinymce_editor":case"password":case"range":case"range_slider":case"hidden":case"h_alignment":case"h_text_alignment":case"spacing":case"bg_position":case"v_alignment":case"font_size":case"line_height":case"font_picker":default:i=e}n[t]=i}),n},isUIControlAlreadyRegistered:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"===e.what}),i=!1;return _.isEmpty(e)?i=k.control.has(t):(i=!0,1<e.length&&k.errare("isUIControlAlreadyRegistered => why is this control registered more than once ? => "+t)),i},htmlIncludesElementsThatNeedAnAjaxRefresh:function(e){var t=e.match(/\[+([\w_-])+/g),i=e.match(/\{\{+([\w_-])+/g),n=e.match(/<script[\s\S]*?>[\s\S]*?<\/script>/gi),o=[],r=[];if(t)for(var s=0;s<t.length;s++){var a=t[s].replace(/^\[+/g,"");-1===o.indexOf(a)&&o.push(a)}if(i)for(var l=0;l<i.length;l++){var c=i[l].replace(/^\[+/g,"");-1===r.indexOf(c)&&r.push(c)}return!_.isEmpty(o)||!_.isEmpty(r)||!_.isEmpty(n)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,a){a.extend(CZRSeksPrototype,{generateUIforDraggableContent:function(r,e){var n=this,i={};a.extend(i,{sek_content_type_switcher_module:{settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+"_sek_content_type_switcher_ui",module_type:"sek_content_type_switcher_module",controlLabel:n.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),priority:10,settingValue:{content_type:r.content_type}},sek_module_picker_module:{settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+"_sek_draggable_modules_ui",module_type:"sek_module_picker_module",controlLabel:n.getRegisteredModuleProperty("sek_module_picker_module","name"),content_type:"module",priority:20,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_my_sections_sec_picker_module:{settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+n.guid()+"_sek_draggable_sections_ui",module_type:"sek_my_sections_sec_picker_module",controlLabel:n.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),content_type:"section",expandAndFocusOnInit:!1,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>',is_new:!0}}),_.each(["sek_intro_sec_picker_module","sek_features_sec_picker_module","sek_about_sec_picker_module","sek_contact_sec_picker_module","sek_team_sec_picker_module","sek_column_layouts_sec_picker_module","sek_header_sec_picker_module","sek_footer_sec_picker_module"],function(e,t){i[e]={settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+n.guid()+"_sek_draggable_sections_ui",module_type:e,controlLabel:n.getRegisteredModuleProperty(e,"name"),content_type:"section",expandAndFocusOnInit:0===t,priority:30,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'}});var t=_.keys(i)[0],o=i[t].settingControlId;return n.isUIControlAlreadyRegistered(o)?s.control(o,function(t){t.focus({completeCallback:function(){var e=t.container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}})}):(_do_register_=function(){_.each(i,function(o,e){s.has(o.settingControlId)||(s(o.settingControlId,function(e){e.bind(function(e,t){s.errare("generateUIforDraggableContent => the setting() should not changed")})}),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:o.settingControlId,dirty:!1,value:o.settingValue||{},transport:"postMessage",type:"_nimble_ui_"})),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:n.SECTION_ID_FOR_CONTENT_PICKER,priority:o.priority||10,settings:{default:o.settingControlId},track:!1}).done(function(){s.control(o.settingControlId,function(e){e.content_type=o.content_type,!0===r.focus&&e.focus({completeCallback:function(){}});var t=e.container.find("label > .customize-control-title"),i=t.html();if(t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),o.is_new){var n=t.html();t.html(n+' <span class="sek-new-label">New!</span>')}_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),"section"===e.content_type?(e.container.attr("data-sek-expanded","false"),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&e.container.addClass("sek-expand-on-init")):e.container.attr("data-sek-accordion","no")})})}),s.trigger("nimble-modules-and-sections-controls-registered")},s.section(n.SECTION_ID_FOR_CONTENT_PICKER,function(e){_do_register_();var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.prepend('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),0<i.length&&i.find(".sek-level-option-icon").length<1&&i.find(".customize-action").after('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e,{expand_first_control:!1}),e.container.find(".customize-control.sek-expand-on-init").find("label > .customize-control-title").trigger("click")})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,p){p.extend(CZRSeksPrototype,{generateUIforFrontModules:function(r,e){var s=this;_.isEmpty(r.id)&&e.reject("generateUI => missing id");var i=s.getLevelProperty({property:"value",id:r.id}),t=s.getLevelProperty({property:"module_type",id:r.id}),n=s.getRegisteredModuleProperty(t,"name");_.isEmpty(t)&&e.reject("generateUI => module => invalid module_type");var o={};if(!0===s.getRegisteredModuleProperty(t,"is_father")){var a=s.getRegisteredModuleProperty(t,"children");if(_.isEmpty(a))throw new Error("::generateUIforFrontModules => a father module "+t+" is missing children modules ");_.each(a,function(e,t){o[t]={settingControlId:r.id+"__"+t,module_type:e,controlLabel:s.getRegisteredModuleProperty(e,"name")}})}else o.__no_option_group_to_be_updated_by_children_modules__={settingControlId:r.id,module_type:t,controlLabel:n};var l=_.keys(o)[0],c=o[l].settingControlId;return s.isUIControlAlreadyRegistered(c)?d.control(c).focus({completeCallback:function(){var e=d.control(c).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(s.cleanRegistered(),_do_register_=function(){_.each(o,function(n,o){if(!d.has(n.settingControlId)){var t=function(e,t,i){try{s.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_markup",uiParams:_.extend(r,{action:"sek-set-module-value"}),options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){d.errare("::generateUIforFrontModules => Error in updateAPISettingAndExecutePreviewActions",e)}};d(n.settingControlId,function(e){e.bind(_.debounce(t,s.SETTING_UPDATE_BUFFER))});var e=p.extend(!0,{},i);"__no_option_group_to_be_updated_by_children_modules__"!==o&&(e=!_.isEmpty(e)&&_.isObject(e)&&_.isObject(e[o])?e[o]:{}),d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:n.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",module_id:r.id,id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:r.id,priority:20,settings:{default:n.settingControlId}}).done(function(){}),d.control(n.settingControlId,function(e){d.control(n.settingControlId).focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=p("<div/>").html(t.html()).text();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false")})})},d.section(r.id,function(e){d.section(r.id).focus(),s.generateModuleOptionSwitcherUI(r.id,r.action),_do_register_(),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".customize-action").after('<i class="fas fa-pencil-alt sek-level-option-icon"></i>'),s.scheduleModuleAccordion.call(e,{expand_first_control:!0})}),d.CZR_Helpers.register({origin:"nimble",what:"section",id:r.id,title:sektionsLocalizedData.i18n["Content for"]+" "+n,panel:sektionsLocalizedData.sektionsPanelId,priority:1e3}).done(function(){})),e},generateModuleOptionSwitcherUI:function(e,t){var i=e+"__option_switcher";d.has(i)||(d(i,function(e){e.bind(function(e,t){d.errare("generateUIforDraggableContent => the setting() should not changed")})}),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"setting",id:i,dirty:!1,value:"",transport:"postMessage",type:"_nimble_ui_"})),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"control",module_id:e,id:i,label:"",type:"czr_module",module_type:"sek_mod_option_switcher_module",section:e,priority:10,settings:{default:i},has_accordion:!1,ui_action:t}).done(function(){d.control(i,function(e){e.deferred.embedded.done(function(){e.container.find(".customize-control-title").hide(),e.container.attr("data-sek-accordion","no")})})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{generateUIforLevelOptions:function(s,e){var a=this,l=a.getLevelProperty({property:"options",id:s.id});l=_.isObject(l)?l:{};var t={};c.trigger("nb_setup_level_ui_registration_params",{params:s,modulesRegistrationParams:t}),d.extend(t,{bg:{settingControlId:s.id+"__bg_options",module_type:"sek_level_bg_module",controlLabel:sektionsLocalizedData.i18n["Background settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">gradient</i>'}}),"section"===s.level&&d.extend(t,{level_text:{settingControlId:s.id+"__text_options",module_type:"sek_level_text_module",controlLabel:sektionsLocalizedData.i18n["Text settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">text_format</i>'}}),d.extend(t,{border:{settingControlId:s.id+"__border_options",module_type:"sek_level_border_module",controlLabel:sektionsLocalizedData.i18n["Borders settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">rounded_corner</i>'},spacing:{settingControlId:s.id+"__spacing_options",module_type:"sek_level_spacing_module",controlLabel:sektionsLocalizedData.i18n["Padding and margin settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">center_focus_weak</i>'},anchor:{settingControlId:s.id+"__anchor_options",module_type:"sek_level_anchor_module",controlLabel:sektionsLocalizedData.i18n["Custom anchor ( CSS ID ) and CSS classes for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-anchor sek-level-option-icon"></i>'},visibility:{settingControlId:s.id+"__visibility_options",module_type:"sek_level_visibility_module",controlLabel:sektionsLocalizedData.i18n["Device visibility settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="far fa-eye sek-level-option-icon"></i>'},height:{settingControlId:s.id+"__height_options",module_type:"sek_level_height_module",controlLabel:sektionsLocalizedData.i18n["Height, vertical alignment, z-index for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-vertical sek-level-option-icon"></i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{animation:{settingControlId:s.id+"__animate_options",module_type:"sek_level_animation_module",controlLabel:sektionsLocalizedData.i18n["Animation settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">movie_filter</i>',isPro:!0}}),"section"===s.level&&(d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_section",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),d.extend(t,{breakpoint:{settingControlId:s.id+"__breakpoint_options",module_type:"sek_level_breakpoint_module",controlLabel:sektionsLocalizedData.i18n["Responsive settings : breakpoint, column direction"],icon:'<i class="material-icons sek-level-option-icon">devices</i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{sec_custom_css:{settingControlId:s.id+"__sec_custom_css",module_type:"sek_level_cust_css_section",controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>',isPro:!0}})),"column"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_column",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),"module"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_module",controlLabel:sektionsLocalizedData.i18n["Width and horizontal alignment for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}});var i=_.keys(t)[0],n=t[i].settingControlId;return a.isUIControlAlreadyRegistered(n)?c.control(n).focus({completeCallback:function(){var e=c.control(n).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(a.cleanRegistered(),_do_register_=function(){_.each(t,function(n,o){if(a.isUIControlAlreadyRegistered(n.settingControlId))c.section(c.control(n.settingControlId).section()).expanded(!0);else{if(!c.has(n.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforLevelOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};c(n.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=l[o]||{},i=a.getModuleStartingValue(n.module_type);if("no_starting_value"!==i&&_.isObject(i)){var r=d.extend(!0,{},i);e=d.extend(r,e)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,level_id:s.id,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:s.id,priority:20,settings:{default:n.settingControlId}}).done(function(){}),c.control(n.settingControlId,function(e){!0===n.expandAndFocusOnInit&&e.focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),n.isPro&&!sektionsLocalizedData.isPro&&t.append(['<img class="sek-pro-icon-next-title" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_orange.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})}})},c.section(s.id,function(e){_do_register_(),"module"===s.level&&a.generateModuleOptionSwitcherUI(s.id,s.action),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.find(".customize-action").after('<i class="fas fa-sliders-h sek-level-option-icon"></i>'),a.scheduleModuleAccordion.call(e,{expand_first_control:!1})}),c.CZR_Helpers.register({origin:"nimble",what:"section",id:s.id,title:sektionsLocalizedData.i18n["Settings for the"]+" "+s.level,panel:sektionsLocalizedData.sektionsPanelId,priority:10}).done(function(){})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{getLocalSkopeOptionId:function(){var e=c.czr_skopeBase.getSkopeProperty("skope_id");return _.isEmpty(e)?(c.errare("czr_sektions::getLocalSkopeOptionId => empty skope_id "),""):sektionsLocalizedData.prefixForSettingsNotSaved+e+"__localSkopeOptions"},generateUIforLocalSkopeOptions:function(s,e){var a=this,i=a.getLocalSkopeOptionId();if(a.isUIControlAlreadyRegistered(i))return e;if(a.localOptionsRegistrationParams={},_.isUndefined(sektionsLocalizedData.localOptionsMap)||!_.isObject(sektionsLocalizedData.localOptionsMap))return c.errare("::generateUIforGlobalOptions => missing or invalid localOptionsMap"),e;!0===s.clean_settings&&a.cleanRegisteredLocalOptionSettings(),_.each(sektionsLocalizedData.localOptionsMap,function(e,t){switch(t){case"template":a.localOptionsRegistrationParams[t]={settingControlId:i+"__template",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page template"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">check_box_outline_blank</i>'};break;case"local_header_footer":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"widths":a.localOptionsRegistrationParams[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Inner and outer widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"custom_css":a.localOptionsRegistrationParams[t]={settingControlId:i+"__custom_css",module_type:e,controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>'};break;case"local_performances":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"local_reset":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections in this page"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"local_revisions":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of local sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"import_export":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;default:c.errare("::generateUIforLocalOptions => an option group could not be registered => "+e,t)}});var t=c(a.localSectionsSettingId())(),l=d.extend(!0,{},_.isObject(t.local_options)?t.local_options:{});return _do_register_=function(){_.each(a.localOptionsRegistrationParams,function(n,o){var e=a.getModuleStartingValue(n.module_type),t=_.isObject(l[o])?l[o]:{};if(!c.has(n.settingControlId)){var i=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_preview",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforLocalSkopeOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};if(c(n.settingControlId,function(e){e.bind(_.debounce(i,a.SETTING_UPDATE_BUFFER))}),"no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);t=d.extend(r,t)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:t,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:a.SECTION_ID_FOR_LOCAL_OPTIONS,priority:10,settings:{default:n.settingControlId}}).done(function(){c.control(n.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{generateUIforGlobalOptions:function(s,e){var a=this,i=sektionsLocalizedData.prefixForSettingsNotSaved+sektionsLocalizedData.optNameForGlobalOptions;if(a.isUIControlAlreadyRegistered(i))return e;var n={};if(_.isUndefined(sektionsLocalizedData.globalOptionsMap)||!_.isObject(sektionsLocalizedData.globalOptionsMap))return c.errare("::generateUIforGlobalOptions => missing or invalid globalOptionsMap"),e;_.each(sektionsLocalizedData.globalOptionsMap,function(e,t){switch(t){case"global_text":n[t]={settingControlId:i+"__global_text",module_type:e,controlLabel:sektionsLocalizedData.i18n["Global text options for Nimble sections"],icon:'<i class="material-icons sek-level-option-icon">text_format</i>'};break;case"widths":n[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide inner and outer sections widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"breakpoint":n[t]={settingControlId:i+"__breakpoint",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide breakpoint for Nimble sections"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">devices</i>'};break;case"global_header_footer":n[t]={settingControlId:i+"__header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"performances":n[t]={settingControlId:i+"__performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"recaptcha":n[t]={settingControlId:i+"__recaptcha",module_type:e,controlLabel:sektionsLocalizedData.i18n["Protect your contact forms with Google reCAPTCHA"],icon:'<i class="material-icons sek-level-option-icon">security</i>'};break;case"global_revisions":n[t]={settingControlId:i+"__global_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of global sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"global_imp_exp":n[t]={settingControlId:i+"__global_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import global sections"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;case"global_reset":n[t]={settingControlId:i+"__global_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections displayed in global locations"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"beta_features":n[t]={settingControlId:i+"__beta_features",module_type:e,controlLabel:sektionsLocalizedData.i18n["Beta features"],icon:'<i class="material-icons sek-level-option-icon">widgets</i>'};break;default:c.errare("::generateUIforGlobalOptions => an option group could not be registered => "+e,t)}});var l=sektionsLocalizedData.globalOptionDBValues;return _do_register_=function(){_.each(n,function(n,o){if(!c.has(n.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isGlobalOptions:!0,defaultPreviewAction:"refresh_preview",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforGlobalOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};c(n.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=a.getModuleStartingValue(n.module_type),i=_.isObject(l)&&!_.isEmpty(l[o])?l[o]:{};if("no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);i=d.extend(r,i)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:i,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:a.SECTION_ID_FOR_GLOBAL_OPTIONS,priority:20,settings:{default:n.settingControlId},track:!1}).done(function(){c.control(n.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{generateUIforSiteTmplOptions:function(s,e){var a=this,i=sektionsLocalizedData.prefixForSettingsNotSaved+sektionsLocalizedData.optNameForSiteTmplOptions;if(a.isUIControlAlreadyRegistered(i))return e;var n={};if(_.isUndefined(sektionsLocalizedData.siteTmplOptionsMap)||!_.isObject(sektionsLocalizedData.siteTmplOptionsMap))return c.errare("::generateUIforSiteTmplOptions => missing or invalid siteTmplOptionsMap"),e;_.each(sektionsLocalizedData.siteTmplOptionsMap,function(e,t){switch(t){case"site_templates":n[t]={settingControlId:i+"__site_templates",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site templates"],icon:""};break;default:c.errare("::generateUIforSiteTmplOptions => an option group could not be registered => "+e,t)}});var l=sektionsLocalizedData.siteTmplOptionDBValues;return _do_register_=function(){_.each(n,function(n,o){if(!c.has(n.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isSiteTemplateOptions:!0,defaultPreviewAction:"refresh_preview",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforSiteTmplOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};c(n.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=a.getModuleStartingValue(n.module_type),i=_.isObject(l)&&!_.isEmpty(l[o])?l[o]:{};if("no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);i=d.extend(r,i)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:i,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:a.SECTION_ID_FOR_SITE_TMPL,priority:20,settings:{default:n.settingControlId},track:!1}).done(function(){c.control(n.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(f,g){g.extend(CZRSeksPrototype,{updateAPISetting:function(d){var p=this;(d=d||{}).is_global_location="global"===d.scope||p.isGlobalLocation(d);var u=d.is_global_location?p.getGlobalSectionsSettingId():p.localSectionsSettingId(),m=f(u)();p.updAPISetParams={params:d,promise:g.Deferred(),newSetValue:_.isObject(m)?g.extend(!0,{},m):p.getDefaultSektionSettingValue(d.is_global_location?"global":"local"),cloneId:"",sectionInjectPromise:"_not_injection_scenario_"};return f(u,function(e){!function(){switch(p.updAPISetParams.newSetValue.collection=_.isArray(p.updAPISetParams.newSetValue.collection)?p.updAPISetParams.newSetValue.collection:p.getDefaultSektionSettingValue(d.is_global_location?"global":"local").collection,d.action){case"sek-maybe-add-missing-locations":var t,i,e=p.activeLocations();g.extend(!0,[],p.updAPISetParams.newSetValue.collection),_.each(e,function(e){t=_.findWhere(p.updAPISetParams.newSetValue.collection,{id:e}),_.isUndefined(t)&&((i=g.extend(!0,{},sektionsLocalizedData.defaultLocationModel)).id=e,f.infoLog("=> need to add missing location to api setting value",i),p.updAPISetParams.newSetValue.collection.push(i))});break;case"sek-add-section":p._updAPISet_sek_add_sektion();break;case"sek-duplicate-section":p._updAPISet_sek_duplicate_sektion();break;case"sek-remove-section":p._updAPISet_sek_remove_sektion();break;case"sek-move-section":p._updAPISet_sek_move_sektion();break;case"sek-move-section-up-down":p._updAPISet_sek_move_sektion_up_down();break;case"sek-add-column":p._updAPISet_sek_add_column();break;case"sek-remove-column":p._updAPISet_sek_remove_column();break;case"sek-duplicate-column":p._updAPISet_sek_duplicate_column();break;case"sek-resize-columns":p._updAPISet_sek_resize_column();break;case"sek-move-column":p._updAPISet_sek_move_column();break;case"sek-add-module":p._updAPISet_sek_add_module();break;case"sek-duplicate-module":p._updAPISet_sek_duplicate_module();break;case"sek-remove-module":p._updAPISet_sek_remove_module();break;case"sek-move-module":p._updAPISet_sek_move_module();break;case"sek-set-module-value":p._updAPISet_sek_set_module_value();break;case"sek-add-content-in-new-sektion":p._updAPISet_sek_add_content_in_new_sektion();break;case"sek-add-preset-section-in-new-nested-sektion":p._updAPISet_sek_add_preset_sektion_in_new_nested_sektion();break;case"sek-import-from-file":p._updAPISet_sek_import_from_file();break;case"sek-inject-tmpl-from-gallery":p._updAPISet_sek_inject_tmpl_from_gallery();break;case"sek-generate-level-options-ui":var n=p.getLevelModel(d.id,p.updAPISetParams.newSetValue.collection),o={};if("no_match"===n){f.errare("updateAPISetting => "+d.action+" => no parent sektion matched"),p.updAPISetParams.promise.reject("updateAPISetting => "+d.action+" => no parent sektion matched");break}var r=g.extend(!0,{},n.options||{});_.each(d.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(d.options_type)&&f.errare("updateAPISetting => "+d.action+" => missing options_type"),r[d.options_type]=o,n.options=r;break;case"sek-generate-local-skope-options-ui":o={};var s=g.extend(!0,{},_.isObject(p.updAPISetParams.newSetValue.local_options)?p.updAPISetParams.newSetValue.local_options:{});if(_.each(d.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(d.options_type)||!_.isString(d.options_type))f.errare("updateAPISetting => "+d.action+" => missing options_type");else{var a={};a[d.options_type]=o,p.updAPISetParams.newSetValue.local_options=g.extend(s,a)}break;case"sek-update-fonts":var l=p.sniffGFonts({is_global_location:d&&!0===d.is_global_location});!_.isEmpty(d.font_family)&&_.isString(d.font_family)&&-1<d.font_family.indexOf("gfont")&&!_.contains(l,d.font_family)&&l.push(d.font_family),p.updAPISetParams.newSetValue.fonts=l;break;case"sek-restore-revision":p.updAPISetParams.newSetValue=d.revision_value;break;case"sek-reset-collection":try{p.updAPISetParams.newSetValue=f.czr_sektions.resetCollectionSetting(d.scope)}catch(e){f.errare("sek-reset-collection => error when firing resetCollectionSetting()",e)}}if("pending"==p.updAPISetParams.promise.state()){var c=function(){var e=d.settingParams&&d.settingParams.from&&d.settingParams.to;e&&_.isEqual(d.settingParams.from,d.settingParams.to)?p.updAPISetParams.promise.reject("updateAPISetting => main sektion setting change => the new setting value is unchanged when firing action : "+d.action):!e&&_.isEqual(m,p.updAPISetParams.newSetValue)?p.updAPISetParams.promise.reject("updateAPISetting => the new setting value is unchanged when firing action : "+d.action):null!==p.validateSettingValue(p.updAPISetParams.newSetValue,d.is_global_location?"global":"local")?(f(u)(p.updAPISetParams.newSetValue,d),d.cloneId=p.updAPISetParams.cloneId,p.updAPISetParams.promise.resolve(d)):p.updAPISetParams.promise.reject("Validation problem for action "+d.action)};"_not_injection_scenario_"===p.updAPISetParams.sectionInjectPromise?(c(),"pending"===p.updAPISetParams.promise.state()&&f.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")):p.updAPISetParams.sectionInjectPromise.done(function(){c(),"pending"===p.updAPISetParams.promise.state()&&f.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")}).fail(function(e){f.errare("updateAPISetting => self.updAPISetParams.sectionInjectPromise failed",e)})}}()}),p.updAPISetParams.promise.promise()},resetColumnsWidthInSection:function(e){_.each(e.collection,function(e){e.options&&e.options.width&&e.options.width["custom-width"]&&(e.options.width=_.omit(e.options.width,"custom-width")),e.width=""})},_maybeFetchSectionsFromServer:function(){var e,t=g.Deferred();return _.isEmpty(f.sek_presetSections)?(_.isUndefined(f.sek_fetchingPresetSections)||"pending"!=f.sek_fetchingPresetSections.state()?(e=wp.ajax.post("sek_get_preset_sections",{nonce:f.settings.nonce.save}),f.sek_fetchingPresetSections=e):e=f.sek_fetchingPresetSections,e.done(function(e){f.sek_presetSections=e,t.resolve(f.sek_presetSections)}).fail(function(e){t.reject(e)})):t.resolve(f.sek_presetSections),t.promise()},getPresetSectionCollection:function(n){var o=this,r=g.Deferred();return n.is_user_section?wp.ajax.post("sek_get_user_section_json",{nonce:f.settings.nonce.save,section_post_name:n.presetSectionId}).done(function(e){if(!_.isObject(e)||_.isEmpty(e)||_.isUndefined(e.data))throw f.errare("getPresetSectionCollection => preset section type not found or empty : "+n.presetSectionId,e),new Error("getPresetSectionCollection => preset section type not found or empty");var t=g.extend({},!0,e.data);t.id=sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),t.collection=o.setPresetOrUserSectionIds(t.collection),t.ver_ini=sektionsLocalizedData.nimbleVersion,t.collection=o.setPresetSectionVersion(t.collection),r.resolve(t)}).fail(function(e){r.reject(e)}):o._maybeFetchSectionsFromServer().fail(function(e){r.reject(e)}).done(function(e){var t=g.extend(!0,{},_.isObject(e)?e:{});if(_.isEmpty(t))throw new Error("getPresetSectionCollection => Invalid collection");if(_.isEmpty(t[n.presetSectionId]))throw new Error('getPresetSectionCollection => the preset section : "'+n.presetSectionId+'" has not been found in the collection');var i=t[n.presetSectionId];i.collection=o.setPresetOrUserSectionIds(i.collection),i.ver_ini=sektionsLocalizedData.nimbleVersion,i.collection=o.setPresetSectionVersion(i.collection),r.resolve(i)}),r.promise()},setPresetOrUserSectionIds:function(e){var t=this;return _.isArray(e)&&_.each(e,function(e){e.id=sektionsLocalizedData.prefixForSettingsNotSaved+t.guid(),_.isArray(e.collection)&&t.setPresetOrUserSectionIds(e.collection)}),e},setPresetSectionVersion:function(e){var t=this;return _.each(e,function(e){e.ver_ini=sektionsLocalizedData.nimbleVersion,_.isArray(e.collection)&&t.setPresetSectionVersion(e.collection)}),e},preparePresetSectionForInjection:function(o){var i=this,n={},r=g.Deferred();i.maybeGenerateNewItemIdsForCrudModules(o);var s=function(e){return _.each(e,function(e,t){_.isObject(e)||_.isArray(e)?s(e):_.isString(e)&&-1!=e.indexOf("__img_url__")&&(_.has(n,e)||(n[e]=i.importAttachment(e.replace("__img_url__",""))))}),n},a=function(i,n){return _.each(i,function(e,t){_.isObject(e)||_.isArray(e)?a(e,n):_.isString(e)&&-1!=e.indexOf("__img_url__")&&_.has(n,e)&&_.isObject(n[e])&&(i[t]=n[e].id)}),o};return i.whenAllPromisesInParallel(s(o)).done(function(e){var t=a(o,e);r.resolve(t)}).fail(function(e){r.reject(e)}),r.promise()}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(y,b){b.extend(CZRSeksPrototype,{_updAPISet_sek_add_sektion:function(){var i,e,t,n,o=this;if(i=o.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.location))throw new Error("updateAPISetting => "+i.action+" => missing location");if(!0===i.is_nested)e=o.getLevelModel(i.in_column,o.updAPISetParams.newSetValue.collection),"no_match"==(t=o.getLevelModel(i.in_sektion,o.updAPISetParams.newSetValue.collection))?o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no grand parent sektion found"):!0===t.is_nested?(o.updAPISetParams.promise.reject(""),y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")})):"no_match"==e?(y.errare("updateAPISetting => "+i.action+" => no parent column matched"),o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched")):(e.collection=_.isArray(e.collection)?e.collection:[],e.collection.push({id:i.id,level:"section",collection:[{id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion}));else if("no_match"==(n=o.getLevelModel(i.location,o.updAPISetParams.newSetValue.collection)))y.errare("updateAPISetting => "+i.action+" => no location matched"),o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no location matched");else{var r=0;n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){i.before_section===e.id&&(r=t),i.after_section===e.id&&(r=t+1)}),n.collection=_.isArray(n.collection)?n.collection:[],n.collection.splice(r,0,{id:i.id,level:"section",collection:[{id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion})}},_updAPISet_sek_duplicate_sektion:function(){var t,e,i,n,o=this;if(t=o.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if(_.isEmpty(t.location))throw new Error("updateAPISetting => "+t.action+" => missing location");try{n=o.cloneLevel(t.id)}catch(e){return void y.errare("updateAPISetting => "+t.action,e)}o.maybeGenerateNewItemIdsForCrudModules(n);var r=o.getLevelPositionInCollection(t.id,o.updAPISetParams.newSetValue.collection);if(!0===t.is_nested){if("no_match"==(e=o.getLevelModel(t.in_column,o.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no parent column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[],e.collection.splice(parseInt(r+1,10),0,n)}else{if("no_match"==(i=o.getLevelModel(t.location,o.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.isArray(i.collection)?i.collection:[],i.collection.splice(parseInt(r+1,10),0,n)}o.updAPISetParams.cloneId=n.id},_updAPISet_sek_remove_sektion:function(){var t,e,i,n=this;if(!0===(t=n.updAPISetParams.params).is_nested)"no_match"!=(e=n.getLevelModel(t.in_column,n.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):y.errare("updateAPISetting => "+t.action+" => no parent column matched");else{if("no_match"==(i=n.getLevelModel(t.location,n.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.filter(i.collection,function(e){return e.id!=t.id})}},_updAPISet_sek_move_sektion:function(){var t,i,n,o=this;t=o.updAPISetParams.params;var e,r,s=o.getLevelModel(t.to_location,o.updAPISetParams.newSetValue.collection);if(_.isEmpty(s)||"no_match"==s)throw new Error("updateAPISetting => "+t.action+" => missing target location");if(t.from_location!=t.to_location){var a=o.getLevelModel(t.from_location,o.updAPISetParams.newSetValue.collection);if(_.isEmpty(a)||"no_match"==a)throw new Error("updateAPISetting => "+t.action+" => missing source location");a.collection=_.isArray(a.collection)?a.collection:[],e=o.getLevelModel(t.id,a.collection),r=b.extend(!0,{},e),a.collection=_.filter(a.collection,function(e){return e.id!=t.id})}s.collection=_.isArray(s.collection)?s.collection:[],i=b.extend(!0,[],s.collection),n=[],_.each(t.newOrder,function(e){if(t.from_location!=t.to_location&&e==r.id)n.push(r);else{if(sektionCandidate=o.getLevelModel(e,i),_.isEmpty(sektionCandidate)||"no_match"==sektionCandidate)throw new Error("updateAPISetting => "+t.action+" => missing section candidate");n.push(sektionCandidate)}}),s.collection=n},_updAPISet_sek_move_sektion_up_down:function(){var t,e,i,n,o=this;if(t=o.updAPISetParams.params,e=o.getLevelModel(t.is_nested?t.in_column:t.location,o.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target location");e.collection=_.isArray(e.collection)?e.collection:[],i=b.extend(!0,[],e.collection),n=b.extend(!0,[],e.collection);var r=_.findIndex(i,function(e){return e.id===t.id});if(-1===r)throw new Error("updateAPISetting => "+t.action+" => invalid index");var s,a,l=t.direction||"up",c=i.length===r+1,d=0===r,p=o.activeLocationsInfo(),u=_.isArray(p)?_.findWhere(p,{id:t.location}):{};s=_.isObject(u)&&u.is_global,a=_.isObject(u)&&u.is_header_footer;var m=[];_.isArray(p)&&_.each(o.activeLocationsInfo(),function(e){e.is_global||e.is_header_footer||m.push(e.id)});var f,g=_.findIndex(m,function(e){return e===t.location}),h=!t.is_nested&&!s&&!a,v=0===g,k=m.length===g+1;h&&c&&"up"!==l&&!k?(f=m[g+1],o.getLevelModel(f,o.updAPISetParams.newSetValue.collection).collection.unshift(i[r]),e.collection.pop(),t.new_location=f):h&&d&&"up"===l&&!v?(f=m[g-1],o.getLevelModel(f,o.updAPISetParams.newSetValue.collection).collection.push(i[r]),e.collection.shift(),t.new_location=f):"up"!==l&&i.length===r+1?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved lower."]+"</strong>","</span>"].join("")}):"up"===l&&0===r?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved higher."]+"</strong>","</span>"].join("")}):(n[r]=i["up"===l?r-1:r+1],n["up"===l?r-1:r+1]=i[r],e.collection=n)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,t){t.extend(CZRSeksPrototype,{_updAPISet_sek_add_content_in_new_sektion:function(){var r,s,a,l=this;r=l.updAPISetParams.params;var e,i=0;if("no_match"==(a=l.getLevelModel(r.location,l.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+r.action+" => no location matched"),void l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no location matched");switch(a.collection=_.isArray(a.collection)?a.collection:[],_.each(a.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),r.content_type){case"module":e=l.getModuleStartingValue(r.content_id),a.collection.splice(i,0,{id:r.id,level:"section",collection:[{id:sektionsLocalizedData.prefixForSettingsNotSaved+l.guid(),level:"column",collection:[{id:r.droppedModuleId,level:"module",module_type:r.content_id,value:"no_starting_value"!==e?e:null,ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion});break;case"preset_section":l.updAPISetParams.sectionInjectPromise=t.Deferred();var n=function(e,i){var t=!1;if(!_.isEmpty(r.sektion_to_replace)){var n=l.getLevelModel(r.sektion_to_replace,l.updAPISetParams.newSetValue.collection);"no_match"===n&&(c.errare("updateAPISetting => "+r.action+" => no sektionToReplace matched"),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no sektionToReplace matched")),t=!0===n.is_nested}var o=sektionsLocalizedData.prefixForSettingsNotSaved+l.guid();r.collection_of_preset_section_id=r.collection_of_preset_section_id||[],r.collection_of_preset_section_id.push(o),t?("no_match"===(s=l.getLevelModel(r.in_column,l.updAPISetParams.newSetValue.collection))&&(c.errare("updateAPISetting => "+r.action+" => no parent column matched"),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no parent column matched")),s.collection=_.isArray(s.collection)?s.collection:[],_.each(s.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),s.collection.splice(i,0,{id:o,is_nested:!0,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})):a.collection.splice(i,0,{id:o,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})};l.getPresetSectionCollection({is_user_section:r.is_user_section,presetSectionId:r.content_id}).fail(function(e){c.errare("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()",e),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(c.errare("updateAPISetting => "+r.action+" => preset section type not found or empty : "+r.content_id,e),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => preset section type not found or empty")),t=e,l.preparePresetSectionForInjection(t).fail(function(e){l.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+r.action+" => "+e),l.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){"section"===e.collection[0].level?_.each(e.collection,function(e){n(e,i),i++}):n(e,i),l.updAPISetParams.sectionInjectPromise.resolve()})})}},_updAPISet_sek_add_preset_sektion_in_new_nested_sektion:function(){var n,o,e,r=this;if(n=r.updAPISetParams.params,"no_match"===(o=r.getLevelModel(n.in_column,r.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+n.action+" => no parent column matched"),void r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => no parent column matched");var i=0;if(o.collection=_.isArray(o.collection)?o.collection:[],_.each(o.collection,function(e,t){n.before_module_or_nested_section===e.id&&(i=t),n.after_module_or_nested_section===e.id&&(i=t+1)}),"no_match"!=(e=r.getLevelModel(n.in_sektion,r.updAPISetParams.newSetValue.collection))){if(!0===e.is_nested)return r.updAPISetParams.promise.reject(""),void c.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")});r.updAPISetParams.sectionInjectPromise=t.Deferred();r.getPresetSectionCollection({is_user_section:n.is_user_section,presetSectionId:n.content_id}).fail(function(){c.errare("updateAPISetting => "+n.action+" => Error with self.getPresetSectionCollection()",_er_),r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(c.errare("updateAPISetting => "+n.action+" => preset section type not found or empty : "+n.content_id,e),r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => preset section type not found or empty")),t=e,r.preparePresetSectionForInjection(t).fail(function(e){r.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+n.action+" => "+e),r.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){var t=function(e,t){t=t||0;var i=sektionsLocalizedData.prefixForSettingsNotSaved+r.guid();n.collection_of_preset_section_id=n.collection_of_preset_section_id||[],n.collection_of_preset_section_id.push(i),o.collection.splice(t,0,{id:i,level:"section",collection:e.collection,options:e.options||{},is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion})};"section"===e.collection[0].level?_.each(e.collection,function(e){t(e,i),i++}):t(e,i),r.updAPISetParams.sectionInjectPromise.resolve()})})}else r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => no grand parent sektion found")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{_updAPISet_sek_add_column:function(){var e,t,i=this;if(e=i.updAPISetParams.params,_.isEmpty(e.id))throw new Error("updateAPISetting => "+e.action+" => missing id");if("no_match"==(t=i.getLevelModel(e.in_sektion,i.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+e.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => no parent sektion matched");t.collection=_.isArray(t.collection)?t.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(t.collection)?i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]):(i.resetColumnsWidthInSection(t),t.collection.push({id:e.id,level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}))},_updAPISet_sek_remove_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,"no_match"!=(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection))){if(1===_.size(e.collection))return void i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["A section must have at least one column."]);e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(e)}else c.errare("updateAPISetting => "+t.action+" => no parent sektion matched")},_updAPISet_sek_duplicate_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+t.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent sektion matched");if(e.collection=_.isArray(e.collection)?e.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(e.collection))i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);else{var n;try{n=i.cloneLevel(t.id)}catch(e){return void c.errare("updateAPISetting => "+t.action,e)}i.maybeGenerateNewItemIdsForCrudModules(n);var o=i.getLevelPositionInCollection(t.id,i.updAPISetParams.newSetValue.collection);i.updAPISetParams.cloneId=n.id,e.collection.splice(parseInt(o+1,10),0,n),i.resetColumnsWidthInSection(e)}},_updAPISet_sek_resize_column:function(){var o,n=this;if(!((o=n.updAPISetParams.params).col_number<2)){var t=n.getLevelModel(o.resized_column,n.updAPISetParams.newSetValue.collection),i=n.getLevelModel(o.sister_column,n.updAPISetParams.newSetValue.collection);if("no_match"==t)return c.errare("updateAPISetting => "+o.action+" => no resized column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => no resized column matched");var r=function(e,t){var i=d.extend(!0,{},e.options||{});return i.width=_.isObject(i.width)&&i.width["custom-width"]?i.width:{},i.width["custom-width"]=t,e.options=i,n.cachedElements.$body.find('[data-sek-width-range-column-id="'+e.id+'"]').val(t).trigger("input",{is_resize_column_trigger:!0}),t},e=r(t,parseFloat(o.resizedColumnWidthInPercent));e=parseFloat(e);var s=n.getLevelModel(o.in_sektion,n.updAPISetParams.newSetValue.collection),a=_.filter(s.collection,function(e){return e.id!=t.id&&e.id!=i.id}),l=parseFloat(e.toFixed(3));_.isEmpty(a)||_.each(a,function(e){var t,i,n;currentColWidth=(t=e,i="_not_set_",n=_.isObject(t.options)?t.options:{},!_.isEmpty(n)&&n.width&&n.width["custom-width"]&&(i=parseFloat(1*n.width["custom-width"])),i),("_not_set_"===currentColWidth||!_.isNumber(1*currentColWidth)||_.isEmpty(currentColWidth+"")||currentColWidth<1)&&(currentColWidth=r(e,parseFloat((100/o.col_number).toFixed(3)))),l=parseFloat((l+currentColWidth).toFixed(3))}),r(i,parseFloat((100-l).toFixed(3)))}},_updAPISet_sek_move_column:function(){var t,i=this;t=i.updAPISetParams.params;var e,n,o=i.getLevelModel(t.to_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(o)||"no_match"==o)throw new Error("updateAPISetting => "+t.action+" => missing target sektion");if(t.from_sektion!=t.to_sektion){var r=i.getLevelModel(t.from_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],e=i.getLevelModel(t.id,r.collection),n=d.extend(!0,{},e),r.collection=_.filter(r.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(r)}o.collection=_.isArray(o.collection)?o.collection:[],originalCollection=d.extend(!0,[],o.collection),reorderedCollection=[],_.each(t.newOrder,function(e){if(t.from_sektion!=t.to_sektion&&e==n.id)reorderedCollection.push(n);else{if(columnCandidate=i.getLevelModel(e,originalCollection),_.isEmpty(columnCandidate)||"no_match"==columnCandidate)throw new Error("updateAPISetting => moveColumn => missing columnCandidate");reorderedCollection.push(columnCandidate)}}),o.collection=reorderedCollection,i.resetColumnsWidthInSection(o)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,c){c.extend(CZRSeksPrototype,{_updAPISet_sek_add_module:function(){var i,e,t,n,o=this;if(i=o.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.module_type))throw new Error("updateAPISetting => "+i.action+" => missing module_type");if("no_match"===(e=o.getLevelModel(i.in_column,o.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+i.action+" => no parent column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched");n=0,e.collection=_.isArray(e.collection)?e.collection:[],_.each(e.collection,function(e,t){i.before_module_or_nested_section===e.id&&(n=t),i.after_module_or_nested_section===e.id&&(n=t+1)});var r={id:i.id,level:"module",module_type:i.module_type,ver_ini:sektionsLocalizedData.nimbleVersion};"no_starting_value"!==(t=o.getModuleStartingValue(i.module_type))&&(r.value=t),e.collection.splice(n,0,r)},_updAPISet_sek_duplicate_module:function(){var t,e,i,n=this;if(t=n.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=n.getLevelModel(t.in_column,n.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+t.action+" => no parent column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[];try{i=n.cloneLevel(t.id)}catch(e){return l.errare("updateAPISetting => "+t.action,e),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => error when cloning the level")}n.maybeGenerateNewItemIdsForCrudModules(i);var o=n.getLevelPositionInCollection(t.id,n.updAPISetParams.newSetValue.collection);n.updAPISetParams.cloneId=i.id,e.collection.splice(parseInt(o+1,10),0,i)},_updAPISet_sek_remove_module:function(){var t,e;if(t=this.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");"no_match"!=(e=this.getLevelModel(t.in_column,this.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):l.errare("updateAPISetting => "+t.action+" => no parent column matched")},_updAPISet_sek_move_module:function(){var t,e,i,n,o=this;if(t=o.updAPISetParams.params,e=o.getLevelModel(t.to_column,o.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target column");if(t.from_column!=t.to_column){var r;if(r=o.getLevelModel(t.from_column,o.updAPISetParams.newSetValue.collection),_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],i=o.getLevelModel(t.id,o.updAPISetParams.newSetValue.collection),n=c.extend(!0,{},i),r.collection=_.filter(r.collection,function(e){return e.id!=t.id})}e.collection=_.isArray(e.collection)?e.collection:[],originalCollection=c.extend(!0,[],e.collection);var s=[];if(_.each(t.newOrder,function(e){if(t.from_column!=t.to_column&&e==n.id)s.push(n);else{if(moduleCandidate=o.getLevelModel(e,o.updAPISetParams.newSetValue.collection),_.isEmpty(moduleCandidate)||"no_match"==moduleCandidate)throw new Error("updateAPISetting => "+t.action+" => missing moduleCandidate");s.push(moduleCandidate)}}),s.length!=_.uniq(s).length)throw new Error("updateAPISetting => "+t.action+" => there are duplicated modules in column : "+e.id);e.collection=s},_updAPISet_sek_set_module_value:function(){var e,t,i=this;e=i.updAPISetParams.params,t=i.getLevelModel(e.id,i.updAPISetParams.newSetValue.collection);var n=e.settingParams.args.moduleRegistrationParams.control,o=e.settingParams.args.moduleRegistrationParams.id,r=n.czr_Module(o);_.isEmpty(r)?l.errare("updateAPISetting => missing parentModuleInstance",e):isMultiItemModule=r.isMultiItem();var s=isMultiItemModule?[]:{};if(_.each(e.value||(isMultiItemModule?[]:{}),function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(s[t]=e)}),"no_match"==t)return l.errare("updateAPISetting => "+e.action+" => no module matched",e),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => error no module matched");if(_.isEmpty(e.options_type))return l.errare("updateAPISetting => "+e.action+" => missing options_type"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => missing options_type");if("__no_option_group_to_be_updated_by_children_modules__"===e.options_type)t.value=s;else{var a=c.extend(!0,{},_.isEmpty(t.value)?{}:t.value);a[e.options_type]=s,t.value=a}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(m,f){f.extend(CZRSeksPrototype,{_updAPISet_sek_import_from_file:function(){var n,o=this;if(n=o.updAPISetParams.params,_.isUndefined(n.imported_content.data)||_.isUndefined(n.imported_content.metas))m.errare("updateAPISetting::sek-import-from-file => invalid imported content",imported_content);else{var i=_.isArray(n.imported_content.data.collection)?f.extend(!0,[],n.imported_content.data.collection):[];if(!0===n.assign_missing_locations){var t,e=n.imported_content.metas.active_locations,r=m.czr_sektions.activeLocations();_.each(r,function(e){o.isHeaderLocation(e)||o.isFooterLocation(e)||t.push(e)});var s=_.first(t);if(!_.isEmpty(s)&&!_.isEmpty(e)&&_.isArray(e)){var a=f(e).not(t).get(),l=o.getLevelModel(s,o.updAPISetParams.newSetValue.collection),c=o.getLevelModel(s,n.imported_content.data.collection),d=[];l.collection=_.isArray(l.collection)?l.collection:[],c.collection=_.isArray(c.collection)?c.collection:[],_.each(e,function(e){var t=o.getLevelModel(e,i);_.isEmpty(t.collection)||(d=_.union(d,t.collection))}),c.collection=d,n.imported_content.data.collection=_.filter(n.imported_content.data.collection,function(e){return!_.contains(a,e.id)})}}if(!0===n.keep_existing_sections){_.each(i,function(e){var t=o.getLevelModel(e.id,o.updAPISetParams.newSetValue.collection);if(!_.isEmpty(t.collection)){var i=o.getLevelModel(e.id,n.imported_content.data.collection);i.collection=_.union(t.collection,i.collection)}});var p=o.updAPISetParams.newSetValue.fonts,u=n.imported_content.data.fonts;p&&!_.isEmpty(p)&&_.isArray(p)&&(u=_.isArray(u)?u:[],n.imported_content.data.fonts=_.uniq(_.union(p,u)))}o.updAPISetParams.newSetValue=n.imported_content.data}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(z,w){w.extend(CZRSeksPrototype,{_updAPISet_sek_inject_tmpl_from_gallery:function(){var t,i=this;if(t=i.updAPISetParams.params,z.infoLog("api update params for sek-inject-tmpl-from-gallery",t),_.isUndefined(t.injected_content.data)||_.isUndefined(t.injected_content.metas))z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported content",injected_content);else{var n=function(e){return t.injected_content&&t.injected_content.metas&&e===t.injected_content.metas.tmpl_header_location},o=function(e){return t.injected_content&&t.injected_content.metas&&e===t.injected_content.metas.tmpl_footer_location},r=function(){var t=!1;return _.each(e,function(e){t||(n(e)||o(e))&&(t="no_match"!=(t=i.getLevelModel(e,s)))}),t&&!_.isEmpty(c.local_header_footer)},s=_.isArray(t.injected_content.data.collection)?w.extend(!0,[],t.injected_content.data.collection):[],e=t.injected_content.metas.tmpl_locations,a=[],l=i.updAPISetParams.newSetValue.collection;if(_.each(z.czr_sektions.activeLocations(),function(e){i.isGlobalLocationId(e)||a.push(e)}),_.isArray(e)&&!_.isEmpty(e)){var c=t.injected_content.data.local_options;c=w.extend(!0,{},_.isObject(c)?c:{});var d=t.injected_content.data.fonts;d=_.isArray(d)?w.extend(!0,[],d):[];var p,u,m,f,g=w.extend(!0,[],l),h=[],v="__not_set__";switch(_.each(s,function(e){n(e.id)||o(e.id)||_.isEmpty(e.collection)||(h=_.union(h,e.collection))}),t.tmpl_inject_mode){case"replace":if(f=!0,_.each(e,function(e){f&&(f=_.contains(a,e))}),f){var k,y;g=[],_.each(l,function(e){m=_.findWhere(s,{id:e.id})||{},_.isEmpty(m.collection)?i.isHeaderLocation(e.id)||i.isFooterLocation(e.id)?g.push(e):(k={collection:[],options:[]},y=w.extend(!0,{},e),y=w.extend(y,k),g.push(y)):g.push(m)})}else{if(c&&c.template&&"nimble_template"===c.template.local_template?v="loop_start":_.contains(a,"loop_start")?v="loop_start":_.each(a,function(e){i.isHeaderLocation(e)||i.isFooterLocation(e)||(v=e)}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}if("no_match"===(u=i.getLevelModel(v,g))){z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => target location id "+v);break}(u=w.extend(!0,{},u)).collection=h,g=[],r()&&_.each(e,function(e){if(n(e)||o(e)){if("no_match"===(m=i.getLevelModel(e,s)))return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id "+e+" not found in template collection");g.push(m)}}),_.each(a,function(e){v===e&&g.push(u),localLocModel=i.getLevelModel(e,l),"no_match"!==localLocModel?r()||(i.isHeaderLocation(e)||i.isFooterLocation(e))&&g.push(localLocModel):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id "+e+" not found in current setting collection")})}break;case"before":if(_.each(a,function(e){"__not_set__"==v&&("no_match"!==(p=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(p.collection)||(v=e,u=p):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}(u=w.extend(!0,{},u)).collection=_.union(h,u.collection),g=[],_.each(a,function(e){if(v===e)g.push(u);else{if("no_match"===p)return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e);g.push(i.getLevelModel(e,l))}});break;case"after":if(_.each(a.reverse(),function(e){"__not_set__"==v&&("no_match"!==(p=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(p.collection)||(v=e,u=p):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}(u=w.extend(!0,{},u)).collection=_.union(u.collection,h),g=[],_.each(a,function(e){if(v===e)g.push(u);else{if("no_match"===(p=i.getLevelModel(e,l)))return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => loc id not found"+e);g.push(p)}})}if(i.updAPISetParams.newSetValue.collection=g,!_.isEmpty(c)&&"replace"===t.tmpl_inject_mode){var b=i.updAPISetParams.newSetValue.local_options;b=w.extend(!0,{},_.isObject(b)?b:{}),i.updAPISetParams.newSetValue.local_options=_.extend(b,c)}if(_.isArray(d)&&!_.isEmpty(d))if("replace"!=t.tmpl_inject_mode){var I=i.updAPISetParams.newSetValue.fonts;I=w.extend(!0,[],_.isArray(I)?I:[]),i.updAPISetParams.newSetValue.fonts=_.uniq(_.union(d,I))}else i.updAPISetParams.newSetValue.fonts=d}else z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported template locations",t)}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(n,o){o.extend(CZRSeksPrototype,{cleanRegistered:function(t){var i=this,e=o.extend(!0,[],i.registered()||[]);n.trigger("sek-before-clean-registered"),e=_.filter(e,function(e){if("setting"!==e.what&&n[e.what].has(e.id)){if(!_.isEmpty(t)&&e.id!==t)return;_.isFunction(n[e.what](e.id).trigger)&&i.trigger("sek-ui-pre-removal",{what:e.what,id:e.id}),o.when(n[e.what](e.id).container.remove()).done(function(){n[e.what].remove(e.id),i.trigger("sek-ui-removed",{what:e.what,id:e.id})})}return"setting"===e.what}),i.registered(e)},cleanRegisteredLocalOptionSettings:function(){var t=this.getLocalSkopeOptionId(),e=o.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return e.id&&-1!==e.id.indexOf(t)&&n.has(e.id)&&n.remove(e.id),e.id&&-1===e.id.indexOf(t)}),this.registered(e)},cleanRegisteredLevelSettingsAfterHistoryNavigation:function(){var e=o.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return!_.isEmpty(e.level)&&"setting"===e.what&&n.has(e.id)&&n.remove(e.id),_.isEmpty(e.level)&&"setting"===e.what}),this.registered(e)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(p,u){u.extend(CZRSeksPrototype,{rootPanelFocus:function(){p.section.has(p.czr_activeSectionId())?p.section(p.czr_activeSectionId()).expanded(!1):p.section.each(function(e){e.expanded(!1)}),p.panel.each(function(e){e.expanded(!1)})},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()},getGlobalSectionsSettingId:function(){return sektionsLocalizedData.settingIdForGlobalSections},getParentSectionFromColumnId:function(i,n){var s=this,a="no_match",l=function(i,e,n,o){if(_.isUndefined(e)){var t=p(n)(),r=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},s.getDefaultSektionSettingValue(o));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){var t;"no_match"==a&&("section"==e.level&&(t=_.findWhere(e.collection,{id:i})),_.isEmpty(t)?_.isArray(e.collection)&&l(i,e.collection,n,o):a=e)}),a};return _.isEmpty(n)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&l(i,n,e,t)}):l(i,n),a},isGlobalLocation:function(e){var t=!1;return e=e||{},_.has(e,"is_global_location")?t=e.is_global_location:_.has(e,"scope")?t="global"===e.scope:_.isEmpty(e.location)?_.isEmpty(e.in_sektion)?_.isEmpty(e.id)||(t=this.isChildOfAGlobalLocation(e.id)):t=this.isChildOfAGlobalLocation(e.in_sektion):t=this.isChildOfAGlobalLocation(e.location),t},isChildOfAGlobalLocation:function(e){var r=this,s=function(t,e){var i="no_match";if(_.isUndefined(e)){var n=p(r.getGlobalSectionsSettingId())(),o=_.isObject(n)?u.extend(!0,{},n):r.getDefaultSektionSettingValue("global");e=_.isArray(o.collection)?o.collection:[]}return _.each(e,function(e){"no_match"==i&&(t===e.id?i=e:_.isArray(e.collection)&&(i=s(t,e.collection)))}),i};return"no_match"!==s(e)},isGlobalLocationId:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_global},isHeaderLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_header},isFooterLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_footer},getLevelModel:function(i,n){var s=this,a="no_match",l=function(t,e,i,n){if(_.isUndefined(e)){var o=p(i)(),r=_.isObject(o)?u.extend(!0,{},o):u.extend(!0,{},s.getDefaultSektionSettingValue(n));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){"no_match"==a&&(t===e.id?a=e:_.isArray(e.collection)&&l(t,e.collection,i,n))}),a};return _.isEmpty(n)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&l(i,n,e,t)}):l(i,n),a},getLevelPositionInCollection:function(i,n){var s=this,a="no_match",l=function(i,e,n,o){if(_.isUndefined(e)){var t=p(n)(),r=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},s.getDefaultSektionSettingValue(o));e=_.isArray(r.collection)?r.collection:[]}_.each(e,function(e,t){"no_match"==a&&(i===e.id?a=t:_.isArray(e.collection)&&l(i,e.collection,n,o))})};return _.isEmpty(n)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&l(i,e,t,n)}):l(i,n),a},getLevelProperty:function(e){if(e=_.extend({id:"",property:""},e),_.isEmpty(e.id))p.errare("getLevelProperty => invalid id provided");else{var t=this.getLevelModel(e.id);if("no_match"!=t){if(_.isObject(t))return t[e.property];p.errare("getLevelProperty => invalid model for id : "+e.id,t)}else p.errare("getLevelProperty => no level model found for id : "+e.id)}},cloneLevel:function(e){var t=this,i=t.getLevelModel(e);if("no_match"==i)throw new Error("cloneLevel => no match for level id : "+e);var n=u.extend(!0,{},i),o=function(e){if(_.isEmpty(e.id))throw new Error("cloneLevel => missing level id");if(e.id=sektionsLocalizedData.prefixForSettingsNotSaved+t.guid(),!_.isEmpty(e.collection)){if(!_.isArray(e.collection))throw new Error("cloneLevel => the collection must be an array for level id : "+e.id);_.each(e.collection,function(e){e.id=sektionsLocalizedData.prefixForSettingsNotSaved+t.guid(),o(e)})}return e};return o(n)},getDefaultItemModelFromRegisteredModuleData:function(e){if(!this.isModuleRegistered(e))return{};if(sektionsLocalizedData.registeredModules[e].is_father)return p.errare("getDefaultItemModelFromRegisteredModuleData => Father modules should be treated specifically"),{};var t=sektionsLocalizedData.registeredModules[e].tmpl["item-inputs"],i={id:"",title:""};return _.each(t,function(e,t){switch(t){case"tabs":_.each(e,function(e){_.each(e.inputs,function(e,t){i[t]=e.default||""})});break;default:i[t]=e.default||""}}),i},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sektionsLocalizedData.registeredModules[e][t]:"not_set"},isModuleRegistered:function(e){return sektionsLocalizedData.registeredModules&&!_.isUndefined(sektionsLocalizedData.registeredModules[e])},isMultiItemsModule:function(e){return sektionsLocalizedData.registeredModules[e]&&!0===sektionsLocalizedData.registeredModules[e].is_crud},maybeGenerateNewItemIdsForCrudModules:function(t){var i=this;return(_.isArray(t)||_.isObject(t))&&_.each(t,function(e){_.isArray(t)&&_.isObject(e)&&e.id&&!_.has(e,"level")?-1===e.id.indexOf(sektionsLocalizedData.prefixForSettingsNotSaved)&&(e.id=i.guid()):(_.isArray(e)||_.isObject(e))&&i.maybeGenerateNewItemIdsForCrudModules(e)}),t},sniffGFonts:function(e){var o=this,r=[],s=function(i,n,e){if(_.isUndefined(e)){var t=p(i)();e=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},o.getDefaultSektionSettingValue(n))}_.each(e,function(e,t){_.isString(t)&&"_css"===t.substr(t.length-4)&&!0===o.inputIsAFontFamilyModifier(t)&&-1<e.indexOf("gfont")&&!_.contains(r,e)&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,n,e)})};return(e=e||{is_global_location:!1}).is_global_location?s(o.getGlobalSectionsSettingId(),"global"):s(o.localSectionsSettingId(),"local"),r},sniffAllFonts:function(){var o=this,r=[],s=function(i,n,e){if(_.isUndefined(e)){var t=p(i)();e=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},o.getDefaultSektionSettingValue(n))}_.each(e,function(e,t){_.isString(t)&&_.isString(e)&&(-1<e.indexOf("[gfont]")||-1<e.indexOf("[cfont]"))&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,n,e)})};return _.each([{id:o.localSectionsSettingId(),scope:"local"},{id:o.getGlobalSectionsSettingId(),scope:"global"},{id:sektionsLocalizedData.optNameForGlobalOptions,scope:"global"}],function(e){s(e.id,e.scope)}),r},getInputDefaultValue:function(i,n,e){var o=this;if(o.cachedDefaultInputValues=o.cachedDefaultInputValues||{},o.cachedDefaultInputValues[n]=o.cachedDefaultInputValues[n]||{},_.has(o.cachedDefaultInputValues[n],i))return o.cachedDefaultInputValues[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))p.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))p.errare("getInputDefaultValue => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_default_value_specified";return _.each(e,function(e,t){"no_default_value_specified"===r&&(i!==t||_.isUndefined(e.default)||(r=e.default),"no_default_value_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputDefaultValue(i,n,e)),"no_default_value_specified"!==r&&(o.cachedDefaultInputValues[n][i]=r))}),r}p.errare("getInputDefaultValue => Father modules should be treated specifically")}},getInputType:function(i,n,e){var o=this;if(o.cachedInputTypes=o.cachedInputTypes||{},o.cachedInputTypes[n]=o.cachedInputTypes[n]||{},_.has(o.cachedInputTypes[n],i))return o.cachedInputTypes[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))p.errare("getInputType => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))p.errare("getInputType => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_input_type_specified";return _.each(e,function(e,t){"no_input_type_specified"===r&&(i!==t||_.isUndefined(e.input_type)||(r=e.input_type),"no_input_type_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputType(i,n,e)),"no_input_type_specified"!==r&&(o.cachedInputTypes[n][i]=r))}),r}p.errare("getInputType => Father modules should be treated specifically")}},getInputRegistrationParams:function(i,n,e){var o=this;if(o.cachedInputRegistrationParams=o.cachedInputRegistrationParams||{},o.cachedInputRegistrationParams[n]=o.cachedInputRegistrationParams[n]||{},_.has(o.cachedInputRegistrationParams[n],i))return o.cachedInputRegistrationParams[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))p.errare("getInputRegistrationParams => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))p.errare("getInputRegistrationParams => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r={};return _.each(e,function(e,t){_.isEmpty(r)&&(i!==t||_.isUndefined(e.input_type)||(r=e),_.isEmpty(r)&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputRegistrationParams(i,n,e)),_.isEmpty(r)||(o.cachedInputRegistrationParams[n][i]=r))}),r}p.errare("getInputRegistrationParams => Father modules should be treated specifically")}},inputIsAFontFamilyModifier:function(i,e){var n=this;if(n.cachedFontFamilyModifier=n.cachedFontFamilyModifier||{},_.has(n.cachedFontFamilyModifier,i))return n.cachedFontFamilyModifier[i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules);var o="not_set";return _.each(e,function(e,t){"not_set"===o&&(i!==t||_.isUndefined(e.input_type)||(o=!_.isUndefined(e.refresh_fonts)&&e.refresh_fonts),"not_set"===o&&(_.isArray(e)||_.isObject(e))&&(o=n.inputIsAFontFamilyModifier(i,e)),"not_set"!==o&&(n.cachedFontFamilyModifier[i]=o))}),o}p.errare("inputIsAFontFamilyModifier => missing sektionsLocalizedData.registeredModules")},getModuleStartingValue:function(e){var a=this;if(!sektionsLocalizedData.registeredModules)return p.errare("getModuleStartingValue => missing sektionsLocalizedData.registeredModules"),"no_starting_value";if(_.isUndefined(sektionsLocalizedData.registeredModules[e]))return p.errare("getModuleStartingValue => the module type "+e+" is not registered"),"no_starting_value";var t,i,n,l=function(e){return readyStartValues=[],_.each(e,function(e){if(_.isObject(e)){var t=u.extend(!0,{},e);t.id=p.czr_sektions.guid(),readyStartValues.push(t)}else p.errare("getModuleStartingValue => multi-item module => items should be objects for module "+mod_type)}),readyStartValues},c={},d=(t=e,sektionsLocalizedData.registeredModules[t]&&sektionsLocalizedData.registeredModules[t].starting_value?sektionsLocalizedData.registeredModules[t].starting_value:{});return n=e,sektionsLocalizedData.registeredModules[n]&&!0===sektionsLocalizedData.registeredModules[n].is_father?_.each((i=e,sektionsLocalizedData.registeredModules[i]&&sektionsLocalizedData.registeredModules[i].children?sektionsLocalizedData.registeredModules[i].children:{}),function(e,t){var i,n,o,r,s=(i=e,r=(o=d)[n=t]?o[n]:{},a.isMultiItemsModule(i)&&_.isArray(r)?l(r):r);_.isEmpty(s)||(c[t]=s)}):c=a.isMultiItemsModule(e)&&_.isArray(d)?l(d):d,_.isEmpty(c)?"no_starting_value":c},selectNextTabbableOrFocusable:function(e){var t=u(e),i=u(":focus"),n=0;if(1===i.length){var o=t.index(i);o+1<t.length&&(n=o+1)}t.eq(n).focus()},selectPrevTabbableOrFocusable:function(e){var t=u(e),i=u(":focus"),n=t.length-1;if(1===i.length){var o=t.index(i);0<o&&(n=o-1)}t.eq(n).focus()},setupSelectInput:function(e){var n=this,t=(n.input_parent,n.module,p.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type)),i={params:e=_.isEmpty(e)?t.choices:e};if(n.module.trigger("nimble-set-select-input-options",i),e=i.params,!_.isEmpty(e)&&_.isObject(e))switch(n.type){case"simpleselect":_.each(e,function(e,t){var i={value:t,html:e};t==n()?u.extend(i,{selected:"selected"}):"px"===t&&u.extend(i,{selected:"selected"}),u("select[data-czrtype]",n.container).append(u("<option>",i))}),u("select[data-czrtype]",n.container).selecter();break;case"multiselect":var o=n();o=_.isString(o)?[o]:o,o=_.isArray(o)?o:[],_.each(e,function(e,t){var i={value:t,html:e};_.contains(o,t)&&u.extend(i,{selected:"selected"}),u("select[data-czrtype]",n.container).append(u("<option>",i))}),u("select[data-czrtype]",n.container).czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),u("select[data-czrtype]",n.container).on("change",function(){0===u(this).find("option:selected").length&&n([])});break;default:p.errare("::setupSelectInput => invalid input type => "+n.type)}else p.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+n.id+" in module "+n.module.module_type)},maybeSetupDeviceSwitcherForInput:function(){var n=this;if(!n.previewedDevice){var e=['<span class="sek-input-device-switcher">','<i data-sek-device="desktop" class="sek-switcher preview-desktop active" title="'+sektionsLocalizedData.i18n["Settings on desktops"]+'"></i>','<i data-sek-device="tablet" class="sek-switcher preview-tablet" title="'+sektionsLocalizedData.i18n["Settings on tablets"]+'"></i>','<i data-sek-device="mobile" class="sek-switcher preview-mobile" title="'+sektionsLocalizedData.i18n["Settings on mobiles"]+'"></i>',"</span>"].join(" ");n.container.find(".customize-control-title").first().prepend(e),n.previewedDevice=new p.Value(p.previewedDevice()),syncWithPreviewedDevice=function(e){e.stopPropagation(),n.container.find("[data-sek-device]").removeClass("active"),u(this).addClass("active");var t,i="desktop";try{i=u(this).data("sek-device")}catch(e){p.errare("maybeSetupDeviceSwitcherForInput => error when binding sek-switcher",e)}try{p.previewedDevice(i)}catch(e){p.errare("maybeSetupDeviceSwitcherForInput => error when setting the previewed device",e)}n.previewedDevice(i),_.isUndefined(e.isTrigger)&&n.module&&n.module.control&&n.module.control.params.section&&(t=n.module.control.params.section,_.delay(function(){p.previewer.send("sek-animate-to-level",{id:t})},600))},n.container.on("click","[data-sek-device]",syncWithPreviewedDevice);var t=n.container.find('[data-sek-device="'+p.previewedDevice()+'"]');0<t.length&&t.trigger("click")}},scheduleModuleAccordion:function(e){e=e||{expand_first_control:!0};var i=this;if(!0!==i.container.data("sek-module-accordion-has-been-setup")&&(u(i.container).on("click",".customize-control label > .customize-control-title",function(e){e.stopPropagation();var t=u(this).closest(".customize-control");"no"!==t.attr("data-sek-accordion")&&(i.container.find(".customize-control").not(t).each(function(){u(this).attr("data-sek-accordion")||u(this).attr("data-sek-expanded","false")}),t.attr("data-sek-expanded","false"==t.attr("data-sek-expanded")?"true":"false"),t.trigger("true"==t.attr("data-sek-expanded")?"sek-accordion-expanded":"sek-accordion-collapsed"),!0===t.data("module_ready_on_custom_control_event_is_setup")?t.trigger("sek-accordion-expanded"):t.one("module_ready_on_custom_control_event_is_setup",function(){t.trigger("sek-accordion-expanded")}))}),i.container.data("sek-module-accordion-has-been-setup",!0),e.expand_first_control)){var t=_.filter(i.controls(),function(e){return!e.params||!e.params.sek_registration_params||!1!==e.params.sek_registration_params.has_accordion}),n=_.first(t);_.isObject(n)&&!_.isEmpty(n.id)&&p.control(n.id,function(e){e.container.one("items-collection-populated",function(){u(this).find("label > .customize-control-title").trigger("click")}),!0===e.container.data("module_ready_on_custom_control_event_is_setup")?e.container.trigger("sek-accordion-expanded"):e.container.one("module_ready_on_custom_control_event_is_setup",function(){e.container.trigger("sek-accordion-expanded")})})}},isPromise:function(e){return e&&"function"==typeof e.then&&String(u.Deferred().then)===String(e.then)},whenAllPromisesInParallel:function(e){var i=this,t=u.Deferred(),n=[],o=_.keys(e);return _.each(e,function(e,t){n.push(u.Deferred(function(t){(i.isPromise(e)?e:u.Deferred()).done(t.resolve).fail(function(e){t.reject(e)})}))}),u.when.apply(this,n).done(function(){var i={},e=Array.prototype.slice.call(arguments);_.each(e,function(e,t){i[o[t]]=e}),t.resolve(i)}).fail(t.reject),t},whenAllPromisesInSerie:function(t,i,n,o){i=i||0,n=n||{},o=o||u.Deferred();var r=this;if(_.isArray(t)){var e=t[i];(r.isPromise(e)?e:u.Deferred(function(e){e.resolve()})).always(function(e){n[i]=e,i+1==t.length?o.resolve(n):i+1<t.length&&r.whenAllPromisesInSerie(t,i+1,n,o)})}return o},importAttachment:function(t){return wp.ajax.post("sek_import_attachment",{img_url:t,nonce:p.settings.nonce.save}).fail(function(e){p.errare("sek_import_attachment ajax action failed for image "+t,e)})},cleanIds:function(e){e.id="";var t=this;return _.each(e.collection,function(e){e.id="",_.isArray(e.collection)&&t.cleanIds(e)}),e},getDefaultSektionSettingValue:function(e){return!_.isUndefined(e)&&_.contains(["local","global"],e)||p.errare("getDefaultSektionSettingValue => the skope should be set to local or global"),"global"===e?sektionsLocalizedData.defaultGlobalSektionSettingValue:sektionsLocalizedData.defaultLocalSektionSettingValue},scheduleVisibilityOfInputId:function(t,i){var n=this.input_parent;if(!_.isFunction(i)||_.isEmpty(t))throw new Error("::scheduleVisibilityOfInputId => error when firing for input id : "+this.id);if(!n.czr_Input.has(t))throw new Error("::scheduleVisibilityOfInputId => missing input id : "+t);n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})},hasCurrentPageNBSectionsNotHeaderFooter:function(){var e,t=this,i=!1,n=this.localSectionsSettingId(),o=p(n)();this.activeLocationsInfo();return o=_.isObject(o)?o:{},e=u.extend(!0,{},o),e=_.isEmpty(e.collection)?[]:e.collection,e=_.isArray(e)?e:[],_.each(e,function(e){i||_.isObject(e)&&"location"==e.level&&e.collection&&(t.isHeaderLocation(e.id)||t.isFooterLocation(e.id)||(i=!_.isEmpty(e.collection)))}),i},isJsonString:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,m){m.extend(CZRSeksPrototype,{setupDnd:function(){var t=this;t.bind("sek-refresh-dragzones",function(e){!0!="draggable"in document.createElement("span")&&l.panel(sektionsLocalizedData.sektionsPanelId,function(e){l.notifications.add(new l.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){l.notifications.remove("drag-drop-support")},1e4)}),t.setupNimbleDragZones(e.input_container)}),l.previewer.bind("ready",function(){try{t.setupNimbleDropZones()}catch(e){l.errare("::setupDnd => error on self.setupNimbleDropZones()",e)}_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_intro_sec_picker_module"}))&&_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_module_picker_module"}))||t.rootPanelFocus()}),t.reactToDrop()},setupNimbleDragZones:function(e){var n=this,o=function(){l.notifications.add(new l.Notification("missing-injection-target",{type:"info",message:sektionsLocalizedData.i18n["You first need to click on a target ( with a + icon ) in the preview."],dismissible:!0})),_.delay(function(){l.notifications.remove("missing-injection-target")},3e4)};e.find('[draggable="true"]').each(function(){m(this).on("dragstart",function(e){(function(e){n.lastClickedTargetInPreview({}),e.originalEvent.dataTransfer.setData("sek-content-type",m(this).data("sek-content-type")),e.originalEvent.dataTransfer.setData("sek-eligible-for-module-dropzones",m(this).data("sek-eligible-for-module-dropzones")),e.originalEvent.dataTransfer.setData("sek-content-id",m(this).data("sek-content-id")),e.originalEvent.dataTransfer.setData("sek-section-type",m(this).data("sek-section-type")),e.originalEvent.dataTransfer.setData("sek-is-user-section",m(this).data("sek-is-user-section")),n.dndData={content_type:e.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===e.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:e.originalEvent.dataTransfer.getData("sek-content-id"),section_type:e.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===e.originalEvent.dataTransfer.getData("sek-is-user-section")};try{e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.clearData("browserSupport")}catch(e){l.panel(sektionsLocalizedData.sektionsPanelId,function(e){l.notifications.add(new l.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){l.notifications.remove("drag-drop-support")},1e4)})}m(this).addClass("sek-dragged"),n.cachedElements.$body.addClass("sek-dragging"),l.previewer.send("sek-drag-start",{content_type:n.dndData.content_type,eligible_for_module_dropzones:n.dndData.eligible_for_module_dropzones})}).call(m(this),e)}).on("dragend",function(e){(function(e){n.cachedElements.$body.removeClass("sek-dragging"),m(this).removeClass("sek-dragged"),l.previewer.send("sek-drag-stop")}).call(m(this),e)}).on("dblclick",function(e){(function(e){var t,i=n.lastClickedTargetInPreview();!_.isEmpty(i)&&i.id?t=n.dnd_getDropZonesElements().find('[data-sek-id="'+i.id+'"]').find(".sek-module-drop-zone-for-first-module").first():o(),t&&0<t.length?(l.czr_sektions.trigger("sek-content-dropped",{drop_target_element:t,location:t.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:t.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:t.data("drop-zone-after-module-or-nested-section"),before_section:t.data("drop-zone-before-section"),after_section:t.data("drop-zone-after-section"),content_type:m(this).attr("data-sek-content-type"),content_id:m(this).attr("data-sek-content-id"),section_type:m(this).attr("data-sek-section-type"),is_user_section:"true"===m(this).attr("data-sek-is-user-section")}),n.lastClickedTargetInPreview({})):(o(),l.errare("Double click insertion => the target zone was not found"))}).call(m(this),e)})})},setupNimbleDropZones:function(){var t=this;if(this.$dropZones=this.dnd_getDropZonesElements(),this.preDropElement=m("<div>",{class:sektionsLocalizedData.preDropElementClass,html:""}),this.$dropZones.length<1)throw new Error("::setupNimbleDropZones => invalid Dom element");this.$dropZones.each(function(){var e=m(this);!0!==e.data("zone-droppable-setup")&&(t.enterOverTimer=null,e.on("dragenter dragover",sektionsLocalizedData.dropSelectors,function(e){_.isNull(t.enterOverTimer)&&(t.enterOverTimer=!0,_.delay(function(){t.currentMousePosition&&t.currentMousePosition+""==e.clientY+""+e.clientX?t.enterOverTimer=null:(t.currentMousePosition=e.clientY+""+e.clientX,t.dnd_toggleDragApproachClassesToDropZones(e))},100)),t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.stopPropagation(),t.dnd_OnEnterOver(m(this),e))}).on("dragleave drop",sektionsLocalizedData.dropSelectors,function(e){switch(e.type){case"dragleave":t.dnd_isOveringDropTarget(m(this),e)||t.dnd_cleanOnLeaveDrop(m(this),e);break;case"drop":this.$cachedDropZoneCandidates=null,t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.preventDefault(),t.dnd_onDrop(m(this),e),t.dnd_cleanOnLeaveDrop(m(this),e),l.previewer.send("sek-drag-stop"))}}).data("zone-droppable-setup",!0))})},dnd_isInTarget:function(e,t){var i=t.clientY,n=t.clientX,o=e[0].getBoundingClientRect(),r=n<=o.right&&o.left<=n;return i>=o.top&&o.bottom>=i&&r},dnd_toggleDragApproachClassesToDropZones:function(p){var u=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.$cachedDropZoneCandidates=_.isEmpty(this.$cachedDropZoneCandidates)?this.$dropZones.find(".sek-drop-zone"):this.$cachedDropZoneCandidates,this.distanceTable=[],this.$dropZones.find(".sek-drop-zone").each(function(){var e,t,i=p.clientY,n=p.clientX,o=m(this)[0].getBoundingClientRect(),r=Math.abs(i-(o.bottom-(o.bottom-o.top)/2)),s=(Math.abs(o.top-i),Math.abs(n-(o.right-(o.right-o.left)/2))),a=(o.right,o.left,r<50),l=s<50,c=n<=o.right&&o.left<=n,d=i>=o.top&&o.bottom>=i;u.distanceTable.push({el:m(this),dist:d&&c?0:(e=s,t=r,Math.sqrt(e*e+t*t))}),m(this).removeClass("sek-drag-is-in"),(a||d)&&(l||c)?(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).addClass("sek-drag-is-very-close")):(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).removeClass("sek-drag-is-very-close")),m(this).removeClass("sek-drag-is-in")});var t=_.min(_.pluck(u.distanceTable,"dist"));u.$dropTargetCandidate=null,_.each(u.distanceTable,function(e){_.isNull(u.$dropTargetCandidate)&&t===e.dist&&(u.$dropTargetCandidate=e.el)}),u.$dropTargetCandidate&&0<u.$dropTargetCandidate.length&&u.dnd_isInTarget(u.$dropTargetCandidate,p)&&u.$dropTargetCandidate.addClass("sek-drag-is-in"),u.enterOverTimer=null},dnd_getPreDropElementContent:function(e){var t,i,n=m(e.currentTarget);switch(this.dndData.content_type){case"module":t=sektionsLocalizedData.i18n["Insert here"],0<n.length&&("between-sections"!==n.data("sek-location")&&"in-empty-location"!==n.data("sek-location")||(t=sektionsLocalizedData.i18n["Insert in a new section"])),i='<div class="sek-module-placeholder-content"><p>'+t+"</p></div>";break;case"preset_section":i='<div class="sek-module-placeholder-content"><p>'+(t=sektionsLocalizedData.i18n["Insert a new section here"])+"</p></div>";break;default:l.errare("::dnd_getPreDropElementContent => invalid content type provided")}return i},dnd_getDropZonesElements:function(){return m(l.previewer.targetWindow().document)},dnd_canDrop:function(e){var t=this,i=(e=_.extend({targetEl:{},evt:{}},e||{})).targetEl;if(!_.isObject(i)||i.length<1)return!1;if(i.closest('[data-sek-level="location"]').length<1)return!1;var n=i.hasClass("sek-content-preset_section-drop-zone"),o=i.hasClass("sek-module-drop-zone-for-first-module"),r=!0===i.closest('[data-sek-level="location"]').data("sek-is-header-location"),s=!0===i.closest('[data-sek-level="location"]').data("sek-is-footer-location"),a="preset_section"===t.dndData.content_type&&"content"===t.dndData.section_type,l=function(e){m(".sek-no-drop-possible-message",i).length<1&&i.append(['<div class="sek-no-drop-possible-message">','<i class="material-icons">not_interested</i>',e,"</div>"].join(""))};return!!i.hasClass("sek-drop-zone")&&(!t.dndData.is_user_section&&(r||s)&&a?(l(r?sektionsLocalizedData.i18n["Header location only accepts modules and pre-built header sections"]:sektionsLocalizedData.i18n["Footer location only accepts modules and pre-built footer sections"]),!1):s&&"preset_section"===t.dndData.content_type&&"header"===t.dndData.section_type?(l(sektionsLocalizedData.i18n["You can't drop a header section in the footer location"]),!1):r&&"preset_section"===t.dndData.content_type&&"footer"===t.dndData.section_type?(l(sektionsLocalizedData.i18n["You can't drop a footer section in the header location"]),!1):"preset_section"===t.dndData.content_type&&!0===t.dndData.eligible_for_module_dropzones&&!n||("preset_section"===t.dndData.content_type&&n||"module"===t.dndData.content_type&&!n||"preset_section"===t.dndData.content_type&&o))},dnd_OnEnterOver:function(e,t){t.preventDefault(),!0!==e.data("is-drag-entered")&&(e.data("is-drag-entered",!0),e.addClass("sek-active-drop-zone"),this.$dropZones.addClass("sek-is-dragging"));try{this.dnd_mayBePrintPreDropElement(e,t)}catch(e){l.errare("Error when trying to insert the preDrop content",e)}},dnd_cleanOnLeaveDrop:function(e,t){var i=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.preDropElement.remove(),this.$dropZones.removeClass("sek-is-dragging"),m(sektionsLocalizedData.dropSelectors,this.$dropZones).each(function(){i.dnd_cleanSingleDropTarget(m(this))})},dnd_cleanSingleDropTarget:function(e){_.isEmpty(e)||e.length<1||(e.data("is-drag-entered",!1),e.data("preDrop-position",!1),e.removeClass("sek-active-drop-zone"),e.find(".sek-drop-zone").removeClass("sek-drag-is-close"),e.find(".sek-drop-zone").removeClass("sek-drag-is-approaching"),e.removeClass("sek-feed-me-seymore"),e.find(".sek-no-drop-possible-message").remove())},dnd_getPosition:function(e,t){var i=e[0].getBoundingClientRect(),n=i.height;return"before"===e.data("preDrop-position")?n+=this.preDropElement.outerHeight():"after"===e.data("preDrop-position")&&(n-=this.preDropElement.outerHeight()),0<t.originalEvent.clientY-i.top-n/2?"after":"before"},dnd_mayBePrintPreDropElement:function(e,t){var i=this,n=e.data("preDrop-position"),o=this.dnd_getPosition(e,t);if(n!==o&&!0!==i.isPrintingPreDrop){i.isPrintingPreDrop=!0,this.dnd_cleanSingleDropTarget(this.$currentPreDropTarget);var r="between-sections"===e.data("sek-location")||"in-empty-location"===e.data("sek-location");m.when(i.preDropElement.remove()).done(function(){e["before"===o?"prepend":"append"](i.preDropElement).find("."+sektionsLocalizedData.preDropElementClass).html(i.dnd_getPreDropElementContent(t)),e.find("."+sektionsLocalizedData.preDropElementClass).toggleClass("in-new-sektion",r),e.data("preDrop-position",o),e.addClass("sek-feed-me-seymore"),i.isPrintingPreDrop=!1,i.$currentPreDropTarget=e})}},dnd_isOveringDropTarget:function(e,t){var i=e[0].getBoundingClientRect(),n=t.clientX,o=t.clientY,r=i.left,s=i.right,a=i.top,l=i.bottom;return r<=n&&n-r<=s-r&&(a<=o&&o-a<=l-a)},dnd_onDrop:function(e,t){t.stopPropagation();this.dnd_getPosition(e,t),e.index();l.czr_sektions.trigger("sek-content-dropped",{drop_target_element:e,location:e.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:e.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:e.data("drop-zone-after-module-or-nested-section"),before_section:e.data("drop-zone-before-section"),after_section:e.data("drop-zone-after-section"),content_type:t.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===t.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:t.originalEvent.dataTransfer.getData("sek-content-id"),section_type:t.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===t.originalEvent.dataTransfer.getData("sek-is-user-section")})},reactToDrop:function(){this.bind("sek-content-dropped",function(e){try{!function(e){if(!_.isObject(e))throw new Error("Invalid params provided");if(e.drop_target_element.length<1)throw new Error("Invalid drop_target_element");var t,i=e.drop_target_element,n="content-in-column";switch(i.data("sek-location")){case"between-sections":n="content-in-a-section-to-create";break;case"in-empty-location":e.is_first_section=!0,e.send_to_preview=!1,n="content-in-empty-location";break;case"between-columns":n="content-in-new-column"}"preset_section"===e.content_type&&(i.hasClass("sek-module-drop-zone-for-first-module")?1<(t=i.closest('div[data-sek-level="section"]')).find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length?(n="preset-section-in-a-nested-section-to-create",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),e.in_sektion=t.data("sek-id")):(e.sektion_to_replace=t.data("sek-id"),e.after_section=e.sektion_to_replace,e.in_column=t.closest('[data-sek-level="column"]').data("sek-id"),n="content-in-a-section-to-replace"):("between-sections"===i.data("sek-location")&&(n="content-in-a-section-to-create"),"between-modules-and-nested-sections"===i.data("sek-location")&&e.eligible_for_module_dropzones&&(n="preset-section-eligible-for-module-dropzones-in-new-nested-sektion",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),t=i.closest('div[data-sek-level="section"]'),e.in_sektion=t.data("sek-id"))));switch(n){case"content-in-column":var o=i.closest("div[data-sek-level]");if(o.length<1)throw new Error("No valid level dom element found");var r=o.data("sek-level"),s=o.data("sek-id");if(_.isEmpty(r)||_.isEmpty(s))throw new Error("No valid level id found");l.previewer.trigger("sek-add-module",{level:r,id:s,in_column:i.closest('div[data-sek-level="column"]').data("sek-id"),in_sektion:i.closest('div[data-sek-level="section"]').data("sek-id"),before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section,content_type:e.content_type,content_id:e.content_id});break;case"content-in-a-section-to-create":case"content-in-a-section-to-replace":case"content-in-empty-location":l.previewer.trigger("sek-add-content-in-new-sektion",e);break;case"preset-section-in-a-nested-section-to-create":l.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",e);break;case"preset-section-eligible-for-module-dropzones-in-new-nested-sektion":var a=m.extend(!0,{},e);a=m.extend(a,{before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section}),l.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",a);break;default:l.errare("sek control panel => ::reactToDrop => invalid drop case : "+n)}}(e)}catch(e){l.errare("error when reactToDrop",e)}})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{setupTinyMceEditor:function(){var n=this;c.sekEditorExpanded=new c.Value(!1),n.editorEventsListenerSetup=!1,n.$editorPane=d("#czr-customize-content_editor-pane"),n.$editorDragbar=d("#czr-customize-content_editor-dragbar"),n.$preview=d("#customize-preview"),n.$collapseSidebar=d(".collapse-sidebar"),n.attachResizeEventsToEditor();d("#customize-theme-controls").on("click",'[data-czr-action="open-tinymce-editor"]',function(){var e=d(this).data("czr-control-id"),t=d(this).data("czr-input-id");_.isEmpty(e)||_.isEmpty(t)?c.errare("toggle-tinymce-editor => missing input or control id"):c.sekEditorExpanded(!0)}),c.sekEditorExpanded.bind(function(e,t,i){!function(){c.sekTinyMceEditor=tinyMCE.get(sektionsLocalizedData.idOfDetachedTinyMceTextArea);var e=function(){!1===n.editorEventsListenerSetup&&(n.editorEventsListenerSetup=!0,n.trigger("sek-tiny-mce-editor-bound-and-instantiated"))};c.sekTinyMceEditor&&(c.sekTinyMceEditor.initialized?e():c.sekTinyMceEditor.on("init",function(){e()}))}(),e&&c.sekTinyMceEditor&&c.sekTinyMceEditor.focus(),d(document.body).toggleClass("czr-customize-content_editor-pane-open",e),n.cachedElements.$window[e?"on":"off"]("resize",function(){c.sekEditorExpanded()&&_.delay(function(){n.czrResizeEditor(window.innerHeight-n.$editorPane.height())},50)}),e?(n.czrResizeEditor(window.innerHeight-n.$editorPane.height()),_.delay(function(){n.cachedElements.$window.trigger("resize")},100)):(n.$preview.css("bottom",""),n.$collapseSidebar.css("bottom",""))}),d("#czr-customize-content_editor-pane").on("click",'[data-czr-action="close-tinymce-editor"]',function(){c.sekEditorExpanded(!1)}),d("#customize-controls").on("click",function(e){"open-tinymce-editor"!=d(e.target).data("czr-action")&&c.sekEditorExpanded(!1,{context:"clicked anywhere"})}),d(document).on("keydown",_.throttle(function(e){27===e.keyCode&&c.sekEditorExpanded(!1)},50)),n.bind("sek-tiny-mce-editor-bound-and-instantiated",function(){var e=d(c.sekTinyMceEditor.iframeElement).contents().get(0);d(e).on("keydown",_.throttle(function(e){27===e.keyCode&&c.sekEditorExpanded(!1)},50))}),_.each(["sek-click-on-inactive-zone","sek-add-section","sek-add-column","sek-add-module","sek-remove","sek-move","sek-duplicate","sek-resize-columns","sek-add-content-in-new-sektion","sek-pick-content","sek-edit-options","sek-edit-module","sek-notify"],function(e){"sek-edit-module"!=e?c.previewer.bind(e,function(){c.sekEditorExpanded(!1)}):c.previewer.bind(e,function(e){c.sekEditorExpanded("czr_tiny_mce_editor_module"===e.module_type)})})},attachResizeEventsToEditor:function(){var t=this;d("#czr-customize-content_editor-pane").on("mousedown mouseup",function(e){if(("mousedown"!==e.type||"czr-customize-content_editor-dragbar"===d(e.target).attr("id")||d(e.target).hasClass("czr-resize-handle"))&&c.sekEditorExpanded())switch(e.type){case"mousedown":d(document).on("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea,function(e){e.preventDefault(),d(document.body).addClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","none"),t.czrResizeEditor(e.pageY)});break;case"mouseup":d(document).off("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea),d(document.body).removeClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","")}})},czrResizeEditor:function(e){var t,i=this,n=window.innerHeight,o=(window.innerWidth,{}),r=d("#czr-customize-content_editor_ifr"),s=d("#wp-czr-customize-content_editor-tools"),a=i.$editorPane.find(".mce-toolbar-grp"),l=i.$editorPane.find(".mce-statusbar");c.sekEditorExpanded()&&(_.isNaN(e)||(t=n-e),o.height=t,o.components=s.outerHeight()+a.outerHeight()+l.outerHeight(),t<40&&(o.height=40),n-1<t&&(o.height=n-1),n<i.$editorPane.outerHeight()&&(o.height=n),i.$preview.css("bottom",o.height),i.$editorPane.css("height",o.height),r.css("height",o.height-o.components))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,a){a.extend(CZRSeksPrototype,{export_template:function(e){e=e||{},e=a.extend({scope:"local"},e);var i=[],t={sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()};_.each(t,function(e,t){i.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),wp.ajax.post("sek_pre_export_checks",{nonce:d.settings.nonce.save,sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()}).done(function(){a(window).off("beforeunload"),window.location.href=[sektionsLocalizedData.customizerURL,"?",i.join("&")].join(""),a(window).on("beforeunload")}).fail(function(e){d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Export failed"],encodeURIComponent(e)].join(" "),"</strong>","</span>"].join("")})})},import_template_from_file:function(i){i=i||{};var e,t,n=(i=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},i)).input;if(_.isEmpty(n))throw new Error("::import_template => missing file_input param");if(_.isEmpty(i.file_input))throw new Error("::import_template => missing file_input param");if(i.file_input.length<1||_.isUndefined(i.file_input[0])||!i.file_input[0].files||_.isEmpty(i.file_input.val()))d.previewer.trigger("sek-notify",{notif_id:"missing-import-file",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Missing file"],"</strong>","</span>"].join("")});else{t=d.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type).scope,n.container.find(".sek-uploading").show(),d.notifications.remove("missing-import-file"),d.notifications.remove("import-success"),d.notifications.remove("import-failed"),d.notifications.remove("img-import-errors");var o=new FormData;if(o.append("file_candidate",i.file_input[0].files[0]),o.append("action","sek_get_manually_imported_file_content"),o.append("nonce",d.settings.nonce.save),_.contains(["local","global"],t)){if(o.append("skope",t),i.pre_import_check&&o.append("pre_import_check",i.pre_import_check),o.append("import_img",n.input_parent.czr_Input("import_img")()),n.container.find(".sek-uploading").show(),e=a.ajax({url:wp.ajax.settings.url,data:o,processData:!1,contentType:!1,type:"POST"}),i.pre_import_check)return a.Deferred(function(){var t=this;e.done(function(e){e.success||t.reject(e),d.czr_sektions.isImportedContentEligibleForAPI(e,i)||t.reject(e),t.resolve(e)}).fail(function(e){t.reject(e)})});d.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),_.delay(function(){"pending"===e.state()&&d.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>",sektionsLocalizedData.i18n['Import exceeds server response time, try to uncheck "import images" option.'],"</strong>","</span>"].join("")})},3e4),e.done(function(e){d.czr_sektions.isImportedContentEligibleForAPI(e,i)?(e.data.data.collection=d.czr_sektions.setIdsForImportedTmpl(e.data.data.collection),d.czr_sektions.doUpdateApiSettingAfter_FileImport(e,i)):d.infoLog("::import_template problem => !api.czr_sektions.isImportedContentEligibleForAPI",e,i)}).fail(function(e){d.errare("::import_template => ajax error",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Import failed, file problem"],"</strong>","</span>"].join("")})}).always(function(){d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(i)})}else d.errare("::import_template => invalid scope provided",t)}},pre_checks_from_file_import:function(e,t){if(t=t||{},(t=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},t)).is_file_import&&_.isEmpty(t.input))throw new Error("::pre_checks_from_file_import => missing file_input param");var i=d.czr_sektions.activeLocations(),n=a.extend(!0,[],_.isArray(e.data.metas.active_locations)?e.data.metas.active_locations:[]),o=t.input,r=d.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type);if(n=_.filter(n,function(e){return!_.contains(["nimble_local_header","nimble_local_footer"],e)}),_.isArray(n)&&_.isArray(i)){var s=a(n).not(i).get();_.isEmpty(s)?d.czr_sektions.import_template_from_file(t):(t.is_file_import&&(o.container.find('button[data-czr-action="sek-pre-import"]').hide(),"local"===r.scope?o.container.find(".czr-import-dialog.czr-local-import").slideToggle():o.container.find(".czr-import-dialog.czr-global-import").slideToggle()),d.infoLog("sek-pre-import => imported locations missing in current page.",s))}else d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Import failed"],"</strong>","</span>"].join("")}),t.is_file_import&&d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},setIdsForImportedTmpl:function(i){var n=this;return(_.isObject(i)||_.isArray(i))&&_.each(i,function(e,t){(_.isObject(e)||_.isArray(e))&&(i[t]=n.setIdsForImportedTmpl(e)),"id"!==t||!_.isString(e)||0!==e.indexOf("__rep__me__")&&0!==e.indexOf("__nimble__")||(i[t]=sektionsLocalizedData.prefixForSettingsNotSaved+d.czr_sektions.guid())}),i},isImportedContentEligibleForAPI:function(e,t){var i=!0,n=e.data,o=null;e.success||(o=[sektionsLocalizedData.i18n["Import failed"],n].join(" : ")),_.isNull(o)&&!_.isObject(n)&&(o=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var r=n.data,s=n.metas,a=n.img_errors;_.isNull(o)&&!_.isObject(r)&&(o=sektionsLocalizedData.i18n["Import failed, invalid file content"]),_.isNull(o)&&!_.isObject(s)&&(o=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var l=d.czr_sektions.localSectionsSettingId();if(t.is_file_import){var c=t.input;l="local"===d.czr_sektions.getInputRegistrationParams(c.id,c.module.module_type).scope?l:d.czr_sektions.getGlobalSectionsSettingId()}return _.isNull(o)&&_.isEqual(d(l)(),r)&&(d.infoLog("::isImportedContentEligibleForAPI => Setting unchanged"),i=!1),_.isNull(o)||(d.errare("::isImportedContentEligibleForAPI => invalid data sent from server",n),d.errare("::isImportedContentEligibleForAPI => importErrorMsg",o),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",o,"</strong>","</span>"].join("")}),i=!1),_.isEmpty(a)||d.previewer.trigger("sek-notify",{notif_id:"img-import-errors",type:"info",duration:6e4,message:['<span style="color:#0075a2">',["<strong>"+sektionsLocalizedData.i18n["Some image(s) could not be imported"]+"</strong><br/>",'<span style="font-size:11px">'+a+"</span>"].join(" : "),"</span>"].join("")}),i},doUpdateApiSettingAfter_FileImport:function(e,t){if(t=t||{},d.czr_sektions.isImportedContentEligibleForAPI(e,t)||!t.is_file_import){var i="local",n=!1;if(t.is_file_import){var o=t.input,r=d.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type);i=r.scope,n="local"===r.scope&&o.input_parent.czr_Input("keep_existing_sections")()}d.czr_sektions.updateAPISetting({action:"sek-import-from-file",scope:i,imported_content:e.data,assign_missing_locations:t.assign_missing_locations,keep_existing_sections:n}).done(function(){"local"===i&&d.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),d.previewer.refresh(),d.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["File successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){d.errare("::doUpdateApiSettingAfter_FileImport => error when firing ::updateAPISetting",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),d.previewer.refresh()}else d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},doAlwaysAfterFileImportAndApiSettingUpdate:function(e){if(d.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0}),e=e||{},(e=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},e)).is_file_import){var t=e.input;t.container.find(".sek-uploading").hide(),e.file_input.val("").trigger("change"),t.container.find(".czr-import-dialog").hide(),t.container.find('button[data-czr-action="sek-pre-import"]').show()}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,d){d.extend(CZRSeksPrototype,{setupTemplateGallery:function(){var i=this;i.templateGalleryExpanded=new o.Value(!1),i.tmplInjectDialogVisible=new o.Value(!1),sektionsLocalizedData.isTemplateGalleryEnabled&&(i.tmplSearchFieldVisible=new o.Value(!1),i.tmplSearchFieldVisible.bind(function(e){var t=i.cachedElements.$body.find(".sek-tmpl-filter-wrapper");e?t.fadeIn("fast"):t.fadeOut("fast")}),i.templateGalleryExpanded.bind(function(e){i.cachedElements.$body.toggleClass("sek-template-gallery-expanded",e),e?(i.tmplDialogVisible(!1),i.levelTreeExpanded(!1),i.tmplInjectDialogVisible(!1),d("#customize-preview iframe").css("z-index",1),i.renderOrRefreshTempGallery({tmpl_source:"api_tmpl"})):(d("#customize-preview iframe").css("z-index",""),o.trigger("nb-template-gallery-closed"))}),i.tmplInjectDialogVisible.bind(function(e){i.cachedElements.$body.toggleClass("sek-tmpl-dialog-expanded",e),e&&(i.tmplDialogVisible(!1),i.levelTreeExpanded(!1),d("#customize-preview iframe").css("z-index",1))}),o.previewer.bind("ready",function(){i.templateGalleryExpanded(!1)}))},renderTmplGalleryUI:function(){if(0<d("#nimble-tmpl-gallery").length)return d("#nimble-tmpl-gallery");try{_tmpl=wp.template("nimble-top-tmpl-gallery")({})}catch(e){return o.errare("Error when parsing nimble-top-tmpl-gallery template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-tmpl-gallery")},renderOrRefreshTempGallery:function(t){t=d.extend({tmpl_source:"api_tmpl"},t||{});var i,n=this;d("#nimble-tmpl-gallery").length<1&&d.when(n.renderTmplGalleryUI({})).done(function(){n.setupTmplGalleryDOMEvents()}),d("#nimble-tmpl-gallery").find(".sek-tmpl-gallery-inner").html("");var o=function(e){return n.getTemplateGalleryHtml(e).done(function(e){(i=d("#nimble-tmpl-gallery")).find(".sek-tmpl-gallery-inner").html(e)}),n.getTemplateGalleryHtml(e)};o(t).done(function(e){_.isEmpty(e)&&"api_tmpl"===t.tmpl_source?("function"==typeof window.console.log&&console.log("Nimble Builder API problem => could not fetch templates"),o({tmpl_source:"user_tmpl"})):((i=d("#nimble-tmpl-gallery")).find("#sek-tmpl-source-switcher").show(),i.find("#sek-tmpl-source-switcher button").attr("aria-pressed","false").removeClass("is-selected"),i.find('[data-sek-tmpl-source="'+t.tmpl_source+'"]').attr("aria-pressed","true").addClass("is-selected"))})},getTemplateGalleryHtml:function(n){var o,r,t=this,s="",a=[sektionsLocalizedData.baseUrl,"/assets/admin/img/wire_frame.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),l=d.Deferred(),c=d("#nimble-tmpl-gallery").find(".czr-css-loader");c.show();return("user_tmpl"===n.tmpl_source?t.setSavedTmplCollection:t.getApiTmplCollection).call(t).done(function(e){setTimeout(function(){!function(e){if(_.isEmpty(e)&&"user_tmpl"===n.tmpl_source){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/empty_tmpl_collection_notice.jpg","?ver=",sektionsLocalizedData.nimbleVersion].join(""),i="https://docs.presscustomizr.com/article/426-how-to-save-and-reuse-templates-with-nimble-builder";s+='<div class="sek-tmpl-empty-collection">',s+="<p>"+sektionsLocalizedData.i18n["You did not save any template yet."]+"</p>",s+='<img src="'+t+'" />',s+='<br/><a href="'+i+'" target="_blank" rel="noreferrer nofollow">'+i+"</a>",s+="</div>"}else _.each(e,function(e,t){o=_.isEmpty(e.description)?[e.title,e.last_modified_date].join(" | "):[e.title,e.last_modified_date,e.description].join(" | "),r=_.isEmpty(e.thumb_url)?a:e.thumb_url,s+='<div class="sek-tmpl-item" data-sek-tmpl-item-id="'+t+'" data-sek-tmpl-item-source="'+n.tmpl_source+'">',s+='<div class="sek-tmpl-thumb" style="background-image:url('+r+')"></div>',s+='<div class="sek-tmpl-info" title="'+o+'">',s+='<h3 class="tmpl-title">'+e.title+"</h3>",s+='<p class="tmpl-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",s+='<p class="tmpl-desc">'+e.description+"</p>",s+='<i class="material-icons use-tmpl" title="'+sektionsLocalizedData.i18n["Use this template"]+'">add_circle_outline</i>',"user_tmpl"===n.tmpl_source&&(s+='<i class="material-icons edit-tmpl" title="'+sektionsLocalizedData.i18n["Edit this template"]+'">edit</i>',s+='<i class="material-icons remove-tmpl" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>'),"true"==e.is_pro_tmpl&&(s+='<div class="sek-is-pro"><img src="'+sektionsLocalizedData.czrAssetsPath+'sek/img/pro_orange.svg" alt="Pro feature"/></div>'),s+="</div>",s+="</div>"});0<c.length?c.hide({duration:100,complete:function(){l.resolve(s)}}):l.resolve(s)}(e),t.tmplSearchFieldVisible(!_.isEmpty(e))},0)}).fail(function(){console.log("tmpl collection promise failed",n),l.resolve("")}),l.promise()},setupTmplGalleryDOMEvents:function(){var c=d("#nimble-tmpl-gallery"),n=this;c.on("click",".sek-tmpl-item .use-tmpl",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-id"),i=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-source");_.isEmpty(t)?o.errare("::setupTmplGalleryDOMEvents => error => invalid template id"):n.hasCurrentPageNBSectionsNotHeaderFooter()?(n._tmplNameWhileImportDialog=t,n._tmplSourceWhileImportDialog=i,n.tmplInjectDialogVisible(!0)):(o.czr_sektions.get_gallery_tmpl_json_and_inject({tmpl_name:t,tmpl_source:i}),n.templateGalleryExpanded(!1))}).on("click",".sek-tmpl-gal-inject-dialog .sek-ui-button",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).data("sek-tmpl-inject-mode");"cancel"!==t?_.contains(["replace","before","after"],t)?(o.czr_sektions.get_gallery_tmpl_json_and_inject({tmpl_name:n._tmplNameWhileImportDialog,tmpl_source:n._tmplSourceWhileImportDialog,tmpl_inject_mode:t}),n.templateGalleryExpanded(!1)):o.errare("::setupTmplGalleryDOMEvents => error => invalid import mode"):n.tmplInjectDialogVisible(!1)}).on("propertychange change click keyup input paste",".sek-filter-tmpl",_.debounce(function(e){e.preventDefault();var t,i,n,o,r,s,a=d(this).val(),l=function(){c.removeClass("search-active"),c.find(".sek-tmpl-item").each(function(){d(this).removeClass("search-match")})};_.isString(a)?(a=a.trim().toLowerCase(),_.isEmpty(a.replace(/\s/g,""))?l():(c.addClass("search-active"),c.find(".sek-tmpl-item").each(function(){t=(d(this).find(".tmpl-title").html()+"").toLowerCase(),i=(d(this).find(".tmpl-desc").html()+"").toLowerCase(),n=(d(this).find(".tmpl-date").html()+"").toLowerCase(),o=-1!=t.indexOf(a),r=-1!=i.indexOf(a),s=-1!=n.indexOf(a),d(this).toggleClass("search-match",o||r||s)}))):l()},100)).on("click",".sek-tmpl-info .edit-tmpl",function(e){e.preventDefault();var t=function(e){n.tmplDialogMode("edit"),n.tmplDialogMode.unbind(t)};n.tmplToEdit=d(this).closest("[data-sek-tmpl-item-id]").data("sek-tmpl-item-id"),n.tmplDialogMode.bind(t),n.tmplDialogVisible(!0)}).on("click",".sek-tmpl-info .remove-tmpl",function(e){e.preventDefault();var t=function(e){n.tmplDialogMode("remove"),n.tmplDialogMode.unbind(t)};n.tmplToRemove=d(this).closest("[data-sek-tmpl-item-id]").data("sek-tmpl-item-id"),n.tmplDialogMode.bind(t),n.tmplDialogVisible(!0)}).on("click",".sek-close-dialog",function(e){e.preventDefault(),n.templateGalleryExpanded(!1)}).on("click","#sek-tmpl-source-switcher button",function(e){e.preventDefault(),d("#sek-tmpl-source-switcher button").removeClass("is-selected").attr("aria-pressed","false"),d(this).addClass("is-selected").attr("aria-pressed","true"),n.renderOrRefreshTempGallery({tmpl_source:d(this).data("sek-tmpl-source")})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(t,e){jQuery.extend(CZRSeksPrototype,t.Events);var i=t.Class.extend(CZRSeksPrototype);try{t.czr_sektions=new i}catch(e){t.errare("api.czr_sektions => problem on instantiation",e)}}(wp.customize),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{content_type_switcher:function(e){var i,n=this,o=r.czr_sektions;if(!r.section.has(n.module.control.section()))throw new Error("api.czrInputMap.content_type_switcher => section not registered");i=r.section(n.module.control.section());var t=function(t){n.container.find('[data-sek-content-type="'+(t||"module")+'"]').trigger("click"),a.each(i.controls(),function(e){a.isUndefined(e.content_type)||e.active(t===e.content_type)})};r.czr_sektions.currentContentPickerType=r.czr_sektions.currentContentPickerType||new r.Value,r.bind("nimble-modules-and-sections-controls-registered",function(){t(r.czr_sektions.currentContentPickerType())}),r.czr_sektions.currentContentPickerType.bind(function(e){t(e)}),r.czr_sektions.currentContentPickerType(n()),n.container.on("click","[data-sek-content-type]",function(e){e.preventDefault();var t=s(this).data("sek-content-type");if(n.container.find("[data-sek-content-type]").attr("aria-pressed",!1),o.levelTreeExpanded(!1),o.tmplDialogVisible&&o.tmplDialogVisible(!1),o.saveSectionDialogVisible&&o.saveSectionDialogVisible(!1),"template"===t){var i=r.czr_sektions.templateGalleryExpanded();s(this).attr("aria-pressed",!i),r.czr_sektions.templateGalleryExpanded(!i)}else r.czr_sektions.templateGalleryExpanded(!1),s(this).attr("aria-pressed",!0),r.czr_sektions.currentContentPickerType(t)}),r.bind("nb-template-gallery-closed",function(){n.container.find('[data-sek-content-type="template"]').attr("aria-pressed",!1)}),t(r.czr_sektions.currentContentPickerType())}})}(wp.customize,jQuery,_),function(t,e,i){t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{module_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"module",input_container:this.container})},section_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:this.container})}})}(wp.customize,jQuery,_),function(s,a,l){s.czrInputMap=s.czrInputMap||{},a.extend(s.czrInputMap,{module_option_switcher:function(e){var t=this;if(!s.section.has(t.module.control.section()))throw new Error(t.input_type+" => section not registered");s.section(t.module.control.section());var i,n="",o=t.module.control.params.sek_registration_params;if(l.isUndefined(o))throw new Error(t.input_type+" => missing registration params");if(o&&o.module_id&&(n=o.module_id,i=o.ui_action),l.isEmpty(n))throw new Error(t.input_type+" => missing module id");t.container.on("click","[data-sek-option-type]",function(e){e.preventDefault(),t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),a(this).addClass("is-selected").attr("aria-pressed",!0),s.previewer.trigger("settings"===a(this).data("sek-option-type")?"sek-edit-options":"sek-edit-module",{id:n,level:"module"})});var r="sek-generate-level-options-ui"===i?"settings":"content";t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),t.container.find('[data-sek-option-type="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(c,d,p){c.czrInputMap=c.czrInputMap||{};var u=function(e){return p.contains(["px","em","%"],e)||(c.errare("error : invalid unit for input "+this.id,e),e="px"),e},_=function(i){var n=this;i.on("click",".sek-ui-button",function(e,t){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),d(this).addClass("is-selected").attr("aria-pressed",!0),n.css_unit(d(this).data("sek-unit"),t)}),i.find('.sek-ui-button[data-sek-unit="'+(n.initial_unit||"px")+'"]').addClass("is-selected").attr("aria-pressed",!0)},m=function(t,i){var n=this;t.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),t.find('input[type="number"]').each(function(){d(this).val("")}),n(i),d(".sek-unit-wrapper",t).find('[data-sek-unit="px"]').trigger("click")})};d.extend(c.czrInputMap,{spacing:function(e){var o=this,i=d(".sek-spacing-wrapper",o.container),t=c.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),n=p.isEmpty(t)||p.isEmpty(t.default)?[]:t.default;if(i.on("input",'input[type="number"]',function(e){var t=d(this).closest("[data-sek-spacing]").data("sek-spacing"),i=d.extend(!0,{},p.isObject(o())?o():{}),n=d(this).val();p.isString(n)&&!p.isEmpty(n)||p.isNumber(n)?i[t]=n:i=p.omit(i,t),o(i)}),m.call(o,i,n),p.isObject(o())){p.each(o(),function(e,t){d('[data-sek-spacing="'+t+'"]',i).find('input[type="number"]').val(e)});var r="px";d(".sek-unit-wrapper .sek-ui-button",o.container).each(function(){var e=d(this).data("sek-unit");p.isEmpty(o())||p.isEmpty(o().unit)||e===o().unit&&(r=e)}),d(".sek-unit-wrapper",o.container).find('[data-sek-unit="'+u.call(o,r)+'"]').trigger("click")}var s=o();o.initial_unit="px",p.isEmpty(s)||(o.initial_unit=p.isEmpty(s.unit)?"px":s.unit),o.css_unit=new c.Value(u.call(o,o.initial_unit)),o.css_unit.bind(function(e){var t;e=p.isEmpty(e)?"px":e,(t=d.extend(!0,{},p.isObject(o())?o():{})).unit=e,o(t)}),_.call(o,i)}}),d.extend(c.czrInputMap,{spacingWithDeviceSwitcher:function(e){var r=this,s=d(".sek-spacing-wrapper",r.container),t=c.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=p.isEmpty(t)||p.isEmpty(t.default)?{}:t.default,l=function(e,t){var i=["mobile","tablet","desktop"];if(p.has(e,t))return e[t];var n=p.findIndex(i,function(e){return t===e});return!p.isEmpty(t)&&n<i.length?l(e,i[n+1]):{}},i=function(e){var t=d.extend(!0,{},p.isObject(r())?r():{}),i=d.extend(!0,{},a);t=p.isObject(t)?d.extend(i,t):i;var n=l(t,e);d("[data-sek-spacing]",s).each(function(){var e=d(this).data("sek-spacing"),t="";p.isEmpty(n)||p.isEmpty(n[e])||(t=n[e]),d(this).find('input[type="number"]').val(t)});var o="px";d(".sek-unit-wrapper .sek-ui-button",r.container).each(function(){var e=d(this).data("sek-unit");p.isEmpty(n)||p.isEmpty(n.unit)||e===n.unit&&(o=e)}),d(".sek-unit-wrapper",r.container).find('[data-sek-unit="'+u.call(r,o)+'"]').trigger("click",{previewed_device_switched:!0})};c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r);var n=r();r.initial_unit="px",p.isEmpty(n)||p.isEmpty(n[r.previewedDevice()])||(r.initial_unit=p.isEmpty(n[r.previewedDevice()].unit)?"px":n[r.previewedDevice()].unit),r.css_unit=new c.Value(u.call(r,r.initial_unit)),s.on("input",'input[type="number"]',function(e){var t,i=d(this).closest("[data-sek-spacing]").data("sek-spacing"),n=d(this).val(),o=c.previewedDevice()||"desktop";(t=d.extend(!0,{},p.isObject(r())?r():{}))[o]=d.extend(!0,{},t[o]||{}),p.isString(n)&&!p.isEmpty(n)||p.isNumber(n)?t[o][i]=n:t[o]=p.omit(t[o],i),t[o].unit&&r.css_unit()==t[o].unit||(t[o].unit=r.css_unit()),r(t)}),m.call(r,s,a),r.previewedDevice.bind(function(e){try{i(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}),r.css_unit.bind(function(e,t,i){if(!p.isObject(i)||!0!==i.previewed_device_switched){e=p.isEmpty(e)?"px":e;var n,o=r.previewedDevice()||"desktop";(n=d.extend(!0,{},p.isObject(r())?r():{}))[o]=d.extend(!0,{},n[o]||{}),n[o].unit=e,r(n)}}),_.call(r,s);try{i(c.previewedDevice())}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}})}(wp.customize,jQuery,_),function(n,a,l){n.czrInputMap=n.czrInputMap||{},a.extend(n.czrInputMap,{bg_position:function(e){var t=this;a(".sek-bg-pos-wrapper",t.container).on("change",'input[type="radio"]',function(e){t(a(this).val())}),l.isEmpty(t())||t.container.find('input[value="'+t()+'"]').attr("checked",!0).trigger("click")},bgPositionWithDeviceSwitcher:function(e){var o=this,t=n.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),r=l.isEmpty(t)||l.isEmpty(t.default)?{}:t.default;n.czr_sektions.maybeSetupDeviceSwitcherForInput.call(o);var s=function(e,t){var i=["mobile","tablet","desktop"];if(l.has(e,t))return e[t];var n=l.findIndex(i,function(e){return t===e});return!l.isEmpty(t)&&n<i.length?s(e,i[n+1]):{}},i=function(e){var t=a.extend(!0,{},l.isObject(o())?o():{}),i=a.extend(!0,{},r);t=l.isObject(t)?a.extend(i,t):i;var n=s(t,e);o.container.find('input[value="'+n+'"]').attr("checked",!0).trigger("click",{previewed_device_switched:!0})};a(".sek-bg-pos-wrapper",o.container).on("change",'input[type="radio"]',function(e){var t,i=a(this).val();(t=a.extend(!0,{},l.isObject(o())?o():{}))[n.previewedDevice()||"desktop"]=i,o(t)}),o.previewedDevice.bind(function(e){try{i(e)}catch(e){n.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+o.id,e)}});try{i(n.previewedDevice())}catch(e){n.errare("Error when firing syncWithPreviewedDevice for input type bgPositionWithDeviceSwitcher for input id "+o.id,e)}}})}(wp.customize,jQuery,_),function(l,c,d){l.czrInputMap=l.czrInputMap||{};var e=function(e){var o=this,t=l.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),r=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i="verticalAlignWithDeviceSwitcher"===o.type?".sek-v-align-wrapper":".sek-h-align-wrapper",s=c(i,o.container);l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(o);var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var n=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&n<i.length?a(e,i[n+1]):{}},n=function(e){var t=c.extend(!0,{},d.isObject(o())?o():{}),i=c.extend(!0,{},r);t=d.isObject(t)?c.extend(i,t):i;var n=a(t,e);s.find(".selected").removeClass("selected"),s.find('div[data-sek-align="'+n+'"]').addClass("selected")};s.on("click","[data-sek-align]",function(e){var t;e.preventDefault(),(t=c.extend(!0,{},d.isObject(o())?o():{}))[l.previewedDevice()||"desktop"]=c(this).data("sek-align"),s.find(".selected").removeClass("selected"),c.when(c(this).addClass("selected")).done(function(){o(t)})}),o.previewedDevice.bind(function(e){try{n(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type : "+o.type+" for input id "+o.id,e)}});try{n(l.previewedDevice())}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type : "+o.type+" for input id "+o.id,e)}};c.extend(l.czrInputMap,{horizTextAlignmentWithDeviceSwitcher:e,horizAlignmentWithDeviceSwitcher:e,verticalAlignWithDeviceSwitcher:e})}(wp.customize,jQuery,_),function(f,g,h){f.czrInputMap=f.czrInputMap||{},g.extend(f.czrInputMap,{font_picker:function(e){var u=this,_=u.input_parent,n=function(e,t){_();var n=g('select[data-czrtype="'+u.id+'"]',u.container);h.isNull(u())||h.isEmpty(u())?n.append('<option value="none" selected="selected">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"):n.append('<option value="none">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>");var i=[{title:sektionsLocalizedData.i18n["Web safe fonts"],type:"cfont",list:t.cfonts},{title:sektionsLocalizedData.i18n["Google fonts"],type:"gfont",list:t.gfonts}],o=f.czr_sektions.sniffAllFonts(),r=sektionsLocalizedData.alreadyUsedFonts,s=[],a=[];if(!h.isEmpty(r)&&h.isObject(r)&&h.each(r,function(e){a.push(e)}),h.isArray(o)&&h.each(o,function(e){a.push(e)}),!h.isEmpty(a)){var l={},c=[];a.forEach(function(e){l[e]=(l[e]||0)+1});var d=h.sortBy(l,function(e){return e});h.each(d,function(i){h.each(l,function(e,t){i!==e||h.contains(c,t)||c.unshift(t)})}),h.each(c,function(e){s.push({name:e})}),i.unshift({title:sektionsLocalizedData.i18n["Already used fonts"],type:null,list:s})}h.each(i,function(e){var t,r,s,i=g("<optgroup>",{label:e.title,html:(t=e.list,r=e.type,s="",h.each(t,function(e){var t,i,n=h.isString(e.name)?e.name:"Undefined Font Family",o=n.replace(/[+|:]/g," ");t=n,i=r,n=h.isEmpty(i)?t:h.isString(t)?["[",i,"]",t].join(""):"",o=o.replace("[cfont]","").replace("[gfont]",""),n==u()?s+='<option selected="selected" value="'+n+'">'+o+"</option>":s+='<option value="'+n+'">'+o+"</option>"}),s)});n.append(i)});var p={escapeMarkup:function(e){return e}};e&&g.extend(p,{resultsAdapter:e,closeOnSelect:!1}),n.czrSelect2(p),g(".czrSelect2-selection__rendered",u.container).css(m(u()))},m=function(e){if(!h.isString(e)||h.isEmpty(e))return{};var t,i,n,o=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return t=r(e),i=o[1]?o[1].replace(/[^0-9.]+/g,""):400,i=h.isNumber(i)?i:400,n=o[1]&&-1!=o[1].indexOf("italic")?"italic":"",{"font-family":"none"==t?"inherit":t.replace(/[+|:]/g," "),"font-weight":i||400,"font-style":n||"normal"}},r=function(e){if(!h.isString(e)||h.isEmpty(e))return e;var t=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return h.isString(t[0])?t[0].replace(/[+|:]/g," "):""};g.when(function(){var e,t=g.Deferred();h.isEmpty(f.sek_fontCollections)?(h.isUndefined(f.sek_fetchingFontCollection)||"pending"!=f.sek_fetchingFontCollection.state()?(e=f.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"font_picker_input",module_id:u.module.id}),f.sek_fetchingFontCollection=e):e=f.sek_fetchingFontCollection,e.done(function(e){if("string"!=typeof e||"{"!==e[0])throw new Error("font_picker => server list is not JSON.parse-able");f.sek_fontCollections=JSON.parse(e),t.resolve(f.sek_fontCollections)}).fail(function(e){t.reject(e)})):t.resolve(f.sek_fontCollections);return t.promise()}()).done(function(t){var i;(i=g.Deferred(),void 0!==g.fn.czrSelect2&&void 0!==g.fn.czrSelect2.amd&&"function"==typeof g.fn.czrSelect2.amd.require?g.fn.czrSelect2.amd.require(["czrSelect2/results","czrSelect2/utils"],function(e,t){var n=function(e,t,i){n.__super__.constructor.call(this,e,t,i)};t.Extend(n,e),n.prototype.bind=function(e,t){var i=this;e.on("results:focus",function(e){"true"!=e.element.attr("aria-selected")&&i.trigger("select",{data:e.data})}),n.__super__.bind.call(this,e,t)},i.resolve(n)}):i.resolve(!1),i.promise()).done(function(e){n(e,t)})}).fail(function(e){f.errare("font_picker => fail response =>",e)})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{fa_icon_picker:function(){var n=this,o=!1,e=function(t){!0!==n.iconCollectionSet&&(s.when(s.Deferred(function(t){a.isEmpty(n.sek_faIconCollection)?r.CZR_Helpers.getModuleTmpl({tmpl:"icon_list",module_type:"fa_icon_picker_input",module_id:n.module.id}).done(function(e){if("string"!=typeof e||"["!==e[0])throw new Error("fa_icon_picker => server list is not JSON.parse-able");n.sek_faIconCollection=JSON.parse(e),t.resolve(n.sek_faIconCollection)}).fail(function(e){t.reject(e)}):t.resolve(n.sek_faIconCollection)})).done(function(e){!function(e){a.each(e,function(e){var t={value:e,html:r.CZR_Helpers.capitalize(e.substring(7))};t.value==n()&&(s.extend(t,{selected:"selected"}),o=!0),s("select[data-czrtype]",n.container).append(s("<option>",t))});var t,i=function(e){return e.id?s('<span class="'+e.element.value+'"></span><span class="social-name">&nbsp;&nbsp;'+e.text+"</span>"):e.text};t=o?s("<option>"):s("<option>",{selected:"selected"}),s("select[data-czrtype]",n.container).prepend(t).czrSelect2({templateResult:i,templateSelection:i,placeholder:sektionsLocalizedData.i18n["Select an icon"],allowClear:!0})}(e),t&&!0===t.open_on_init&&a.delay(function(){try{s("select[data-czrtype]",n.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){r.errare("fa_icon_picker => fail response =>",e)}),n.iconCollectionSet=!0)};n.container.on("click",function(){e()}),a.delay(function(){e({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(u,_,m){u.czrInputMap=u.czrInputMap||{},_.extend(u.czrInputMap,{code_editor:function(e){var n,r=this,i=this.module.control,o=(r.input_parent(),!1),s=r.container.find("textarea"),a=r.container.find(".customize-control-title"),l=function(){return _.Deferred(function(t){var i=m.isEmpty(s.data("editor-code-type"))?"text/html":s.data("editor-code-type");u.czr_sektions.code_editor_params&&u.czr_sektions.code_editor_params[i]?t.resolve(u.czr_sektions.code_editor_params[i]):wp.ajax.post("sek_get_code_editor_params",{nonce:u.settings.nonce.save,code_type:i}).done(function(e){m.isObject(e)||u.errare(r.id+" => error => invalid code editor params sent by server",e),u.czr_sektions.code_editor_params={},u.czr_sektions.code_editor_params[i]=e,t.resolve(u.czr_sektions.code_editor_params[i])}).fail(function(e){t.reject(e)})})};r.isReady.done(function(){var t=function(e){m.isEmpty(this.editor)&&(m.isEmpty(this.module.control.container.attr("data-sek-expanded"))||"false"==this.module.control.container.attr("data-sek-expanded")||setTimeout(function(){if(o)try{c(o)}catch(e){u.errare("error in sek_control => code_editor() input",e),d()}else d();a.trigger("click")},10))};n=r(),u.czr_sektions.isJsonString(n)&&(n=JSON.parse(n)),s.html(n),_.when(l()).done(function(e){wp.codeEditor&&(m.isUndefined(e)||!1!==e)&&(o=e),t.call(r),r.module.control.container.first().one("sek-accordion-expanded",function(){t.call(r)})}).fail(function(e){u.errare(r.id+" => error when getting the editor params from server")})});var c=function(e){var t,i=!1;t=m.extend({},e,{onTabNext:CZRSeksPrototype.selectNextTabbableOrFocusable(":tabbable"),onTabPrevious:CZRSeksPrototype.selectPrevTabbableOrFocusable(":tabbable"),onUpdateErrorNotice:p}),r.editor=wp.codeEditor.initialize(s,t),_(r.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-label":a.html(),"aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),a.on("click",function(e){e.stopPropagation(),r.editor.codemirror.focus()}),r.editor.codemirror.on("change",function(e){i=!0,s.val(e.getValue()).trigger("change"),i=!1}),n=r(),u.czr_sektions.isJsonString(n)&&(n=JSON.parse(n)),r.editor.codemirror.setValue(n),r.bind(r.id+":changed",function(e){i||r.editor.codemirror.setValue(e)}),r.editor.codemirror.on("keydown",function(e,t){27===t.keyCode&&t.stopPropagation()})},d=function(){var o=s[0];r.editor=o,s.on("blur",function(){s.data("next-tab-blurs",!1)}),s.on("keydown",function(e){var t,i,n;27!==e.keyCode?9!==e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||s.data("next-tab-blurs")||(t=o.selectionStart,i=o.selectionEnd,n=o.value,0<=t&&(o.value=n.substring(0,t).concat("\t",n.substring(i)),s.selectionStart=o.selectionEnd=t+1),e.stopPropagation(),e.preventDefault()):s.data("next-tab-blurs")||(s.data("next-tab-blurs",!0),e.stopPropagation())})},p=function(e){var t;i.setting.notifications.remove(r.id),0!==e.length&&(t=1===e.length?sektionsLocalizedData.i18n.codeEditorSingular.replace("%d","1").replace("%s",a.html()):sektionsLocalizedData.i18n.codeEditorPlural.replace("%d",String(e.length)).replace("%s",a.html()),i.setting.notifications.add(r.id,new u.Notification(r.id,{message:t,type:"warning"})))}}})}(wp.customize,jQuery,_),function(e,r,t){e.czrInputMap=e.czrInputMap||{},r.extend(e.czrInputMap,{range_simple:function(e){var t=this,i=r(".sek-range-with-unit-picker-wrapper",t.container),n=i.find('input[type="number"]'),o=i.find('input[type="range"]');o.on("input",function(e){n.val(r(this).val()).trigger("input")}),n.on("input",function(e){t(r(this).val()),o.val(r(this).val())}),o.val(n.val()||0)},number_simple:function(e){var t=this;t.container.find('input[type="number"]').on("input",function(e){t(r(this).val())})}})}(wp.customize,jQuery,_),function(d,p,u){d.czrInputMap=d.czrInputMap||{},p.extend(d.czrInputMap,{range_simple_device_switcher:function(e){var s=this,t=p(".sek-range-with-unit-picker-wrapper",s.container),a=t.find('input[type="number"]'),r=t.find('input[type="range"]'),i=d.czr_sektions.getInputRegistrationParams(s.id,s.module.module_type),l=u.isEmpty(i)||u.isEmpty(i.default)?{}:i.default,c=function(e,t){var i=["mobile","tablet","desktop"];if(u.has(e,t))return e[t];var n=u.findIndex(i,function(e){return t===e});return!u.isEmpty(t)&&n<i.length?c(e,i[n+1]):p.extend(!0,{desktop:""},l).desktop},n=function(e){var t=s(),i={};i=p.extend(!0,{},l),u.isObject(t)?i=p.extend(!0,{},t):u.isString(t)&&!u.isEmpty(t)&&(i={desktop:t});var n,o=c(i,e),r=(n=o,u.isEmpty(n)||!u.isString(n)?"16":n.replace(/px|em|%/g,""));a.val(r).trigger("input",{previewed_device_switched:!0})};d.czr_sektions.maybeSetupDeviceSwitcherForInput.call(s),r.on("input",function(e){a.val(p(this).val()).trigger("input")}),a.on("input",function(e,t){var i,n=d.previewedDevice()||"desktop",o=p(this).val();(i=p.extend(!0,{},u.isObject(s())?s():{}))[n]=p.extend(!0,{},i[n]||{}),u.isString(o)&&!u.isEmpty(o)&&(i[n]=o),(u.isEmpty(t)||u.isObject(t)&&!0!==t.previewed_device_switched)&&s(i),r.val(p(this).val())}),s.previewedDevice.bind(function(e){try{n(e)}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}),r.val(a.val()||0);try{n(d.previewedDevice())}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}})}(wp.customize,jQuery,_),function(a,l,c){a.czrInputMap=a.czrInputMap||{},l.extend(a.czrInputMap,{range_with_unit_picker:function(e){var t=this,i=l(".sek-range-with-unit-picker-wrapper",t.container),n=i.find('input[type="number"]'),o=i.find('input[type="range"]'),r=i.find("input[data-czrtype]").data("sek-unit"),s=function(e){return c.contains(["px","em","%"],e)||(a.errare("error : invalid unit for input "+t.id,e),e="px"),e};t.css_unit=new a.Value(c.isEmpty(r)?"px":s(r)),t.css_unit.bind(function(e){e=c.isEmpty(e)?"px":e,i.find('input[type="number"]').trigger("input")}),o.on("input",function(e){n.val(l(this).val()).trigger("input")}),n.on("input",function(e){t(l(this).val()+s(t.css_unit())),o.val(l(this).val())}),o.val(n.val()||0),i.on("click",".sek-ui-button",function(e){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),l(this).addClass("is-selected").attr("aria-pressed",!0),i.find("input[data-czrtype]").data("sek-unit",l(this).data("sek-unit")),t.css_unit(l(this).data("sek-unit"))}),i.find('.sek-ui-button[data-sek-unit="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(a,_,m){a.czrInputMap=a.czrInputMap||{},_.extend(a.czrInputMap,{range_with_unit_picker_device_switcher:function(e){var l=this,c=_(".sek-range-with-unit-picker-wrapper",l.container),d=c.find('input[type="number"]'),r=c.find('input[type="range"]'),s=function(e){return m.contains(["px","em","%"],e)||(a.errare("range_with_unit_picker_device_switcher => error : invalid unit for input "+l.id,e),e="px"),e},t=a.czr_sektions.getInputRegistrationParams(l.id,l.module.module_type),p=m.isEmpty(t)||m.isEmpty(t.default)?{}:t.default,i=function(){return c.find("input[data-czrtype]").data("sek-unit")||"px"},u=function(e,t){var i=["mobile","tablet","desktop"];if(m.has(e,t))return e[t];var n=m.findIndex(i,function(e){return t===e});return!m.isEmpty(t)&&n<i.length?u(e,i[n+1]):_.extend(!0,{desktop:""},p).desktop},n=function(e){var t=l(),i={};i=_.extend(!0,{},p),m.isObject(t)?i=_.extend(!0,{},t):m.isString(t)&&!m.isEmpty(t)&&(i={desktop:t});var n,o,r=u(i,e),s=(o=r,m.isEmpty(o)||!m.isString(o)?"px":o.replace(/[0-9]|\.|,/g,"")),a=(n=r,m.isEmpty(n)||!m.isString(n)?"16":n.replace(/px|em|%/g,""));_(".sek-unit-wrapper",c).find('[data-sek-unit="'+s+'"]').trigger("click",{previewed_device_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+s+'"]').addClass("is-selected").attr("aria-pressed",!0),d.val(a).trigger("input",{previewed_device_switched:!0})};a.czr_sektions.maybeSetupDeviceSwitcherForInput.call(l),l.css_unit=new a.Value(m.isEmpty(i())?"px":s(i()));var o='<button type="button" class="button sek-reset-button sek-float-right">'+sektionsLocalizedData.i18n.Reset+"</button>";l.container.find(".customize-control-title").append(o),l.css_unit.bind(function(e,t,i){m.isObject(i)&&!0===i.previewed_device_switched||d.trigger("input")}),r.on("input",function(e){d.val(_(this).val()).trigger("input")}),d.on("input",function(e,t){var i,n=a.previewedDevice()||"desktop",o=_(this).val()+s(l.css_unit());(i=_.extend(!0,{},m.isObject(l())?l():{}))[n]=_.extend(!0,{},i[n]||{}),m.isString(o)&&!m.isEmpty(o)&&(i[n]=o),(m.isEmpty(t)||m.isObject(t)&&!0!==t.previewed_device_switched)&&l(i),r.val(_(this).val())}),c.on("click",".sek-ui-button",function(e,t){e.stopPropagation(),c.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),_(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",_(this).data("sek-unit")),l.css_unit(_(this).data("sek-unit"),t)}),l.previewedDevice.bind(function(e){try{n(e)}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+l.id,e)}}),l.container.on("click",".sek-reset-button",function(e){var t=a.previewedDevice(),i=_.extend(!0,{},m.isObject(l())?l():{});m.isEmpty(i[t])||(i=m.omit(i,t),l(i),n(a.previewedDevice()))}),r.val(d.val()||0);try{n(a.previewedDevice())}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+l.id,e)}}})}(wp.customize,jQuery,_),function(g,h,v){g.czrInputMap=g.czrInputMap||{},h.extend(g.czrInputMap,{borders:function(e){var a=this,l=h(".sek-borders",a.container),c=l.find('input[type="number"]'),d=l.find('input[type="range"]'),p=l.find(".sek-alpha-color-input"),u=function(e){return v.contains(["px","em","%"],e)||(g.errare("borders => error : invalid unit for input "+a.id,e),e="px"),e},_=function(e){return v.isEmpty(e)||!v.isString(e)?"16":e.replace(/px|em|%/g,"")},m=function(e){return v.isEmpty(e)||!v.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=g.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),f=v.isEmpty(t)||v.isEmpty(t.default)?{}:t.default;a.cssBorderTypes=["top","left","right","bottom"];var i,n,o=function(){var e=a(),t="px";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.wght)&&(t=u(m(e._all_.wght))),t},r=function(){var e=a(),t="#000000";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.col)&&(t=e._all_.col),t},s=function(e){if(!v.contains(v.union(a.cssBorderTypes,["_all_"]),e))throw new Error("Error in syncWithBorderType : the border type must be one of those values '_all_', 'top', 'left', 'right', 'bottom'");var t=a(),i={},n=h.extend(!0,{},f);v.isObject(t)?i=h.extend(!0,{},t):v.isString(t)&&(i={_all_:{wght:t}});var o,r,s=function(e,t){var i,n=h.extend(!0,{},f);if(!v.has(n,"_all_"))throw new Error("Error when firing getCurrentBorderTypeOrAllValue : the default value of the borders input must be php registered as an array formed : array( 'wght' => '1px', 'col' => '#000000' )");return i=v.isObject(e)&&v.has(e,"_all_")?v.extend(n._all_,e._all_):n._all_,v.has(e,t)&&v.isObject(e[t])?v.extend(i,e[t]):n._all_}(i=h.extend(n,i),e);if(v.isEmpty(s)||!v.isObject(s)||v.isEmpty(s.wght)||v.isEmpty(s.col))throw new Error("Error in syncWithBorderType : getCurrentBorderTypeOrAllValue must return an object formed : array( 'wght' => '1px', 'col' => '#000000' )");o=m(s.wght),r=_(s.wght),h(".sek-unit-wrapper",l).find('[data-sek-unit="'+o+'"]').trigger("click",{border_type_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+o+'"]').addClass("is-selected").attr("aria-pressed",!0),c.val(r).trigger("input",{border_type_switched:!0}),p.data("border_type_switched",!0),p.val(s.col).trigger("change"),p.data("border_type_switched",!1)};a.borderColor=new g.Value(v.isEmpty(r())?"#000000":r()),a.css_unit=new g.Value(v.isEmpty(o())?"px":u(o())),a.borderType=new g.Value("_all_"),c.val((i=a(),n=1,v.isObject(i)&&v.has(i,"_all_")&&v.isObject(i._all_)&&!v.isEmpty(i._all_.wght)&&(n=_(i._all_.wght)),n=parseInt(n,10),(!v.isNumber(n)||n<0)&&(g.errare("Error in borders input type for module : "+a.module.module_type+" the initial border width is invalid : "+n),n=1),n)),p.val(a.borderColor()),p.wpColorPicker({palettes:!0,width:1440<=window.innerWidth?271:251,change:function(e,t){h(this).val(t.color.toString()).trigger("colorpickerchange"),a.borderColor(t.color.toString(),{border_type_switched:!0===h(this).data("border_type_switched")})},clear:function(e,t){h(this).val("").trigger("colorpickerchange"),a.borderColor("")}}),a.css_unit.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_unit)&&c.trigger("input",i)}),a.borderColor.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_color)&&c.trigger("input",i)}),a.borderType.bind(function(e){try{s(e)}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}}),d.on("input",function(e){c.val(h(this).val()).trigger("input")}),c.on("input",function(e,t){var i,n=a.borderType()||"_all_",o=a.borderColor(),r=h(this).val()+u(a.css_unit()),s=h.extend(!0,{},f);(i=h.extend(!0,{},v.isObject(a())?a():s))[n]=h.extend(!0,{},i[n]||s[n]),v.isString(r)&&!v.isEmpty(r)&&(i[n].wght=r),i[n].col=o,(v.isEmpty(t)||v.isObject(t)&&!0!==t.border_type_switched)&&("_all_"===n&&v.each(a.cssBorderTypes,function(e){i=v.omit(i,e)}),a(i)),d.val(h(this).val())}),l.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),l.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",h(this).data("sek-unit")),a.css_unit(h(this).data("sek-unit"),t)}),l.on("click","[data-sek-border-type]",function(e,t){e.preventDefault(),l.find("[data-sek-border-type]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=h(this).data("sek-border-type")}catch(e){g.errare("borders input type => error when attaching click event",e)}a.borderType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.borderType()||"_all_",i=h.extend(!0,{},v.isObject(a())?a():{});v.isEmpty(i[t])||(i=v.omit(i,t),a(i),s(t))}),d.val(c.val()||0);try{s(a.borderType())}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}h('[data-sek-unit="'+a.css_unit()+'"]',l).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(m,f,g){m.czrInputMap=m.czrInputMap||{},f.extend(m.czrInputMap,{border_radius:function(e){var a=this,l=f(".sek-borders",a.container),c=l.find('input[type="number"]'),s=l.find('input[type="range"]'),d=function(e){return g.contains(["px","em","%"],e)||(m.errare("border_radius => error : invalid unit for input "+a.id,e),e="px"),e},p=function(e){return g.isEmpty(e)||!g.isString(e)?"16":e.replace(/px|em|%/g,"")},u=function(e){return g.isEmpty(e)||!g.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=m.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),_=g.isEmpty(t)||g.isEmpty(t.default)?{}:t.default;a.cssRadiusTypes=["top_left","top_right","bottom_right","bottom_left"];var i,n,o=function(){var e=a(),t="px";return g.isObject(e)&&g.has(e,"_all_")&&(t=d(u(e._all_))),t},r=function(e){if(!g.contains(["_all_","top_left","top_right","bottom_right","bottom_left"],e))throw new Error("Error in syncWithRadiusType : the radius type must be one of those values '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left', => radius type => "+e);var t=a(),i={},n=f.extend(!0,{},_);g.isObject(t)?i=f.extend(!0,{},t):g.isString(t)&&(i={_all_:"0px"});var o,r,s=function(e,t){var i,n=f.extend(!0,{},_);if(!g.has(n,"_all_"))throw new Error("Error when firing getCurrentRadiusTypeOrAllValue : the default value of the border_radius input must be php registered as an array");return i=g.isObject(e)&&g.has(e,"_all_")?e._all_:n._all_,g.has(e,t)?e[t]:i}(i=f.extend(n,i),e);if(g.isEmpty(s)||!g.isString(s))throw new Error("Error in syncWithRadiusType : getCurrentRadiusTypeOrAllValue must return a string like 3em");o=u(s),r=p(s),f(".sek-unit-wrapper",l).find('[data-sek-unit="'+o+'"]').trigger("click",{radius_type_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+o+'"]').addClass("is-selected").attr("aria-pressed",!0),c.val(r).trigger("input",{radius_type_switched:!0})};a.css_unit=new m.Value(g.isEmpty(o())?"px":d(o())),a.radiusType=new m.Value("_all_"),c.val((i=a(),n=0,g.isObject(i)&&g.has(i,"_all_")&&(n=p(i._all_)),n=parseInt(n,10),(!g.isNumber(n)||n<0)&&(m.errare("Error in border_radius input type for module : "+a.module.module_type+" the initial radius is invalid : "+n),n=0),n)),a.css_unit.bind(function(e,t,i){(!g.isObject(i)||!0!==i.radius_type_switched&&!0!==i.initializing_the_unit)&&c.trigger("input",i)}),a.radiusType.bind(function(e){try{r(e)}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}}),s.on("input",function(e){c.val(f(this).val()).trigger("input")}),c.on("input",function(e,t){var i,n=a.radiusType()||"_all_",o=f(this).val()+d(a.css_unit()),r=f.extend(!0,{},_);(i=f.extend(!0,{},g.isObject(a())?a():r))[n]=f.extend(!0,{},i[n]||r[n]),g.isString(o)&&!g.isEmpty(o)&&(i[n]=o),(g.isEmpty(t)||g.isObject(t)&&!0!==t.radius_type_switched)&&("_all_"===n&&g.each(a.cssRadiusTypes,function(e){i=g.omit(i,e)}),a(i)),s.val(f(this).val())}),l.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),l.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",f(this).data("sek-unit")),a.css_unit(f(this).data("sek-unit"),t)}),l.on("click","[data-sek-radius-type]",function(e,t){e.preventDefault(),l.find("[data-sek-radius-type]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=f(this).data("sek-radius-type")}catch(e){m.errare("border_radius input type => error when attaching click event",e)}a.radiusType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.radiusType()||"_all_",i=f.extend(!0,{},g.isObject(a())?a():{});g.isEmpty(i[t])||(i=g.omit(i,t),a(i),r(t))}),s.val(c.val()||0);try{r(a.radiusType())}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}f('[data-sek-unit="'+a.css_unit()+'"]',l).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{buttons_choice:function(e){var n=this,o=s(".sek-button-choice-wrapper",n.container),t=o.find('input[type="number"]'),i=r.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);a.isEmpty(i)||a.isEmpty(i.default)||i.default;t.val(n()),o.on("click","[data-sek-choice]",function(e,t){var i;e.stopPropagation(),o.find("[data-sek-choice]").removeClass("is-selected").attr("aria-pressed",!1),s(this).addClass("is-selected").attr("aria-pressed",!0);try{i=s(this).data("sek-choice")}catch(e){r.errare("buttons_choice input type => error when attaching click event",e)}n(i)}),s('[data-sek-choice="'+n()+'"]',o).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(n,o,r){n.czrInputMap=n.czrInputMap||{},o.extend(n.czrInputMap,{reset_button:function(e){this.container.on("click","[data-sek-reset-scope]",function(e,t){e.stopPropagation();var i=o(this).data("sek-reset-scope");!r.isEmpty(i)&&r.contains(["local","global"],i)?n.czr_sektions.updateAPISetting({action:"sek-reset-collection",scope:i}).done(function(e){n.previewer.refresh(),n.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}).fail(function(e){n.errare("reset_button input => error when firing ::updateAPISetting",e),n.previewer.trigger("sek-notify",{notif_id:"reset-failed",type:"error",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset failed"],"<br/>","<i>"+e+"</i>","</strong>","</span>"].join("")})}):n.errare("reset_button input => invalid scope provided.",i)})}})}(wp.customize,jQuery,_),function(i,r,s){i.czrInputMap=i.czrInputMap||{},r.extend(i.czrInputMap,{revision_history:function(e){var o=this;_selected_found=!1;var t=function(t){!0!==o.revisionHistorySet&&(r.when(r.Deferred(function(t){s.isEmpty(o.sek_revisionHistory)?i.czr_sektions.getRevisionHistory({is_local:"local_revisions"===o.id}).done(function(e){if(!s.isObject(e))throw new Error("_getRevisionHistory => server list is not a object");o.sek_revisionHistory=e,t.resolve(o.sek_revisionHistory)}).fail(function(e){t.reject(e)}):t.resolve(o.sek_revisionHistory)})).done(function(e){!function(e){if(!(0<o.container.find(".sek-revision-history").length))if(s.isEmpty(e))o.container.append(["<i>",sektionsLocalizedData.i18n["No revision history available for the moment."],"</i>"].join(""));else{o.container.append(r("<select/>",{class:"sek-revision-history",html:['<option value="_select_">'," -",sektionsLocalizedData.i18n.Select,"- ","</option>"].join("")}));var n=[];s.each(e,function(e,t){var i={value:t,html:e};i.value==o()&&(r.extend(i,{selected:"selected"}),_selected_found=!0),n.unshift(r("<option>",i))}),n[0].html([n[0].html(),sektionsLocalizedData.i18n["(currently published version)"]].join(" ")),s.each(n,function(e){r("select.sek-revision-history",o.container).append(e)}),r("select.sek-revision-history",o.container).selecter()}}(e),t&&!0===t.open_on_init&&s.delay(function(){try{r("select[data-czrtype]",o.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){i.errare("_getRevisionHistory => fail response =>",e)}),o.revisionHistorySet=!0)};o.container.on("change",".sek-revision-history",function(){var e=r(this).val();"_select_"!==e&&i.czr_sektions.setSingleRevision({revision_post_id:e,is_local:"local_revisions"===o.id})}),s.delay(function(){t({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(_,m,f){_.czrInputMap=_.czrInputMap||{},m.extend(_.czrInputMap,{nimble_tinymce_editor:function(){var t=this,e=t.container.find("textarea").first(),i=0<e.length?e.attr("id"):null,n=_.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type),o=sektionsLocalizedData.defaultToolbarBtns;if(f.isNull(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => missing textarea for module :"+t.module.id);if(tinyMCE.get(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => duplicate editor id.");var r,s,a=function(){return n&&n.editor_params&&!0===n.editor_params.autop},l={tinymce:{toolbar1:function(){var e=o.split(",");if(n.editor_params&&f.isArray(n.editor_params.excludedBtns)){var t=n.editor_params.excludedBtns;e=f.filter(e,function(e){return!f.contains(t,e)})}if(n.editor_params&&f.isString(n.editor_params.includedBtns)){var i=n.editor_params.includedBtns;f.isEmpty(i)||!f.isArray(sektionsLocalizedData[i])?_.errare("nimble_tinymce_editor input => invalid set of buttons provided",i):(i=sektionsLocalizedData[i],e=f.filter(e,function(e){return f.contains(i,e)}))}return e.join(",")}(),content_css:(r=wp.editor.getDefaultSettings(),s=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],r&&r.tinymce&&r.tinymce.content_css&&(s=f.union(r.tinymce.content_css.split(","),s)),s.join(",")),min_height:40,height:n.editor_params&&f.isNumber(n.editor_params.height)?n.editor_params.height:_.czr_sektions.TINYMCE_EDITOR_HEIGHT},quicktags:{buttons:"strong,em,link,code"},mediaButtons:!n.editor_params||!1!==n.editor_params.media_button};l.tinymce.wpautop=a(),a()||(l.tinymce.forced_root_block=""),wp.editor.initialize(i,l);var c=tinyMCE.get(i);if(!c)throw new Error("setupTinyMceEditor => missing editor instance for module :"+t.module.id);_.czrActiveWPEditors=_.czrActiveWPEditors||[];var d=m.extend(!0,[],_.czrActiveWPEditors);d.push(i),_.czrActiveWPEditors=d;var p,u=function(){p=t(),_.czr_sektions.isJsonString(p)&&(p=JSON.parse(p)),e.html(p),c.setContent(p)};c.initialized?u():c.on("init",u),c.on("input change keyup",function(e){t(c.getContent())})},detached_tinymce_editor:function(){var e,t=this,i=m("textarea#"+sektionsLocalizedData.idOfDetachedTinyMceTextArea),n=_.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type);if(!(0<i.length))throw new Error("api.czrInputMap::detached_tinymce_editor => missing textarea element");if(e=i.attr("id"),window.tinymce&&(mceInstance=window.tinymce.get(e),mceInstance&&mceInstance.remove()),!window.nimbleTinyMCEPreInit||!window.nimbleTinyMCEPreInit.mceInit||!window.nimbleTinyMCEPreInit.mceInit[e])throw new Error("setupDetachedTinyMceEditor => invalid nimbleTinyMCEPreInit global var");var o,r,s=nimbleTinyMCEPreInit.mceInit[e];s.content_css=(o=wp.editor.getDefaultSettings(),r=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],o&&o.tinymce&&o.tinymce.content_css&&(r=f.union(o.tinymce.content_css.split(","),r)),r.join(","));var a=t.input_parent,l=function(){var e=a();return f.isUndefined(e.autop)?n&&n.editor_params&&!0===n.editor_params.autop:e.autop};s.wpautop=l(),l()||(s.forced_root_block=""),s.toolbar1=sektionsLocalizedData.defaultToolbarBtns,s.toolbar2="",window.tinymce.init(s),window.QTags.getInstance(e);var c=tinyMCE.get(e);if(!c)throw new Error("setupDetachedTinyMceEditor => missing editor instance for module :"+t.module.id);var d,p=function(){d=t(),_.czr_sektions.isJsonString(d)&&(d=JSON.parse(d)),c.setContent(d),_.sekEditorExpanded(!0),m(window).trigger("resize")};c.initialized?p():c.on("init",p),c.on("input change keyup keydown click SetContent BeforeSetContent",function(e){t(l()?c.getContent():wp.editor.removep(c.getContent()))}),_.sekCurrentDetachedTinyMceInput=t,i.data("czr-bound-for-detached-editor")||(i.on("input",function(e,t){_.sekCurrentDetachedTinyMceInput(m(this).val())}),i.data("czr-bound-for-detached-editor",!0))}})}(wp.customize,jQuery,_),function(c,d,p){c.czrInputMap=c.czrInputMap||{},d.extend(c.czrInputMap,{import_export:function(){var r=this,t=r.container.find('button[data-czr-action="sek-pre-import"]'),s=r.container.find("input[name=sek-import-file]"),e=c.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=e.scope,l="local"===e.scope?c.czr_sektions.localSectionsSettingId():c.czr_sektions.getGlobalSectionsSettingId();p.contains(["local","global"],a)||c.errare("api.czrInputMap.import_export => invalid currentScope",a),s.on("change",function(e){t.toggleClass("disabled",p.isEmpty(d(this).val()))});r.container.on("click","[data-czr-action]",function(e){var i,t;switch(e.stopPropagation(),d(this).data("czr-action")){case"sek-export":if(i=!1,t=wp.customize.dirtyValues(),p.isEmpty(t)||p.each(t,function(e,t){i||(i=-1!==t.indexOf("nimble"))}),i){alert(sektionsLocalizedData.i18n["You need to publish before exporting."]);break}var n=c(l)(),o=!0;if(p.each(n.collection,function(e){o&&(p.isEmpty(e.collection)||(o=!1))}),o){alert(sektionsLocalizedData.i18n["Nothing to export."]);break}c.czr_sektions.export_template({scope:a});break;case"sek-pre-import":if(p.isEmpty(c.czr_sektions.activeLocations())){alert(sektionsLocalizedData.i18n["The current page has no available locations to import Nimble Builder sections."]);break}c.czr_sektions.import_template_from_file({pre_import_check:!0,input:r,file_input:s}).done(function(e){c.czr_sektions.pre_checks_from_file_import(e,{pre_import_check:!1,input:r,file_input:s})}).fail(function(e){c.errare("import_export_ input => pre_checks_from_file_import failed",e),c.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s}),c.czr_sektions.import_template_from_file({input:r,file_input:s})});break;case"sek-import-as-is":c.czr_sektions.import_template_from_file({input:r,file_input:s});break;case"sek-import-assign":c.czr_sektions.import_template_from_file({assign_missing_locations:!0,input:r,file_input:s});break;case"sek-cancel-import":c.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s})}})}})}(wp.customize,jQuery,_),function(l,c,d){l.czrInputMap=l.czrInputMap||{},c.extend(l.czrInputMap,{simpleselect:function(e){l.czr_sektions.setupSelectInput.call(this,e)},multiselect:function(e){l.czr_sektions.setupSelectInput.call(this,e)},simpleselectWithDeviceSwitcher:function(e){var r=this,t=(r.input_parent,r.module,l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type)),o=c("select",r.container),s=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i={params:e=d.isEmpty(e)?t.choices:e};if(r.module.trigger("nimble-set-select-input-options",i),e=i.params,!d.isEmpty(e)&&d.isObject(e)){d.each(e,function(e,t){var i={value:t,html:e};t==r()?c.extend(i,{selected:"selected"}):"px"===t&&c.extend(i,{selected:"selected"}),o.append(c("<option>",i))});var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var n=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&n<i.length?a(e,i[n+1]):c.extend(!0,{desktop:""},s).desktop};l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r),o.on("change",function(e,t){var i,n=l.previewedDevice()||"desktop",o=c(this).val();(i=c.extend(!0,{},d.isObject(r())?r():{}))[n]=c.extend(!0,{},i[n]||{}),d.isString(o)&&!d.isEmpty(o)&&(i[n]=o),(d.isEmpty(t)||d.isObject(t)&&!0!==t.previewed_device_switched)&&r(i)}),r.previewedDevice.bind(function(e){try{!function(e){var t=r(),i={};i=c.extend(!0,{},s),d.isObject(t)?i=c.extend(!0,{},t):d.isString(t)&&!d.isEmpty(t)&&(i={desktop:t});var n=a(i,e);o.val(n).trigger("change",{previewed_device_switched:!0})}(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type "+r.type+" for input id "+r.id,e)}})}else l.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+r.id+" in module "+r.module.module_type)}})}(wp.customize,jQuery,_),function(a,l,c){a.czrInputMap=a.czrInputMap||{},l.extend(a.czrInputMap,{category_picker:function(e){var n=this,o=l("select[data-czrtype]",n.container),r=function(){var e=n();return e=c.isString(e)?[e]:e,c.isArray(e)?e:[]},t=function(t){!0!==n.catCollectionSet&&(l.when(l.Deferred(function(i){c.isEmpty(a.czr_sektions.post_categories)?wp.ajax.post("sek_get_post_categories",{nonce:a.settings.nonce.save}).done(function(e){c.isArray(e)||a.errare(n.id+" => error => invalid category collection sent by server");var t={};c.each(e,function(e){c.isEmpty(e.slug)||c.isEmpty(e.name)?i.reject("missing slug or name for at least one category"):t[e.slug]=e.name}),a.czr_sektions.post_categories=t,i.resolve(a.czr_sektions.post_categories)}).fail(function(e){i.reject(e)}):i.resolve(a.czr_sektions.post_categories)})).done(function(e){i(e),t&&!0===t.open_on_init&&c.delay(function(){try{o.czrSelect2("open")}catch(e){}},100)}).fail(function(e){a.errare(n.id+" => fail response when _getCategoryCollection()",e)}),n.catCollectionSet=!0)},i=function(e){c.each(e,function(e,t){var i={value:t,html:e};c.contains(r(),t)&&l.extend(i,{selected:"selected"}),o.append(l("<option>",i))}),o.czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),o.on("change",function(){0===l(this).find("option:selected").length&&n([])})},s={};c.each(r(),function(e){s[e]=(e+"").replace(/-/g," ")}),i(s),n.container.on("click",function(){!0!==n.catCollectionSet&&(o.czrSelect2("destroy"),l.when(o.find("option").remove()).done(function(){t({open_on_init:!0})}))})}})}(wp.customize,jQuery,_),function(r,s,e){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{grid_layout:function(e){var n=this,o=s(".sek-grid-layout-wrapper",n.container);o.find('input[type="hidden"]').val(n()),o.on("click","[data-sek-grid-layout]",function(e,t){var i;e.stopPropagation(),o.find("[data-sek-grid-layout]").removeClass("selected").attr("aria-pressed",!1),s(this).addClass("selected").attr("aria-pressed",!0);try{i=s(this).data("sek-grid-layout")}catch(e){r.errare(n.type+" => error when attaching click event",e)}n(i)}),s('[data-sek-grid-layout="'+n()+'"]',o).trigger("click")}})}(wp.customize,jQuery,_),function(i,e,t){i.czrInputMap=i.czrInputMap||{},e.extend(i.czrInputMap,{refresh_preview_button:function(e){this.container.on("click",".sek-refresh-button",function(e,t){e.stopPropagation(),i.previewer.refresh()})}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_content_type_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_content_type_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_module_picker_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_module_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_module_picker_module"))}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{};var n=sektionsLocalizedData.presetSectionsModules;i.isArray(n)&&!i.isEmpty(n)?i.each(n,function(e){t.czrModuleMap[e]={crud:!1,name:t.czr_sektions.getRegisteredModuleProperty(e,"name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData(e))}}):t.errare("api.czrModuleMap => error when adding section modules")}(wp.customize,jQuery,_),function(a,n,l){var e={initialize:function(e,t){this.inputConstructor=a.CZRInput.extend({initialize:function(e,t){var i=this;a.CZRInput.prototype.initialize.call(i,e,t),i.isReady.then(function(){i.renderUserSavedSections(),i.attachDomEvents()})},getUserSavedSections:function(){var t=n.Deferred();return l.isEmpty(a.czr_sektions.userSavedSections)?a.czr_sektions.getSavedSectionCollection().done(function(e){t.resolve(e)}):t.resolve(a.czr_sektions.userSavedSections),t.promise()},renderUserSavedSections:function(){var o=this,r="",s=o.container.find(".sek-content-type-wrapper"),t=function(e){if(s.find(".sek-user-section-wrapper").remove(),l.isEmpty(e)){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/save_section_notice.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),i="https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder";r=['<div class="sek-user-section-wrapper">','<img src="'+t+'" />','<br/><a href="'+i+'" target="_blank" rel="noreferrer nofollow">'+i+"</a>","</div>"].join(""),s.append(r),o.module.container.find(".czr-item-content .customize-control-title").html(sektionsLocalizedData.i18n["You did not save any section yet."])}else{var n="background: url("+[sektionsLocalizedData.baseUrl,"/assets/admin/img/nb_sec_pholder.png","?ver=",sektionsLocalizedData.nimbleVersion].join("")+") 50% 50% / cover no-repeat;";l.each(e,function(e,t){l.isEmpty(e.description)?_titleAttr=[e.title,e.last_modified_date].join(" | "):_titleAttr=[e.title,e.last_modified_date,e.description].join(" | "),r=['<div class="sek-user-section-wrapper">','<div draggable="true" data-sek-is-user-section="true" data-sek-section-type="content" data-sek-content-type="preset_section" data-sek-content-id="'+t+'" style="" title="'+e.title+'">','<div class="sek-sec-thumb" style="'+n+'"></div>','<div class="sek-overlay"></div>','<div class="sek-sec-info" title="'+_titleAttr+'">','<h3 class="sec-title">'+e.title+"</h3>",'<p class="sec-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",'<p class="sec-desc">'+e.description+"</p>",'<i class="material-icons edit-user-sec" title="'+sektionsLocalizedData.i18n["Edit this template"]+'">edit</i>','<i class="material-icons remove-user-sec" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>',"</div>","</div>","</div>"].join(""),s.append(r)})}s.find(".czr-css-loader").remove(),a.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:o.container})};s.append('<div class="czr-css-loader czr-mr-loader" style="display:block"><div></div><div></div><div></div></div>'),o.getUserSavedSections().done(function(e){t(e)}),a.czr_sektions.allSavedSections.bind(function(e){t(e)})},attachDomEvents:function(){this.container.on("click",".sek-sec-info .remove-user-sec",function(e){e.preventDefault();var t=a.czr_sektions;t.saveSectionDialogVisible(!1);var i=function(e){t.saveSectionDialogMode("remove"),t.saveSectionDialogMode.unbind(i)};t.userSectionToRemove=n(this).closest("[data-sek-content-id]").data("sek-content-id"),t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)}).on("click",".sek-sec-info .edit-user-sec",function(e){e.preventDefault();var t=a.czr_sektions;t.saveSectionDialogVisible(!1);var i=function(e){t.saveSectionDialogMode("edit"),t.saveSectionDialogMode.unbind(i)};t.userSectionToEdit=n(this).closest("[data-sek-content-id]").data("sek-content-id"),t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)})}}),a.CZRDynModule.prototype.initialize.call(this,e,t)}};a.czrModuleMap=a.czrModuleMap||{},n.extend(a.czrModuleMap,{sek_my_sections_sec_picker_module:{mthds:e,crud:!1,name:a.czr_sektions.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:a.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_my_sections_sec_picker_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_mod_option_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_mod_option_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_mod_option_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_anchor_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_anchor_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_anchor_module"))}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var t=this,n=t.module;t.czr_Input.each(function(i){switch(i.id){case"bg-apply-overlay":r.each(["bg-color-overlay","bg-opacity-overlay"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return o.CZR_Helpers.isChecked(i())})}catch(e){o.errare(n.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-parallax":r.each(["bg-parallax-force","bg-scale","bg-repeat"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"bg-parallax-force":e=o.CZR_Helpers.isChecked(i());break;case"bg-repeat":case"bg-scale":e=!o.CZR_Helpers.isChecked(i())}return e})}catch(e){o.errare(n.id+" => error in setInputVisibilityDeps",e)}}),i.bind(function(e){o.CZR_Helpers.isChecked(i())&&o.CZR_Helpers.isChecked(t.czr_Input("bg-attachment")())&&t.czr_Input("bg-attachment").container.find("input[type=checkbox]").trigger("click")});break;case"bg-attachment":i.bind(function(e){o.CZR_Helpers.isChecked(i())&&o.CZR_Helpers.isChecked(t.czr_Input("bg-parallax")())&&t.czr_Input("bg-parallax").container.find("input[type=checkbox]").trigger("click")});break;case"bg-use-video":r.each(["bg-video","bg-video-loop","bg-video-delay-start","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return o.CZR_Helpers.isChecked(i())})}catch(e){o.errare(n.id+" => error in setInputVisibilityDeps",e)}})}}),n.control&&n.control.params&&n.control.params.sek_registration_params&&(r.contains(["section","column"],n.control.params.sek_registration_params.level)||r.each(["bg-use-video","bg-video","bg-video-loop","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){t.czr_Input(e).visible(!1)}))}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_bg_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_bg_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_bg_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_text_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_text_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_text_module")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_border_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_border_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_border_module"))}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":o.each(["custom-breakpoint","apply-to-all"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_breakpoint_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_breakpoint_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_breakpoint_module"))}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":o.each(["custom-height","overflow_hidden"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_height_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_height_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_height_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_visibility_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_visibility_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_visibility_module"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"width-type":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"custom-width",function(){return"custom"===e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_module"))}})}(wp.customize,jQuery,_),function(d,p,u){var e={initialize:function(e,t){var i=this;i.inputConstructor=d.CZRInput.extend(i.CZRInputConstructor||{}),i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputConstructor:{range_simple:function(e){var t,i=this,n=p(".sek-range-with-unit-picker-wrapper",i.container),o=n.find('input[type="number"]'),r=n.find('input[type="range"]');try{t=i.module.control.params.sek_registration_params}catch(e){return void d.errare("Error when getting the module registration params",e)}if(u.isUndefined(t.level_id))d.errare("Error : missing column id",er);else if(i.columnId=t.level_id,i.columnModel=p.extend(!0,{},d.czr_sektions.getLevelModel(i.columnId)),i.parentSectionModel=d.czr_sektions.getParentSectionFromColumnId(i.columnId),"no_match"!=i.columnModel)if("no_match"!=i.parentSectionModel){i.colNb=u.size(i.parentSectionModel.collection),o.attr("data-sek-width-range-column-id",i.columnId),1===i.colNb?i.container.html(["<p>",sektionsLocalizedData.i18n["This is a single-column section with a width of 100%. You can act on the internal width of the parent section, or adjust padding and margin."]].join("")):i.container.show();var s,a=d.czr_sektions.getLevelModel(i.columnId),l="_not_set_";if("no_match"!=a){var c=a.options&&a.options.width&&a.options.width["custom-width"]&&u.isNumber(+a.options.width["custom-width"]);c?l=a.options.width["custom-width"]:!c&&a.width&&u.isNumber(+a.width)&&(l=a.width),s="_not_set_"!==l?l:"_not_set_"===i()?Math.floor(100/i.colNb):i(),s=1*+parseFloat(s).toFixed(3),(!u.isNumber(s)||100<s||s<0)&&(d.errare("Error => invalid column width",s),s=50),r.on("input",function(e,t){o.val(p(this).val()).trigger("input",t)}),o.on("input",u.debounce(function(e,t){r.val(p(this).val()),t&&t.is_init||i(+parseFloat(p(this).val()).toFixed(3))},300)),o.on("input",u.debounce(function(e,t){t&&(t.is_init||t.is_resize_column_trigger)||i.sayItToApi(p(this).val())},300)),r.val(s).trigger("input",{is_init:!0})}else d.errare("sek_level_width_column module => invalid column model")}else d.errare("sek_level_width_column module => invalid parent section model");else d.errare("sek_level_width_column module => invalid column model")},sayItToApi:function(e,t){var i=this,n=u.findIndex(i.parentSectionModel.collection,{id:i.columnId}),o=n+1==i.colNb?n-1:n+1,r=u.find(i.parentSectionModel.collection,function(e,t){return o===t});"no_match"===r&&d.errare("sek_level_width_column module => invalid sister column model"),d.previewer.trigger("sek-resize-columns",{action:"sek-resize-columns",level:"column",in_sektion:i.parentSectionModel.id,id:i.columnId,resized_column:i.columnId,sister_column:r.id,resizedColumnWidthInPercent:e,col_number:i.colNb})}}};d.czrModuleMap=d.czrModuleMap||{},p.extend(d.czrModuleMap,{sek_level_width_column:{mthds:e,crud:!1,name:d.czr_sektions.getRegisteredModuleProperty("sek_level_width_column","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:u.extend({id:"",title:""},d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_column"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_section:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_section","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_section"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_spacing_module:{mthds:"",crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_spacing_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_spacing_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_cust_css_section:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_cust_css_section","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_cust_css_section"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this.module;i.trigger("nb_setup_visibility_deps_for_animation_module",{item:this,module:e})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_animation_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_animation_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_animation_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_template:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_template","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_template"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_local_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_local_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_custom_css:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_custom_css","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_custom_css"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_header_footer"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_imp_exp"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"links_underline":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"links_underline_hover",function(){return!e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_text:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_text","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_text"))}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":o.each(["global-custom-breakpoint","apply-to-all"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_global_breakpoint:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_global_breakpoint","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_breakpoint"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_header_footer"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module;n.czr_Input.each(function(i){switch(i.id){case"enable":s.each(["public_key","private_key","badge","show_failure_message","failure_message","score"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"failure_message":e=i()&&n.czr_Input("show_failure_message")();break;default:e=i()}return e})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_failure_message":s.each(["failure_message"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&n.czr_Input("enable")()})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{sek_global_recaptcha:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("sek_global_recaptcha","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:s.extend({id:"",title:""},r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_recaptcha"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_imp_exp"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_beta_features:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_beta_features","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_beta_features"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_site_tmpl_pickers:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_site_tmpl_pickers","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_site_tmpl_pickers"))}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!r.contains(["no-link","img-lightbox"],i())}return e})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"border-type":r.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"none"!==i()})}catch(e){o.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"use_custom_width":r.each(["custom_width"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_height":r.each(["custom_height"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_title_attr":r.each(["heading_title"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}})}}),o.trigger("nb_setup_visibility_deps_for_img_module",{item:n,module:t})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_image_main_settings_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_image_main_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_main_settings_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_image_borders_corners_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_image_borders_corners_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_borders_corners_child")}})}(wp.customize,jQuery,_),function(n,e,t){var i={initialize:function(e,t){this.inputConstructor=n.CZRInput.extend(this.CZRTextEditorInputMths||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRTextEditorInputMths:{initialize:function(e,t){var i=this;"detached_tinymce_editor"==i.type&&i.isReady.then(function(){i.container.find('[data-czr-action="open-tinymce-editor"]').trigger("click")}),n.CZRInput.prototype.initialize.call(i,e,t)}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_tinymce_child:{mthds:i,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_tinymce_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_tinymce_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_html_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_html_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_html_module")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(i){switch(i.id){case"img-type":o.each(["img-id","img-size"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img-id":e="custom"===i();break;default:e="none"!==i()}return e})}catch(e){n.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"content-type":o.each(["content-custom-text"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"custom"===i()})}catch(e){n.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"btn-display":o.each(["btn-custom-text"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_featured_pages_module:{mthds:t,crud:n.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","is_crud"),hasPreItem:!1,refresh_on_add_item:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_featured_pages_module")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":s.each(["link-pick-url","link-custom-url","link-target"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":r.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"use_custom_color_on_hover":s.each(["color_hover"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_icon_settings_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_icon_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_settings_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_icon_spacing_border_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_icon_spacing_border_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_spacing_border_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e=i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":case"link-target":e=i()}return e})}catch(e){o.errare("Heading module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&!0===n.czr_Input("link-to")()})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_heading_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_heading_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_heading_spacing_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_heading_spacing_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_spacing_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_divider_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_divider_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_divider_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_spacer_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_spacer_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_spacer_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_map_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_map_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_map_module")}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRButtonItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"quote_design":n.each(["border_width_css","border_color_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"border-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}}),n.each(["icon_color_css","icon_size_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"quote-icon-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_quote_design_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_quote_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_design_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_quote_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_quote_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_quote_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_cite_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_cite_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_cite_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"icon":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"icon-side",function(){return!r.isEmpty(i())})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_btn_content_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_btn_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_content_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":o.each(["bg_color_hover"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":o.each(["push_effect"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"width-type":n.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-width",function(){return"custom"===t()}),o.each(["custom-width","h_inner_align_css"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"height-type":n.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-height",function(){return"custom"===t()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_btn_design_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_btn_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_design_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this.module;this.czr_Input.each(function(i){switch(i.id){case"layout":r.each(["columns","img_column_width","has_tablet_breakpoint","has_mobile_breakpoint"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"columns":e="grid"===i();break;case"has_tablet_breakpoint":case"has_mobile_breakpoint":case"img_column_width":e="list"===i()}return e})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"categories":r.each(["must_have_all_cats"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){var e=i();return r.isArray(e)&&1<e.length})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"display_pagination":r.each(["posts_per_page","post_number"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"posts_per_page"===e?i():!i()})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"custom_grid_spaces":r.each(["column_gap","row_gap"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_excerpt":r.each(["excerpt_length"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_post_grid_main_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_post_grid_main_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_main_child")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module;n.czr_Input.each(function(i){switch(i.id){case"show_thumb":s.each(["img_size","img_has_custom_height","img_height","border_radius_css","use_post_thumb_placeholder"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img_height":e=i()&&n.czr_Input("img_has_custom_height")();break;default:e=i()}return e})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"img_has_custom_height":s.each(["img_height"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&n.czr_Input("show_thumb")()})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_post_grid_thumb_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_post_grid_thumb_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_thumb_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_metas_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_metas_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_metas_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_content_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_content_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_mobile_options:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_mobile_options","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_mobile_options")}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"show_name_field":n.each(["name_field_label","name_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_subject_field":n.each(["subject_field_label","subject_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_message_field":n.each(["message_field_label","message_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_privacy_field":n.each(["privacy_field_label","privacy_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,"link-custom-url",function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_simple_form_fields_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fields_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fields_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_simple_form_design_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_simple_form_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_design_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":o.each(["bg_color_hover"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":o.each(["push_effect"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_simple_form_button_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_simple_form_button_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_button_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_submission_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_submission_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_submission_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_font_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_font_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_font_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.bind("nimble-set-select-input-options",function(e){e.params=sektionsLocalizedData.registeredWidgetZones}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_widget_area_module:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_widget_area_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_widget_area_module")}})}(wp.customize,jQuery,_),function(s,a,l){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=s.CZRItem.extend(i.CZRItemConstructor||{}),s.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return s.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&a.fn.sortable){var i=this;a("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){l.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!l.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){s.errorLog("item.setInputVisibilityDeps() : "+e)}}),s.CZRItem.prototype.ready.call(t)},_buildTitle:function(e,t,i){var n=this.module;return e=e||("string"==typeof t?s.CZR_Helpers.capitalize(t.replace("fa-","")):""),e=s.CZR_Helpers.truncate(e,20),'<div><span class="'+t+'" style="color:'+(i=i||n.defaultSocialColor)+'"></span> '+e+"</div>"},writeItemViewTitle:function(e){var t=this.module,i=e||this(),n=(i.icon?i.icon:"").replace("fa-","").replace("envelope","email").replace("far","").replace("fab","").replace("fas","");a("."+t.control.css_attr.item_title,this.container).html(this._buildTitle(n,i.icon,i.color_css))},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_color_on_hover":l.each(["social_color_hover"],function(e){try{s.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){s.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,n=l.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),n=l.without(n,l.findWhere(n,{id:t.id})),i.itemCollection.set(n),i.trigger("pre_item_api_remove",t());var o=a.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=s(i.control.id).transport||!l.has(e,"dom_event")||l.has(e.dom_event,"isTrigger")||s.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",o),i.control.trigger("item-removed",o);else{var r=function(){s.previewer.unbind("ready",r),i.trigger("item-removed",o)};s.previewer.bind("ready",r)}}}};s.czrModuleMap=s.czrModuleMap||{},a.extend(s.czrModuleMap,{czr_social_icons_settings_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:s.czr_sektions.getRegisteredModuleProperty("czr_social_icons_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_settings_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_social_icons_style_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_social_icons_style_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_style_child")}})}(wp.customize,jQuery,_),function(g,h,v){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=g.CZRItem.extend(i.CZRItemConstructor||{}),g.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return g.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&h.fn.sortable){var i=this;h("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){v.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","starting_value"),t=h.extend(!0,{},this.preItem());if(v.isObject(e)){var i=h.extend(!0,{},e);return h.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!v.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){g.errorLog("item.setInputVisibilityDeps() : "+e)}}),g.CZRItem.prototype.ready.call(t);var i=function(){g.previewer.send("sek-item-focus",{control_id:t.module.control.id,item_id:t.id,item_value:t()})};t.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),t.callbacks.add(i),t.bind("sek-request-item-focus-in-preview",i)},writeItemViewTitle:function(e,t){var i=this,n=i.module,o=e||i(),r="",s="",a="not_set",l=!v.isUndefined(t)&&v.isObject(t);if(!l||!t.input_changed||v.contains(["img","text_content"],t.input_changed)){if(v.isEmpty(o.title)){var c=v.findIndex(n.itemCollection(),function(e){return e.id===i.id});c=v.isUndefined(c)?1:c+1}else r=o.title;r=g.CZR_Helpers.truncate(r,15),o.img&&(s=o.img,v.isString(o.img)&&(s=-1!==o.img.indexOf("http")?o.img:parseInt(o.img,10)));var d=function(){return h.Deferred(function(){var e=this;v.isUndefined(s)||v.isEmpty(""+s)?e.resolve(""):v.isString(s)&&-1!==s.indexOf("http")?e.resolve(s):wp.media.attachment(s).fetch().always(function(){if(v.isObject(this)&&v.has(this,"attributes")&&v.has(this.attributes,"sizes")){var i=this.get("sizes");i&&v.isObject(i)&&v.each(["thumbnail","medium","large","full"],function(e,t){"not_set"===a&&i[e]&&v.isObject(i[e])&&i[e].url&&(a=i[e].url)}),e.resolve(a)}})}).promise()},p=h("."+n.control.css_attr.item_title,i.container).find(".sek-slide-title"),u=h("."+n.control.css_attr.item_title,i.container).find(".sek-slide-thumb"),_=o.text_content?o.text_content:"";_=(_=h("<div>").html(_).text()).substring(0,60),p.length<1?(h("."+n.control.css_attr.item_title,i.container).html(""),h("."+n.control.css_attr.item_title,i.container).append(h("<div/>",{class:"sek-slide-title",html:_}))):p.html(_);var m=l&&t.input_changed&&"img"===t.input_changed,f=function(e){return v.isEmpty(""+e)||"not_set"===e?"":'<img src="'+e+'" width="32" alt="'+r+'" />'};h("."+n.control.css_attr.item_title,i.container).css("padding","0 4px"),u.length<1?d().done(function(e){h("."+n.control.css_attr.item_title,i.container).prepend(h("<div/>",{class:"sek-slide-thumb",html:f(e)}))}):!m&&l||d().done(function(e){u.html(f(e))})}},setInputVisibilityDeps:function(){var n=this,t=n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":v.each(["link-pick-url","link-custom-url","link-target"],function(t){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!v.contains(["no-link"],i())}return e})}catch(e){g.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":g.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"apply-overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"enable_text":v.each(["text_content","font_family_css","font_size_css","line_height_css","color_css","h_alignment_css","v_alignment","spacing_css"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"apply_overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,n=v.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),n=v.without(n,v.findWhere(n,{id:t.id})),i.itemCollection.set(n),i.trigger("pre_item_api_remove",t());var o=h.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=g(i.control.id).transport||!v.has(e,"dom_event")||v.has(e.dom_event,"isTrigger")||g.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",o),i.control.trigger("item-removed",o);else{var r=function(){g.previewer.unbind("ready",r),i.trigger("item-removed",o)};g.previewer.bind("ready",r)}}}};g.czrModuleMap=g.czrModuleMap||{},h.extend(g.czrModuleMap,{czr_img_slider_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:g.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_collection_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":o.each(["custom-height"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"autoplay":o.each(["autoplay_delay","pause_on_hover"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return n.CZR_Helpers.isChecked(t())})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_img_slider_opts_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_img_slider_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_opts_child")}})}(wp.customize,jQuery,_),function(d,p,u){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return d.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&p.fn.sortable){var i=this;p("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){u.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","starting_value"),t=p.extend(!0,{},this.preItem());if(u.isObject(e)){var i=p.extend(!0,{},e);return p.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var e=this;d.CZRItem.prototype.ready.call(e);var i=function(){d.previewer.send("sek-item-focus",{control_id:e.module.control.id,item_id:e.id,item_value:e()})};e.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),e.callbacks.add(i),e.bind("sek-request-item-focus-in-preview",i),e.module.bind("item-collection-sorted",function(){e.writeItemViewTitle(e(),{input_changed:"title_text"})})},writeItemViewTitle:function(e,t){var i=this,n=i.module,o=e||i(),r="";if(!(!u.isUndefined(t)&&u.isObject(t))||!t.input_changed||u.contains(["title_text"],t.input_changed)){if(u.isEmpty(o.title)){var s=u.findIndex(n.itemCollection(),function(e){return e.id===i.id});s=u.isUndefined(s)?1:s+1}else r=o.title;r=d.CZR_Helpers.truncate(r,25);var a=p("."+n.control.css_attr.item_title,i.container).find(".sek-accord-title"),l=o.title_text?o.title_text:"";l=p("<div>").html(l).text();var c=i.module.container.find(".czr-items-wrapper > li").index(i.container);l=(l=u.isEmpty(l)?sektionsLocalizedData.i18n["Accordion title"]+" #"+(+c+1):l).substring(0,60),a.length<1?(p("."+n.control.css_attr.item_title,i.container).html(""),p("."+n.control.css_attr.item_title,i.container).append(p("<div/>",{class:"sek-accord-title",html:l}))):a.html(l)}},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,n=u.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),n=u.without(n,u.findWhere(n,{id:t.id})),i.itemCollection.set(n),i.trigger("pre_item_api_remove",t());var o=p.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=d(i.control.id).transport||!u.has(e,"dom_event")||u.has(e.dom_event,"isTrigger")||d.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",o),i.control.trigger("item-removed",o);else{var r=function(){d.previewer.unbind("ready",r),i.trigger("item-removed",o)};d.previewer.bind("ready",r)}}}};d.czrModuleMap=d.czrModuleMap||{},p.extend(d.czrModuleMap,{czr_accordion_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_collection_child")}})}(wp.customize,jQuery,_),function(n,e,t){var i={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){n.CZRItem.prototype.ready.call(this)}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_accordion_opts_child:{mthds:i,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_accordion_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_opts_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRButtonItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_flex":o.each(["h_alignment_css"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_shortcode_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_shortcode_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_shortcode_module")}})}(wp.customize,jQuery,_);
1
+ !function(u,m){u.CZR_Helpers.getInputSubTemplate=function(e){return 0<m("#tmpl-nimble-subtemplate___"+e).length?wp.template("nimble-subtemplate___"+e):(u.errare("problem in api.czr_sektions.getInputSubTemplate(), missing js template in the DOM for template_name : "+e),null)};var f=u.CZR_Helpers.getModuleTmpl;u.CZR_Helpers.getModuleTmpl=function(n){if(-1===(n=_.extend({tmpl:"",module_type:"",module_id:"",cache:!0,nonce:u.settings.nonce.save},n)).module_id.indexOf("__nimble__"))return f(n);var o=m.Deferred();if((_.isEmpty(n.tmpl)||_.isEmpty(n.module_type))&&o.reject("api.CZR_Helpers.getModuleTmpl => missing tmpl or module_type param"),!u.czr_sektions.isModuleRegistered(n.module_type))return o.reject("api.CZR_Helpers.getModuleTmpl => module type not registered"),o.resolve(),f(n);if(_.contains([],n.module_type))return o.resolve(),f(n);var e=u.czr_sektions.getRegisteredModuleProperty(n.module_type,"tmpl"),t=_.isObject(e)&&e[n.tmpl]?e[n.tmpl]:{};!_.isEmpty(t)&&_.isObject(t)||(u.errare("getModuleTmpl => Error empty or invalid input map for module : ",n.module_type),o.reject("getModuleTmpl => Error empty or invalid input map for module : ",n.module_type));var r=n.item_model,i=m.extend(!0,{},u.czr_sektions.getDefaultItemModelFromRegisteredModuleData(n.module_type)),s=m.extend(!0,{},i);r=m.extend(s,r),_.isEmpty(r)&&(u.errare("getModuleTmpl => Error invalid item model for module : ",n.module_type),o.reject("getModuleTmpl => Error invalid item model for module : ",n.module_type));var a,l="",c=function(e){var i="";return _.each(e,function(e,t){a=e.input_type;try{i+=wp.template("nimble-input-wrapper")({input_type:a,input_data:e,input_id:t,item_model:r,input_tmpl:function(e){var t=e;switch(e){case"czr_layouts":case"select":case"simpleselect":case"fa_icon_picker":case"font_picker":case"animation_picker":t="simpleselect";break;case"simpleselectWithDeviceSwitcher":t="simpleselect_deviceswitcher";break;case"multiselect":case"category_picker":t="multiselect";break;case"h_alignment":case"horizAlignmentWithDeviceSwitcher":t="h_alignment";break;case"h_text_alignment":case"horizTextAlignmentWithDeviceSwitcher":t="h_text_alignment";break;case"range_simple":case"range_simple_device_switcher":t="range_simple";break;case"number_simple":t="number_simple";break;case"font_size":case"line_height":case"range_with_unit_picker":case"range_with_unit_picker_device_switcher":t="range_with_unit_picker";break;case"spacing":case"spacingWithDeviceSwitcher":t="spacing";break;case"upload":case"upload_url":t="upload";break;case"bg_position":case"bgPositionWithDeviceSwitcher":t="bg_position";break;case"verticalAlignWithDeviceSwitcher":t="v_alignment"}return 0<m("#tmpl-nimble-input___"+t).length?wp.template("nimble-input___"+t):(u.errare("problem in getInputTemplate(), missing js template in the DOM for input_type : "+e),null)}(a),control_id:n.control_id})}catch(e){return u.errare("getModuleTmpl => Error when parsing the nimble-input-wrapper template",e),o.reject("getModuleTmpl => Error when parsing the nimble-input-wrapper template"),!1}}),i};if(t.tabs){var d="",p="";_.each(t.tabs,function(e,t){var i=m.extend(!0,{},e);i=m.extend({inputs:{},title:""},i);var n=_.isEmpty(i.attributes)?"":i.attributes;d+='<li data-tab-id="section-topline-'+(+t+1)+'" '+n+'><a href="#" title="'+i.title+'"><span>'+i.title+"</span></a></li>";var o=c(i.inputs);p+='<section id="section-topline-'+(+t+1)+'">'+o+"</section>"}),l+=['<div class="tabs tabs-style-topline">',"<nav>","<ul>",d,"</ul>","</nav>",'<div class="content-wrap">',p,"</div>","</div>"].join("")}else l=c(t);return o.resolve(l).promise()}}(wp.customize,jQuery);var CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{cachedElements:{$body:s("body"),$window:s(window)},initialize:function(){var e=this;if(_.isUndefined(window.sektionsLocalizedData))throw new Error("CZRSeksPrototype => missing localized server params sektionsLocalizedData");if(!_.isFunction(r.czr_activeSkopes))throw new Error("CZRSeksPrototype => api.czr_activeSkopes");e.SECTION_ID_FOR_GLOBAL_OPTIONS="__globalOptionsSectionId",e.SECTION_ID_FOR_LOCAL_OPTIONS="__localOptionsSection",e.SECTION_ID_FOR_CONTENT_PICKER="__content_picker__",e.SECTION_ID_FOR_SITE_TMPL="__siteTmplSection",e.MAX_NUMBER_OF_COLUMNS=12,e.SETTING_UPDATE_BUFFER=100,e.TINYMCE_EDITOR_HEIGHT=100,e.defaultLocalSektionSettingValue=e.getDefaultSektionSettingValue("local"),e.localSectionsSettingId=new r.Value({}),e.registered=new r.Value([]),wp.customize.apiIsReady?e.doSektionThinksOnApiReady():r.bind("ready",function(){e.doSektionThinksOnApiReady()}),r.bind("save-request-params",function(e){s.extend(e,{local_skope_id:r.czr_skopeBase.getSkopeProperty("skope_id"),group_skope_id:r.czr_skopeBase.getSkopeProperty("skope_id","group"),active_locations:r.czr_sektions.activeLocations()})});var t=function(){_.isArray(r.czrActiveWPEditors)&&(_.each(r.czrActiveWPEditors,function(e){wp.editor.remove(e)}),r.czrActiveWPEditors=[])};r.bind("sek-before-clean-registered",t),r.bind("czr-all-items-closed",t)},doSektionThinksOnApiReady:function(){var o=this;o.registerAndSetupDefaultPanelSectionOptions(),o.localSectionsSettingId.callbacks.add(function(e,t){try{o.setupSettingsToBeSaved()}catch(e){r.errare("Error in self.localSectionsSettingId.callbacks => self.setupSettingsToBeSaved()",e)}o.initializeHistoryLogWhenSettingsRegistered(),r.previewer.send("sek-request-active-locations")});var i=function(e,t){o.setContextualCollectionSettingIdWhenSkopeSet(e,t),r.section(o.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){e.deferred.embedded.done(function(){!0!==e.boundForLocalOptionGeneration&&(e.boundForLocalOptionGeneration=!0,e.expanded.bind(function(e){!0===e&&o.generateUI({action:"sek-generate-local-skope-options-ui"})}))})}),sektionsLocalizedData.isSiteTemplateEnabled&&r.section(o.SECTION_ID_FOR_SITE_TMPL,function(e){e.deferred.embedded.done(function(){!0!==e.siteTmplOptionsGenerated&&(e.siteTmplOptionsGenerated=!0,e.expanded.bind(function(e){!0===e&&o.generateUI({action:"sek-generate-site-tmpl-options-ui"})}))})}),r.section(o.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){!0!==e.nimbleGlobalOptionGenerated&&(o.generateUI({action:"sek-generate-global-options-ui"}),e.nimbleGlobalOptionGenerated=!0)}),o.nb_is_ready=!0,r.trigger("nimble-ready-for-current-skope")};_.isEmpty(r.czr_activeSkopes().local)||i(),r.czr_activeSkopes.callbacks.add(function(e,t){i(e,t)}),o.reactToPreviewMsg(),o.setupDnd(),o.setupTinyMceEditor(),o.schedulePrintSectionJson(),r.previewedDevice.bind(function(t){var e=_.filter(o.registered(),function(e){return"control"==e.what});_.each(e||[],function(e){r.control(e.id,function(e){e.container.find('[data-sek-device="'+t+'"]').each(function(){s(this).trigger("click")})})})}),s("#customize-notifications-area").on("click",'[data-sek-reset="true"]',function(){r.previewer.trigger("sek-reset-collection",{scope:"local"})}),o.bind("sek-ui-pre-removal",function(e){"control"==e.what&&-1<e.id.indexOf("draggable")&&r.control(e.id,function(e){e.container.find("[draggable]").each(function(){s(this).off("dragstart dragend")})}),"control"==e.what&&r.control(e.id,function(e){e.container.find("select").each(function(){_.isUndefined(s(this).data("czrSelect2"))||s(this).czrSelect2("destroy")})})}),r.bind("czr-new-registered",function(e){if(_.isUndefined(e.origin))throw new Error("czr-new-registered event => missing params.origin");if("nimble"===e.origin&&!1!==e.track){var t=o.registered(),i=s.extend(!0,[],t),n=_.findWhere(i,{id:e.id});if(!_.isEmpty(n)&&_.isEqual(n,e))throw new Error("register => duplicated element in self.registered() collection "+e.id);i.push(e),o.registered(i)}}),o.activeLocations=new r.Value([]),o.activeLocationsInfo=new r.Value([]),r.previewer.bind("sek-active-locations-in-preview",function(e){o.activeLocations(_.isObject(e)&&_.isArray(e.active_locations)?e.active_locations:[]),o.activeLocationsInfo(_.isObject(e)&&_.isArray(e.active_locs_info)?e.active_locs_info:[])}),o.setupTopBar(),o.setupSaveSectionUI(),o.setupSaveTmplUI(),o.lastClickedTargetInPreview=new r.Value,o.lastClickedTargetInPreview.bind(function(e,t){_.isObject(e)&&e.id?r.previewer.send("sek-set-double-click-target",e):r.previewer.send("sek-reset-double-click-target"),clearTimeout(o.cachedElements.$window.data("_preview_target_timer_")),o.cachedElements.$window.data("_preview_target_timer_",setTimeout(function(){o.lastClickedTargetInPreview({}),r.previewer.send("sek-reset-double-click-target")},2e4))}),r.previewer.bind("sek-clean-target-drop-zone",function(){o.lastClickedTargetInPreview({})}),s(document).keydown(function(e){e&&27===e.keyCode&&o.lastClickedTargetInPreview({})}),sektionsLocalizedData.hasActiveCachePlugin&&_.delay(function(){r.previewer.trigger("sek-notify",{notif_id:"has-active-cache-plugin",type:"info",duration:2e4,message:['<span style="color:#0075a2">',sektionsLocalizedData.i18n["You seem to be using a cache plugin."],!_.isString(sektionsLocalizedData.hasActiveCachePlugin)||sektionsLocalizedData.hasActiveCachePlugin.length<2?"":"<strong> ("+sektionsLocalizedData.hasActiveCachePlugin+")</strong><br/>"," <strong>",sektionsLocalizedData.i18n["It is recommended to disable your cache plugin when customizing your website."],"</strong>","</span>"].join("")})},2e3),r.previewer.bind("multi-items-module-refreshed",function(t){_.isUndefined(t.apiParams.control_id)||r.control(t.apiParams.control_id,function(e){_.isUndefined(e.params.sek_registration_params)||r.control(e.id).params.sek_registration_params.module_id===t.apiParams.id&&e.czr_Module.each(function(e){e.czr_Item.each(function(e){"expanded"===e.viewState()&&e.trigger("sek-request-item-focus-in-preview")})})})}),o.setupTemplateGallery()},registerAndSetupDefaultPanelSectionOptions:function(){var o=this,e=r.Panel.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}});r.panel(sektionsLocalizedData.sektionsPanelId,function(n){n.deferred.embedded.done(function(){var e=n.container.first().find("h3.accordion-section-title"),t=(n.container.first().find(".panel-meta .accordion-section-title"),['<img class="sek-nimble-logo" alt="'+n.params.title+'" src="',sektionsLocalizedData.baseUrl,"/assets/img/nimble/nimble_horizontal.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join(""));if(sektionsLocalizedData.isPro&&(t+=['<img class="sek-nimble-logo sek-pro-pastil" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_white.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),0<e.length){var i=e.find("span");e.addClass("sek-side-nimble-logo-wrapper").html(t).append(i)}})}),r.CZR_Helpers.register({origin:"nimble",what:"panel",id:sektionsLocalizedData.sektionsPanelId,title:sektionsLocalizedData.i18n["Nimble Builder"],priority:-1e3,constructWith:e,track:!1}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_GLOBAL_OPTIONS,title:sektionsLocalizedData.i18n["Site wide options"],panel:sektionsLocalizedData.sektionsPanelId,priority:20,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_GLOBAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-globe sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-globe sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_LOCAL_OPTIONS,title:sektionsLocalizedData.i18n["Current page options"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_LOCAL_OPTIONS,function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForGlobalOptions,dirty:!1,value:sektionsLocalizedData.globalOptionDBValues,transport:"postMessage",type:"option"}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForSiteTmplOptions,dirty:!1,value:sektionsLocalizedData.siteTmplOptionDBValues,transport:"postMessage",type:"option"}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_CONTENT_PICKER,title:sektionsLocalizedData.i18n["Content Picker"],panel:sektionsLocalizedData.sektionsPanelId,priority:30,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_CONTENT_PICKER,function(e){"resolved"!=r.czr_initialSkopeCollectionPopulated.state()?r.czr_initialSkopeCollectionPopulated.done(function(){r.previewer.trigger("sek-pick-content",{focus:!1})}):r.previewer.trigger("sek-pick-content",{focus:!1})})}),sektionsLocalizedData.isSiteTemplateEnabled&&r.CZR_Helpers.register({origin:"nimble",what:"section",id:o.SECTION_ID_FOR_SITE_TMPL,title:sektionsLocalizedData.i18n["Site templates"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section(o.SECTION_ID_FOR_SITE_TMPL,function(t){var e=t.container.find(".accordion-section-title"),i=t.container.find(".customize-section-title h3");0<e.length&&e.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(t,{expand_first_control:!0});var n=function(){setTimeout(function(){t.expanded(!0);var e=_.first(t.controls());e&&e.id&&r.control(e.id).container.find(".customize-control-title").trigger("click")},500),r.czr_currentSkopesCollection.unbind(n)};t.container.find(".accordion-section-title").first().on("click",function(){r.czr_currentSkopesCollection.bind(n),r.previewer.previewUrl(r.settings.url.home)})})})},setContextualCollectionSettingIdWhenSkopeSet:function(e,t){t=t||{},!_.isEmpty(t.local)&&r.panel(sektionsLocalizedData.sektionsPanelId).expanded()&&r.previewer.trigger("sek-pick-content"),sektionsData=r.czr_skopeBase.getSkopeProperty("sektions","local"),sektionsLocalizedData.isDevMode&&(sektionsLocalizedData.isSiteTemplateEnabled&&r.infoLog("TO DO SITE TEMPLATES => 1) PHP create a site template mapping : skope => site_template option that applies, 2) Include this mapping in the localized customizer params 3) use it on local reset to set the new value"),r.infoLog("::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ",sektionsData)),_.isEmpty(sektionsData)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData"),_.isEmpty(sektionsData.setting_id)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id"),this.localSectionsSettingId(sektionsData.setting_id)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{setupTopBar:function(){var t=this;t.topBarId="#nimble-top-bar",t.topBarVisible=new r.Value(!1),t.topBarVisible.bind(function(e){t.levelTreeExpanded()||t.toggleTopBar(e)}),t.mouseMovedRecently=new r.Value({}),t.mouseMovedRecently.bind(function(e){t.topBarVisible(!_.isEmpty(e))});var e=function(e){t.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(t.cachedElements.$window.data("_scroll_move_timer_")),t.cachedElements.$window.data("_scroll_move_timer_",setTimeout(function(){t.mouseMovedRecently.set({})},4e3))};t.cachedElements.$window.on("mousemove scroll,",_.throttle(e,50)),r.previewer.bind("ready",function(){s(r.previewer.targetWindow().document).on("mousemove scroll,",_.throttle(e,50))}),t.setupLevelTree()},toggleTopBar:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?s.when(i.renderAndSetupTopBarTmpl({})).done(function(e){i.topBarContainer=e,_.delay(function(){i.cachedElements.$body.addClass("nimble-top-bar-visible")},200)}):(t=s.Deferred(),i.cachedElements.$body.removeClass("nimble-top-bar-visible"),i.topBarContainer&&i.topBarContainer.length?_.delay(function(){t.resolve()},300):t.resolve(),t.promise()).done(function(){i.topBarVisible(!1)})},renderAndSetupTopBarTmpl:function(e){var t,i=this;if(0<s(i.topBarId).length)return s(i.topBarId);try{t=wp.template("nimble-top-bar")({})}catch(e){return r.errare("Error when parsing the the top note template",e),!1}s("#customize-preview").after(s(t)),s(document).keydown(function(e){if(e.ctrlKey&&_.contains([89,90],e.keyCode))try{i.navigateHistory(90===e.keyCode?"undo":"redo")}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-add-content",i.topBarId).on("click",function(e){e.preventDefault(),r.previewer.trigger("sek-pick-content",{content_type:"module"})}),s(".sek-level-tree",i.topBarId).on("click",function(e){e.preventDefault(),i.levelTreeExpanded(!i.levelTreeExpanded())}),s("[data-nimble-history]",i.topBarId).on("click",function(e){try{i.navigateHistory(s(this).data("nimble-history"))}catch(e){r.errare("Error when firing self.navigateHistory",e)}}),s(".sek-settings",i.topBarId).on("click",function(e){r.panel(sektionsLocalizedData.sektionsPanelId,function(e){i.rootPanelFocus(),e.focus()})}),s(".sek-nimble-doc",i.topBarId).on("click",function(e){e.preventDefault(),window.open(s(this).data("doc-href"),"_blank")}),s(".sek-tmpl-saving",i.topBarId).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!i.tmplDialogVisible())});var n=function(e){s(i.topBarId).length<1||sektionsLocalizedData.isDebugMode||(_.isObject(e)&&e.local_template&&"default"!==e.local_template?s(i.topBarId).find(".sek-notifications").html(['<span class="fas fa-info-circle"></span>',sektionsLocalizedData.i18n["This page uses a custom template."]].join(" ")):s(i.topBarId).find(".sek-notifications").html(""))},o=function(){r(i.localSectionsSettingId(),function(e){var t=e(),i=_.isObject(t)&&t.local_options&&t.local_options.template?t.local_options.template:null;n(i)}),r(i.getLocalSkopeOptionId()+"__template",function(e){e.bind(function(e,t){n(e)})})};return o(),r.bind("nimble-ready-for-current-skope",function(){o()}),s(i.topBarId)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{initializeHistoryLogWhenSettingsRegistered:function(){this.historyLog=new c.Value([{status:"current",value:{local:c(this.localSectionsSettingId())(),global:c(this.getGlobalSectionsSettingId())()},action:"initial"}]),this.historyLog.bind(function(e){if(!_.isEmpty(e)){var t=_.findKey(e,{status:"current"});t=Number(t),d("#nimble-top-bar").find("[data-nimble-history]").each(function(){"undo"===d(this).data("nimble-history")?d(this).attr("data-nimble-state",t<=0?"disabled":"enabled"):d(this).attr("data-nimble-state",e.length<=t+1?"disabled":"enabled")})}})},trackHistoryLog:function(e,t){var i=this,n=e.id===i.getGlobalSectionsSettingId();if(!_.isObject(t)||!_.isFunction(i.historyLog)||!_.isArray(i.historyLog()))throw c.errare("params, self.historyLog() ",t,i.historyLog()),new Error("trackHistoryLog => invalid params or historyLog value");var o,r=[],s=d.extend(!0,[],i.historyLog());_.isEmpty(t.in_sektion)?_.isEmpty(t.to_sektion)||(o=t.to_sektion):o=t.in_sektion,_.each(s,function(e){"future"!=e.status&&(d.extend(e,{status:"previous"}),r.push(e))}),r.push({status:"current",value:n?{global:e()}:{local:e()},action:_.isObject(t)&&t.action||"",sektionToRefresh:o}),i.historyLog(r)},navigateHistory:function(i){var t,n,o,r,e=this,s=d.extend(!0,[],e.historyLog()),a=[];if(_.each(s,function(e){if(_.isEmpty(r)){switch(e.status){case"previous":t=e;break;case"current":n=e;break;case"future":o=e}switch(i){case"undo":_.isEmpty(n)||_.isEmpty(t)||(r=t.value,n.sektionToRefresh,t.sektionToRefresh);break;case"redo":_.isEmpty(o)||(r=o.value,n.sektionToRefresh,o.sektionToRefresh)}}}),!_.isUndefined(r)){_.isEmpty(r.local)||(c(e.localSectionsSettingId())(e.validateSettingValue(r.local,"local"),{navigatingHistoryLogs:!0}),c.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0})),_.isEmpty(r.global)||c(e.getGlobalSectionsSettingId())(e.validateSettingValue(r.global,"global"),{navigatingHistoryLogs:!0});c.previewer.refresh(),c.previewer.trigger("sek-pick-content",{}),e.cleanRegistered(),e.cleanRegisteredLevelSettingsAfterHistoryNavigation()}var l=_.findKey(s,{status:"current"});l=Number(l),_.isNumber(l)?(_.each(s,function(e,t){switch(newLog=d.extend(!0,{},e),t=Number(t),i){case"undo":0<l&&(t===l-1?newLog.status="current":t===l&&(newLog.status="future"));break;case"redo":s.length>l+1&&(t===l?newLog.status="previous":t===l+1&&(newLog.status="current"))}a.push(newLog)}),e.historyLog(a)):c.errare("Error when navigating the history log, the current key should be a number")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(b,I){I.extend(CZRSeksPrototype,{setupLevelTree:function(){var i=this;i.levelTree=new b.Value([]),i.levelTree.bind(function(){i.levelTreeExpanded()&&i.renderOrRefreshTree()}),i.levelTreeExpanded=new b.Value(!1),i.levelTreeExpanded.bind(function(e){if(i.cachedElements.$body.toggleClass("sek-level-tree-expanded",e),e){if(i.templateGalleryExpanded(!1),i.tmplDialogVisible(!1),i.saveSectionDialogVisible&&i.saveSectionDialogVisible(!1),i.setLevelTreeValue(),_.isEmpty(i.levelTree()))return b.previewer.trigger("sek-notify",{type:"info",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["No sections to navigate"]+"</strong>","</span>"].join("")}),void i.levelTreeExpanded(!1);I("#customize-preview iframe").css("z-index",1),i.renderOrRefreshTree()}else 0<I("#nimble-level-tree").length&&_.delay(function(){I("#nimble-level-tree").remove(),I("#customize-preview iframe").css("z-index","")},300)}),i.activeLocations.bind(function(){_.isEmpty(i.levelTree())||i.renderOrRefreshTree()}),b.previewer.bind("ready",function(){i.localSectionsSettingId.callbacks.add(function(){i.levelTreeExpanded(!1),_.each([i.getGlobalSectionsSettingId(),i.localSectionsSettingId(),sektionsLocalizedData.optNameForGlobalOptions],function(e){b(e)._isBoundForNimbleLevelTree||(b(e).bind(function(e){i.setLevelTreeValue()}),b(e)._isBoundForNimbleLevelTree=!0)})})}),i.cachedElements.$body.on("click","#nimble-level-tree [data-nimb-level]",function(e){e.preventDefault(),e.stopPropagation();var i=I(e.target).closest("[data-nimb-level]");b.previewer.send("sek-animate-to-level",{id:i.data("nimb-id")}),b.previewer.send("sek-clean-level-uis"),_.delay(function(){b.previewer.send("sek-display-level-ui",{id:i.data("nimb-id")});var e=i.data("nimb-id"),t=i.data("nimb-level");"column"===t||"section"===t?b.previewer.trigger("sek-edit-options",{id:e,level:t}):"module"===t&&b.previewer.trigger("sek-edit-module",{id:e,level:t})},100)}),i.cachedElements.$body.on("click","#nimble-level-tree .sek-remove-level",function(e){e.preventDefault(),e.stopPropagation();var t=I(e.target).closest("[data-nimb-level]");b.previewer.trigger("sek-remove",{level:t.data("nimb-level"),id:t.data("nimb-id"),location:t.closest('[data-nimb-level="location"]').data("nimb-id"),in_sektion:t.closest('[data-nimb-level="section"]').data("nimb-id"),in_column:t.closest('[data-nimb-level="column"]').data("nimb-id")}),t.fadeOut("slow"),i.renderOrRefreshTree()}),i.cachedElements.$body.on("click",".sek-close-level-tree",function(e){e.preventDefault(),i.levelTreeExpanded(!1)})},setLevelTreeValue:function(){var e,t,i,n,o,r=this.getGlobalSectionsSettingId(),s=this.localSectionsSettingId(),a=sektionsLocalizedData.optNameForGlobalOptions,l=!1;if(_.each([r,s,a],function(e){b.has(e)||(l=e)}),!1===l){e=b(r)(),i=_.isObject(e)?I.extend(!0,{},e):{},i=_.isEmpty(i.collection)?[]:i.collection,i=_.isArray(i)?i:[],t=b(s)(),t=_.isObject(t)?t:{},n=I.extend(!0,{},t),n=_.isEmpty(n.collection)?[]:n.collection,n=_.isArray(n)?n:[];var c,d=_.union(i,n),p=!1,u=!1;o=b(a)(),o=_.isObject(o)?o:{},t.local_options&&t.local_options.local_header_footer&&(p="nimble_local"===(c=t.local_options.local_header_footer["header-footer"])),o.global_header_footer&&!p&&"theme"!==c&&(u="nimble_global"===o.global_header_footer["header-footer"]||"nimble_global"===c);var m,f,g=I.extend(!0,[],d);g=_.filter(g,function(e,t){return!_.contains(["nimble_global_header","nimble_global_footer","nimble_local_header","nimble_local_footer"],e.id)});var h=function(e){m=_.findWhere(d,{id:"nimble_"+e+"_header"}),f=_.findWhere(d,{id:"nimble_"+e+"_footer"}),g.unshift(m),g.push(f)};p?h("local"):u&&h("global");var v,k=this.activeLocations(),y=[];_.isEmpty(k)?y=g:_.each(k,function(e){v=_.findWhere(g,{id:e}),_.isUndefined(v)||y.push(v)}),this.levelTree(y)}else b.errare("::setLevelTreeValue => a setting id is not registered ")},renderOrRefreshTree:function(){var e;if(I("#nimble-level-tree").length<1){try{e=wp.template("nimble-level-tree")({})}catch(e){return b.errare("Error when parsing the nimble-level-tree template",e),!1}I("#customize-preview").after(I(e))}I("#nimble-level-tree").find(".sek-tree-wrap").html(this.getLevelTreeHtml())},getLevelTreeHtml:function(e,t){var i=this;e=e||i.levelTree();var n,o,r,s=!1;if(!_.isArray(e)||_.isEmpty(e))return b.errare("::buildLevelTree => invalid collection param",e),r;var a='<i class="material-icons sek-remove-level" title="'+sektionsLocalizedData.i18n["Remove this element"]+'">delete_forever</i>';return r="<ul>",_.each(e,function(e){_.isUndefined(e.level)?b.errare("::buildLevelTree => missing level property",e):_.isUndefined(e.id)?b.errare("::buildLevelTree => missing id property",e):(n=e.level,"location"===(o=n)&&(s=!_.contains(i.activeLocations(),e.id)),s||(sektionsLocalizedData.i18n[n]&&(o=sektionsLocalizedData.i18n[n]),!0===e.is_nested&&(o=sektionsLocalizedData.i18n["nested section"]),a="location"!==n?a:"",r+='<li data-nimb-level="'+n+'" data-nimb-id="'+e.id+'">',r+='<div class="sek-level-infos"><div class="sek-inner-level-infos">',"module"===n&&(r+=[i.getTreeModuleIcon(e.module_type),i.getTreeModuleTitle(e.module_type)].join(" ")),r+=[" ",o,"( id :",e.id,")",a].join(" "),r+="</div></div>",_.isArray(e.collection)&&!_.isEmpty(e.collection)&&(r+=i.getLevelTreeHtml(e.collection,t)),r+="</li>"))}),r+="</ul>"},getTreeModuleIcon:function(t){var i,n={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(n)&&t===e["content-id"]&&(_.isEmpty(e.icon)||(i="http"===e.icon.substring(0,4)?e.icon:sektionsLocalizedData.moduleIconPath+e.icon,n={svg:e.icon?i:"",font:e.font_icon?e.font_icon:""}))}),_.isEmpty(n.svg)?_.isEmpty(n.font)?void 0:n.font:'<img class="sek-svg-mod-icon" src="'+n.svg+'"/>'},getTreeModuleTitle:function(t){var i={};return _.each(sektionsLocalizedData.moduleCollection,function(e){_.isEmpty(i)&&t===e["content-id"]&&(i=e.title)}),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{setupSaveSectionUI:function(){var r=this;r.saveSectionDialogVisible=new c.Value(!1),r.saveSectionDialogVisible.bind(function(e){e&&(r.templateGalleryExpanded(!1),r.levelTreeExpanded(!1),r.tmplDialogVisible&&r.tmplDialogVisible(!1)),r.toggleSaveSectionUI(e)}),r.allSavedSections=new c.Value("_not_populated_"),r.allSavedSections.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,r.refreshSectionPickerHtml(e)):c.errare("error setupSaveSectionUI => section collection should be an object")}),r.saveSectionDialogMode=new c.Value("hidden"),r.saveSectionDialogMode.bind(function(e){_.contains(["hidden","save","update","remove","edit"],e)||(c.errare("error setupSaveSectionUI => unknown section dialog mode",e),e="save");var t,i=d("#nimble-top-section-save-ui"),n=i.find("#sek-saved-section-title"),o=i.find("#sek-saved-section-description");switch(i.find("[data-section-mode-switcher]").attr("aria-pressed",!1),i.find('[data-section-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-section-save-ui").attr("data-sek-section-dialog-mode",e),i.removeClass("sek-removal-confirmation-opened"),e){case"save":n.val(""),o.val("");break;case"update":case"edit":(t=i.find(".sek-saved-section-picker")).val("none").trigger("change"),r.setSavedSectionCollection().done(function(e){r.refreshSectionPickerHtml(),t.val(r.userSectionToEdit||"none").trigger("change"),r.userSectionToEdit=null});break;case"remove":console.log("sOOO ?",r.userSectionToRemove),(t=i.find(".sek-saved-section-picker")).val("none").trigger("change"),r.setSavedSectionCollection().done(function(e){r.refreshSectionPickerHtml(),t.val(r.userSectionToRemove||"none").trigger("change"),r.userSectionToRemove=null})}"remove"===e&&_.isEmpty(r.idOfSectionToSave)?i.addClass("sek-is-removal-only"):i.removeClass("sek-is-removal-only")})},refreshSectionPickerHtml:function(e){e=e||this.allSavedSections();var t=d("#nimble-top-section-save-ui"),i=t.find(".sek-saved-section-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var n,o,r="";_.each(e,function(e,t){_.isObject(e)&&(o=e.last_modified_date?e.last_modified_date:"",n=e.title?e.title:"section title not set",r+='<option value="'+t+'">'+[n,sektionsLocalizedData.i18n["Last modified"]+" : "+o].join(" | ")+"</option>")}),i.append(r),t.addClass("section-collection-populated")},renderSectionSaveUI:function(e){if(0<d("#nimble-top-section-save-ui").length)return d("#nimble-top-section-save-ui");try{_tmpl=wp.template("nimble-top-section-save-ui")({})}catch(e){return c.errare("Error when parsing nimble-top-section-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-section-save-ui")},maybeScheduleSectionSaveDOMEvents:function(){var i=this,n=d("#nimble-top-section-save-ui");n.data("nimble-sec-save-dom-events-scheduled")||(n.on("click","[data-section-mode-switcher]",function(e){e.preventDefault(),i.saveSectionDialogMode(d(this).data("section-mode-switcher"))}).on("change",".sek-saved-section-picker",function(e){i.reactOnSectionSelection(e,d(this))}).on("click",".sek-do-save-section",function(e){n.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e).done(function(e){n.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}))})}).on("click",".sek-do-update-section",function(e){var t=n.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-section-processing-ajax"),i.saveOrUpdateSavedSection(e,t).done(function(e){n.removeClass("nimble-section-processing-ajax"),e.success&&(i.saveSectionDialogVisible(!1),i.setSavedSectionCollection({refresh:!0}).done(function(e){i.refreshSectionPickerHtml()}))}))}).on("click",".sek-open-remove-confirmation",function(e){n.addClass("sek-removal-confirmation-opened")}).on("click",".sek-do-remove-section",function(e){var t=n.find(".sek-saved-section-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-section-processing-ajax"),i.removeSavedSection(e,t).done(function(e){n.removeClass("nimble-section-processing-ajax"),n.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedSectionCollection({refresh:!0})}))}).on("click",".sek-cancel-remove-section",function(e){n.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",n).on("click",function(e){e.preventDefault(),i.saveSectionDialogVisible(!1)}),n.data("nimble-sec-save-dom-events-scheduled",!0))},reactOnSectionSelection:function(e,t){var i=d("#nimble-top-section-save-ui"),n=t.val(),o=i.find("#sek-saved-section-title"),r=i.find("#sek-saved-section-description"),s="update"===this.saveSectionDialogMode()?"sek-section-update-selected":"sek-section-remove-selected";if("none"===n)o.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedSections();(a=_.isObject(a)&&!_.isArray(a)?a:{})[n]=d.extend({title:"",description:"",last_modified_date:""},a[n]||{}),o.val(a[n].title),r.val(a[n].description),i.addClass(s)}},saveOrUpdateSavedSection:function(e,t){var i=this,n=d.Deferred(),o="edit"===i.saveSectionDialogMode();if(!o&&(!i.idOfSectionToSave||_.isEmpty(i.idOfSectionToSave)))return c.errare("saveOrUpdateSavedSection => error => missing section id"),n.resolve({success:!1});e.preventDefault();var r,s=d("#sek-saved-section-title"),a=s.val(),l=d("#sek-saved-section-description").val();if(!o){if("no_match"==(r=d.extend(!0,{},i.getLevelModel(i.idOfSectionToSave))))return c.errare("saveOrUpdateSavedSection => error => no section model with id "+i.idOfSectionToSave),n.resolve({success:!1});if(r=i.preProcessSection(r),!_.isObject(r))return c.errare("::saveOrUpdateSavedSection => error => invalid sectionModel"),n.resolve({success:!1})}return _.isEmpty(a)?(s.addClass("error"),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),n.resolve({success:!1})):(d("#sek-saved-section-title").removeClass("error"),wp.ajax.post("sek_save_user_section",{nonce:c.settings.nonce.save,section_data:o?"":JSON.stringify(r),section_title:a,section_description:l,section_post_name:t||"",skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),edit_metas_only:o?"yes":"no"}).done(function(e){n.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){n.resolve({success:!1}),c.errorLog("ajax sek_save_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),n)},preProcessSection:function(e){if(!_.isObject(e))return null;var t=d.extend({},!0,e);return _.has(t,"is_nested")&&(t=_.omit(t,"is_nested")),t},removeSavedSection:function(e,t){var i=this,n=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_section",{nonce:c.settings.nonce.save,section_post_name:t}).done(function(e){n.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){n.resolve({success:!1}),c.errorLog("ajax sek_remove_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}).always(function(){i.idOfSectionToSave=null}),n},toggleSaveSectionUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderSectionSaveUI({})).done(function(e){i.maybeScheduleSectionSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.saveSectionDialogMode("save"),i.cachedElements.$body.addClass("sek-save-section-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-section-ui-visible"),0<d("#nimble-top-section-save-ui").length?_.delay(function(){i.saveSectionDialogMode=i.saveSectionDialogMode?i.saveSectionDialogMode:new c.Value,i.saveSectionDialogMode("hidden"),i.saveUIContainer.remove(),i.idOfSectionToSave=null,t.resolve()},250):t.resolve(),t.promise()).done(function(){i.saveSectionDialogVisible(!1)})},setSavedSectionCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedSections()?((t.sectionCollectionPromise&&"pending"===t.sectionCollectionPromise.state()?t.sectionCollectionPromise:t.getSavedSectionCollection(e)).done(function(e){t.allSavedSections(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedSections())},getSavedSectionCollection:function(e){var t=this;return e=e||{refresh:!1},t.sectionCollectionPromise=d.Deferred(),e.refresh||"_not_populated_"===t.allSavedSections()?wp.ajax.post("sek_get_all_saved_sections",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.sectionCollectionPromise.resolve(e):(t.sectionCollectionPromise.resolve({}),_.isEmpty(e)||c.errorLog("control::getSavedSectionCollection => collection is empty or invalid"))}).fail(function(e){c.errorLog("ajax sek_get_all_saved_section => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.sectionCollectionPromise.resolve({})}):t.sectionCollectionPromise.resolve(t.allSavedSections()),t.sectionCollectionPromise}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{setupSaveTmplUI:function(){var r=this;r.tmplDialogVisible=new c.Value(!1),sektionsLocalizedData.isTemplateSaveEnabled&&(r.tmplDialogVisible.bind(function(e){e&&(r.templateGalleryExpanded(!1),r.levelTreeExpanded(!1),r.saveSectionDialogVisible&&r.saveSectionDialogVisible(!1)),r.toggleSaveTmplUI(e)}),r.allSavedTemplates=new c.Value("_not_populated_"),r.allSavedTemplates.bind(function(e){_.isObject(e)?(e=_.isEmpty(e)?{}:e,r.refreshTmplPickerHtml(e)):c.errare("error setupSaveTmplUI => tmpl collection should be an object")}),r.allApiTemplates=new c.Value("_not_populated_"),r.tmplDialogMode=new c.Value("hidden"),r.tmplDialogMode.bind(function(e){_.contains(["hidden","save","update","remove","edit"],e)||(c.errare("::setupSaveTmplUI => unknown tmpl dialog mode",e),e="save");var t,i=d("#nimble-top-tmpl-save-ui"),n=i.find("#sek-saved-tmpl-title"),o=i.find("#sek-saved-tmpl-description");switch(i.find("[data-tmpl-mode-switcher]").attr("aria-pressed",!1),i.find('[data-tmpl-mode-switcher="'+e+'"]').attr("aria-pressed",!0),d("#nimble-top-tmpl-save-ui").attr("data-sek-tmpl-dialog-mode",e),i.removeClass("sek-removal-confirmation-opened"),e){case"save":n.val(""),o.val("");break;case"update":case"remove":(t=i.find(".sek-saved-tmpl-picker")).val("none").trigger("change"),r.setSavedTmplCollection().done(function(e){r.refreshTmplPickerHtml(),t.val(r.tmplToRemove||"none").trigger("change"),r.tmplToRemove=null});break;case"edit":(t=i.find(".sek-saved-tmpl-picker")).val("none").trigger("change"),r.setSavedTmplCollection().done(function(e){r.refreshTmplPickerHtml(),t.val(r.tmplToEdit||"none").trigger("change"),r.tmplToEdit=null})}}))},refreshTmplPickerHtml:function(e){e=e||this.allSavedTemplates();var t=d("#nimble-top-tmpl-save-ui"),i=t.find(".sek-saved-tmpl-picker");i.val("none").trigger("change"),i.find("option").each(function(){"none"!==d(this).attr("value")&&d(this).remove()});var n,o,r="";_.each(e,function(e,t){_.isObject(e)&&(o=e.last_modified_date?e.last_modified_date:"",n=e.title?e.title:"template title not set",r+='<option value="'+t+'">'+[n,sektionsLocalizedData.i18n["Last modified"]+" : "+o].join(" | ")+"</option>")}),i.append(r),t.addClass("tmpl-collection-populated")},renderTmplUI:function(e){if(0<d("#nimble-top-tmpl-save-ui").length)return d("#nimble-top-tmpl-save-ui");try{_tmpl=wp.template("nimble-top-tmpl-save-ui")({})}catch(e){return c.errare("Error when parsing nimble-top-tmpl-save-ui template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-top-tmpl-save-ui")},scheduleTmplSaveDOMEvents:function(){var i=this,n=d("#nimble-top-tmpl-save-ui");n.data("nimble-tmpl-dom-events-scheduled")||(n.on("click","[data-tmpl-mode-switcher]",function(e){e.preventDefault(),i.tmplDialogMode(d(this).data("tmpl-mode-switcher"))}),n.on("change",".sek-saved-tmpl-picker",function(e){i.reactOnTemplateSelection(e,d(this))}),n.on("click",".sek-do-save-tmpl",function(e){n.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e).done(function(e){n.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}))})}),n.on("click",".sek-do-update-tmpl",function(e){var t=n.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-tmpl-processing-ajax"),i.saveOrUpdateTemplate(e,t).done(function(e){n.removeClass("nimble-tmpl-processing-ajax"),e.success&&(i.tmplDialogVisible(!1),i.setSavedTmplCollection({refresh:!0}).done(function(e){i.refreshTmplPickerHtml()}))}))}),n.on("click",".sek-open-remove-confirmation",function(e){n.addClass("sek-removal-confirmation-opened")}),n.on("click",".sek-do-remove-tmpl",function(e){var t=n.find(".sek-saved-tmpl-picker").val();"none"===t||_.isEmpty(t)||(n.addClass("nimble-tmpl-processing-ajax"),i.removeTemplate(e,t).done(function(e){n.removeClass("nimble-tmpl-processing-ajax"),n.removeClass("sek-removal-confirmation-opened"),e.success&&i.setSavedTmplCollection({refresh:!0})}))}),n.on("click",".sek-cancel-remove-tmpl",function(e){n.removeClass("sek-removal-confirmation-opened")}),d(".sek-close-dialog",n).on("click",function(e){e.preventDefault(),i.tmplDialogVisible(!1)}),n.data("nimble-tmpl-dom-events-scheduled",!0))},reactOnTemplateSelection:function(e,t){var i=d("#nimble-top-tmpl-save-ui"),n=t.val(),o=i.find("#sek-saved-tmpl-title"),r=i.find("#sek-saved-tmpl-description"),s="update"===this.tmplDialogMode()?"sek-tmpl-update-selected":"sek-tmpl-remove-selected";if("none"===n)o.val(""),r.val(""),i.removeClass(s);else{var a=this.allSavedTemplates();(a=_.isObject(a)&&!_.isArray(a)?a:{})[n]=d.extend({title:"",description:"",last_modified_date:""},a[n]||{}),o.val(a[n].title),r.val(a[n].description),i.addClass(s)}},saveOrUpdateTemplate:function(e,t){var i=this,n=d.Deferred();e.preventDefault();var o,r=d("#sek-saved-tmpl-title"),s=r.val(),a=d("#sek-saved-tmpl-description").val(),l=i.localSectionsSettingId();try{o=i.preProcessTmpl(c(l)())}catch(e){c.errorLog("error in ::saveOrUpdateTemplate",e),n.resolve({success:!1})}return _.isEmpty(s)?(r.addClass("error"),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["A title is required"]+"</strong>","</span>"].join("")}),n.resolve({success:!1})):(d("#sek-saved-tmpl-title").removeClass("error"),wp.ajax.post("sek_save_user_template",{nonce:c.settings.nonce.save,tmpl_data:"edit"===i.tmplDialogMode()?"":JSON.stringify(o),tmpl_title:s,tmpl_description:a,tmpl_post_name:t||"",edit_metas_only:"edit"===i.tmplDialogMode()?"yes":"no",skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),tmpl_locations:i.getActiveLocationsForTmpl(o),tmpl_header_location:i.getHeaderOrFooterLocationIdForTmpl("header",o),tmpl_footer_location:i.getHeaderOrFooterLocationIdForTmpl("footer",o)}).done(function(e){n.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template saved"]+"</strong>","</span>"].join("")})}).fail(function(e){n.resolve({success:!1}),c.errorLog("ajax sek_save_template => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing template"]+"</strong>","</span>"].join("")})}),n)},getActiveLocationsForTmpl:function(e){if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var t=[];return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&"location"===e.level&&t.push(e.id)}),t},getHeaderOrFooterLocationIdForTmpl:function(t,e){var i=this;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");var n="";return _.each(e.collection,function(e){_.isObject(e)&&e.id&&e.level&&("header"===t&&i.isHeaderLocation(e.id)||"footer"===t&&i.isFooterLocation(e.id))&&(n=e.id)}),n},preProcessTmpl:function(e){var t,i;if(!_.isObject(e))throw new Error("preProcess Tmpl => error : tmpl_data must be an object");return(t=d.extend(!0,{},e)).collection=[],i=this.activeLocations(),_.each(e.collection,function(e){_.isObject(e)&&e.id&&e.collection&&_.contains(i,e.id)&&!_.isEmpty(e.collection)&&t.collection.push(e)}),t},removeTemplate:function(e,t){var i=d.Deferred();return e.preventDefault(),wp.ajax.post("sek_remove_user_template",{nonce:c.settings.nonce.save,tmpl_post_name:t}).done(function(e){i.resolve({success:!0}),c.previewer.trigger("sek-notify",{type:"success",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Template removed"]+"</strong>","</span>"].join("")})}).fail(function(e){i.resolve({success:!1}),c.errorLog("ajax sek_remove_template => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")})}),i},toggleSaveTmplUI:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderTmplUI({})).done(function(e){i.scheduleTmplSaveDOMEvents(),i.saveUIContainer=e,_.delay(function(){i.tmplDialogMode("save"),i.cachedElements.$body.addClass("sek-save-tmpl-ui-visible")},200)}):(t=d.Deferred(),i.cachedElements.$body.removeClass("sek-save-tmpl-ui-visible"),0<d("#nimble-top-tmpl-save-ui").length?_.delay(function(){i.tmplDialogMode=i.tmplDialogMode?i.tmplDialogMode:new c.Value,i.tmplDialogMode("hidden"),i.saveUIContainer.remove(),t.resolve()},250):t.resolve(),t.promise()).done(function(){i.tmplDialogVisible(!1)})},setSavedTmplCollection:function(e){var t=this,i=d.Deferred();return(e=e||{refresh:!1}).refresh||"_not_populated_"===t.allSavedTemplates()?((t.templateCollectionPromise&&"pending"===t.templateCollectionPromise.state()?t.templateCollectionPromise:t.getSavedTmplCollection()).done(function(e){t.allSavedTemplates(e),i.resolve(e)}),i.promise()):i.resolve(t.allSavedTemplates())},getSavedTmplCollection:function(){var t=this;return t.templateCollectionPromise=d.Deferred(),wp.ajax.post("sek_get_all_saved_tmpl",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?t.templateCollectionPromise.resolve(e):(t.templateCollectionPromise.resolve({}),_.isEmpty(e)||c.errare("control::getSavedTmplCollection => error => tmpl collection is invalid",e))}).fail(function(e){c.errorLog("ajax sek_get_all_saved_tmpl => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),t.templateCollectionPromise.resolve({})}),t.templateCollectionPromise},getApiTmplCollection:function(){var t=this,i=d.Deferred(),n={};return"_not_populated_"!==t.allApiTemplates()?i.resolve(t.allApiTemplates()):sektionsLocalizedData.useAPItemplates?wp.ajax.post("sek_get_all_api_tmpl",{nonce:c.settings.nonce.save}).done(function(e){_.isObject(e)&&!_.isArray(e)?n=e:c.errare("control::getApiTmplCollection => error => tmpl collection is invalid",e),t.allApiTemplates(n),i.resolve(n)}).fail(function(e){c.errorLog("ajax sek_get_all_api_tmpl => error",e),c.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["Error when processing templates"]+"</strong>","</span>"].join("")}),i.resolve({})}):(t.allApiTemplates([]),i.resolve([])),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,r){r.extend(CZRSeksPrototype,{getTmplJsonFromUserTmpl:function(e){var t=r.Deferred();return wp.ajax.post("sek_get_user_tmpl_json",{nonce:o.settings.nonce.save,tmpl_post_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),o.errorLog("ajax getTmplJsonFromUserTmpl => error",e),o.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>error when fetching the template</strong>","</span>"].join("")})}),t},getTmplJsonFromApi:function(e){var t=r.Deferred();return wp.ajax.post("sek_get_api_tmpl_json",{nonce:o.settings.nonce.save,api_tmpl_name:e}).done(function(e){t.resolve({success:!0,tmpl_json:e})}).fail(function(e){t.resolve({success:!1}),o.errorLog("ajax getTmplJsonFromApiTmpl => error",e),o.previewer.trigger("sek-notify",{type:"error",duration:1e4,message:['<span style="font-size:0.95em">',"<strong>error when fetching the template</strong>","</span>"].join("")})}),t},get_gallery_tmpl_json_and_inject:function(t){var e,i=this,n=(t=r.extend({tmpl_name:"",tmpl_source:"user",tmpl_inject_mode:"replace"},t||{})).tmpl_name;!_.isEmpty(n)&&_.isString(n)||o.errare("::tmpl inject => error => invalid template name"),(e="api_tmpl"===t.tmpl_source?i.getTmplJsonFromApi(n):i.getTmplJsonFromUserTmpl(n)).done(function(e){e.success&&i.inject_tmpl_from_gallery({tmpl_name:n,template_data:e.tmpl_json,tmpl_inject_mode:t.tmpl_inject_mode})}),_.delay(function(){"pending"===e.state()&&o.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>","Template import failed","</strong>","</span>"].join("")})},3e4)},inject_tmpl_from_gallery:function(e){e=e||{};if(!(e=r.extend({tmpl_inject_mode:"replace"},e)).template_data)throw new Error("::inject_tmpl => missing remote template data");o.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),o.czr_sektions.isImportedContentEligibleForAPI({success:!0,data:e.template_data},e)?(e.template_data.data.collection=this.setIdsForImportedTmpl(e.template_data.data.collection),o.czr_sektions.doUpdateApiSettingAfter_TmplGalleryImport({success:!0,data:e.template_data},e)):o.infoLog("::inject_tmpl problem => !api.czr_sektions.isImportedContentEligibleForAPI",e)},doUpdateApiSettingAfter_TmplGalleryImport:function(e,t){if(t=t||{},o.czr_sektions.isImportedContentEligibleForAPI(e,t)){o.czr_sektions.updateAPISetting({action:"sek-inject-tmpl-from-gallery",scope:"local",injected_content:e.data,tmpl_inject_mode:t.tmpl_inject_mode}).done(function(){o.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),o.previewer.refresh(),o.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Template successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){o.errare("::doUpdateApiSettingAfter_TmplGalleryImport => error when firing ::updateAPISetting",e),o.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),o.previewer.refresh()}else o.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,e){jQuery.extend(CZRSeksPrototype,{getRevisionHistory:function(e){return wp.ajax.post("sek_get_revision_history",{nonce:r.settings.nonce.save,skope_id:e.is_local?r.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId})},setSingleRevision:function(i){var n=this,o=function(e,t){r.previewer.trigger("sek-notify",{notif_id:"restore-revision-error",type:t||"info",duration:1e4,message:['<span style="">',"<strong>",e||"","</strong>","</span>"].join("")})};wp.ajax.post("sek_get_single_revision",{nonce:r.settings.nonce.save,revision_post_id:i.revision_post_id}).done(function(e){var t=i.is_local?n.localSectionsSettingId():n.getGlobalSectionsSettingId();_.isEqual(r(t)(),e)?o(sektionsLocalizedData.i18n["This is the current version."],"info"):n.updateAPISetting({action:"sek-restore-revision",is_global_location:!i.is_local,revision_value:e}).done(function(){r.previewer.refresh()}).fail(function(e){r.errare("::setSingleRevision error when firing ::updateAPISetting",e),o(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}).fail(function(e){r.errare("::setSingleRevision ajax error",e),o(sektionsLocalizedData.i18n["The revision could not be restored."],"error")})}})}(wp.customize);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,c){c.extend(CZRSeksPrototype,{setupSettingsToBeSaved:function(){var i,o=this,e={local:{collectionSettingId:o.localSectionsSettingId()},global:{collectionSettingId:o.getGlobalSectionsSettingId()}};_.each(e,function(e,t){if(i=l.czr_skopeBase.getSkopeProperty("sektions",t).db_values,_.isEmpty(e.collectionSettingId))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");if(!l.has(e.collectionSettingId)){l.CZR_Helpers.register({what:"setting",id:e.collectionSettingId,value:o.validateSettingValue(_.isObject(i)?i:o.getDefaultSektionSettingValue(t),t),transport:"postMessage",type:"option",track:!1,origin:"nimble"});l(e.collectionSettingId,function(n){n.bind(_.debounce(function(e,t,i){if(!_.isObject(i)||!0!==i.navigatingHistoryLogs)try{o.trackHistoryLog(n,i)}catch(e){l.errare("setupSettingsToBeSaved => trackHistoryLog",e)}},1e3))})}})},validateSettingValue:function(i,n){if(!_.isObject(i))return l.errare("::validateSettingValue => validation error => the setting should be an object",i),null;if(!_.isEmpty(n)&&_.contains(["local","global"],n)){var o={},r=!1,e=[],s=function(e){l.errare(e,i),sektionsLocalizedData.isDevMode&&l.previewer.trigger("sek-notify",{type:"error",duration:6e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")}),r=!0},a=function(t){if(!r)if(_.isUndefined(t)&&_.isEmpty(o)){if(t=c.extend(!0,{},i),_.isUndefined(t.id)||_.isUndefined(t.level)){if(_.isUndefined(t.collection))return void s("validation error => the root level is missing the collection of locations");if(!_.isEmpty(t.level)||!_.isEmpty(t.id))return void s('validation error => the root level should not have a "level" or an "id" property');_.each(t,function(e,t){switch(n){case"local":if(!_.contains(["collection","local_options","fonts"],t))return void s("validation error => unauthorized option group for local setting value => "+t);break;case"global":if(!_.contains(["collection","fonts"],t))return void s("validation error => unauthorized option group for global setting value => "+t)}}),_.each(i.collection,function(e){o=t,a(e)})}}else{if(_.isUndefined(t)||!_.isObject(t))return void s("validation error => a level is invalid");if(_.isEmpty(t.id)||!_.isString(t.id))return void s("validation error => a "+t.level+" level must have a valid id");if(_.contains(e,t.id))return void s("validation error => duplicated level id : "+t.id);if(e.push(t.id),_.isEmpty(t.level)||!_.isString(t.level))return void s("validation error => a "+t.level+" level must have a level property");if(!_.contains(["location","section","column","module"],t.level))return void s('validation error => the level "'+t.level+'" is not authorized');if("module"==t.level){if(!_.isUndefined(t.collection))return void s("validation error => a module can not have a collection property")}else if(_.isUndefined(t.collection))return void s("validation error => missing collection property for level => "+t.level+" "+t.id);switch(_.isUndefined(t.ver_ini)&&l.errare("validateSettingValue() => validation error => a "+t.level+' should have a version property : "ver_ini"'),t.level){case"location":if(!_.isEmpty(o.level))return void s("validation error => the parent of location "+t.id+" should have no level set");break;case"section":if(t.is_nested&&"column"!=o.level)return void s("validation error => the nested section "+t.id+" must be child of a column");if(!t.is_nested&&"location"!=o.level)return void s("validation error => the section "+t.id+" must be child of a location");break;case"column":if("section"!=o.level)return void s("validation error => the column "+t.id+" must be child of a section");break;case"module":if("column"!=o.level)return void s("validation error => the module "+t.id+" must be child of a column")}"module"!=t.level&&_.each(t.collection,function(e){o=c.extend(!0,{},t),_.isUndefined(e)?s("validation error => undefined level "):a(e)})}};return a(),r?null:i}l.errare("::validateSettingValue => invalid scope provided.",n)},resetCollectionSetting:function(e){if(_.isEmpty(e)||!_.contains(["local","global"],e))throw new Error("resetCollectionSetting => invalid scope provided.",e);if(sektionsLocalizedData.isSiteTmplEnabled){var t=l(sektionsLocalizedData.optNameForSiteTmplOptions)(),i=l.czr_skopeBase.getSkopeProperty("skope_id","group"),n=l.czr_skopeBase.getSkopeProperty("group_sektions","group");console.log("ALORS ?",t,i,n),_.isObject(t)&&t.site_templates&&_.isObject(t.site_templates)&&t.site_templates.pages&&"skp__all_page"===i&&n&&n.db_values&&(console.log("SET GROUP SKOPE SEKTION ?"),this.validateSettingValue(_.isObject(n.db_value)?n.db_value:this.getDefaultSektionSettingValue("local"),"local"))}return c.extend(!0,{},this.getDefaultSektionSettingValue(e))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,n){n.extend(CZRSeksPrototype,{reactToPreviewMsg:function(){var o=this,r={},s={},a=!0,e={"sek-add-section":{callback:function(e){return l.previewedDevice("desktop"),a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},r={action:"sek-add-section",id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),before_section:e.before_section,after_section:e.after_section,is_first_section:e.is_first_section},o.updateAPISetting(r)},complete:function(e){e.apiParams.is_first_section&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),l.previewer.trigger("sek-pick-content",{id:e.apiParams?e.apiParams.id:"",content_type:"section"}),l.previewer.send("sek-animate-to-level",{id:e.apiParams.id})}},"sek-add-column":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),action:"sek-add-column",in_sektion:e.in_sektion,autofocus:e.autofocus},o.updateAPISetting(r)},complete:function(e){!1!==e.apiParams.autofocus&&l.previewer.trigger("sek-pick-content",{})}},"sek-add-module":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),action:"sek-add-module",in_sektion:e.in_sektion,in_column:e.in_column,module_type:e.content_id,before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section},o.updateAPISetting(r)},complete:function(e){l.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)}),l.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_column,location_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-remove":{callback:function(e){switch(a=!0,s={},e.level){case"section":var t=o.getLevelModel(e.id);if("no_match"===t){l.errare("reactToPreviewMsg => sek-remove-section => no sektionToRemove matched");break}r={action:"sek-remove-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:t.is_nested};break;case"column":r={action:"sek-remove-column",id:e.id,in_sektion:e.in_sektion};break;case"module":r={action:"sek-remove-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;default:l.errare("::reactToPreviewMsg => sek-remove => missing level ",e)}return o.updateAPISetting(r)},complete:function(e){if(l.previewer.trigger("sek-pick-content",{}),o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)}),"sek-remove-section"===e.apiParams.action){var t=o.getLevelModel(e.apiParams.location);_.isEmpty(t.collection)&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}}},"sek-move":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-move-section",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),newOrder:e.newOrder,from_location:e.from_location,to_location:e.to_location};break;case"column":r={action:"sek-move-column",id:e.id,newOrder:e.newOrder,from_sektion:e.from_sektion,to_sektion:e.to_sektion};break;case"module":r={action:"sek-move-module",id:e.id,newOrder:e.newOrder,from_column:e.from_column,to_column:e.to_column,from_sektion:e.from_sektion,to_sektion:e.to_sektion}}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-move-section":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),e.apiParams.from_location!=e.apiParams.to_location&&(l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.to_location}),l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.from_location}));break;case"sek-move-column":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-refresh-modules-in-column":l.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}}},"sek-move-section-up":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"up",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},o.updateAPISetting(r)},complete:function(e){l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-up",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-move-section-down":{callback:function(e){return a=!1,s={},r={action:"sek-move-section-up-down",direction:"down",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),location:e.location,in_column:e.in_column},o.updateAPISetting(r)},complete:function(e){l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id}),e.apiParams.new_location&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.new_location,original_action:"sek-move-section-down",moved_level_id:e.apiParams.id})}},"sek-duplicate":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-duplicate-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-duplicate-column",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;case"module":r={action:"sek-duplicate-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return o.updateAPISetting(r)},complete:function(e){var t;switch(e.apiParams.action){case"sek-duplicate-section":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),t=e.apiParams.location,e.apiParams.is_nested&&l.previewer.refresh(),l.previewer.send("sek-animate-to-level",{id:e.apiParams.id});break;case"sek-duplicate-column":l.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_sektion;break;case"sek-duplicate-module":l.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),t=e.apiParams.in_column}l.previewer.trigger("sek-refresh-stylesheet",{id:t,location_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-resize-columns":function(e){return a=!0,s={},r=e,o.updateAPISetting(r)},"sek-add-content-in-new-sektion":{callback:function(e){switch(a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},(r=e).action="sek-add-content-in-new-sektion",r.id=sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),e.content_type){case"module":r.droppedModuleId=sektionsLocalizedData.prefixForSettingsNotSaved+o.guid();break;case"preset_section":l.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),l.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0})}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.content_type){case"module":l.previewer.trigger("sek-edit-module",{level:"module",id:e.apiParams.droppedModuleId});break;case"preset_section":l.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)});var t=e.location_skope_id;_.isUndefined(t)&&(t=!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:l.czr_skopeBase.getSkopeProperty("skope_id")),l.previewer.trigger("sek-refresh-stylesheet",{location_skope_id:t,is_global_location:o.isGlobalLocation(e.apiParams)}),e.apiParams.is_first_section&&l.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),e.apiParams.sektion_to_replace&&l.previewer.trigger("sek-remove",{id:e.apiParams.sektion_to_replace,location:e.apiParams.location,in_column:e.apiParams.in_column,level:"section"})}},"sek-add-preset-section-in-new-nested-sektion":{callback:function(e){return a=!1,s={},(r=e).action="sek-add-preset-section-in-new-nested-sektion",l.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),o.updateAPISetting(r)},complete:function(e){o.updateAPISetting({action:"sek-update-fonts",is_global_location:o.isGlobalLocation(e.apiParams)}),l.previewer.trigger("sek-refresh-stylesheet",{id:e.apiParams.in_sektion,location_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id")}),l.previewer.trigger("sek-refresh-level",{level:"section",id:e.apiParams.in_sektion})}},"sek-pick-content":function(e){return e=_.isObject(e)?e:{},l.czr_sektions.currentContentPickerType=l.czr_sektions.currentContentPickerType||new l.Value,_.isObject(e)&&e.id&&o.lastClickedTargetInPreview({id:e.id}),a=!0,r={},s={action:"sek-generate-draggable-candidates-picker-ui",content_type:(e=e||{}).content_type||"module",was_triggered:!_.has(e,"was_triggered")||e.was_triggered,focus:!_.has(e,"focus")||e.focus},o.generateUI(s)},"sek-edit-options":function(e){return a=!0,r={},_.isEmpty(e.id)?n.Deferred(function(){this.reject("missing id")}):(s={action:"sek-generate-level-options-ui",location:e.location,level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(s))},"sek-edit-module":function(e){return a=!0,r={},s={action:"sek-generate-module-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(s)},"sek-notify":function(t){a=!1;var i=t.notif_id||"sek-notify";return o.lastNimbleNotificationId&&l.notifications.remove(o.lastNimbleNotificationId),n.Deferred(function(){l.panel(sektionsLocalizedData.sektionsPanelId,function(e){l.notifications.add(new l.Notification(i,{type:t.type||"info",message:t.message,dismissible:!0})),o.lastNimbleNotificationId=i,_.delay(function(){l.notifications.remove(i)},t.duration||5e3)}),this.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-refresh-level":function(t){return a=!0,n.Deferred(function(e){r={action:"sek-refresh-level",level:t.level,id:t.id,original_action:t.original_action,moved_level_id:t.moved_level_id},s={},e.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-refresh-stylesheet":function(t){return a=!0,t=t||{},n.Deferred(function(e){r={id:t.id},s={},e.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-toggle-save-section-ui":function(t){return a=!1,o.idOfSectionToSave=t.id,o.saveSectionDialogVisible(!0),n.Deferred(function(e){r={},s={},e.resolve({is_global_location:o.isGlobalLocation(t)})})},"sek-reset-collection":{callback:function(e){return a=!1,s={},(r=e).action="sek-reset-collection",r.scope=e.scope,o.updateAPISetting(r)},complete:function(e){l.previewer.refresh(),l.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}}};_.each(e,function(i,n){l.previewer.bind(n,function(t){var e;if(_.isFunction(i))e=i;else{if(!_.isFunction(i.callback))return void l.errare("::reactToPreviewMsg => invalid callback for action "+n);e=i.callback}"sek-notify"!==n&&(o.templateGalleryExpanded(!1),o.tmplDialogVisible(!1));try{e(t).done(function(e){e=e||{},a?l.previewer.send(n,{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:l.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:l.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:r,uiParams:s,cloneId:!_.isEmpty(e.cloneId)&&e.cloneId,all_params:t}):l.previewer.trigger([n,"done"].join("_"),{apiParams:r,uiParams:s}),o.trigger([n,"done"].join("_"),t)}).fail(function(e){l.errare("reactToPreviewMsg => problem or error when running action "+n,e),!_.isEmpty(e)&&sektionsLocalizedData.isDevMode&&l.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks Nimble Builder, you can try resetting the sections of this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")})})}catch(e){l.errare("reactToPreviewMsg => error when receiving "+n,e)}})}),_.each(e,function(t,i){l.previewer.bind([i,"done"].join("_"),function(e){if(_.isFunction(t.complete))try{t.complete(e)}catch(e){l.errare("reactToPreviewMsg done => error when receiving "+[i,"done"].join("_"),e)}})})},schedulePrintSectionJson:function(){var i=this;l.previewer.bind("sek-to-json",function(e){var t=n.extend(!0,{},i.getLevelModel(e.id));console.log(JSON.stringify(i.cleanIds(t)))})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(k,y){y.extend(CZRSeksPrototype,{generateUI:function(e){var t=this,i=y.Deferred();switch(_.isEmpty(e.action)&&i.reject("generateUI => missing action"),e.action){case"sek-generate-module-ui":try{i=t.generateUIforFrontModules(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-level-options-ui":try{i=t.generateUIforLevelOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-draggable-candidates-picker-ui":t.cleanRegistered();try{i=t.generateUIforDraggableContent(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}k.czr_sektions.currentContentPickerType(e.content_type||"module");break;case"sek-generate-local-skope-options-ui":t.cleanRegistered();try{i=t.generateUIforLocalSkopeOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-site-tmpl-options-ui":t.cleanRegistered();try{i=t.generateUIforSiteTmplOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-global-options-ui":t.cleanRegistered();try{i=t.generateUIforGlobalOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}}return"pending"==i.state()?i.resolve().promise():i.promise()},updateAPISettingAndExecutePreviewActions:function(a){if(!_.isEmpty(a.settingParams)&&_.has(a.settingParams,"to")){var l,c=this,e=a.settingParams.to,t=null,d=!1;if(!_.isEmpty(a.settingParams.args)&&_.has(a.settingParams.args,"moduleRegistrationParams")){var p=a.settingParams.args.moduleRegistrationParams.control,i=a.settingParams.args.moduleRegistrationParams.id,n=p.czr_Module(i);if(_.isEmpty(n)?k.errare("updateAPISettingAndExecutePreviewActions => missing parentModuleInstance",a):(t=n.module_type,d=n.isMultiItem()),!d&&_.isObject(e)?l=c.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!1}):(l=[],_.each(e,function(e){l.push(c.normalizeAndSanitizeSingleItemInputValues({item_value:e,parent_module_type:t,is_multi_items:!0}))})),_.isEmpty(a.defaultPreviewAction))k.errare("updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.",a);else{var u,m="refresh_stylesheet"===a.defaultPreviewAction,f="refresh_markup"===a.defaultPreviewAction,g="refresh_fonts"===a.defaultPreviewAction,h="refresh_preview"===a.defaultPreviewAction,o=a.settingParams.args.input_changed,v=function(){return u&&_.isString(u.refresh_markup)&&"true"!==u.refresh_markup&&"false"!==u.refresh_markup};_.isUndefined(o)||(u=c.getInputRegistrationParams(o,t),_.isUndefined(u.refresh_stylesheet)||(m=Boolean(u.refresh_stylesheet)),_.isUndefined(u.refresh_markup)||(f=v()?u.refresh_markup:Boolean(u.refresh_markup)),_.isUndefined(u.refresh_fonts)||(g=Boolean(u.refresh_fonts)),_.isUndefined(u.refresh_preview)||(h=Boolean(u.refresh_preview)));var r=function(){if(!0===a.isGlobalOptions){if(_.isEmpty(a.options_type))return void k.errare("updateAPISettingAndExecutePreviewActions => error when updating the global options => missing options_type");var e=k(sektionsLocalizedData.optNameForGlobalOptions)(),t=y.extend(!0,{},_.isObject(e)?e:{}),i={};if(_.each(l||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(i[t]=e)}),t[a.options_type]=i,k(sektionsLocalizedData.optNameForGlobalOptions)(t),!1!==h&&k.previewer.refresh(),!0===g){var n=a.settingParams.args.input_value;if(!_.isString(n))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",n);c.updateGlobalGFonts(n)}!0===m&&k.previewer.send("sek-refresh-stylesheet",{local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),location_skope_id:sektionsLocalizedData.globalSkopeId})}else{if(!0!==a.isSiteTemplateOptions)return c.updateAPISetting({action:a.uiParams.action,id:a.uiParams.id,value:l,in_column:a.uiParams.in_column,in_sektion:a.uiParams.in_sektion,options_type:a.options_type,settingParams:a.settingParams}).done(function(e){var t;!0===m&&k.previewer.send("sek-refresh-stylesheet",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-stylesheet",id:a.uiParams.id,level:a.uiParams.level}}),d&&a.settingParams.args.inputRegistrationParams&&_.isFunction(a.settingParams.args.inputRegistrationParams.input_parent)&&(t=a.settingParams.args.inputRegistrationParams.input_parent.id);var i=function(){k.previewer.send("sek-refresh-level",{location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-level",id:a.uiParams.id,level:a.uiParams.level,changed_item_id:t,control_id:p.id,is_multi_items:d},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})};if(!0===f&&i(),v()){var n=a.settingParams.args.input_value;if(!_.isString(n))throw new Error("::updateAPISettingAndExecutePreviewActions => _doUpdateWithRequestedAction => refreshMarkupWhenNeededForInput => html content is not a string.");c.htmlIncludesElementsThatNeedAnAjaxRefresh(n)?i():k.previewer.send("sek-update-html-in-selector",{selector:u.refresh_markup,changed_item_id:t,is_multi_items:d,html:n,id:a.uiParams.id,location_skope_id:!0===e.is_global_location?sektionsLocalizedData.globalSkopeId:k.czr_skopeBase.getSkopeProperty("skope_id"),local_skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-update-html-in-selector",id:a.uiParams.id,level:a.uiParams.level},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")})}!0===h&&k.previewer.refresh()}).fail(function(e){k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated",e),k.errare("::updateAPISettingAndExecutePreviewActions=> api setting not updated => params ",a)});if(_.isEmpty(a.options_type))return void k.errare("updateAPISettingAndExecutePreviewActions => error when updating the site template options => missing options_type");var o=k(sektionsLocalizedData.optNameForSiteTmplOptions)(),r=y.extend(!0,{},_.isObject(o)?o:{}),s={};_.each(l||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(s[t]=e)}),r[a.options_type]=s,k(sektionsLocalizedData.optNameForSiteTmplOptions)(r),!1!==h&&k.previewer.refresh()}};if(!0===g){var s=a.settingParams.args.input_value;if(!_.isString(s))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",s);!0===a.isGlobalOptions?r():c.updateAPISetting({action:"sek-update-fonts",font_family:s,is_global_location:c.isGlobalLocation(a.uiParams)}).always(function(){r().then(function(){c.updateAPISetting({action:"sek-update-fonts",is_global_location:c.isGlobalLocation(a.uiParams)})})})}else r()}}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated",a)}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated",a)},updateGlobalGFonts:function(e){var t=k(sektionsLocalizedData.optNameForGlobalOptions)(),i=y.extend(!0,{},_.isObject(t)?t:{}),n=this.sniffGlobalGFonts(i);!_.isEmpty(e)&&_.isString(e)&&-1<e.indexOf("gfont")&&!_.contains(n,e)&&n.push(e),i.fonts=n,k(sektionsLocalizedData.optNameForGlobalOptions)(i)},sniffGlobalGFonts:function(e){var i=[],n=function(e){_.each(e,function(e,t){"fonts"!==t&&(_.isString(t)&&-1<t.indexOf("font_family")&&-1<e.indexOf("gfont")&&!_.contains(i,e)&&i.push(e),(_.isArray(e)||_.isObject(e))&&n(e))})};return(_.isArray(e)||_.isObject(e))&&n(e),i},normalizeAndSanitizeSingleItemInputValues:function(o){var i,r={},n={},s=null,a=this;return _.each(o.item_value,function(e,t){var i,n;"title"!==t&&((o.is_multi_items||"id"!==t)&&(null!==o.parent_module_type&&"id"!==t&&"no_default_value_specified"===(s=a.getInputDefaultValue(t,o.parent_module_type))&&k.infoLog("::normalizeAndSanitizeSingleItemInputValues => missing default value for input "+t+" in module "+o.parent_module_type),i=e,n=s,(_.isBoolean(i)||_.isBoolean(n)?Boolean(i)===Boolean(n):_.isNumber(i)||_.isNumber(n)?Number(i)===Number(n):_.isString(i)||_.isString(n)?i+""==n+"":_.isObject(i)&&_.isObject(n)?_.isEqual(i,n):_.isArray(i)&&_.isArray(n)?JSON.stringify(i.sort())===JSON.stringify(n.sort()):i===n)||(_.isString(e)||_.isObject(e))&&_.isEmpty(e)||(r[t]=e)))}),_.each(r,function(e,t){switch(a.getInputType(t,o.parent_module_type)){case"text":case"textarea":case"check":case"gutencheck":case"select":case"radio":case"number":case"upload":case"upload_url":case"color":case"wp_color_alpha":case"wp_color":case"content_picker":case"detached_tinymce_editor":case"nimble_tinymce_editor":case"password":case"range":case"range_slider":case"hidden":case"h_alignment":case"h_text_alignment":case"spacing":case"bg_position":case"v_alignment":case"font_size":case"line_height":case"font_picker":default:i=e}n[t]=i}),n},isUIControlAlreadyRegistered:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"===e.what}),i=!1;return _.isEmpty(e)?i=k.control.has(t):(i=!0,1<e.length&&k.errare("isUIControlAlreadyRegistered => why is this control registered more than once ? => "+t)),i},htmlIncludesElementsThatNeedAnAjaxRefresh:function(e){var t=e.match(/\[+([\w_-])+/g),i=e.match(/\{\{+([\w_-])+/g),n=e.match(/<script[\s\S]*?>[\s\S]*?<\/script>/gi),o=[],r=[];if(t)for(var s=0;s<t.length;s++){var a=t[s].replace(/^\[+/g,"");-1===o.indexOf(a)&&o.push(a)}if(i)for(var l=0;l<i.length;l++){var c=i[l].replace(/^\[+/g,"");-1===r.indexOf(c)&&r.push(c)}return!_.isEmpty(o)||!_.isEmpty(r)||!_.isEmpty(n)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,a){a.extend(CZRSeksPrototype,{generateUIforDraggableContent:function(r,e){var n=this,i={};a.extend(i,{sek_content_type_switcher_module:{settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+"_sek_content_type_switcher_ui",module_type:"sek_content_type_switcher_module",controlLabel:n.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),priority:10,settingValue:{content_type:r.content_type}},sek_module_picker_module:{settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+"_sek_draggable_modules_ui",module_type:"sek_module_picker_module",controlLabel:n.getRegisteredModuleProperty("sek_module_picker_module","name"),content_type:"module",priority:20,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_my_sections_sec_picker_module:{settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+n.guid()+"_sek_draggable_sections_ui",module_type:"sek_my_sections_sec_picker_module",controlLabel:n.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),content_type:"section",expandAndFocusOnInit:!1,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>',is_new:!0}}),_.each(["sek_intro_sec_picker_module","sek_features_sec_picker_module","sek_about_sec_picker_module","sek_contact_sec_picker_module","sek_team_sec_picker_module","sek_column_layouts_sec_picker_module","sek_header_sec_picker_module","sek_footer_sec_picker_module"],function(e,t){i[e]={settingControlId:sektionsLocalizedData.prefixForSettingsNotSaved+n.guid()+"_sek_draggable_sections_ui",module_type:e,controlLabel:n.getRegisteredModuleProperty(e,"name"),content_type:"section",expandAndFocusOnInit:0===t,priority:30,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'}});var t=_.keys(i)[0],o=i[t].settingControlId;return n.isUIControlAlreadyRegistered(o)?s.control(o,function(t){t.focus({completeCallback:function(){var e=t.container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}})}):(_do_register_=function(){_.each(i,function(o,e){s.has(o.settingControlId)||(s(o.settingControlId,function(e){e.bind(function(e,t){s.errare("generateUIforDraggableContent => the setting() should not changed")})}),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:o.settingControlId,dirty:!1,value:o.settingValue||{},transport:"postMessage",type:"_nimble_ui_"})),s.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",id:o.settingControlId,label:o.controlLabel,type:"czr_module",module_type:o.module_type,section:n.SECTION_ID_FOR_CONTENT_PICKER,priority:o.priority||10,settings:{default:o.settingControlId},track:!1}).done(function(){s.control(o.settingControlId,function(e){e.content_type=o.content_type,!0===r.focus&&e.focus({completeCallback:function(){}});var t=e.container.find("label > .customize-control-title"),i=t.html();if(t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),o.is_new){var n=t.html();t.html(n+' <span class="sek-new-label">New!</span>')}_.isUndefined(o.icon)||t.addClass("sek-flex-vertical-center").prepend(o.icon),"section"===e.content_type?(e.container.attr("data-sek-expanded","false"),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===o.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&e.container.addClass("sek-expand-on-init")):e.container.attr("data-sek-accordion","no")})})}),s.trigger("nimble-modules-and-sections-controls-registered")},s.section(n.SECTION_ID_FOR_CONTENT_PICKER,function(e){_do_register_();var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.prepend('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),0<i.length&&i.find(".sek-level-option-icon").length<1&&i.find(".customize-action").after('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e,{expand_first_control:!1}),e.container.find(".customize-control.sek-expand-on-init").find("label > .customize-control-title").trigger("click")})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,p){p.extend(CZRSeksPrototype,{generateUIforFrontModules:function(r,e){var s=this;_.isEmpty(r.id)&&e.reject("generateUI => missing id");var i=s.getLevelProperty({property:"value",id:r.id}),t=s.getLevelProperty({property:"module_type",id:r.id}),n=s.getRegisteredModuleProperty(t,"name");_.isEmpty(t)&&e.reject("generateUI => module => invalid module_type");var o={};if(!0===s.getRegisteredModuleProperty(t,"is_father")){var a=s.getRegisteredModuleProperty(t,"children");if(_.isEmpty(a))throw new Error("::generateUIforFrontModules => a father module "+t+" is missing children modules ");_.each(a,function(e,t){o[t]={settingControlId:r.id+"__"+t,module_type:e,controlLabel:s.getRegisteredModuleProperty(e,"name")}})}else o.__no_option_group_to_be_updated_by_children_modules__={settingControlId:r.id,module_type:t,controlLabel:n};var l=_.keys(o)[0],c=o[l].settingControlId;return s.isUIControlAlreadyRegistered(c)?d.control(c).focus({completeCallback:function(){var e=d.control(c).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(s.cleanRegistered(),_do_register_=function(){_.each(o,function(n,o){if(!d.has(n.settingControlId)){var t=function(e,t,i){try{s.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_markup",uiParams:_.extend(r,{action:"sek-set-module-value"}),options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){d.errare("::generateUIforFrontModules => Error in updateAPISettingAndExecutePreviewActions",e)}};d(n.settingControlId,function(e){e.bind(_.debounce(t,s.SETTING_UPDATE_BUFFER))});var e=p.extend(!0,{},i);"__no_option_group_to_be_updated_by_children_modules__"!==o&&(e=!_.isEmpty(e)&&_.isObject(e)&&_.isObject(e[o])?e[o]:{}),d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:n.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}d.CZR_Helpers.register({origin:"nimble",level:r.level,what:"control",module_id:r.id,id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:r.id,priority:20,settings:{default:n.settingControlId}}).done(function(){}),d.control(n.settingControlId,function(e){d.control(n.settingControlId).focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=p("<div/>").html(t.html()).text();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false")})})},d.section(r.id,function(e){d.section(r.id).focus(),s.generateModuleOptionSwitcherUI(r.id,r.action),_do_register_(),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".customize-action").after('<i class="fas fa-pencil-alt sek-level-option-icon"></i>'),s.scheduleModuleAccordion.call(e,{expand_first_control:!0})}),d.CZR_Helpers.register({origin:"nimble",what:"section",id:r.id,title:sektionsLocalizedData.i18n["Content for"]+" "+n,panel:sektionsLocalizedData.sektionsPanelId,priority:1e3}).done(function(){})),e},generateModuleOptionSwitcherUI:function(e,t){var i=e+"__option_switcher";d.has(i)||(d(i,function(e){e.bind(function(e,t){d.errare("generateUIforDraggableContent => the setting() should not changed")})}),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"setting",id:i,dirty:!1,value:"",transport:"postMessage",type:"_nimble_ui_"})),d.CZR_Helpers.register({origin:"nimble",level:"module",what:"control",module_id:e,id:i,label:"",type:"czr_module",module_type:"sek_mod_option_switcher_module",section:e,priority:10,settings:{default:i},has_accordion:!1,ui_action:t}).done(function(){d.control(i,function(e){e.deferred.embedded.done(function(){e.container.find(".customize-control-title").hide(),e.container.attr("data-sek-accordion","no")})})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{generateUIforLevelOptions:function(s,e){var a=this,l=a.getLevelProperty({property:"options",id:s.id});l=_.isObject(l)?l:{};var t={};c.trigger("nb_setup_level_ui_registration_params",{params:s,modulesRegistrationParams:t}),d.extend(t,{bg:{settingControlId:s.id+"__bg_options",module_type:"sek_level_bg_module",controlLabel:sektionsLocalizedData.i18n["Background settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">gradient</i>'}}),"section"===s.level&&d.extend(t,{level_text:{settingControlId:s.id+"__text_options",module_type:"sek_level_text_module",controlLabel:sektionsLocalizedData.i18n["Text settings for the"]+" "+sektionsLocalizedData.i18n[s.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">text_format</i>'}}),d.extend(t,{border:{settingControlId:s.id+"__border_options",module_type:"sek_level_border_module",controlLabel:sektionsLocalizedData.i18n["Borders settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">rounded_corner</i>'},spacing:{settingControlId:s.id+"__spacing_options",module_type:"sek_level_spacing_module",controlLabel:sektionsLocalizedData.i18n["Padding and margin settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">center_focus_weak</i>'},anchor:{settingControlId:s.id+"__anchor_options",module_type:"sek_level_anchor_module",controlLabel:sektionsLocalizedData.i18n["Custom anchor ( CSS ID ) and CSS classes for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-anchor sek-level-option-icon"></i>'},visibility:{settingControlId:s.id+"__visibility_options",module_type:"sek_level_visibility_module",controlLabel:sektionsLocalizedData.i18n["Device visibility settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="far fa-eye sek-level-option-icon"></i>'},height:{settingControlId:s.id+"__height_options",module_type:"sek_level_height_module",controlLabel:sektionsLocalizedData.i18n["Height, vertical alignment, z-index for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-vertical sek-level-option-icon"></i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{animation:{settingControlId:s.id+"__animate_options",module_type:"sek_level_animation_module",controlLabel:sektionsLocalizedData.i18n["Animation settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="material-icons sek-level-option-icon">movie_filter</i>',isPro:!0}}),"section"===s.level&&(d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_section",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),d.extend(t,{breakpoint:{settingControlId:s.id+"__breakpoint_options",module_type:"sek_level_breakpoint_module",controlLabel:sektionsLocalizedData.i18n["Responsive settings : breakpoint, column direction"],icon:'<i class="material-icons sek-level-option-icon">devices</i>'}}),(sektionsLocalizedData.isUpsellEnabled||sektionsLocalizedData.isPro)&&d.extend(t,{sec_custom_css:{settingControlId:s.id+"__sec_custom_css",module_type:"sek_level_cust_css_section",controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>',isPro:!0}})),"column"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_column",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),"module"===s.level&&d.extend(t,{width:{settingControlId:s.id+"__width_options",module_type:"sek_level_width_module",controlLabel:sektionsLocalizedData.i18n["Width and horizontal alignment for the"]+" "+sektionsLocalizedData.i18n[s.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}});var i=_.keys(t)[0],n=t[i].settingControlId;return a.isUIControlAlreadyRegistered(n)?c.control(n).focus({completeCallback:function(){var e=c.control(n).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(a.cleanRegistered(),_do_register_=function(){_.each(t,function(n,o){if(a.isUIControlAlreadyRegistered(n.settingControlId))c.section(c.control(n.settingControlId).section()).expanded(!0);else{if(!c.has(n.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforLevelOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};c(n.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=l[o]||{},i=a.getModuleStartingValue(n.module_type);if("no_starting_value"!==i&&_.isObject(i)){var r=d.extend(!0,{},i);e=d.extend(r,e)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,level_id:s.id,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:s.id,priority:20,settings:{default:n.settingControlId}}).done(function(){}),c.control(n.settingControlId,function(e){!0===n.expandAndFocusOnInit&&e.focus({completeCallback:function(){}}),e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),n.isPro&&!sektionsLocalizedData.isPro&&t.append(['<img class="sek-pro-icon-next-title" src="',sektionsLocalizedData.baseUrl,"/assets/czr/sek/img/pro_orange.svg?ver="+sektionsLocalizedData.nimbleVersion,'"/>'].join("")),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})}})},c.section(s.id,function(e){_do_register_(),"module"===s.level&&a.generateModuleOptionSwitcherUI(s.id,s.action),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.find(".customize-action").after('<i class="fas fa-sliders-h sek-level-option-icon"></i>'),a.scheduleModuleAccordion.call(e,{expand_first_control:!1})}),c.CZR_Helpers.register({origin:"nimble",what:"section",id:s.id,title:sektionsLocalizedData.i18n["Settings for the"]+" "+s.level,panel:sektionsLocalizedData.sektionsPanelId,priority:10}).done(function(){})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{getLocalSkopeOptionId:function(){var e=c.czr_skopeBase.getSkopeProperty("skope_id");return _.isEmpty(e)?(c.errare("czr_sektions::getLocalSkopeOptionId => empty skope_id "),""):sektionsLocalizedData.prefixForSettingsNotSaved+e+"__localSkopeOptions"},generateUIforLocalSkopeOptions:function(s,e){var a=this,i=a.getLocalSkopeOptionId();if(a.isUIControlAlreadyRegistered(i))return e;if(a.localOptionsRegistrationParams={},_.isUndefined(sektionsLocalizedData.localOptionsMap)||!_.isObject(sektionsLocalizedData.localOptionsMap))return c.errare("::generateUIforGlobalOptions => missing or invalid localOptionsMap"),e;!0===s.clean_settings&&a.cleanRegisteredLocalOptionSettings(),_.each(sektionsLocalizedData.localOptionsMap,function(e,t){switch(t){case"template":a.localOptionsRegistrationParams[t]={settingControlId:i+"__template",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page template"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">check_box_outline_blank</i>'};break;case"local_header_footer":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"widths":a.localOptionsRegistrationParams[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Inner and outer widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"custom_css":a.localOptionsRegistrationParams[t]={settingControlId:i+"__custom_css",module_type:e,controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>'};break;case"local_performances":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"local_reset":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections in this page"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"local_revisions":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of local sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"import_export":a.localOptionsRegistrationParams[t]={settingControlId:i+"__local_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;default:c.errare("::generateUIforLocalOptions => an option group could not be registered => "+e,t)}});var t=c(a.localSectionsSettingId())(),l=d.extend(!0,{},_.isObject(t.local_options)?t.local_options:{});return _do_register_=function(){_.each(a.localOptionsRegistrationParams,function(n,o){var e=a.getModuleStartingValue(n.module_type),t=_.isObject(l[o])?l[o]:{};if(!c.has(n.settingControlId)){var i=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_preview",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforLocalSkopeOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};if(c(n.settingControlId,function(e){e.bind(_.debounce(i,a.SETTING_UPDATE_BUFFER))}),"no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);t=d.extend(r,t)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:t,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:a.SECTION_ID_FOR_LOCAL_OPTIONS,priority:10,settings:{default:n.settingControlId}}).done(function(){c.control(n.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{generateUIforGlobalOptions:function(s,e){var a=this,i=sektionsLocalizedData.prefixForSettingsNotSaved+sektionsLocalizedData.optNameForGlobalOptions;if(a.isUIControlAlreadyRegistered(i))return e;var n={};if(_.isUndefined(sektionsLocalizedData.globalOptionsMap)||!_.isObject(sektionsLocalizedData.globalOptionsMap))return c.errare("::generateUIforGlobalOptions => missing or invalid globalOptionsMap"),e;_.each(sektionsLocalizedData.globalOptionsMap,function(e,t){switch(t){case"global_text":n[t]={settingControlId:i+"__global_text",module_type:e,controlLabel:sektionsLocalizedData.i18n["Global text options for Nimble sections"],icon:'<i class="material-icons sek-level-option-icon">text_format</i>'};break;case"widths":n[t]={settingControlId:i+"__widths",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide inner and outer sections widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'};break;case"breakpoint":n[t]={settingControlId:i+"__breakpoint",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide breakpoint for Nimble sections"],expandAndFocusOnInit:!1,icon:'<i class="material-icons sek-level-option-icon">devices</i>'};break;case"global_header_footer":n[t]={settingControlId:i+"__header_footer",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide header and footer"],icon:'<i class="material-icons sek-level-option-icon">web</i>'};break;case"performances":n[t]={settingControlId:i+"__performances",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site wide page speed optimizations"],icon:'<i class="material-icons sek-level-option-icon">network_check</i>'};break;case"recaptcha":n[t]={settingControlId:i+"__recaptcha",module_type:e,controlLabel:sektionsLocalizedData.i18n["Protect your contact forms with Google reCAPTCHA"],icon:'<i class="material-icons sek-level-option-icon">security</i>'};break;case"global_revisions":n[t]={settingControlId:i+"__global_revisions",module_type:e,controlLabel:sektionsLocalizedData.i18n["Revision history of global sections"],icon:'<i class="material-icons sek-level-option-icon">history</i>'};break;case"global_imp_exp":n[t]={settingControlId:i+"__global_imp_exp",module_type:e,controlLabel:sektionsLocalizedData.i18n["Export / Import global sections"],icon:'<i class="material-icons sek-level-option-icon">import_export</i>'};break;case"global_reset":n[t]={settingControlId:i+"__global_reset",module_type:e,controlLabel:sektionsLocalizedData.i18n["Reset the sections displayed in global locations"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'};break;case"beta_features":n[t]={settingControlId:i+"__beta_features",module_type:e,controlLabel:sektionsLocalizedData.i18n["Beta features"],icon:'<i class="material-icons sek-level-option-icon">widgets</i>'};break;default:c.errare("::generateUIforGlobalOptions => an option group could not be registered => "+e,t)}});var l=sektionsLocalizedData.globalOptionDBValues;return _do_register_=function(){_.each(n,function(n,o){if(!c.has(n.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isGlobalOptions:!0,defaultPreviewAction:"refresh_preview",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforGlobalOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};c(n.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=a.getModuleStartingValue(n.module_type),i=_.isObject(l)&&!_.isEmpty(l[o])?l[o]:{};if("no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);i=d.extend(r,i)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:i,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:a.SECTION_ID_FOR_GLOBAL_OPTIONS,priority:20,settings:{default:n.settingControlId},track:!1}).done(function(){c.control(n.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{generateUIforSiteTmplOptions:function(s,e){var a=this,i=sektionsLocalizedData.prefixForSettingsNotSaved+sektionsLocalizedData.optNameForSiteTmplOptions;if(a.isUIControlAlreadyRegistered(i))return e;var n={};if(_.isUndefined(sektionsLocalizedData.siteTmplOptionsMap)||!_.isObject(sektionsLocalizedData.siteTmplOptionsMap))return c.errare("::generateUIforSiteTmplOptions => missing or invalid siteTmplOptionsMap"),e;_.each(sektionsLocalizedData.siteTmplOptionsMap,function(e,t){switch(t){case"site_templates":n[t]={settingControlId:i+"__site_templates",module_type:e,controlLabel:sektionsLocalizedData.i18n["Site templates"],icon:""};break;default:c.errare("::generateUIforSiteTmplOptions => an option group could not be registered => "+e,t)}});var l=sektionsLocalizedData.siteTmplOptionDBValues;return _do_register_=function(){_.each(n,function(n,o){if(!c.has(n.settingControlId)){var t=function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isSiteTemplateOptions:!0,defaultPreviewAction:"refresh_preview",uiParams:s,options_type:o,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("::generateUIforSiteTmplOptions => Error in updateAPISettingAndExecutePreviewActions",e)}};c(n.settingControlId,function(e){e.bind(_.debounce(t,a.SETTING_UPDATE_BUFFER))});var e=a.getModuleStartingValue(n.module_type),i=_.isObject(l)&&!_.isEmpty(l[o])?l[o]:{};if("no_starting_value"!==e&&_.isObject(e)){var r=d.extend(!0,{},e);i=d.extend(r,i)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:n.settingControlId,dirty:!1,value:i,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:n.settingControlId,label:n.controlLabel,type:"czr_module",module_type:n.module_type,section:a.SECTION_ID_FOR_SITE_TMPL,priority:20,settings:{default:n.settingControlId},track:!1}).done(function(){c.control(n.settingControlId,function(e){e.container.attr("data-sek-expanded","false");var t=e.container.find("label > .customize-control-title"),i=t.html();t.html(['<span class="sek-ctrl-accordion-title">',i,"</span>"].join("")),_.isUndefined(n.icon)||t.addClass("sek-flex-vertical-center").prepend(n.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===n.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},_do_register_(),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(f,g){g.extend(CZRSeksPrototype,{updateAPISetting:function(d){var p=this;(d=d||{}).is_global_location="global"===d.scope||p.isGlobalLocation(d);var u=d.is_global_location?p.getGlobalSectionsSettingId():p.localSectionsSettingId(),m=f(u)();p.updAPISetParams={params:d,promise:g.Deferred(),newSetValue:_.isObject(m)?g.extend(!0,{},m):p.getDefaultSektionSettingValue(d.is_global_location?"global":"local"),cloneId:"",sectionInjectPromise:"_not_injection_scenario_"};return f(u,function(e){!function(){switch(p.updAPISetParams.newSetValue.collection=_.isArray(p.updAPISetParams.newSetValue.collection)?p.updAPISetParams.newSetValue.collection:p.getDefaultSektionSettingValue(d.is_global_location?"global":"local").collection,d.action){case"sek-maybe-add-missing-locations":var t,i,e=p.activeLocations();g.extend(!0,[],p.updAPISetParams.newSetValue.collection),_.each(e,function(e){t=_.findWhere(p.updAPISetParams.newSetValue.collection,{id:e}),_.isUndefined(t)&&((i=g.extend(!0,{},sektionsLocalizedData.defaultLocationModel)).id=e,f.infoLog("=> need to add missing location to api setting value",i),p.updAPISetParams.newSetValue.collection.push(i))});break;case"sek-add-section":p._updAPISet_sek_add_sektion();break;case"sek-duplicate-section":p._updAPISet_sek_duplicate_sektion();break;case"sek-remove-section":p._updAPISet_sek_remove_sektion();break;case"sek-move-section":p._updAPISet_sek_move_sektion();break;case"sek-move-section-up-down":p._updAPISet_sek_move_sektion_up_down();break;case"sek-add-column":p._updAPISet_sek_add_column();break;case"sek-remove-column":p._updAPISet_sek_remove_column();break;case"sek-duplicate-column":p._updAPISet_sek_duplicate_column();break;case"sek-resize-columns":p._updAPISet_sek_resize_column();break;case"sek-move-column":p._updAPISet_sek_move_column();break;case"sek-add-module":p._updAPISet_sek_add_module();break;case"sek-duplicate-module":p._updAPISet_sek_duplicate_module();break;case"sek-remove-module":p._updAPISet_sek_remove_module();break;case"sek-move-module":p._updAPISet_sek_move_module();break;case"sek-set-module-value":p._updAPISet_sek_set_module_value();break;case"sek-add-content-in-new-sektion":p._updAPISet_sek_add_content_in_new_sektion();break;case"sek-add-preset-section-in-new-nested-sektion":p._updAPISet_sek_add_preset_sektion_in_new_nested_sektion();break;case"sek-import-from-file":p._updAPISet_sek_import_from_file();break;case"sek-inject-tmpl-from-gallery":p._updAPISet_sek_inject_tmpl_from_gallery();break;case"sek-generate-level-options-ui":var n=p.getLevelModel(d.id,p.updAPISetParams.newSetValue.collection),o={};if("no_match"===n){f.errare("updateAPISetting => "+d.action+" => no parent sektion matched"),p.updAPISetParams.promise.reject("updateAPISetting => "+d.action+" => no parent sektion matched");break}var r=g.extend(!0,{},n.options||{});_.each(d.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(d.options_type)&&f.errare("updateAPISetting => "+d.action+" => missing options_type"),r[d.options_type]=o,n.options=r;break;case"sek-generate-local-skope-options-ui":o={};var s=g.extend(!0,{},_.isObject(p.updAPISetParams.newSetValue.local_options)?p.updAPISetParams.newSetValue.local_options:{});if(_.each(d.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(o[t]=e)}),_.isEmpty(d.options_type)||!_.isString(d.options_type))f.errare("updateAPISetting => "+d.action+" => missing options_type");else{var a={};a[d.options_type]=o,p.updAPISetParams.newSetValue.local_options=g.extend(s,a)}break;case"sek-update-fonts":var l=p.sniffGFonts({is_global_location:d&&!0===d.is_global_location});!_.isEmpty(d.font_family)&&_.isString(d.font_family)&&-1<d.font_family.indexOf("gfont")&&!_.contains(l,d.font_family)&&l.push(d.font_family),p.updAPISetParams.newSetValue.fonts=l;break;case"sek-restore-revision":p.updAPISetParams.newSetValue=d.revision_value;break;case"sek-reset-collection":try{p.updAPISetParams.newSetValue=f.czr_sektions.resetCollectionSetting(d.scope)}catch(e){f.errare("sek-reset-collection => error when firing resetCollectionSetting()",e)}}if("pending"==p.updAPISetParams.promise.state()){var c=function(){var e=d.settingParams&&d.settingParams.from&&d.settingParams.to;e&&_.isEqual(d.settingParams.from,d.settingParams.to)?p.updAPISetParams.promise.reject("updateAPISetting => main sektion setting change => the new setting value is unchanged when firing action : "+d.action):!e&&_.isEqual(m,p.updAPISetParams.newSetValue)?p.updAPISetParams.promise.reject("updateAPISetting => the new setting value is unchanged when firing action : "+d.action):null!==p.validateSettingValue(p.updAPISetParams.newSetValue,d.is_global_location?"global":"local")?(f(u)(p.updAPISetParams.newSetValue,d),d.cloneId=p.updAPISetParams.cloneId,p.updAPISetParams.promise.resolve(d)):p.updAPISetParams.promise.reject("Validation problem for action "+d.action)};"_not_injection_scenario_"===p.updAPISetParams.sectionInjectPromise?(c(),"pending"===p.updAPISetParams.promise.state()&&f.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")):p.updAPISetParams.sectionInjectPromise.done(function(){c(),"pending"===p.updAPISetParams.promise.state()&&f.errare("::updateAPISetting => The self.updAPISetParams.promise has not been resolved properly.")}).fail(function(e){f.errare("updateAPISetting => self.updAPISetParams.sectionInjectPromise failed",e)})}}()}),p.updAPISetParams.promise.promise()},resetColumnsWidthInSection:function(e){_.each(e.collection,function(e){e.options&&e.options.width&&e.options.width["custom-width"]&&(e.options.width=_.omit(e.options.width,"custom-width")),e.width=""})},_maybeFetchSectionsFromServer:function(){var e,t=g.Deferred();return _.isEmpty(f.sek_presetSections)?(_.isUndefined(f.sek_fetchingPresetSections)||"pending"!=f.sek_fetchingPresetSections.state()?(e=wp.ajax.post("sek_get_preset_sections",{nonce:f.settings.nonce.save}),f.sek_fetchingPresetSections=e):e=f.sek_fetchingPresetSections,e.done(function(e){f.sek_presetSections=e,t.resolve(f.sek_presetSections)}).fail(function(e){t.reject(e)})):t.resolve(f.sek_presetSections),t.promise()},getPresetSectionCollection:function(n){var o=this,r=g.Deferred();return n.is_user_section?wp.ajax.post("sek_get_user_section_json",{nonce:f.settings.nonce.save,section_post_name:n.presetSectionId}).done(function(e){if(!_.isObject(e)||_.isEmpty(e)||_.isUndefined(e.data))throw f.errare("getPresetSectionCollection => preset section type not found or empty : "+n.presetSectionId,e),new Error("getPresetSectionCollection => preset section type not found or empty");var t=g.extend({},!0,e.data);t.id=sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),t.collection=o.setPresetOrUserSectionIds(t.collection),t.ver_ini=sektionsLocalizedData.nimbleVersion,t.collection=o.setPresetSectionVersion(t.collection),r.resolve(t)}).fail(function(e){r.reject(e)}):o._maybeFetchSectionsFromServer().fail(function(e){r.reject(e)}).done(function(e){var t=g.extend(!0,{},_.isObject(e)?e:{});if(_.isEmpty(t))throw new Error("getPresetSectionCollection => Invalid collection");if(_.isEmpty(t[n.presetSectionId]))throw new Error('getPresetSectionCollection => the preset section : "'+n.presetSectionId+'" has not been found in the collection');var i=t[n.presetSectionId];i.collection=o.setPresetOrUserSectionIds(i.collection),i.ver_ini=sektionsLocalizedData.nimbleVersion,i.collection=o.setPresetSectionVersion(i.collection),r.resolve(i)}),r.promise()},setPresetOrUserSectionIds:function(e){var t=this;return _.isArray(e)&&_.each(e,function(e){e.id=sektionsLocalizedData.prefixForSettingsNotSaved+t.guid(),_.isArray(e.collection)&&t.setPresetOrUserSectionIds(e.collection)}),e},setPresetSectionVersion:function(e){var t=this;return _.each(e,function(e){e.ver_ini=sektionsLocalizedData.nimbleVersion,_.isArray(e.collection)&&t.setPresetSectionVersion(e.collection)}),e},preparePresetSectionForInjection:function(o){var i=this,n={},r=g.Deferred();i.maybeGenerateNewItemIdsForCrudModules(o);var s=function(e){return _.each(e,function(e,t){_.isObject(e)||_.isArray(e)?s(e):_.isString(e)&&-1!=e.indexOf("__img_url__")&&(_.has(n,e)||(n[e]=i.importAttachment(e.replace("__img_url__",""))))}),n},a=function(i,n){return _.each(i,function(e,t){_.isObject(e)||_.isArray(e)?a(e,n):_.isString(e)&&-1!=e.indexOf("__img_url__")&&_.has(n,e)&&_.isObject(n[e])&&(i[t]=n[e].id)}),o};return i.whenAllPromisesInParallel(s(o)).done(function(e){var t=a(o,e);r.resolve(t)}).fail(function(e){r.reject(e)}),r.promise()}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(y,b){b.extend(CZRSeksPrototype,{_updAPISet_sek_add_sektion:function(){var i,e,t,n,o=this;if(i=o.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.location))throw new Error("updateAPISetting => "+i.action+" => missing location");if(!0===i.is_nested)e=o.getLevelModel(i.in_column,o.updAPISetParams.newSetValue.collection),"no_match"==(t=o.getLevelModel(i.in_sektion,o.updAPISetParams.newSetValue.collection))?o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no grand parent sektion found"):!0===t.is_nested?(o.updAPISetParams.promise.reject(""),y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")})):"no_match"==e?(y.errare("updateAPISetting => "+i.action+" => no parent column matched"),o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched")):(e.collection=_.isArray(e.collection)?e.collection:[],e.collection.push({id:i.id,level:"section",collection:[{id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion}));else if("no_match"==(n=o.getLevelModel(i.location,o.updAPISetParams.newSetValue.collection)))y.errare("updateAPISetting => "+i.action+" => no location matched"),o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no location matched");else{var r=0;n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){i.before_section===e.id&&(r=t),i.after_section===e.id&&(r=t+1)}),n.collection=_.isArray(n.collection)?n.collection:[],n.collection.splice(r,0,{id:i.id,level:"section",collection:[{id:sektionsLocalizedData.prefixForSettingsNotSaved+o.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion})}},_updAPISet_sek_duplicate_sektion:function(){var t,e,i,n,o=this;if(t=o.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if(_.isEmpty(t.location))throw new Error("updateAPISetting => "+t.action+" => missing location");try{n=o.cloneLevel(t.id)}catch(e){return void y.errare("updateAPISetting => "+t.action,e)}o.maybeGenerateNewItemIdsForCrudModules(n);var r=o.getLevelPositionInCollection(t.id,o.updAPISetParams.newSetValue.collection);if(!0===t.is_nested){if("no_match"==(e=o.getLevelModel(t.in_column,o.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no parent column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[],e.collection.splice(parseInt(r+1,10),0,n)}else{if("no_match"==(i=o.getLevelModel(t.location,o.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.isArray(i.collection)?i.collection:[],i.collection.splice(parseInt(r+1,10),0,n)}o.updAPISetParams.cloneId=n.id},_updAPISet_sek_remove_sektion:function(){var t,e,i,n=this;if(!0===(t=n.updAPISetParams.params).is_nested)"no_match"!=(e=n.getLevelModel(t.in_column,n.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):y.errare("updateAPISetting => "+t.action+" => no parent column matched");else{if("no_match"==(i=n.getLevelModel(t.location,n.updAPISetParams.newSetValue.collection)))return y.errare("updateAPISetting => "+t.action+" => no location matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no location matched");i.collection=_.filter(i.collection,function(e){return e.id!=t.id})}},_updAPISet_sek_move_sektion:function(){var t,i,n,o=this;t=o.updAPISetParams.params;var e,r,s=o.getLevelModel(t.to_location,o.updAPISetParams.newSetValue.collection);if(_.isEmpty(s)||"no_match"==s)throw new Error("updateAPISetting => "+t.action+" => missing target location");if(t.from_location!=t.to_location){var a=o.getLevelModel(t.from_location,o.updAPISetParams.newSetValue.collection);if(_.isEmpty(a)||"no_match"==a)throw new Error("updateAPISetting => "+t.action+" => missing source location");a.collection=_.isArray(a.collection)?a.collection:[],e=o.getLevelModel(t.id,a.collection),r=b.extend(!0,{},e),a.collection=_.filter(a.collection,function(e){return e.id!=t.id})}s.collection=_.isArray(s.collection)?s.collection:[],i=b.extend(!0,[],s.collection),n=[],_.each(t.newOrder,function(e){if(t.from_location!=t.to_location&&e==r.id)n.push(r);else{if(sektionCandidate=o.getLevelModel(e,i),_.isEmpty(sektionCandidate)||"no_match"==sektionCandidate)throw new Error("updateAPISetting => "+t.action+" => missing section candidate");n.push(sektionCandidate)}}),s.collection=n},_updAPISet_sek_move_sektion_up_down:function(){var t,e,i,n,o=this;if(t=o.updAPISetParams.params,e=o.getLevelModel(t.is_nested?t.in_column:t.location,o.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target location");e.collection=_.isArray(e.collection)?e.collection:[],i=b.extend(!0,[],e.collection),n=b.extend(!0,[],e.collection);var r=_.findIndex(i,function(e){return e.id===t.id});if(-1===r)throw new Error("updateAPISetting => "+t.action+" => invalid index");var s,a,l=t.direction||"up",c=i.length===r+1,d=0===r,p=o.activeLocationsInfo(),u=_.isArray(p)?_.findWhere(p,{id:t.location}):{};s=_.isObject(u)&&u.is_global,a=_.isObject(u)&&u.is_header_footer;var m=[];_.isArray(p)&&_.each(o.activeLocationsInfo(),function(e){e.is_global||e.is_header_footer||m.push(e.id)});var f,g=_.findIndex(m,function(e){return e===t.location}),h=!t.is_nested&&!s&&!a,v=0===g,k=m.length===g+1;h&&c&&"up"!==l&&!k?(f=m[g+1],o.getLevelModel(f,o.updAPISetParams.newSetValue.collection).collection.unshift(i[r]),e.collection.pop(),t.new_location=f):h&&d&&"up"===l&&!v?(f=m[g-1],o.getLevelModel(f,o.updAPISetParams.newSetValue.collection).collection.push(i[r]),e.collection.shift(),t.new_location=f):"up"!==l&&i.length===r+1?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved lower."]+"</strong>","</span>"].join("")}):"up"===l&&0===r?y.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["The section cannot be moved higher."]+"</strong>","</span>"].join("")}):(n[r]=i["up"===l?r-1:r+1],n["up"===l?r-1:r+1]=i[r],e.collection=n)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,t){t.extend(CZRSeksPrototype,{_updAPISet_sek_add_content_in_new_sektion:function(){var r,s,a,l=this;r=l.updAPISetParams.params;var e,i=0;if("no_match"==(a=l.getLevelModel(r.location,l.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+r.action+" => no location matched"),void l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no location matched");switch(a.collection=_.isArray(a.collection)?a.collection:[],_.each(a.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),r.content_type){case"module":e=l.getModuleStartingValue(r.content_id),a.collection.splice(i,0,{id:r.id,level:"section",collection:[{id:sektionsLocalizedData.prefixForSettingsNotSaved+l.guid(),level:"column",collection:[{id:r.droppedModuleId,level:"module",module_type:r.content_id,value:"no_starting_value"!==e?e:null,ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion});break;case"preset_section":l.updAPISetParams.sectionInjectPromise=t.Deferred();var n=function(e,i){var t=!1;if(!_.isEmpty(r.sektion_to_replace)){var n=l.getLevelModel(r.sektion_to_replace,l.updAPISetParams.newSetValue.collection);"no_match"===n&&(c.errare("updateAPISetting => "+r.action+" => no sektionToReplace matched"),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no sektionToReplace matched")),t=!0===n.is_nested}var o=sektionsLocalizedData.prefixForSettingsNotSaved+l.guid();r.collection_of_preset_section_id=r.collection_of_preset_section_id||[],r.collection_of_preset_section_id.push(o),t?("no_match"===(s=l.getLevelModel(r.in_column,l.updAPISetParams.newSetValue.collection))&&(c.errare("updateAPISetting => "+r.action+" => no parent column matched"),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => no parent column matched")),s.collection=_.isArray(s.collection)?s.collection:[],_.each(s.collection,function(e,t){r.before_section===e.id&&(i=t),r.after_section===e.id&&(i=t+1)}),s.collection.splice(i,0,{id:o,is_nested:!0,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})):a.collection.splice(i,0,{id:o,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})};l.getPresetSectionCollection({is_user_section:r.is_user_section,presetSectionId:r.content_id}).fail(function(e){c.errare("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()",e),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(c.errare("updateAPISetting => "+r.action+" => preset section type not found or empty : "+r.content_id,e),l.updAPISetParams.promise.reject("updateAPISetting => "+r.action+" => preset section type not found or empty")),t=e,l.preparePresetSectionForInjection(t).fail(function(e){l.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+r.action+" => "+e),l.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){"section"===e.collection[0].level?_.each(e.collection,function(e){n(e,i),i++}):n(e,i),l.updAPISetParams.sectionInjectPromise.resolve()})})}},_updAPISet_sek_add_preset_sektion_in_new_nested_sektion:function(){var n,o,e,r=this;if(n=r.updAPISetParams.params,"no_match"===(o=r.getLevelModel(n.in_column,r.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+n.action+" => no parent column matched"),void r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => no parent column matched");var i=0;if(o.collection=_.isArray(o.collection)?o.collection:[],_.each(o.collection,function(e,t){n.before_module_or_nested_section===e.id&&(i=t),n.after_module_or_nested_section===e.id&&(i=t+1)}),"no_match"!=(e=r.getLevelModel(n.in_sektion,r.updAPISetParams.newSetValue.collection))){if(!0===e.is_nested)return r.updAPISetParams.promise.reject(""),void c.previewer.trigger("sek-notify",{type:"info",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]+"</strong>","</span>"].join("")});r.updAPISetParams.sectionInjectPromise=t.Deferred();r.getPresetSectionCollection({is_user_section:n.is_user_section,presetSectionId:n.content_id}).fail(function(){c.errare("updateAPISetting => "+n.action+" => Error with self.getPresetSectionCollection()",_er_),r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){var t;_.isObject(e)&&!_.isEmpty(e)||(c.errare("updateAPISetting => "+n.action+" => preset section type not found or empty : "+n.content_id,e),r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => preset section type not found or empty")),t=e,r.preparePresetSectionForInjection(t).fail(function(e){r.updAPISetParams.promise.reject("updateAPISetting => error when preparePresetSectionForInjection => "+n.action+" => "+e),r.updAPISetParams.sectionInjectPromise.reject(e)}).done(function(e){var t=function(e,t){t=t||0;var i=sektionsLocalizedData.prefixForSettingsNotSaved+r.guid();n.collection_of_preset_section_id=n.collection_of_preset_section_id||[],n.collection_of_preset_section_id.push(i),o.collection.splice(t,0,{id:i,level:"section",collection:e.collection,options:e.options||{},is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion})};"section"===e.collection[0].level?_.each(e.collection,function(e){t(e,i),i++}):t(e,i),r.updAPISetParams.sectionInjectPromise.resolve()})})}else r.updAPISetParams.promise.reject("updateAPISetting => "+n.action+" => no grand parent sektion found")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{_updAPISet_sek_add_column:function(){var e,t,i=this;if(e=i.updAPISetParams.params,_.isEmpty(e.id))throw new Error("updateAPISetting => "+e.action+" => missing id");if("no_match"==(t=i.getLevelModel(e.in_sektion,i.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+e.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => no parent sektion matched");t.collection=_.isArray(t.collection)?t.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(t.collection)?i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]):(i.resetColumnsWidthInSection(t),t.collection.push({id:e.id,level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}))},_updAPISet_sek_remove_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,"no_match"!=(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection))){if(1===_.size(e.collection))return void i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["A section must have at least one column."]);e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(e)}else c.errare("updateAPISetting => "+t.action+" => no parent sektion matched")},_updAPISet_sek_duplicate_column:function(){var t,e,i=this;if(t=i.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=i.getLevelModel(t.in_sektion,i.updAPISetParams.newSetValue.collection)))return c.errare("updateAPISetting => "+t.action+" => no parent sektion matched"),void i.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent sektion matched");if(e.collection=_.isArray(e.collection)?e.collection:[],i.MAX_NUMBER_OF_COLUMNS-1<_.size(e.collection))i.updAPISetParams.promise.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);else{var n;try{n=i.cloneLevel(t.id)}catch(e){return void c.errare("updateAPISetting => "+t.action,e)}i.maybeGenerateNewItemIdsForCrudModules(n);var o=i.getLevelPositionInCollection(t.id,i.updAPISetParams.newSetValue.collection);i.updAPISetParams.cloneId=n.id,e.collection.splice(parseInt(o+1,10),0,n),i.resetColumnsWidthInSection(e)}},_updAPISet_sek_resize_column:function(){var o,n=this;if(!((o=n.updAPISetParams.params).col_number<2)){var t=n.getLevelModel(o.resized_column,n.updAPISetParams.newSetValue.collection),i=n.getLevelModel(o.sister_column,n.updAPISetParams.newSetValue.collection);if("no_match"==t)return c.errare("updateAPISetting => "+o.action+" => no resized column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+o.action+" => no resized column matched");var r=function(e,t){var i=d.extend(!0,{},e.options||{});return i.width=_.isObject(i.width)&&i.width["custom-width"]?i.width:{},i.width["custom-width"]=t,e.options=i,n.cachedElements.$body.find('[data-sek-width-range-column-id="'+e.id+'"]').val(t).trigger("input",{is_resize_column_trigger:!0}),t},e=r(t,parseFloat(o.resizedColumnWidthInPercent));e=parseFloat(e);var s=n.getLevelModel(o.in_sektion,n.updAPISetParams.newSetValue.collection),a=_.filter(s.collection,function(e){return e.id!=t.id&&e.id!=i.id}),l=parseFloat(e.toFixed(3));_.isEmpty(a)||_.each(a,function(e){var t,i,n;currentColWidth=(t=e,i="_not_set_",n=_.isObject(t.options)?t.options:{},!_.isEmpty(n)&&n.width&&n.width["custom-width"]&&(i=parseFloat(1*n.width["custom-width"])),i),("_not_set_"===currentColWidth||!_.isNumber(1*currentColWidth)||_.isEmpty(currentColWidth+"")||currentColWidth<1)&&(currentColWidth=r(e,parseFloat((100/o.col_number).toFixed(3)))),l=parseFloat((l+currentColWidth).toFixed(3))}),r(i,parseFloat((100-l).toFixed(3)))}},_updAPISet_sek_move_column:function(){var t,i=this;t=i.updAPISetParams.params;var e,n,o=i.getLevelModel(t.to_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(o)||"no_match"==o)throw new Error("updateAPISetting => "+t.action+" => missing target sektion");if(t.from_sektion!=t.to_sektion){var r=i.getLevelModel(t.from_sektion,i.updAPISetParams.newSetValue.collection);if(_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],e=i.getLevelModel(t.id,r.collection),n=d.extend(!0,{},e),r.collection=_.filter(r.collection,function(e){return e.id!=t.id}),i.resetColumnsWidthInSection(r)}o.collection=_.isArray(o.collection)?o.collection:[],originalCollection=d.extend(!0,[],o.collection),reorderedCollection=[],_.each(t.newOrder,function(e){if(t.from_sektion!=t.to_sektion&&e==n.id)reorderedCollection.push(n);else{if(columnCandidate=i.getLevelModel(e,originalCollection),_.isEmpty(columnCandidate)||"no_match"==columnCandidate)throw new Error("updateAPISetting => moveColumn => missing columnCandidate");reorderedCollection.push(columnCandidate)}}),o.collection=reorderedCollection,i.resetColumnsWidthInSection(o)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,c){c.extend(CZRSeksPrototype,{_updAPISet_sek_add_module:function(){var i,e,t,n,o=this;if(i=o.updAPISetParams.params,_.isEmpty(i.id))throw new Error("updateAPISetting => "+i.action+" => missing id");if(_.isEmpty(i.module_type))throw new Error("updateAPISetting => "+i.action+" => missing module_type");if("no_match"===(e=o.getLevelModel(i.in_column,o.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+i.action+" => no parent column matched"),void o.updAPISetParams.promise.reject("updateAPISetting => "+i.action+" => no parent column matched");n=0,e.collection=_.isArray(e.collection)?e.collection:[],_.each(e.collection,function(e,t){i.before_module_or_nested_section===e.id&&(n=t),i.after_module_or_nested_section===e.id&&(n=t+1)});var r={id:i.id,level:"module",module_type:i.module_type,ver_ini:sektionsLocalizedData.nimbleVersion};"no_starting_value"!==(t=o.getModuleStartingValue(i.module_type))&&(r.value=t),e.collection.splice(n,0,r)},_updAPISet_sek_duplicate_module:function(){var t,e,i,n=this;if(t=n.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");if("no_match"==(e=n.getLevelModel(t.in_column,n.updAPISetParams.newSetValue.collection)))return l.errare("updateAPISetting => "+t.action+" => no parent column matched"),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => no parent column matched");e.collection=_.isArray(e.collection)?e.collection:[];try{i=n.cloneLevel(t.id)}catch(e){return l.errare("updateAPISetting => "+t.action,e),void n.updAPISetParams.promise.reject("updateAPISetting => "+t.action+" => error when cloning the level")}n.maybeGenerateNewItemIdsForCrudModules(i);var o=n.getLevelPositionInCollection(t.id,n.updAPISetParams.newSetValue.collection);n.updAPISetParams.cloneId=i.id,e.collection.splice(parseInt(o+1,10),0,i)},_updAPISet_sek_remove_module:function(){var t,e;if(t=this.updAPISetParams.params,_.isEmpty(t.id))throw new Error("updateAPISetting => "+t.action+" => missing id");"no_match"!=(e=this.getLevelModel(t.in_column,this.updAPISetParams.newSetValue.collection))?(e.collection=_.isArray(e.collection)?e.collection:[],e.collection=_.filter(e.collection,function(e){return e.id!=t.id})):l.errare("updateAPISetting => "+t.action+" => no parent column matched")},_updAPISet_sek_move_module:function(){var t,e,i,n,o=this;if(t=o.updAPISetParams.params,e=o.getLevelModel(t.to_column,o.updAPISetParams.newSetValue.collection),_.isEmpty(e)||"no_match"==e)throw new Error("updateAPISetting => "+t.action+" => missing target column");if(t.from_column!=t.to_column){var r;if(r=o.getLevelModel(t.from_column,o.updAPISetParams.newSetValue.collection),_.isEmpty(r)||"no_match"==r)throw new Error("updateAPISetting => "+t.action+" => missing source column");r.collection=_.isArray(r.collection)?r.collection:[],i=o.getLevelModel(t.id,o.updAPISetParams.newSetValue.collection),n=c.extend(!0,{},i),r.collection=_.filter(r.collection,function(e){return e.id!=t.id})}e.collection=_.isArray(e.collection)?e.collection:[],originalCollection=c.extend(!0,[],e.collection);var s=[];if(_.each(t.newOrder,function(e){if(t.from_column!=t.to_column&&e==n.id)s.push(n);else{if(moduleCandidate=o.getLevelModel(e,o.updAPISetParams.newSetValue.collection),_.isEmpty(moduleCandidate)||"no_match"==moduleCandidate)throw new Error("updateAPISetting => "+t.action+" => missing moduleCandidate");s.push(moduleCandidate)}}),s.length!=_.uniq(s).length)throw new Error("updateAPISetting => "+t.action+" => there are duplicated modules in column : "+e.id);e.collection=s},_updAPISet_sek_set_module_value:function(){var e,t,i=this;e=i.updAPISetParams.params,t=i.getLevelModel(e.id,i.updAPISetParams.newSetValue.collection);var n=e.settingParams.args.moduleRegistrationParams.control,o=e.settingParams.args.moduleRegistrationParams.id,r=n.czr_Module(o);_.isEmpty(r)?l.errare("updateAPISetting => missing parentModuleInstance",e):isMultiItemModule=r.isMultiItem();var s=isMultiItemModule?[]:{};if(_.each(e.value||(isMultiItemModule?[]:{}),function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(s[t]=e)}),"no_match"==t)return l.errare("updateAPISetting => "+e.action+" => no module matched",e),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => error no module matched");if(_.isEmpty(e.options_type))return l.errare("updateAPISetting => "+e.action+" => missing options_type"),void i.updAPISetParams.promise.reject("updateAPISetting => "+e.action+" => missing options_type");if("__no_option_group_to_be_updated_by_children_modules__"===e.options_type)t.value=s;else{var a=c.extend(!0,{},_.isEmpty(t.value)?{}:t.value);a[e.options_type]=s,t.value=a}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(m,f){f.extend(CZRSeksPrototype,{_updAPISet_sek_import_from_file:function(){var n,o=this;if(n=o.updAPISetParams.params,_.isUndefined(n.imported_content.data)||_.isUndefined(n.imported_content.metas))m.errare("updateAPISetting::sek-import-from-file => invalid imported content",imported_content);else{var i=_.isArray(n.imported_content.data.collection)?f.extend(!0,[],n.imported_content.data.collection):[];if(!0===n.assign_missing_locations){var t,e=n.imported_content.metas.active_locations,r=m.czr_sektions.activeLocations();_.each(r,function(e){o.isHeaderLocation(e)||o.isFooterLocation(e)||t.push(e)});var s=_.first(t);if(!_.isEmpty(s)&&!_.isEmpty(e)&&_.isArray(e)){var a=f(e).not(t).get(),l=o.getLevelModel(s,o.updAPISetParams.newSetValue.collection),c=o.getLevelModel(s,n.imported_content.data.collection),d=[];l.collection=_.isArray(l.collection)?l.collection:[],c.collection=_.isArray(c.collection)?c.collection:[],_.each(e,function(e){var t=o.getLevelModel(e,i);_.isEmpty(t.collection)||(d=_.union(d,t.collection))}),c.collection=d,n.imported_content.data.collection=_.filter(n.imported_content.data.collection,function(e){return!_.contains(a,e.id)})}}if(!0===n.keep_existing_sections){_.each(i,function(e){var t=o.getLevelModel(e.id,o.updAPISetParams.newSetValue.collection);if(!_.isEmpty(t.collection)){var i=o.getLevelModel(e.id,n.imported_content.data.collection);i.collection=_.union(t.collection,i.collection)}});var p=o.updAPISetParams.newSetValue.fonts,u=n.imported_content.data.fonts;p&&!_.isEmpty(p)&&_.isArray(p)&&(u=_.isArray(u)?u:[],n.imported_content.data.fonts=_.uniq(_.union(p,u)))}o.updAPISetParams.newSetValue=n.imported_content.data}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(z,w){w.extend(CZRSeksPrototype,{_updAPISet_sek_inject_tmpl_from_gallery:function(){var t,i=this;if(t=i.updAPISetParams.params,z.infoLog("api update params for sek-inject-tmpl-from-gallery",t),_.isUndefined(t.injected_content.data)||_.isUndefined(t.injected_content.metas))z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported content",injected_content);else{var n=function(e){return t.injected_content&&t.injected_content.metas&&e===t.injected_content.metas.tmpl_header_location},o=function(e){return t.injected_content&&t.injected_content.metas&&e===t.injected_content.metas.tmpl_footer_location},r=function(){var t=!1;return _.each(e,function(e){t||(n(e)||o(e))&&(t="no_match"!=(t=i.getLevelModel(e,s)))}),t&&!_.isEmpty(c.local_header_footer)},s=_.isArray(t.injected_content.data.collection)?w.extend(!0,[],t.injected_content.data.collection):[],e=t.injected_content.metas.tmpl_locations,a=[],l=i.updAPISetParams.newSetValue.collection;if(_.each(z.czr_sektions.activeLocations(),function(e){i.isGlobalLocationId(e)||a.push(e)}),_.isArray(e)&&!_.isEmpty(e)){var c=t.injected_content.data.local_options;c=w.extend(!0,{},_.isObject(c)?c:{});var d=t.injected_content.data.fonts;d=_.isArray(d)?w.extend(!0,[],d):[];var p,u,m,f,g=w.extend(!0,[],l),h=[],v="__not_set__";switch(_.each(s,function(e){n(e.id)||o(e.id)||_.isEmpty(e.collection)||(h=_.union(h,e.collection))}),t.tmpl_inject_mode){case"replace":if(f=!0,_.each(e,function(e){f&&(f=_.contains(a,e))}),f){var k,y;g=[],_.each(l,function(e){m=_.findWhere(s,{id:e.id})||{},_.isEmpty(m.collection)?i.isHeaderLocation(e.id)||i.isFooterLocation(e.id)?g.push(e):(k={collection:[],options:[]},y=w.extend(!0,{},e),y=w.extend(y,k),g.push(y)):g.push(m)})}else{if(c&&c.template&&"nimble_template"===c.template.local_template?v="loop_start":_.contains(a,"loop_start")?v="loop_start":_.each(a,function(e){i.isHeaderLocation(e)||i.isFooterLocation(e)||(v=e)}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}if("no_match"===(u=i.getLevelModel(v,g))){z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => target location id "+v);break}(u=w.extend(!0,{},u)).collection=h,g=[],r()&&_.each(e,function(e){if(n(e)||o(e)){if("no_match"===(m=i.getLevelModel(e,s)))return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id "+e+" not found in template collection");g.push(m)}}),_.each(a,function(e){v===e&&g.push(u),localLocModel=i.getLevelModel(e,l),"no_match"!==localLocModel?r()||(i.isHeaderLocation(e)||i.isFooterLocation(e))&&g.push(localLocModel):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id "+e+" not found in current setting collection")})}break;case"before":if(_.each(a,function(e){"__not_set__"==v&&("no_match"!==(p=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(p.collection)||(v=e,u=p):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}(u=w.extend(!0,{},u)).collection=_.union(h,u.collection),g=[],_.each(a,function(e){if(v===e)g.push(u);else{if("no_match"===p)return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e);g.push(i.getLevelModel(e,l))}});break;case"after":if(_.each(a.reverse(),function(e){"__not_set__"==v&&("no_match"!==(p=i.getLevelModel(e,g))?i.isHeaderLocation(e)||i.isFooterLocation(e)||_.isEmpty(p.collection)||(v=e,u=p):z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => location id not found"+e))}),"__not_set__"===v){z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => target location id is empty");break}(u=w.extend(!0,{},u)).collection=_.union(u.collection,h),g=[],_.each(a,function(e){if(v===e)g.push(u);else{if("no_match"===(p=i.getLevelModel(e,l)))return void z.errare("::_updAPISet_sek_inject_tmpl_from_gallery => error => loc id not found"+e);g.push(p)}})}if(i.updAPISetParams.newSetValue.collection=g,!_.isEmpty(c)&&"replace"===t.tmpl_inject_mode){var b=i.updAPISetParams.newSetValue.local_options;b=w.extend(!0,{},_.isObject(b)?b:{}),i.updAPISetParams.newSetValue.local_options=_.extend(b,c)}if(_.isArray(d)&&!_.isEmpty(d))if("replace"!=t.tmpl_inject_mode){var I=i.updAPISetParams.newSetValue.fonts;I=w.extend(!0,[],_.isArray(I)?I:[]),i.updAPISetParams.newSetValue.fonts=_.uniq(_.union(d,I))}else i.updAPISetParams.newSetValue.fonts=d}else z.errare("updateAPISetting::sek-inject-tmpl-from-gallery => invalid imported template locations",t)}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(n,o){o.extend(CZRSeksPrototype,{cleanRegistered:function(t){var i=this,e=o.extend(!0,[],i.registered()||[]);n.trigger("sek-before-clean-registered"),e=_.filter(e,function(e){if("setting"!==e.what&&n[e.what].has(e.id)){if(!_.isEmpty(t)&&e.id!==t)return;_.isFunction(n[e.what](e.id).trigger)&&i.trigger("sek-ui-pre-removal",{what:e.what,id:e.id}),o.when(n[e.what](e.id).container.remove()).done(function(){n[e.what].remove(e.id),i.trigger("sek-ui-removed",{what:e.what,id:e.id})})}return"setting"===e.what}),i.registered(e)},cleanRegisteredLocalOptionSettings:function(){var t=this.getLocalSkopeOptionId(),e=o.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return e.id&&-1!==e.id.indexOf(t)&&n.has(e.id)&&n.remove(e.id),e.id&&-1===e.id.indexOf(t)}),this.registered(e)},cleanRegisteredLevelSettingsAfterHistoryNavigation:function(){var e=o.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return!_.isEmpty(e.level)&&"setting"===e.what&&n.has(e.id)&&n.remove(e.id),_.isEmpty(e.level)&&"setting"===e.what}),this.registered(e)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(p,u){u.extend(CZRSeksPrototype,{rootPanelFocus:function(){p.section.has(p.czr_activeSectionId())?p.section(p.czr_activeSectionId()).expanded(!1):p.section.each(function(e){e.expanded(!1)}),p.panel.each(function(e){e.expanded(!1)})},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()},getGlobalSectionsSettingId:function(){return sektionsLocalizedData.settingIdForGlobalSections},getParentSectionFromColumnId:function(i,n){var s=this,a="no_match",l=function(i,e,n,o){if(_.isUndefined(e)){var t=p(n)(),r=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},s.getDefaultSektionSettingValue(o));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){var t;"no_match"==a&&("section"==e.level&&(t=_.findWhere(e.collection,{id:i})),_.isEmpty(t)?_.isArray(e.collection)&&l(i,e.collection,n,o):a=e)}),a};return _.isEmpty(n)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&l(i,n,e,t)}):l(i,n),a},isGlobalLocation:function(e){var t=!1;return e=e||{},_.has(e,"is_global_location")?t=e.is_global_location:_.has(e,"scope")?t="global"===e.scope:_.isEmpty(e.location)?_.isEmpty(e.in_sektion)?_.isEmpty(e.id)||(t=this.isChildOfAGlobalLocation(e.id)):t=this.isChildOfAGlobalLocation(e.in_sektion):t=this.isChildOfAGlobalLocation(e.location),t},isChildOfAGlobalLocation:function(e){var r=this,s=function(t,e){var i="no_match";if(_.isUndefined(e)){var n=p(r.getGlobalSectionsSettingId())(),o=_.isObject(n)?u.extend(!0,{},n):r.getDefaultSektionSettingValue("global");e=_.isArray(o.collection)?o.collection:[]}return _.each(e,function(e){"no_match"==i&&(t===e.id?i=e:_.isArray(e.collection)&&(i=s(t,e.collection)))}),i};return"no_match"!==s(e)},isGlobalLocationId:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_global},isHeaderLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_header},isFooterLocation:function(e){var t=this.activeLocationsInfo(),i=_.isArray(t)?_.findWhere(t,{id:e}):{};return _.isObject(i)&&i.is_footer},getLevelModel:function(i,n){var s=this,a="no_match",l=function(t,e,i,n){if(_.isUndefined(e)){var o=p(i)(),r=_.isObject(o)?u.extend(!0,{},o):u.extend(!0,{},s.getDefaultSektionSettingValue(n));e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){"no_match"==a&&(t===e.id?a=e:_.isArray(e.collection)&&l(t,e.collection,i,n))}),a};return _.isEmpty(n)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&l(i,n,e,t)}):l(i,n),a},getLevelPositionInCollection:function(i,n){var s=this,a="no_match",l=function(i,e,n,o){if(_.isUndefined(e)){var t=p(n)(),r=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},s.getDefaultSektionSettingValue(o));e=_.isArray(r.collection)?r.collection:[]}_.each(e,function(e,t){"no_match"==a&&(i===e.id?a=t:_.isArray(e.collection)&&l(i,e.collection,n,o))})};return _.isEmpty(n)?_.each({local:s.localSectionsSettingId(),global:s.getGlobalSectionsSettingId()},function(e,t){"no_match"===a&&l(i,e,t,n)}):l(i,n),a},getLevelProperty:function(e){if(e=_.extend({id:"",property:""},e),_.isEmpty(e.id))p.errare("getLevelProperty => invalid id provided");else{var t=this.getLevelModel(e.id);if("no_match"!=t){if(_.isObject(t))return t[e.property];p.errare("getLevelProperty => invalid model for id : "+e.id,t)}else p.errare("getLevelProperty => no level model found for id : "+e.id)}},cloneLevel:function(e){var t=this,i=t.getLevelModel(e);if("no_match"==i)throw new Error("cloneLevel => no match for level id : "+e);var n=u.extend(!0,{},i),o=function(e){if(_.isEmpty(e.id))throw new Error("cloneLevel => missing level id");if(e.id=sektionsLocalizedData.prefixForSettingsNotSaved+t.guid(),!_.isEmpty(e.collection)){if(!_.isArray(e.collection))throw new Error("cloneLevel => the collection must be an array for level id : "+e.id);_.each(e.collection,function(e){e.id=sektionsLocalizedData.prefixForSettingsNotSaved+t.guid(),o(e)})}return e};return o(n)},getDefaultItemModelFromRegisteredModuleData:function(e){if(!this.isModuleRegistered(e))return{};if(sektionsLocalizedData.registeredModules[e].is_father)return p.errare("getDefaultItemModelFromRegisteredModuleData => Father modules should be treated specifically"),{};var t=sektionsLocalizedData.registeredModules[e].tmpl["item-inputs"],i={id:"",title:""};return _.each(t,function(e,t){switch(t){case"tabs":_.each(e,function(e){_.each(e.inputs,function(e,t){i[t]=e.default||""})});break;default:i[t]=e.default||""}}),i},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sektionsLocalizedData.registeredModules[e][t]:"not_set"},isModuleRegistered:function(e){return sektionsLocalizedData.registeredModules&&!_.isUndefined(sektionsLocalizedData.registeredModules[e])},isMultiItemsModule:function(e){return sektionsLocalizedData.registeredModules[e]&&!0===sektionsLocalizedData.registeredModules[e].is_crud},maybeGenerateNewItemIdsForCrudModules:function(t){var i=this;return(_.isArray(t)||_.isObject(t))&&_.each(t,function(e){_.isArray(t)&&_.isObject(e)&&e.id&&!_.has(e,"level")?-1===e.id.indexOf(sektionsLocalizedData.prefixForSettingsNotSaved)&&(e.id=i.guid()):(_.isArray(e)||_.isObject(e))&&i.maybeGenerateNewItemIdsForCrudModules(e)}),t},sniffGFonts:function(e){var o=this,r=[],s=function(i,n,e){if(_.isUndefined(e)){var t=p(i)();e=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},o.getDefaultSektionSettingValue(n))}_.each(e,function(e,t){_.isString(t)&&"_css"===t.substr(t.length-4)&&!0===o.inputIsAFontFamilyModifier(t)&&-1<e.indexOf("gfont")&&!_.contains(r,e)&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,n,e)})};return(e=e||{is_global_location:!1}).is_global_location?s(o.getGlobalSectionsSettingId(),"global"):s(o.localSectionsSettingId(),"local"),r},sniffAllFonts:function(){var o=this,r=[],s=function(i,n,e){if(_.isUndefined(e)){var t=p(i)();e=_.isObject(t)?u.extend(!0,{},t):u.extend(!0,{},o.getDefaultSektionSettingValue(n))}_.each(e,function(e,t){_.isString(t)&&_.isString(e)&&(-1<e.indexOf("[gfont]")||-1<e.indexOf("[cfont]"))&&r.push(e),(_.isArray(e)||_.isObject(e))&&s(i,n,e)})};return _.each([{id:o.localSectionsSettingId(),scope:"local"},{id:o.getGlobalSectionsSettingId(),scope:"global"},{id:sektionsLocalizedData.optNameForGlobalOptions,scope:"global"}],function(e){s(e.id,e.scope)}),r},getInputDefaultValue:function(i,n,e){var o=this;if(o.cachedDefaultInputValues=o.cachedDefaultInputValues||{},o.cachedDefaultInputValues[n]=o.cachedDefaultInputValues[n]||{},_.has(o.cachedDefaultInputValues[n],i))return o.cachedDefaultInputValues[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))p.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))p.errare("getInputDefaultValue => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_default_value_specified";return _.each(e,function(e,t){"no_default_value_specified"===r&&(i!==t||_.isUndefined(e.default)||(r=e.default),"no_default_value_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputDefaultValue(i,n,e)),"no_default_value_specified"!==r&&(o.cachedDefaultInputValues[n][i]=r))}),r}p.errare("getInputDefaultValue => Father modules should be treated specifically")}},getInputType:function(i,n,e){var o=this;if(o.cachedInputTypes=o.cachedInputTypes||{},o.cachedInputTypes[n]=o.cachedInputTypes[n]||{},_.has(o.cachedInputTypes[n],i))return o.cachedInputTypes[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))p.errare("getInputType => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))p.errare("getInputType => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_input_type_specified";return _.each(e,function(e,t){"no_input_type_specified"===r&&(i!==t||_.isUndefined(e.input_type)||(r=e.input_type),"no_input_type_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputType(i,n,e)),"no_input_type_specified"!==r&&(o.cachedInputTypes[n][i]=r))}),r}p.errare("getInputType => Father modules should be treated specifically")}},getInputRegistrationParams:function(i,n,e){var o=this;if(o.cachedInputRegistrationParams=o.cachedInputRegistrationParams||{},o.cachedInputRegistrationParams[n]=o.cachedInputRegistrationParams[n]||{},_.has(o.cachedInputRegistrationParams[n],i))return o.cachedInputRegistrationParams[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))p.errare("getInputRegistrationParams => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))p.errare("getInputRegistrationParams => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r={};return _.each(e,function(e,t){_.isEmpty(r)&&(i!==t||_.isUndefined(e.input_type)||(r=e),_.isEmpty(r)&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputRegistrationParams(i,n,e)),_.isEmpty(r)||(o.cachedInputRegistrationParams[n][i]=r))}),r}p.errare("getInputRegistrationParams => Father modules should be treated specifically")}},inputIsAFontFamilyModifier:function(i,e){var n=this;if(n.cachedFontFamilyModifier=n.cachedFontFamilyModifier||{},_.has(n.cachedFontFamilyModifier,i))return n.cachedFontFamilyModifier[i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules);var o="not_set";return _.each(e,function(e,t){"not_set"===o&&(i!==t||_.isUndefined(e.input_type)||(o=!_.isUndefined(e.refresh_fonts)&&e.refresh_fonts),"not_set"===o&&(_.isArray(e)||_.isObject(e))&&(o=n.inputIsAFontFamilyModifier(i,e)),"not_set"!==o&&(n.cachedFontFamilyModifier[i]=o))}),o}p.errare("inputIsAFontFamilyModifier => missing sektionsLocalizedData.registeredModules")},getModuleStartingValue:function(e){var a=this;if(!sektionsLocalizedData.registeredModules)return p.errare("getModuleStartingValue => missing sektionsLocalizedData.registeredModules"),"no_starting_value";if(_.isUndefined(sektionsLocalizedData.registeredModules[e]))return p.errare("getModuleStartingValue => the module type "+e+" is not registered"),"no_starting_value";var t,i,n,l=function(e){return readyStartValues=[],_.each(e,function(e){if(_.isObject(e)){var t=u.extend(!0,{},e);t.id=p.czr_sektions.guid(),readyStartValues.push(t)}else p.errare("getModuleStartingValue => multi-item module => items should be objects for module "+mod_type)}),readyStartValues},c={},d=(t=e,sektionsLocalizedData.registeredModules[t]&&sektionsLocalizedData.registeredModules[t].starting_value?sektionsLocalizedData.registeredModules[t].starting_value:{});return n=e,sektionsLocalizedData.registeredModules[n]&&!0===sektionsLocalizedData.registeredModules[n].is_father?_.each((i=e,sektionsLocalizedData.registeredModules[i]&&sektionsLocalizedData.registeredModules[i].children?sektionsLocalizedData.registeredModules[i].children:{}),function(e,t){var i,n,o,r,s=(i=e,r=(o=d)[n=t]?o[n]:{},a.isMultiItemsModule(i)&&_.isArray(r)?l(r):r);_.isEmpty(s)||(c[t]=s)}):c=a.isMultiItemsModule(e)&&_.isArray(d)?l(d):d,_.isEmpty(c)?"no_starting_value":c},selectNextTabbableOrFocusable:function(e){var t=u(e),i=u(":focus"),n=0;if(1===i.length){var o=t.index(i);o+1<t.length&&(n=o+1)}t.eq(n).focus()},selectPrevTabbableOrFocusable:function(e){var t=u(e),i=u(":focus"),n=t.length-1;if(1===i.length){var o=t.index(i);0<o&&(n=o-1)}t.eq(n).focus()},setupSelectInput:function(e){var n=this,t=(n.input_parent,n.module,p.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type)),i={params:e=_.isEmpty(e)?t.choices:e};if(n.module.trigger("nimble-set-select-input-options",i),e=i.params,!_.isEmpty(e)&&_.isObject(e))switch(n.type){case"simpleselect":_.each(e,function(e,t){var i={value:t,html:e};t==n()?u.extend(i,{selected:"selected"}):"px"===t&&u.extend(i,{selected:"selected"}),u("select[data-czrtype]",n.container).append(u("<option>",i))}),u("select[data-czrtype]",n.container).selecter();break;case"multiselect":var o=n();o=_.isString(o)?[o]:o,o=_.isArray(o)?o:[],_.each(e,function(e,t){var i={value:t,html:e};_.contains(o,t)&&u.extend(i,{selected:"selected"}),u("select[data-czrtype]",n.container).append(u("<option>",i))}),u("select[data-czrtype]",n.container).czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),u("select[data-czrtype]",n.container).on("change",function(){0===u(this).find("option:selected").length&&n([])});break;default:p.errare("::setupSelectInput => invalid input type => "+n.type)}else p.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+n.id+" in module "+n.module.module_type)},maybeSetupDeviceSwitcherForInput:function(){var n=this;if(!n.previewedDevice){var e=['<span class="sek-input-device-switcher">','<i data-sek-device="desktop" class="sek-switcher preview-desktop active" title="'+sektionsLocalizedData.i18n["Settings on desktops"]+'"></i>','<i data-sek-device="tablet" class="sek-switcher preview-tablet" title="'+sektionsLocalizedData.i18n["Settings on tablets"]+'"></i>','<i data-sek-device="mobile" class="sek-switcher preview-mobile" title="'+sektionsLocalizedData.i18n["Settings on mobiles"]+'"></i>',"</span>"].join(" ");n.container.find(".customize-control-title").first().prepend(e),n.previewedDevice=new p.Value(p.previewedDevice()),syncWithPreviewedDevice=function(e){e.stopPropagation(),n.container.find("[data-sek-device]").removeClass("active"),u(this).addClass("active");var t,i="desktop";try{i=u(this).data("sek-device")}catch(e){p.errare("maybeSetupDeviceSwitcherForInput => error when binding sek-switcher",e)}try{p.previewedDevice(i)}catch(e){p.errare("maybeSetupDeviceSwitcherForInput => error when setting the previewed device",e)}n.previewedDevice(i),_.isUndefined(e.isTrigger)&&n.module&&n.module.control&&n.module.control.params.section&&(t=n.module.control.params.section,_.delay(function(){p.previewer.send("sek-animate-to-level",{id:t})},600))},n.container.on("click","[data-sek-device]",syncWithPreviewedDevice);var t=n.container.find('[data-sek-device="'+p.previewedDevice()+'"]');0<t.length&&t.trigger("click")}},scheduleModuleAccordion:function(e){e=e||{expand_first_control:!0};var i=this;if(!0!==i.container.data("sek-module-accordion-has-been-setup")&&(u(i.container).on("click",".customize-control label > .customize-control-title",function(e){e.stopPropagation();var t=u(this).closest(".customize-control");"no"!==t.attr("data-sek-accordion")&&(i.container.find(".customize-control").not(t).each(function(){u(this).attr("data-sek-accordion")||u(this).attr("data-sek-expanded","false")}),t.attr("data-sek-expanded","false"==t.attr("data-sek-expanded")?"true":"false"),t.trigger("true"==t.attr("data-sek-expanded")?"sek-accordion-expanded":"sek-accordion-collapsed"),!0===t.data("module_ready_on_custom_control_event_is_setup")?t.trigger("sek-accordion-expanded"):t.one("module_ready_on_custom_control_event_is_setup",function(){t.trigger("sek-accordion-expanded")}))}),i.container.data("sek-module-accordion-has-been-setup",!0),e.expand_first_control)){var t=_.filter(i.controls(),function(e){return!e.params||!e.params.sek_registration_params||!1!==e.params.sek_registration_params.has_accordion}),n=_.first(t);_.isObject(n)&&!_.isEmpty(n.id)&&p.control(n.id,function(e){e.container.one("items-collection-populated",function(){u(this).find("label > .customize-control-title").trigger("click")}),!0===e.container.data("module_ready_on_custom_control_event_is_setup")?e.container.trigger("sek-accordion-expanded"):e.container.one("module_ready_on_custom_control_event_is_setup",function(){e.container.trigger("sek-accordion-expanded")})})}},isPromise:function(e){return e&&"function"==typeof e.then&&String(u.Deferred().then)===String(e.then)},whenAllPromisesInParallel:function(e){var i=this,t=u.Deferred(),n=[],o=_.keys(e);return _.each(e,function(e,t){n.push(u.Deferred(function(t){(i.isPromise(e)?e:u.Deferred()).done(t.resolve).fail(function(e){t.reject(e)})}))}),u.when.apply(this,n).done(function(){var i={},e=Array.prototype.slice.call(arguments);_.each(e,function(e,t){i[o[t]]=e}),t.resolve(i)}).fail(t.reject),t},whenAllPromisesInSerie:function(t,i,n,o){i=i||0,n=n||{},o=o||u.Deferred();var r=this;if(_.isArray(t)){var e=t[i];(r.isPromise(e)?e:u.Deferred(function(e){e.resolve()})).always(function(e){n[i]=e,i+1==t.length?o.resolve(n):i+1<t.length&&r.whenAllPromisesInSerie(t,i+1,n,o)})}return o},importAttachment:function(t){return wp.ajax.post("sek_import_attachment",{img_url:t,nonce:p.settings.nonce.save}).fail(function(e){p.errare("sek_import_attachment ajax action failed for image "+t,e)})},cleanIds:function(e){e.id="";var t=this;return _.each(e.collection,function(e){e.id="",_.isArray(e.collection)&&t.cleanIds(e)}),e},getDefaultSektionSettingValue:function(e){return!_.isUndefined(e)&&_.contains(["local","global"],e)||p.errare("getDefaultSektionSettingValue => the skope should be set to local or global"),"global"===e?sektionsLocalizedData.defaultGlobalSektionSettingValue:sektionsLocalizedData.defaultLocalSektionSettingValue},scheduleVisibilityOfInputId:function(t,i){var n=this.input_parent;if(!_.isFunction(i)||_.isEmpty(t))throw new Error("::scheduleVisibilityOfInputId => error when firing for input id : "+this.id);if(!n.czr_Input.has(t))throw new Error("::scheduleVisibilityOfInputId => missing input id : "+t);n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})},hasCurrentPageNBSectionsNotHeaderFooter:function(){var e,t=this,i=!1,n=this.localSectionsSettingId(),o=p(n)();this.activeLocationsInfo();return o=_.isObject(o)?o:{},e=u.extend(!0,{},o),e=_.isEmpty(e.collection)?[]:e.collection,e=_.isArray(e)?e:[],_.each(e,function(e){i||_.isObject(e)&&"location"==e.level&&e.collection&&(t.isHeaderLocation(e.id)||t.isFooterLocation(e.id)||(i=!_.isEmpty(e.collection)))}),i},isJsonString:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,m){m.extend(CZRSeksPrototype,{setupDnd:function(){var t=this;t.bind("sek-refresh-dragzones",function(e){!0!="draggable"in document.createElement("span")&&l.panel(sektionsLocalizedData.sektionsPanelId,function(e){l.notifications.add(new l.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){l.notifications.remove("drag-drop-support")},1e4)}),t.setupNimbleDragZones(e.input_container)}),l.previewer.bind("ready",function(){try{t.setupNimbleDropZones()}catch(e){l.errare("::setupDnd => error on self.setupNimbleDropZones()",e)}_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_intro_sec_picker_module"}))&&_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_module_picker_module"}))||t.rootPanelFocus()}),t.reactToDrop()},setupNimbleDragZones:function(e){var n=this,o=function(){l.notifications.add(new l.Notification("missing-injection-target",{type:"info",message:sektionsLocalizedData.i18n["You first need to click on a target ( with a + icon ) in the preview."],dismissible:!0})),_.delay(function(){l.notifications.remove("missing-injection-target")},3e4)};e.find('[draggable="true"]').each(function(){m(this).on("dragstart",function(e){(function(e){n.lastClickedTargetInPreview({}),e.originalEvent.dataTransfer.setData("sek-content-type",m(this).data("sek-content-type")),e.originalEvent.dataTransfer.setData("sek-eligible-for-module-dropzones",m(this).data("sek-eligible-for-module-dropzones")),e.originalEvent.dataTransfer.setData("sek-content-id",m(this).data("sek-content-id")),e.originalEvent.dataTransfer.setData("sek-section-type",m(this).data("sek-section-type")),e.originalEvent.dataTransfer.setData("sek-is-user-section",m(this).data("sek-is-user-section")),n.dndData={content_type:e.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===e.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:e.originalEvent.dataTransfer.getData("sek-content-id"),section_type:e.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===e.originalEvent.dataTransfer.getData("sek-is-user-section")};try{e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.clearData("browserSupport")}catch(e){l.panel(sektionsLocalizedData.sektionsPanelId,function(e){l.notifications.add(new l.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){l.notifications.remove("drag-drop-support")},1e4)})}m(this).addClass("sek-dragged"),n.cachedElements.$body.addClass("sek-dragging"),l.previewer.send("sek-drag-start",{content_type:n.dndData.content_type,eligible_for_module_dropzones:n.dndData.eligible_for_module_dropzones})}).call(m(this),e)}).on("dragend",function(e){(function(e){n.cachedElements.$body.removeClass("sek-dragging"),m(this).removeClass("sek-dragged"),l.previewer.send("sek-drag-stop")}).call(m(this),e)}).on("dblclick",function(e){(function(e){var t,i=n.lastClickedTargetInPreview();!_.isEmpty(i)&&i.id?t=n.dnd_getDropZonesElements().find('[data-sek-id="'+i.id+'"]').find(".sek-module-drop-zone-for-first-module").first():o(),t&&0<t.length?(l.czr_sektions.trigger("sek-content-dropped",{drop_target_element:t,location:t.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:t.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:t.data("drop-zone-after-module-or-nested-section"),before_section:t.data("drop-zone-before-section"),after_section:t.data("drop-zone-after-section"),content_type:m(this).attr("data-sek-content-type"),content_id:m(this).attr("data-sek-content-id"),section_type:m(this).attr("data-sek-section-type"),is_user_section:"true"===m(this).attr("data-sek-is-user-section")}),n.lastClickedTargetInPreview({})):(o(),l.errare("Double click insertion => the target zone was not found"))}).call(m(this),e)})})},setupNimbleDropZones:function(){var t=this;if(this.$dropZones=this.dnd_getDropZonesElements(),this.preDropElement=m("<div>",{class:sektionsLocalizedData.preDropElementClass,html:""}),this.$dropZones.length<1)throw new Error("::setupNimbleDropZones => invalid Dom element");this.$dropZones.each(function(){var e=m(this);!0!==e.data("zone-droppable-setup")&&(t.enterOverTimer=null,e.on("dragenter dragover",sektionsLocalizedData.dropSelectors,function(e){_.isNull(t.enterOverTimer)&&(t.enterOverTimer=!0,_.delay(function(){t.currentMousePosition&&t.currentMousePosition+""==e.clientY+""+e.clientX?t.enterOverTimer=null:(t.currentMousePosition=e.clientY+""+e.clientX,t.dnd_toggleDragApproachClassesToDropZones(e))},100)),t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.stopPropagation(),t.dnd_OnEnterOver(m(this),e))}).on("dragleave drop",sektionsLocalizedData.dropSelectors,function(e){switch(e.type){case"dragleave":t.dnd_isOveringDropTarget(m(this),e)||t.dnd_cleanOnLeaveDrop(m(this),e);break;case"drop":this.$cachedDropZoneCandidates=null,t.dnd_canDrop({targetEl:m(this),evt:e})&&(e.preventDefault(),t.dnd_onDrop(m(this),e),t.dnd_cleanOnLeaveDrop(m(this),e),l.previewer.send("sek-drag-stop"))}}).data("zone-droppable-setup",!0))})},dnd_isInTarget:function(e,t){var i=t.clientY,n=t.clientX,o=e[0].getBoundingClientRect(),r=n<=o.right&&o.left<=n;return i>=o.top&&o.bottom>=i&&r},dnd_toggleDragApproachClassesToDropZones:function(p){var u=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.$cachedDropZoneCandidates=_.isEmpty(this.$cachedDropZoneCandidates)?this.$dropZones.find(".sek-drop-zone"):this.$cachedDropZoneCandidates,this.distanceTable=[],this.$dropZones.find(".sek-drop-zone").each(function(){var e,t,i=p.clientY,n=p.clientX,o=m(this)[0].getBoundingClientRect(),r=Math.abs(i-(o.bottom-(o.bottom-o.top)/2)),s=(Math.abs(o.top-i),Math.abs(n-(o.right-(o.right-o.left)/2))),a=(o.right,o.left,r<50),l=s<50,c=n<=o.right&&o.left<=n,d=i>=o.top&&o.bottom>=i;u.distanceTable.push({el:m(this),dist:d&&c?0:(e=s,t=r,Math.sqrt(e*e+t*t))}),m(this).removeClass("sek-drag-is-in"),(a||d)&&(l||c)?(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).addClass("sek-drag-is-very-close")):(m(this).removeClass("sek-drag-is-approaching"),m(this).removeClass("sek-drag-is-close"),m(this).removeClass("sek-drag-is-very-close")),m(this).removeClass("sek-drag-is-in")});var t=_.min(_.pluck(u.distanceTable,"dist"));u.$dropTargetCandidate=null,_.each(u.distanceTable,function(e){_.isNull(u.$dropTargetCandidate)&&t===e.dist&&(u.$dropTargetCandidate=e.el)}),u.$dropTargetCandidate&&0<u.$dropTargetCandidate.length&&u.dnd_isInTarget(u.$dropTargetCandidate,p)&&u.$dropTargetCandidate.addClass("sek-drag-is-in"),u.enterOverTimer=null},dnd_getPreDropElementContent:function(e){var t,i,n=m(e.currentTarget);switch(this.dndData.content_type){case"module":t=sektionsLocalizedData.i18n["Insert here"],0<n.length&&("between-sections"!==n.data("sek-location")&&"in-empty-location"!==n.data("sek-location")||(t=sektionsLocalizedData.i18n["Insert in a new section"])),i='<div class="sek-module-placeholder-content"><p>'+t+"</p></div>";break;case"preset_section":i='<div class="sek-module-placeholder-content"><p>'+(t=sektionsLocalizedData.i18n["Insert a new section here"])+"</p></div>";break;default:l.errare("::dnd_getPreDropElementContent => invalid content type provided")}return i},dnd_getDropZonesElements:function(){return m(l.previewer.targetWindow().document)},dnd_canDrop:function(e){var t=this,i=(e=_.extend({targetEl:{},evt:{}},e||{})).targetEl;if(!_.isObject(i)||i.length<1)return!1;if(i.closest('[data-sek-level="location"]').length<1)return!1;var n=i.hasClass("sek-content-preset_section-drop-zone"),o=i.hasClass("sek-module-drop-zone-for-first-module"),r=!0===i.closest('[data-sek-level="location"]').data("sek-is-header-location"),s=!0===i.closest('[data-sek-level="location"]').data("sek-is-footer-location"),a="preset_section"===t.dndData.content_type&&"content"===t.dndData.section_type,l=function(e){m(".sek-no-drop-possible-message",i).length<1&&i.append(['<div class="sek-no-drop-possible-message">','<i class="material-icons">not_interested</i>',e,"</div>"].join(""))};return!!i.hasClass("sek-drop-zone")&&(!t.dndData.is_user_section&&(r||s)&&a?(l(r?sektionsLocalizedData.i18n["Header location only accepts modules and pre-built header sections"]:sektionsLocalizedData.i18n["Footer location only accepts modules and pre-built footer sections"]),!1):s&&"preset_section"===t.dndData.content_type&&"header"===t.dndData.section_type?(l(sektionsLocalizedData.i18n["You can't drop a header section in the footer location"]),!1):r&&"preset_section"===t.dndData.content_type&&"footer"===t.dndData.section_type?(l(sektionsLocalizedData.i18n["You can't drop a footer section in the header location"]),!1):"preset_section"===t.dndData.content_type&&!0===t.dndData.eligible_for_module_dropzones&&!n||("preset_section"===t.dndData.content_type&&n||"module"===t.dndData.content_type&&!n||"preset_section"===t.dndData.content_type&&o))},dnd_OnEnterOver:function(e,t){t.preventDefault(),!0!==e.data("is-drag-entered")&&(e.data("is-drag-entered",!0),e.addClass("sek-active-drop-zone"),this.$dropZones.addClass("sek-is-dragging"));try{this.dnd_mayBePrintPreDropElement(e,t)}catch(e){l.errare("Error when trying to insert the preDrop content",e)}},dnd_cleanOnLeaveDrop:function(e,t){var i=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.preDropElement.remove(),this.$dropZones.removeClass("sek-is-dragging"),m(sektionsLocalizedData.dropSelectors,this.$dropZones).each(function(){i.dnd_cleanSingleDropTarget(m(this))})},dnd_cleanSingleDropTarget:function(e){_.isEmpty(e)||e.length<1||(e.data("is-drag-entered",!1),e.data("preDrop-position",!1),e.removeClass("sek-active-drop-zone"),e.find(".sek-drop-zone").removeClass("sek-drag-is-close"),e.find(".sek-drop-zone").removeClass("sek-drag-is-approaching"),e.removeClass("sek-feed-me-seymore"),e.find(".sek-no-drop-possible-message").remove())},dnd_getPosition:function(e,t){var i=e[0].getBoundingClientRect(),n=i.height;return"before"===e.data("preDrop-position")?n+=this.preDropElement.outerHeight():"after"===e.data("preDrop-position")&&(n-=this.preDropElement.outerHeight()),0<t.originalEvent.clientY-i.top-n/2?"after":"before"},dnd_mayBePrintPreDropElement:function(e,t){var i=this,n=e.data("preDrop-position"),o=this.dnd_getPosition(e,t);if(n!==o&&!0!==i.isPrintingPreDrop){i.isPrintingPreDrop=!0,this.dnd_cleanSingleDropTarget(this.$currentPreDropTarget);var r="between-sections"===e.data("sek-location")||"in-empty-location"===e.data("sek-location");m.when(i.preDropElement.remove()).done(function(){e["before"===o?"prepend":"append"](i.preDropElement).find("."+sektionsLocalizedData.preDropElementClass).html(i.dnd_getPreDropElementContent(t)),e.find("."+sektionsLocalizedData.preDropElementClass).toggleClass("in-new-sektion",r),e.data("preDrop-position",o),e.addClass("sek-feed-me-seymore"),i.isPrintingPreDrop=!1,i.$currentPreDropTarget=e})}},dnd_isOveringDropTarget:function(e,t){var i=e[0].getBoundingClientRect(),n=t.clientX,o=t.clientY,r=i.left,s=i.right,a=i.top,l=i.bottom;return r<=n&&n-r<=s-r&&(a<=o&&o-a<=l-a)},dnd_onDrop:function(e,t){t.stopPropagation();this.dnd_getPosition(e,t),e.index();l.czr_sektions.trigger("sek-content-dropped",{drop_target_element:e,location:e.closest('[data-sek-level="location"]').data("sek-id"),before_module_or_nested_section:e.data("drop-zone-before-module-or-nested-section"),after_module_or_nested_section:e.data("drop-zone-after-module-or-nested-section"),before_section:e.data("drop-zone-before-section"),after_section:e.data("drop-zone-after-section"),content_type:t.originalEvent.dataTransfer.getData("sek-content-type"),eligible_for_module_dropzones:"true"===t.originalEvent.dataTransfer.getData("sek-eligible-for-module-dropzones"),content_id:t.originalEvent.dataTransfer.getData("sek-content-id"),section_type:t.originalEvent.dataTransfer.getData("sek-section-type"),is_user_section:"true"===t.originalEvent.dataTransfer.getData("sek-is-user-section")})},reactToDrop:function(){this.bind("sek-content-dropped",function(e){try{!function(e){if(!_.isObject(e))throw new Error("Invalid params provided");if(e.drop_target_element.length<1)throw new Error("Invalid drop_target_element");var t,i=e.drop_target_element,n="content-in-column";switch(i.data("sek-location")){case"between-sections":n="content-in-a-section-to-create";break;case"in-empty-location":e.is_first_section=!0,e.send_to_preview=!1,n="content-in-empty-location";break;case"between-columns":n="content-in-new-column"}"preset_section"===e.content_type&&(i.hasClass("sek-module-drop-zone-for-first-module")?1<(t=i.closest('div[data-sek-level="section"]')).find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length?(n="preset-section-in-a-nested-section-to-create",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),e.in_sektion=t.data("sek-id")):(e.sektion_to_replace=t.data("sek-id"),e.after_section=e.sektion_to_replace,e.in_column=t.closest('[data-sek-level="column"]').data("sek-id"),n="content-in-a-section-to-replace"):("between-sections"===i.data("sek-location")&&(n="content-in-a-section-to-create"),"between-modules-and-nested-sections"===i.data("sek-location")&&e.eligible_for_module_dropzones&&(n="preset-section-eligible-for-module-dropzones-in-new-nested-sektion",e.is_nested=!0,e.in_column=i.closest('[data-sek-level="column"]').data("sek-id"),t=i.closest('div[data-sek-level="section"]'),e.in_sektion=t.data("sek-id"))));switch(n){case"content-in-column":var o=i.closest("div[data-sek-level]");if(o.length<1)throw new Error("No valid level dom element found");var r=o.data("sek-level"),s=o.data("sek-id");if(_.isEmpty(r)||_.isEmpty(s))throw new Error("No valid level id found");l.previewer.trigger("sek-add-module",{level:r,id:s,in_column:i.closest('div[data-sek-level="column"]').data("sek-id"),in_sektion:i.closest('div[data-sek-level="section"]').data("sek-id"),before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section,content_type:e.content_type,content_id:e.content_id});break;case"content-in-a-section-to-create":case"content-in-a-section-to-replace":case"content-in-empty-location":l.previewer.trigger("sek-add-content-in-new-sektion",e);break;case"preset-section-in-a-nested-section-to-create":l.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",e);break;case"preset-section-eligible-for-module-dropzones-in-new-nested-sektion":var a=m.extend(!0,{},e);a=m.extend(a,{before_module_or_nested_section:e.before_module_or_nested_section,after_module_or_nested_section:e.after_module_or_nested_section}),l.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",a);break;default:l.errare("sek control panel => ::reactToDrop => invalid drop case : "+n)}}(e)}catch(e){l.errare("error when reactToDrop",e)}})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,d){d.extend(CZRSeksPrototype,{setupTinyMceEditor:function(){var n=this;c.sekEditorExpanded=new c.Value(!1),n.editorEventsListenerSetup=!1,n.$editorPane=d("#czr-customize-content_editor-pane"),n.$editorDragbar=d("#czr-customize-content_editor-dragbar"),n.$preview=d("#customize-preview"),n.$collapseSidebar=d(".collapse-sidebar"),n.attachResizeEventsToEditor();d("#customize-theme-controls").on("click",'[data-czr-action="open-tinymce-editor"]',function(){var e=d(this).data("czr-control-id"),t=d(this).data("czr-input-id");_.isEmpty(e)||_.isEmpty(t)?c.errare("toggle-tinymce-editor => missing input or control id"):c.sekEditorExpanded(!0)}),c.sekEditorExpanded.bind(function(e,t,i){!function(){c.sekTinyMceEditor=tinyMCE.get(sektionsLocalizedData.idOfDetachedTinyMceTextArea);var e=function(){!1===n.editorEventsListenerSetup&&(n.editorEventsListenerSetup=!0,n.trigger("sek-tiny-mce-editor-bound-and-instantiated"))};c.sekTinyMceEditor&&(c.sekTinyMceEditor.initialized?e():c.sekTinyMceEditor.on("init",function(){e()}))}(),e&&c.sekTinyMceEditor&&c.sekTinyMceEditor.focus(),d(document.body).toggleClass("czr-customize-content_editor-pane-open",e),n.cachedElements.$window[e?"on":"off"]("resize",function(){c.sekEditorExpanded()&&_.delay(function(){n.czrResizeEditor(window.innerHeight-n.$editorPane.height())},50)}),e?(n.czrResizeEditor(window.innerHeight-n.$editorPane.height()),_.delay(function(){n.cachedElements.$window.trigger("resize")},100)):(n.$preview.css("bottom",""),n.$collapseSidebar.css("bottom",""))}),d("#czr-customize-content_editor-pane").on("click",'[data-czr-action="close-tinymce-editor"]',function(){c.sekEditorExpanded(!1)}),d("#customize-controls").on("click",function(e){"open-tinymce-editor"!=d(e.target).data("czr-action")&&c.sekEditorExpanded(!1,{context:"clicked anywhere"})}),d(document).on("keydown",_.throttle(function(e){27===e.keyCode&&c.sekEditorExpanded(!1)},50)),n.bind("sek-tiny-mce-editor-bound-and-instantiated",function(){var e=d(c.sekTinyMceEditor.iframeElement).contents().get(0);d(e).on("keydown",_.throttle(function(e){27===e.keyCode&&c.sekEditorExpanded(!1)},50))}),_.each(["sek-click-on-inactive-zone","sek-add-section","sek-add-column","sek-add-module","sek-remove","sek-move","sek-duplicate","sek-resize-columns","sek-add-content-in-new-sektion","sek-pick-content","sek-edit-options","sek-edit-module","sek-notify"],function(e){"sek-edit-module"!=e?c.previewer.bind(e,function(){c.sekEditorExpanded(!1)}):c.previewer.bind(e,function(e){c.sekEditorExpanded("czr_tiny_mce_editor_module"===e.module_type)})})},attachResizeEventsToEditor:function(){var t=this;d("#czr-customize-content_editor-pane").on("mousedown mouseup",function(e){if(("mousedown"!==e.type||"czr-customize-content_editor-dragbar"===d(e.target).attr("id")||d(e.target).hasClass("czr-resize-handle"))&&c.sekEditorExpanded())switch(e.type){case"mousedown":d(document).on("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea,function(e){e.preventDefault(),d(document.body).addClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","none"),t.czrResizeEditor(e.pageY)});break;case"mouseup":d(document).off("mousemove."+sektionsLocalizedData.idOfDetachedTinyMceTextArea),d(document.body).removeClass("czr-customize-content_editor-pane-resize"),d("#czr-customize-content_editor_ifr").css("pointer-events","")}})},czrResizeEditor:function(e){var t,i=this,n=window.innerHeight,o=(window.innerWidth,{}),r=d("#czr-customize-content_editor_ifr"),s=d("#wp-czr-customize-content_editor-tools"),a=i.$editorPane.find(".mce-toolbar-grp"),l=i.$editorPane.find(".mce-statusbar");c.sekEditorExpanded()&&(_.isNaN(e)||(t=n-e),o.height=t,o.components=s.outerHeight()+a.outerHeight()+l.outerHeight(),t<40&&(o.height=40),n-1<t&&(o.height=n-1),n<i.$editorPane.outerHeight()&&(o.height=n),i.$preview.css("bottom",o.height),i.$editorPane.css("height",o.height),r.css("height",o.height-o.components))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,a){a.extend(CZRSeksPrototype,{export_template:function(e){e=e||{},e=a.extend({scope:"local"},e);var i=[],t={sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()};_.each(t,function(e,t){i.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),wp.ajax.post("sek_pre_export_checks",{nonce:d.settings.nonce.save,sek_export_nonce:d.settings.nonce.save,skope_id:"local"===e.scope?d.czr_skopeBase.getSkopeProperty("skope_id"):sektionsLocalizedData.globalSkopeId,active_locations:d.czr_sektions.activeLocations()}).done(function(){a(window).off("beforeunload"),window.location.href=[sektionsLocalizedData.customizerURL,"?",i.join("&")].join(""),a(window).on("beforeunload")}).fail(function(e){d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Export failed"],encodeURIComponent(e)].join(" "),"</strong>","</span>"].join("")})})},import_template_from_file:function(i){i=i||{};var e,t,n=(i=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},i)).input;if(_.isEmpty(n))throw new Error("::import_template => missing file_input param");if(_.isEmpty(i.file_input))throw new Error("::import_template => missing file_input param");if(i.file_input.length<1||_.isUndefined(i.file_input[0])||!i.file_input[0].files||_.isEmpty(i.file_input.val()))d.previewer.trigger("sek-notify",{notif_id:"missing-import-file",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Missing file"],"</strong>","</span>"].join("")});else{t=d.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type).scope,n.container.find(".sek-uploading").show(),d.notifications.remove("missing-import-file"),d.notifications.remove("import-success"),d.notifications.remove("import-failed"),d.notifications.remove("img-import-errors");var o=new FormData;if(o.append("file_candidate",i.file_input[0].files[0]),o.append("action","sek_get_manually_imported_file_content"),o.append("nonce",d.settings.nonce.save),_.contains(["local","global"],t)){if(o.append("skope",t),i.pre_import_check&&o.append("pre_import_check",i.pre_import_check),o.append("import_img",n.input_parent.czr_Input("import_img")()),n.container.find(".sek-uploading").show(),e=a.ajax({url:wp.ajax.settings.url,data:o,processData:!1,contentType:!1,type:"POST"}),i.pre_import_check)return a.Deferred(function(){var t=this;e.done(function(e){e.success||t.reject(e),d.czr_sektions.isImportedContentEligibleForAPI(e,i)||t.reject(e),t.resolve(e)}).fail(function(e){t.reject(e)})});d.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0,duration:3e4}),_.delay(function(){"pending"===e.state()&&d.previewer.trigger("sek-notify",{notif_id:"import-too-long",type:"error",duration:2e4,message:["<span>","<strong>",sektionsLocalizedData.i18n['Import exceeds server response time, try to uncheck "import images" option.'],"</strong>","</span>"].join("")})},3e4),e.done(function(e){d.czr_sektions.isImportedContentEligibleForAPI(e,i)?(e.data.data.collection=d.czr_sektions.setIdsForImportedTmpl(e.data.data.collection),d.czr_sektions.doUpdateApiSettingAfter_FileImport(e,i)):d.infoLog("::import_template problem => !api.czr_sektions.isImportedContentEligibleForAPI",e,i)}).fail(function(e){d.errare("::import_template => ajax error",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["Import failed, file problem"],"</strong>","</span>"].join("")})}).always(function(){d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(i)})}else d.errare("::import_template => invalid scope provided",t)}},pre_checks_from_file_import:function(e,t){if(t=t||{},(t=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},t)).is_file_import&&_.isEmpty(t.input))throw new Error("::pre_checks_from_file_import => missing file_input param");var i=d.czr_sektions.activeLocations(),n=a.extend(!0,[],_.isArray(e.data.metas.active_locations)?e.data.metas.active_locations:[]),o=t.input,r=d.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type);if(n=_.filter(n,function(e){return!_.contains(["nimble_local_header","nimble_local_footer"],e)}),_.isArray(n)&&_.isArray(i)){var s=a(n).not(i).get();_.isEmpty(s)?d.czr_sektions.import_template_from_file(t):(t.is_file_import&&(o.container.find('button[data-czr-action="sek-pre-import"]').hide(),"local"===r.scope?o.container.find(".czr-import-dialog.czr-local-import").slideToggle():o.container.find(".czr-import-dialog.czr-global-import").slideToggle()),d.infoLog("sek-pre-import => imported locations missing in current page.",s))}else d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"info",duration:3e4,message:['<span style="color:#0075a2">',"<strong>",sektionsLocalizedData.i18n["Import failed"],"</strong>","</span>"].join("")}),t.is_file_import&&d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},setIdsForImportedTmpl:function(i){var n=this;return(_.isObject(i)||_.isArray(i))&&_.each(i,function(e,t){(_.isObject(e)||_.isArray(e))&&(i[t]=n.setIdsForImportedTmpl(e)),"id"!==t||!_.isString(e)||0!==e.indexOf("__rep__me__")&&0!==e.indexOf("__nimble__")||(i[t]=sektionsLocalizedData.prefixForSettingsNotSaved+d.czr_sektions.guid())}),i},isImportedContentEligibleForAPI:function(e,t){var i=!0,n=e.data,o=null;e.success||(o=[sektionsLocalizedData.i18n["Import failed"],n].join(" : ")),_.isNull(o)&&!_.isObject(n)&&(o=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var r=n.data,s=n.metas,a=n.img_errors;_.isNull(o)&&!_.isObject(r)&&(o=sektionsLocalizedData.i18n["Import failed, invalid file content"]),_.isNull(o)&&!_.isObject(s)&&(o=sektionsLocalizedData.i18n["Import failed, invalid file content"]);var l=d.czr_sektions.localSectionsSettingId();if(t.is_file_import){var c=t.input;l="local"===d.czr_sektions.getInputRegistrationParams(c.id,c.module.module_type).scope?l:d.czr_sektions.getGlobalSectionsSettingId()}return _.isNull(o)&&_.isEqual(d(l)(),r)&&(d.infoLog("::isImportedContentEligibleForAPI => Setting unchanged"),i=!1),_.isNull(o)||(d.errare("::isImportedContentEligibleForAPI => invalid data sent from server",n),d.errare("::isImportedContentEligibleForAPI => importErrorMsg",o),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",o,"</strong>","</span>"].join("")}),i=!1),_.isEmpty(a)||d.previewer.trigger("sek-notify",{notif_id:"img-import-errors",type:"info",duration:6e4,message:['<span style="color:#0075a2">',["<strong>"+sektionsLocalizedData.i18n["Some image(s) could not be imported"]+"</strong><br/>",'<span style="font-size:11px">'+a+"</span>"].join(" : "),"</span>"].join("")}),i},doUpdateApiSettingAfter_FileImport:function(e,t){if(t=t||{},d.czr_sektions.isImportedContentEligibleForAPI(e,t)||!t.is_file_import){var i="local",n=!1;if(t.is_file_import){var o=t.input,r=d.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type);i=r.scope,n="local"===r.scope&&o.input_parent.czr_Input("keep_existing_sections")()}d.czr_sektions.updateAPISetting({action:"sek-import-from-file",scope:i,imported_content:e.data,assign_missing_locations:t.assign_missing_locations,keep_existing_sections:n}).done(function(){"local"===i&&d.czr_sektions.generateUI({action:"sek-generate-local-skope-options-ui",clean_settings:!0}),d.previewer.refresh(),d.previewer.trigger("sek-notify",{notif_id:"import-success",type:"success",duration:3e4,message:["<span>","<strong>",sektionsLocalizedData.i18n["File successfully imported"],"</strong>","</span>"].join("")})}).fail(function(e){d.errare("::doUpdateApiSettingAfter_FileImport => error when firing ::updateAPISetting",e),d.previewer.trigger("sek-notify",{notif_id:"import-failed",type:"error",duration:3e4,message:["<span>","<strong>",[sektionsLocalizedData.i18n["Import failed"],e].join(" : "),"</strong>","</span>"].join("")})}),d.previewer.refresh()}else d.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate(t)},doAlwaysAfterFileImportAndApiSettingUpdate:function(e){if(d.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0}),e=e||{},(e=a.extend({is_file_import:!0,pre_import_check:!1,assign_missing_locations:!1,input:"",file_input:""},e)).is_file_import){var t=e.input;t.container.find(".sek-uploading").hide(),e.file_input.val("").trigger("change"),t.container.find(".czr-import-dialog").hide(),t.container.find('button[data-czr-action="sek-pre-import"]').show()}}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(o,d){d.extend(CZRSeksPrototype,{setupTemplateGallery:function(){var i=this;i.templateGalleryExpanded=new o.Value(!1),i.tmplInjectDialogVisible=new o.Value(!1),sektionsLocalizedData.isTemplateGalleryEnabled&&(i.tmplSearchFieldVisible=new o.Value(!1),i.tmplSearchFieldVisible.bind(function(e){var t=i.cachedElements.$body.find(".sek-tmpl-filter-wrapper");e?t.fadeIn("fast"):t.fadeOut("fast")}),i.templateGalleryExpanded.bind(function(e){i.cachedElements.$body.toggleClass("sek-template-gallery-expanded",e),e?(i.tmplDialogVisible(!1),i.levelTreeExpanded(!1),i.tmplInjectDialogVisible(!1),d("#customize-preview iframe").css("z-index",1),i.renderOrRefreshTempGallery({tmpl_source:"api_tmpl"})):(d("#customize-preview iframe").css("z-index",""),o.trigger("nb-template-gallery-closed"))}),i.tmplInjectDialogVisible.bind(function(e){i.cachedElements.$body.toggleClass("sek-tmpl-dialog-expanded",e),e&&(i.tmplDialogVisible(!1),i.levelTreeExpanded(!1),d("#customize-preview iframe").css("z-index",1))}),o.previewer.bind("ready",function(){i.templateGalleryExpanded(!1)}))},renderTmplGalleryUI:function(){if(0<d("#nimble-tmpl-gallery").length)return d("#nimble-tmpl-gallery");try{_tmpl=wp.template("nimble-top-tmpl-gallery")({})}catch(e){return o.errare("Error when parsing nimble-top-tmpl-gallery template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("#nimble-tmpl-gallery")},renderOrRefreshTempGallery:function(t){t=d.extend({tmpl_source:"api_tmpl"},t||{});var i,n=this;d("#nimble-tmpl-gallery").length<1&&d.when(n.renderTmplGalleryUI({})).done(function(){n.setupTmplGalleryDOMEvents()}),d("#nimble-tmpl-gallery").find(".sek-tmpl-gallery-inner").html("");var o=function(e){return n.getTemplateGalleryHtml(e).done(function(e){(i=d("#nimble-tmpl-gallery")).find(".sek-tmpl-gallery-inner").html(e)}),n.getTemplateGalleryHtml(e)};o(t).done(function(e){_.isEmpty(e)&&"api_tmpl"===t.tmpl_source?("function"==typeof window.console.log&&console.log("Nimble Builder API problem => could not fetch templates"),o({tmpl_source:"user_tmpl"})):((i=d("#nimble-tmpl-gallery")).find("#sek-tmpl-source-switcher").show(),i.find("#sek-tmpl-source-switcher button").attr("aria-pressed","false").removeClass("is-selected"),i.find('[data-sek-tmpl-source="'+t.tmpl_source+'"]').attr("aria-pressed","true").addClass("is-selected"))})},getTemplateGalleryHtml:function(n){var o,r,t=this,s="",a=[sektionsLocalizedData.baseUrl,"/assets/admin/img/wire_frame.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),l=d.Deferred(),c=d("#nimble-tmpl-gallery").find(".czr-css-loader");c.show();return("user_tmpl"===n.tmpl_source?t.setSavedTmplCollection:t.getApiTmplCollection).call(t).done(function(e){setTimeout(function(){!function(e){if(_.isEmpty(e)&&"user_tmpl"===n.tmpl_source){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/empty_tmpl_collection_notice.jpg","?ver=",sektionsLocalizedData.nimbleVersion].join(""),i="https://docs.presscustomizr.com/article/426-how-to-save-and-reuse-templates-with-nimble-builder";s+='<div class="sek-tmpl-empty-collection">',s+="<p>"+sektionsLocalizedData.i18n["You did not save any template yet."]+"</p>",s+='<img src="'+t+'" />',s+='<br/><a href="'+i+'" target="_blank" rel="noreferrer nofollow">'+i+"</a>",s+="</div>"}else _.each(e,function(e,t){o=_.isEmpty(e.description)?[e.title,e.last_modified_date].join(" | "):[e.title,e.last_modified_date,e.description].join(" | "),r=_.isEmpty(e.thumb_url)?a:e.thumb_url,s+='<div class="sek-tmpl-item" data-sek-tmpl-item-id="'+t+'" data-sek-tmpl-item-source="'+n.tmpl_source+'">',s+='<div class="sek-tmpl-thumb" style="background-image:url('+r+')"></div>',s+='<div class="sek-tmpl-info" title="'+o+'">',s+='<h3 class="tmpl-title">'+e.title+"</h3>",s+='<p class="tmpl-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",s+='<p class="tmpl-desc">'+e.description+"</p>",s+='<i class="material-icons use-tmpl" title="'+sektionsLocalizedData.i18n["Use this template"]+'">add_circle_outline</i>',"user_tmpl"===n.tmpl_source&&(s+='<i class="material-icons edit-tmpl" title="'+sektionsLocalizedData.i18n["Edit this template"]+'">edit</i>',s+='<i class="material-icons remove-tmpl" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>'),"true"==e.is_pro_tmpl&&(s+='<div class="sek-is-pro"><img src="'+sektionsLocalizedData.czrAssetsPath+'sek/img/pro_orange.svg" alt="Pro feature"/></div>'),s+="</div>",s+="</div>"});0<c.length?c.hide({duration:100,complete:function(){l.resolve(s)}}):l.resolve(s)}(e),t.tmplSearchFieldVisible(!_.isEmpty(e))},0)}).fail(function(){console.log("tmpl collection promise failed",n),l.resolve("")}),l.promise()},setupTmplGalleryDOMEvents:function(){var c=d("#nimble-tmpl-gallery"),n=this;c.on("click",".sek-tmpl-item .use-tmpl",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-id"),i=d(this).closest(".sek-tmpl-item").data("sek-tmpl-item-source");_.isEmpty(t)?o.errare("::setupTmplGalleryDOMEvents => error => invalid template id"):n.hasCurrentPageNBSectionsNotHeaderFooter()?(n._tmplNameWhileImportDialog=t,n._tmplSourceWhileImportDialog=i,n.tmplInjectDialogVisible(!0)):(o.czr_sektions.get_gallery_tmpl_json_and_inject({tmpl_name:t,tmpl_source:i}),n.templateGalleryExpanded(!1))}).on("click",".sek-tmpl-gal-inject-dialog .sek-ui-button",function(e){e.preventDefault(),e.stopPropagation();var t=d(this).data("sek-tmpl-inject-mode");"cancel"!==t?_.contains(["replace","before","after"],t)?(o.czr_sektions.get_gallery_tmpl_json_and_inject({tmpl_name:n._tmplNameWhileImportDialog,tmpl_source:n._tmplSourceWhileImportDialog,tmpl_inject_mode:t}),n.templateGalleryExpanded(!1)):o.errare("::setupTmplGalleryDOMEvents => error => invalid import mode"):n.tmplInjectDialogVisible(!1)}).on("propertychange change click keyup input paste",".sek-filter-tmpl",_.debounce(function(e){e.preventDefault();var t,i,n,o,r,s,a=d(this).val(),l=function(){c.removeClass("search-active"),c.find(".sek-tmpl-item").each(function(){d(this).removeClass("search-match")})};_.isString(a)?(a=a.trim().toLowerCase(),_.isEmpty(a.replace(/\s/g,""))?l():(c.addClass("search-active"),c.find(".sek-tmpl-item").each(function(){t=(d(this).find(".tmpl-title").html()+"").toLowerCase(),i=(d(this).find(".tmpl-desc").html()+"").toLowerCase(),n=(d(this).find(".tmpl-date").html()+"").toLowerCase(),o=-1!=t.indexOf(a),r=-1!=i.indexOf(a),s=-1!=n.indexOf(a),d(this).toggleClass("search-match",o||r||s)}))):l()},100)).on("click",".sek-tmpl-info .edit-tmpl",function(e){e.preventDefault();var t=function(e){n.tmplDialogMode("edit"),n.tmplDialogMode.unbind(t)};n.tmplToEdit=d(this).closest("[data-sek-tmpl-item-id]").data("sek-tmpl-item-id"),n.tmplDialogMode.bind(t),n.tmplDialogVisible(!0)}).on("click",".sek-tmpl-info .remove-tmpl",function(e){e.preventDefault();var t=function(e){n.tmplDialogMode("remove"),n.tmplDialogMode.unbind(t)};n.tmplToRemove=d(this).closest("[data-sek-tmpl-item-id]").data("sek-tmpl-item-id"),n.tmplDialogMode.bind(t),n.tmplDialogVisible(!0)}).on("click",".sek-close-dialog",function(e){e.preventDefault(),n.templateGalleryExpanded(!1)}).on("click","#sek-tmpl-source-switcher button",function(e){e.preventDefault(),d("#sek-tmpl-source-switcher button").removeClass("is-selected").attr("aria-pressed","false"),d(this).addClass("is-selected").attr("aria-pressed","true"),n.renderOrRefreshTempGallery({tmpl_source:d(this).data("sek-tmpl-source")})})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(t,e){jQuery.extend(CZRSeksPrototype,t.Events);var i=t.Class.extend(CZRSeksPrototype);try{t.czr_sektions=new i}catch(e){t.errare("api.czr_sektions => problem on instantiation",e)}}(wp.customize),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{content_type_switcher:function(e){var i,n=this,o=r.czr_sektions;if(!r.section.has(n.module.control.section()))throw new Error("api.czrInputMap.content_type_switcher => section not registered");i=r.section(n.module.control.section());var t=function(t){n.container.find('[data-sek-content-type="'+(t||"module")+'"]').trigger("click"),a.each(i.controls(),function(e){a.isUndefined(e.content_type)||e.active(t===e.content_type)})};r.czr_sektions.currentContentPickerType=r.czr_sektions.currentContentPickerType||new r.Value,r.bind("nimble-modules-and-sections-controls-registered",function(){t(r.czr_sektions.currentContentPickerType())}),r.czr_sektions.currentContentPickerType.bind(function(e){t(e)}),r.czr_sektions.currentContentPickerType(n()),n.container.on("click","[data-sek-content-type]",function(e){e.preventDefault();var t=s(this).data("sek-content-type");if(n.container.find("[data-sek-content-type]").attr("aria-pressed",!1),o.levelTreeExpanded(!1),o.tmplDialogVisible&&o.tmplDialogVisible(!1),o.saveSectionDialogVisible&&o.saveSectionDialogVisible(!1),"template"===t){var i=r.czr_sektions.templateGalleryExpanded();s(this).attr("aria-pressed",!i),r.czr_sektions.templateGalleryExpanded(!i)}else r.czr_sektions.templateGalleryExpanded(!1),s(this).attr("aria-pressed",!0),r.czr_sektions.currentContentPickerType(t)}),r.bind("nb-template-gallery-closed",function(){n.container.find('[data-sek-content-type="template"]').attr("aria-pressed",!1)}),t(r.czr_sektions.currentContentPickerType())}})}(wp.customize,jQuery,_),function(t,e,i){t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{module_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"module",input_container:this.container})},section_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:this.container})}})}(wp.customize,jQuery,_),function(s,a,l){s.czrInputMap=s.czrInputMap||{},a.extend(s.czrInputMap,{module_option_switcher:function(e){var t=this;if(!s.section.has(t.module.control.section()))throw new Error(t.input_type+" => section not registered");s.section(t.module.control.section());var i,n="",o=t.module.control.params.sek_registration_params;if(l.isUndefined(o))throw new Error(t.input_type+" => missing registration params");if(o&&o.module_id&&(n=o.module_id,i=o.ui_action),l.isEmpty(n))throw new Error(t.input_type+" => missing module id");t.container.on("click","[data-sek-option-type]",function(e){e.preventDefault(),t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),a(this).addClass("is-selected").attr("aria-pressed",!0),s.previewer.trigger("settings"===a(this).data("sek-option-type")?"sek-edit-options":"sek-edit-module",{id:n,level:"module"})});var r="sek-generate-level-options-ui"===i?"settings":"content";t.container.find("[data-sek-option-type]").removeClass("is-selected").attr("aria-pressed",!1),t.container.find('[data-sek-option-type="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(c,d,p){c.czrInputMap=c.czrInputMap||{};var u=function(e){return p.contains(["px","em","%"],e)||(c.errare("error : invalid unit for input "+this.id,e),e="px"),e},_=function(i){var n=this;i.on("click",".sek-ui-button",function(e,t){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),d(this).addClass("is-selected").attr("aria-pressed",!0),n.css_unit(d(this).data("sek-unit"),t)}),i.find('.sek-ui-button[data-sek-unit="'+(n.initial_unit||"px")+'"]').addClass("is-selected").attr("aria-pressed",!0)},m=function(t,i){var n=this;t.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),t.find('input[type="number"]').each(function(){d(this).val("")}),n(i),d(".sek-unit-wrapper",t).find('[data-sek-unit="px"]').trigger("click")})};d.extend(c.czrInputMap,{spacing:function(e){var o=this,i=d(".sek-spacing-wrapper",o.container),t=c.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),n=p.isEmpty(t)||p.isEmpty(t.default)?[]:t.default;if(i.on("input",'input[type="number"]',function(e){var t=d(this).closest("[data-sek-spacing]").data("sek-spacing"),i=d.extend(!0,{},p.isObject(o())?o():{}),n=d(this).val();p.isString(n)&&!p.isEmpty(n)||p.isNumber(n)?i[t]=n:i=p.omit(i,t),o(i)}),m.call(o,i,n),p.isObject(o())){p.each(o(),function(e,t){d('[data-sek-spacing="'+t+'"]',i).find('input[type="number"]').val(e)});var r="px";d(".sek-unit-wrapper .sek-ui-button",o.container).each(function(){var e=d(this).data("sek-unit");p.isEmpty(o())||p.isEmpty(o().unit)||e===o().unit&&(r=e)}),d(".sek-unit-wrapper",o.container).find('[data-sek-unit="'+u.call(o,r)+'"]').trigger("click")}var s=o();o.initial_unit="px",p.isEmpty(s)||(o.initial_unit=p.isEmpty(s.unit)?"px":s.unit),o.css_unit=new c.Value(u.call(o,o.initial_unit)),o.css_unit.bind(function(e){var t;e=p.isEmpty(e)?"px":e,(t=d.extend(!0,{},p.isObject(o())?o():{})).unit=e,o(t)}),_.call(o,i)}}),d.extend(c.czrInputMap,{spacingWithDeviceSwitcher:function(e){var r=this,s=d(".sek-spacing-wrapper",r.container),t=c.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=p.isEmpty(t)||p.isEmpty(t.default)?{}:t.default,l=function(e,t){var i=["mobile","tablet","desktop"];if(p.has(e,t))return e[t];var n=p.findIndex(i,function(e){return t===e});return!p.isEmpty(t)&&n<i.length?l(e,i[n+1]):{}},i=function(e){var t=d.extend(!0,{},p.isObject(r())?r():{}),i=d.extend(!0,{},a);t=p.isObject(t)?d.extend(i,t):i;var n=l(t,e);d("[data-sek-spacing]",s).each(function(){var e=d(this).data("sek-spacing"),t="";p.isEmpty(n)||p.isEmpty(n[e])||(t=n[e]),d(this).find('input[type="number"]').val(t)});var o="px";d(".sek-unit-wrapper .sek-ui-button",r.container).each(function(){var e=d(this).data("sek-unit");p.isEmpty(n)||p.isEmpty(n.unit)||e===n.unit&&(o=e)}),d(".sek-unit-wrapper",r.container).find('[data-sek-unit="'+u.call(r,o)+'"]').trigger("click",{previewed_device_switched:!0})};c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r);var n=r();r.initial_unit="px",p.isEmpty(n)||p.isEmpty(n[r.previewedDevice()])||(r.initial_unit=p.isEmpty(n[r.previewedDevice()].unit)?"px":n[r.previewedDevice()].unit),r.css_unit=new c.Value(u.call(r,r.initial_unit)),s.on("input",'input[type="number"]',function(e){var t,i=d(this).closest("[data-sek-spacing]").data("sek-spacing"),n=d(this).val(),o=c.previewedDevice()||"desktop";(t=d.extend(!0,{},p.isObject(r())?r():{}))[o]=d.extend(!0,{},t[o]||{}),p.isString(n)&&!p.isEmpty(n)||p.isNumber(n)?t[o][i]=n:t[o]=p.omit(t[o],i),t[o].unit&&r.css_unit()==t[o].unit||(t[o].unit=r.css_unit()),r(t)}),m.call(r,s,a),r.previewedDevice.bind(function(e){try{i(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}),r.css_unit.bind(function(e,t,i){if(!p.isObject(i)||!0!==i.previewed_device_switched){e=p.isEmpty(e)?"px":e;var n,o=r.previewedDevice()||"desktop";(n=d.extend(!0,{},p.isObject(r())?r():{}))[o]=d.extend(!0,{},n[o]||{}),n[o].unit=e,r(n)}}),_.call(r,s);try{i(c.previewedDevice())}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}})}(wp.customize,jQuery,_),function(n,a,l){n.czrInputMap=n.czrInputMap||{},a.extend(n.czrInputMap,{bg_position:function(e){var t=this;a(".sek-bg-pos-wrapper",t.container).on("change",'input[type="radio"]',function(e){t(a(this).val())}),l.isEmpty(t())||t.container.find('input[value="'+t()+'"]').attr("checked",!0).trigger("click")},bgPositionWithDeviceSwitcher:function(e){var o=this,t=n.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),r=l.isEmpty(t)||l.isEmpty(t.default)?{}:t.default;n.czr_sektions.maybeSetupDeviceSwitcherForInput.call(o);var s=function(e,t){var i=["mobile","tablet","desktop"];if(l.has(e,t))return e[t];var n=l.findIndex(i,function(e){return t===e});return!l.isEmpty(t)&&n<i.length?s(e,i[n+1]):{}},i=function(e){var t=a.extend(!0,{},l.isObject(o())?o():{}),i=a.extend(!0,{},r);t=l.isObject(t)?a.extend(i,t):i;var n=s(t,e);o.container.find('input[value="'+n+'"]').attr("checked",!0).trigger("click",{previewed_device_switched:!0})};a(".sek-bg-pos-wrapper",o.container).on("change",'input[type="radio"]',function(e){var t,i=a(this).val();(t=a.extend(!0,{},l.isObject(o())?o():{}))[n.previewedDevice()||"desktop"]=i,o(t)}),o.previewedDevice.bind(function(e){try{i(e)}catch(e){n.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+o.id,e)}});try{i(n.previewedDevice())}catch(e){n.errare("Error when firing syncWithPreviewedDevice for input type bgPositionWithDeviceSwitcher for input id "+o.id,e)}}})}(wp.customize,jQuery,_),function(l,c,d){l.czrInputMap=l.czrInputMap||{};var e=function(e){var o=this,t=l.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),r=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i="verticalAlignWithDeviceSwitcher"===o.type?".sek-v-align-wrapper":".sek-h-align-wrapper",s=c(i,o.container);l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(o);var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var n=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&n<i.length?a(e,i[n+1]):{}},n=function(e){var t=c.extend(!0,{},d.isObject(o())?o():{}),i=c.extend(!0,{},r);t=d.isObject(t)?c.extend(i,t):i;var n=a(t,e);s.find(".selected").removeClass("selected"),s.find('div[data-sek-align="'+n+'"]').addClass("selected")};s.on("click","[data-sek-align]",function(e){var t;e.preventDefault(),(t=c.extend(!0,{},d.isObject(o())?o():{}))[l.previewedDevice()||"desktop"]=c(this).data("sek-align"),s.find(".selected").removeClass("selected"),c.when(c(this).addClass("selected")).done(function(){o(t)})}),o.previewedDevice.bind(function(e){try{n(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type : "+o.type+" for input id "+o.id,e)}});try{n(l.previewedDevice())}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type : "+o.type+" for input id "+o.id,e)}};c.extend(l.czrInputMap,{horizTextAlignmentWithDeviceSwitcher:e,horizAlignmentWithDeviceSwitcher:e,verticalAlignWithDeviceSwitcher:e})}(wp.customize,jQuery,_),function(f,g,h){f.czrInputMap=f.czrInputMap||{},g.extend(f.czrInputMap,{font_picker:function(e){var u=this,_=u.input_parent,n=function(e,t){_();var n=g('select[data-czrtype="'+u.id+'"]',u.container);h.isNull(u())||h.isEmpty(u())?n.append('<option value="none" selected="selected">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"):n.append('<option value="none">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>");var i=[{title:sektionsLocalizedData.i18n["Web safe fonts"],type:"cfont",list:t.cfonts},{title:sektionsLocalizedData.i18n["Google fonts"],type:"gfont",list:t.gfonts}],o=f.czr_sektions.sniffAllFonts(),r=sektionsLocalizedData.alreadyUsedFonts,s=[],a=[];if(!h.isEmpty(r)&&h.isObject(r)&&h.each(r,function(e){a.push(e)}),h.isArray(o)&&h.each(o,function(e){a.push(e)}),!h.isEmpty(a)){var l={},c=[];a.forEach(function(e){l[e]=(l[e]||0)+1});var d=h.sortBy(l,function(e){return e});h.each(d,function(i){h.each(l,function(e,t){i!==e||h.contains(c,t)||c.unshift(t)})}),h.each(c,function(e){s.push({name:e})}),i.unshift({title:sektionsLocalizedData.i18n["Already used fonts"],type:null,list:s})}h.each(i,function(e){var t,r,s,i=g("<optgroup>",{label:e.title,html:(t=e.list,r=e.type,s="",h.each(t,function(e){var t,i,n=h.isString(e.name)?e.name:"Undefined Font Family",o=n.replace(/[+|:]/g," ");t=n,i=r,n=h.isEmpty(i)?t:h.isString(t)?["[",i,"]",t].join(""):"",o=o.replace("[cfont]","").replace("[gfont]",""),n==u()?s+='<option selected="selected" value="'+n+'">'+o+"</option>":s+='<option value="'+n+'">'+o+"</option>"}),s)});n.append(i)});var p={escapeMarkup:function(e){return e}};e&&g.extend(p,{resultsAdapter:e,closeOnSelect:!1}),n.czrSelect2(p),g(".czrSelect2-selection__rendered",u.container).css(m(u()))},m=function(e){if(!h.isString(e)||h.isEmpty(e))return{};var t,i,n,o=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return t=r(e),i=o[1]?o[1].replace(/[^0-9.]+/g,""):400,i=h.isNumber(i)?i:400,n=o[1]&&-1!=o[1].indexOf("italic")?"italic":"",{"font-family":"none"==t?"inherit":t.replace(/[+|:]/g," "),"font-weight":i||400,"font-style":n||"normal"}},r=function(e){if(!h.isString(e)||h.isEmpty(e))return e;var t=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return h.isString(t[0])?t[0].replace(/[+|:]/g," "):""};g.when(function(){var e,t=g.Deferred();h.isEmpty(f.sek_fontCollections)?(h.isUndefined(f.sek_fetchingFontCollection)||"pending"!=f.sek_fetchingFontCollection.state()?(e=f.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"font_picker_input",module_id:u.module.id}),f.sek_fetchingFontCollection=e):e=f.sek_fetchingFontCollection,e.done(function(e){if("string"!=typeof e||"{"!==e[0])throw new Error("font_picker => server list is not JSON.parse-able");f.sek_fontCollections=JSON.parse(e),t.resolve(f.sek_fontCollections)}).fail(function(e){t.reject(e)})):t.resolve(f.sek_fontCollections);return t.promise()}()).done(function(t){var i;(i=g.Deferred(),void 0!==g.fn.czrSelect2&&void 0!==g.fn.czrSelect2.amd&&"function"==typeof g.fn.czrSelect2.amd.require?g.fn.czrSelect2.amd.require(["czrSelect2/results","czrSelect2/utils"],function(e,t){var n=function(e,t,i){n.__super__.constructor.call(this,e,t,i)};t.Extend(n,e),n.prototype.bind=function(e,t){var i=this;e.on("results:focus",function(e){"true"!=e.element.attr("aria-selected")&&i.trigger("select",{data:e.data})}),n.__super__.bind.call(this,e,t)},i.resolve(n)}):i.resolve(!1),i.promise()).done(function(e){n(e,t)})}).fail(function(e){f.errare("font_picker => fail response =>",e)})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{fa_icon_picker:function(){var n=this,o=!1,e=function(t){!0!==n.iconCollectionSet&&(s.when(s.Deferred(function(t){a.isEmpty(n.sek_faIconCollection)?r.CZR_Helpers.getModuleTmpl({tmpl:"icon_list",module_type:"fa_icon_picker_input",module_id:n.module.id}).done(function(e){if("string"!=typeof e||"["!==e[0])throw new Error("fa_icon_picker => server list is not JSON.parse-able");n.sek_faIconCollection=JSON.parse(e),t.resolve(n.sek_faIconCollection)}).fail(function(e){t.reject(e)}):t.resolve(n.sek_faIconCollection)})).done(function(e){!function(e){a.each(e,function(e){var t={value:e,html:r.CZR_Helpers.capitalize(e.substring(7))};t.value==n()&&(s.extend(t,{selected:"selected"}),o=!0),s("select[data-czrtype]",n.container).append(s("<option>",t))});var t,i=function(e){return e.id?s('<span class="'+e.element.value+'"></span><span class="social-name">&nbsp;&nbsp;'+e.text+"</span>"):e.text};t=o?s("<option>"):s("<option>",{selected:"selected"}),s("select[data-czrtype]",n.container).prepend(t).czrSelect2({templateResult:i,templateSelection:i,placeholder:sektionsLocalizedData.i18n["Select an icon"],allowClear:!0})}(e),t&&!0===t.open_on_init&&a.delay(function(){try{s("select[data-czrtype]",n.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){r.errare("fa_icon_picker => fail response =>",e)}),n.iconCollectionSet=!0)};n.container.on("click",function(){e()}),a.delay(function(){e({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(u,_,m){u.czrInputMap=u.czrInputMap||{},_.extend(u.czrInputMap,{code_editor:function(e){var n,r=this,i=this.module.control,o=(r.input_parent(),!1),s=r.container.find("textarea"),a=r.container.find(".customize-control-title"),l=function(){return _.Deferred(function(t){var i=m.isEmpty(s.data("editor-code-type"))?"text/html":s.data("editor-code-type");u.czr_sektions.code_editor_params&&u.czr_sektions.code_editor_params[i]?t.resolve(u.czr_sektions.code_editor_params[i]):wp.ajax.post("sek_get_code_editor_params",{nonce:u.settings.nonce.save,code_type:i}).done(function(e){m.isObject(e)||u.errare(r.id+" => error => invalid code editor params sent by server",e),u.czr_sektions.code_editor_params={},u.czr_sektions.code_editor_params[i]=e,t.resolve(u.czr_sektions.code_editor_params[i])}).fail(function(e){t.reject(e)})})};r.isReady.done(function(){var t=function(e){m.isEmpty(this.editor)&&(m.isEmpty(this.module.control.container.attr("data-sek-expanded"))||"false"==this.module.control.container.attr("data-sek-expanded")||setTimeout(function(){if(o)try{c(o)}catch(e){u.errare("error in sek_control => code_editor() input",e),d()}else d();a.trigger("click")},10))};n=r(),u.czr_sektions.isJsonString(n)&&(n=JSON.parse(n)),s.html(n),_.when(l()).done(function(e){wp.codeEditor&&(m.isUndefined(e)||!1!==e)&&(o=e),t.call(r),r.module.control.container.first().one("sek-accordion-expanded",function(){t.call(r)})}).fail(function(e){u.errare(r.id+" => error when getting the editor params from server")})});var c=function(e){var t,i=!1;t=m.extend({},e,{onTabNext:CZRSeksPrototype.selectNextTabbableOrFocusable(":tabbable"),onTabPrevious:CZRSeksPrototype.selectPrevTabbableOrFocusable(":tabbable"),onUpdateErrorNotice:p}),r.editor=wp.codeEditor.initialize(s,t),_(r.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-label":a.html(),"aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),a.on("click",function(e){e.stopPropagation(),r.editor.codemirror.focus()}),r.editor.codemirror.on("change",function(e){i=!0,s.val(e.getValue()).trigger("change"),i=!1}),n=r(),u.czr_sektions.isJsonString(n)&&(n=JSON.parse(n)),r.editor.codemirror.setValue(n),r.bind(r.id+":changed",function(e){i||r.editor.codemirror.setValue(e)}),r.editor.codemirror.on("keydown",function(e,t){27===t.keyCode&&t.stopPropagation()})},d=function(){var o=s[0];r.editor=o,s.on("blur",function(){s.data("next-tab-blurs",!1)}),s.on("keydown",function(e){var t,i,n;27!==e.keyCode?9!==e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||s.data("next-tab-blurs")||(t=o.selectionStart,i=o.selectionEnd,n=o.value,0<=t&&(o.value=n.substring(0,t).concat("\t",n.substring(i)),s.selectionStart=o.selectionEnd=t+1),e.stopPropagation(),e.preventDefault()):s.data("next-tab-blurs")||(s.data("next-tab-blurs",!0),e.stopPropagation())})},p=function(e){var t;i.setting.notifications.remove(r.id),0!==e.length&&(t=1===e.length?sektionsLocalizedData.i18n.codeEditorSingular.replace("%d","1").replace("%s",a.html()):sektionsLocalizedData.i18n.codeEditorPlural.replace("%d",String(e.length)).replace("%s",a.html()),i.setting.notifications.add(r.id,new u.Notification(r.id,{message:t,type:"warning"})))}}})}(wp.customize,jQuery,_),function(e,r,t){e.czrInputMap=e.czrInputMap||{},r.extend(e.czrInputMap,{range_simple:function(e){var t=this,i=r(".sek-range-with-unit-picker-wrapper",t.container),n=i.find('input[type="number"]'),o=i.find('input[type="range"]');o.on("input",function(e){n.val(r(this).val()).trigger("input")}),n.on("input",function(e){t(r(this).val()),o.val(r(this).val())}),o.val(n.val()||0)},number_simple:function(e){var t=this;t.container.find('input[type="number"]').on("input",function(e){t(r(this).val())})}})}(wp.customize,jQuery,_),function(d,p,u){d.czrInputMap=d.czrInputMap||{},p.extend(d.czrInputMap,{range_simple_device_switcher:function(e){var s=this,t=p(".sek-range-with-unit-picker-wrapper",s.container),a=t.find('input[type="number"]'),r=t.find('input[type="range"]'),i=d.czr_sektions.getInputRegistrationParams(s.id,s.module.module_type),l=u.isEmpty(i)||u.isEmpty(i.default)?{}:i.default,c=function(e,t){var i=["mobile","tablet","desktop"];if(u.has(e,t))return e[t];var n=u.findIndex(i,function(e){return t===e});return!u.isEmpty(t)&&n<i.length?c(e,i[n+1]):p.extend(!0,{desktop:""},l).desktop},n=function(e){var t=s(),i={};i=p.extend(!0,{},l),u.isObject(t)?i=p.extend(!0,{},t):u.isString(t)&&!u.isEmpty(t)&&(i={desktop:t});var n,o=c(i,e),r=(n=o,u.isEmpty(n)||!u.isString(n)?"16":n.replace(/px|em|%/g,""));a.val(r).trigger("input",{previewed_device_switched:!0})};d.czr_sektions.maybeSetupDeviceSwitcherForInput.call(s),r.on("input",function(e){a.val(p(this).val()).trigger("input")}),a.on("input",function(e,t){var i,n=d.previewedDevice()||"desktop",o=p(this).val();(i=p.extend(!0,{},u.isObject(s())?s():{}))[n]=p.extend(!0,{},i[n]||{}),u.isString(o)&&!u.isEmpty(o)&&(i[n]=o),(u.isEmpty(t)||u.isObject(t)&&!0!==t.previewed_device_switched)&&s(i),r.val(p(this).val())}),s.previewedDevice.bind(function(e){try{n(e)}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}),r.val(a.val()||0);try{n(d.previewedDevice())}catch(e){d.errare("Error when firing syncWithPreviewedDevice for input type "+s.type+" for input id "+s.id,e)}}})}(wp.customize,jQuery,_),function(a,l,c){a.czrInputMap=a.czrInputMap||{},l.extend(a.czrInputMap,{range_with_unit_picker:function(e){var t=this,i=l(".sek-range-with-unit-picker-wrapper",t.container),n=i.find('input[type="number"]'),o=i.find('input[type="range"]'),r=i.find("input[data-czrtype]").data("sek-unit"),s=function(e){return c.contains(["px","em","%"],e)||(a.errare("error : invalid unit for input "+t.id,e),e="px"),e};t.css_unit=new a.Value(c.isEmpty(r)?"px":s(r)),t.css_unit.bind(function(e){e=c.isEmpty(e)?"px":e,i.find('input[type="number"]').trigger("input")}),o.on("input",function(e){n.val(l(this).val()).trigger("input")}),n.on("input",function(e){t(l(this).val()+s(t.css_unit())),o.val(l(this).val())}),o.val(n.val()||0),i.on("click",".sek-ui-button",function(e){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),l(this).addClass("is-selected").attr("aria-pressed",!0),i.find("input[data-czrtype]").data("sek-unit",l(this).data("sek-unit")),t.css_unit(l(this).data("sek-unit"))}),i.find('.sek-ui-button[data-sek-unit="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(a,_,m){a.czrInputMap=a.czrInputMap||{},_.extend(a.czrInputMap,{range_with_unit_picker_device_switcher:function(e){var l=this,c=_(".sek-range-with-unit-picker-wrapper",l.container),d=c.find('input[type="number"]'),r=c.find('input[type="range"]'),s=function(e){return m.contains(["px","em","%"],e)||(a.errare("range_with_unit_picker_device_switcher => error : invalid unit for input "+l.id,e),e="px"),e},t=a.czr_sektions.getInputRegistrationParams(l.id,l.module.module_type),p=m.isEmpty(t)||m.isEmpty(t.default)?{}:t.default,i=function(){return c.find("input[data-czrtype]").data("sek-unit")||"px"},u=function(e,t){var i=["mobile","tablet","desktop"];if(m.has(e,t))return e[t];var n=m.findIndex(i,function(e){return t===e});return!m.isEmpty(t)&&n<i.length?u(e,i[n+1]):_.extend(!0,{desktop:""},p).desktop},n=function(e){var t=l(),i={};i=_.extend(!0,{},p),m.isObject(t)?i=_.extend(!0,{},t):m.isString(t)&&!m.isEmpty(t)&&(i={desktop:t});var n,o,r=u(i,e),s=(o=r,m.isEmpty(o)||!m.isString(o)?"px":o.replace(/[0-9]|\.|,/g,"")),a=(n=r,m.isEmpty(n)||!m.isString(n)?"16":n.replace(/px|em|%/g,""));_(".sek-unit-wrapper",c).find('[data-sek-unit="'+s+'"]').trigger("click",{previewed_device_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+s+'"]').addClass("is-selected").attr("aria-pressed",!0),d.val(a).trigger("input",{previewed_device_switched:!0})};a.czr_sektions.maybeSetupDeviceSwitcherForInput.call(l),l.css_unit=new a.Value(m.isEmpty(i())?"px":s(i()));var o='<button type="button" class="button sek-reset-button sek-float-right">'+sektionsLocalizedData.i18n.Reset+"</button>";l.container.find(".customize-control-title").append(o),l.css_unit.bind(function(e,t,i){m.isObject(i)&&!0===i.previewed_device_switched||d.trigger("input")}),r.on("input",function(e){d.val(_(this).val()).trigger("input")}),d.on("input",function(e,t){var i,n=a.previewedDevice()||"desktop",o=_(this).val()+s(l.css_unit());(i=_.extend(!0,{},m.isObject(l())?l():{}))[n]=_.extend(!0,{},i[n]||{}),m.isString(o)&&!m.isEmpty(o)&&(i[n]=o),(m.isEmpty(t)||m.isObject(t)&&!0!==t.previewed_device_switched)&&l(i),r.val(_(this).val())}),c.on("click",".sek-ui-button",function(e,t){e.stopPropagation(),c.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),_(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",_(this).data("sek-unit")),l.css_unit(_(this).data("sek-unit"),t)}),l.previewedDevice.bind(function(e){try{n(e)}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+l.id,e)}}),l.container.on("click",".sek-reset-button",function(e){var t=a.previewedDevice(),i=_.extend(!0,{},m.isObject(l())?l():{});m.isEmpty(i[t])||(i=m.omit(i,t),l(i),n(a.previewedDevice()))}),r.val(d.val()||0);try{n(a.previewedDevice())}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+l.id,e)}}})}(wp.customize,jQuery,_),function(g,h,v){g.czrInputMap=g.czrInputMap||{},h.extend(g.czrInputMap,{borders:function(e){var a=this,l=h(".sek-borders",a.container),c=l.find('input[type="number"]'),d=l.find('input[type="range"]'),p=l.find(".sek-alpha-color-input"),u=function(e){return v.contains(["px","em","%"],e)||(g.errare("borders => error : invalid unit for input "+a.id,e),e="px"),e},_=function(e){return v.isEmpty(e)||!v.isString(e)?"16":e.replace(/px|em|%/g,"")},m=function(e){return v.isEmpty(e)||!v.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=g.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),f=v.isEmpty(t)||v.isEmpty(t.default)?{}:t.default;a.cssBorderTypes=["top","left","right","bottom"];var i,n,o=function(){var e=a(),t="px";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.wght)&&(t=u(m(e._all_.wght))),t},r=function(){var e=a(),t="#000000";return v.isObject(e)&&v.has(e,"_all_")&&v.isObject(e._all_)&&!v.isEmpty(e._all_.col)&&(t=e._all_.col),t},s=function(e){if(!v.contains(v.union(a.cssBorderTypes,["_all_"]),e))throw new Error("Error in syncWithBorderType : the border type must be one of those values '_all_', 'top', 'left', 'right', 'bottom'");var t=a(),i={},n=h.extend(!0,{},f);v.isObject(t)?i=h.extend(!0,{},t):v.isString(t)&&(i={_all_:{wght:t}});var o,r,s=function(e,t){var i,n=h.extend(!0,{},f);if(!v.has(n,"_all_"))throw new Error("Error when firing getCurrentBorderTypeOrAllValue : the default value of the borders input must be php registered as an array formed : array( 'wght' => '1px', 'col' => '#000000' )");return i=v.isObject(e)&&v.has(e,"_all_")?v.extend(n._all_,e._all_):n._all_,v.has(e,t)&&v.isObject(e[t])?v.extend(i,e[t]):n._all_}(i=h.extend(n,i),e);if(v.isEmpty(s)||!v.isObject(s)||v.isEmpty(s.wght)||v.isEmpty(s.col))throw new Error("Error in syncWithBorderType : getCurrentBorderTypeOrAllValue must return an object formed : array( 'wght' => '1px', 'col' => '#000000' )");o=m(s.wght),r=_(s.wght),h(".sek-unit-wrapper",l).find('[data-sek-unit="'+o+'"]').trigger("click",{border_type_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+o+'"]').addClass("is-selected").attr("aria-pressed",!0),c.val(r).trigger("input",{border_type_switched:!0}),p.data("border_type_switched",!0),p.val(s.col).trigger("change"),p.data("border_type_switched",!1)};a.borderColor=new g.Value(v.isEmpty(r())?"#000000":r()),a.css_unit=new g.Value(v.isEmpty(o())?"px":u(o())),a.borderType=new g.Value("_all_"),c.val((i=a(),n=1,v.isObject(i)&&v.has(i,"_all_")&&v.isObject(i._all_)&&!v.isEmpty(i._all_.wght)&&(n=_(i._all_.wght)),n=parseInt(n,10),(!v.isNumber(n)||n<0)&&(g.errare("Error in borders input type for module : "+a.module.module_type+" the initial border width is invalid : "+n),n=1),n)),p.val(a.borderColor()),p.wpColorPicker({palettes:!0,width:1440<=window.innerWidth?271:251,change:function(e,t){h(this).val(t.color.toString()).trigger("colorpickerchange"),a.borderColor(t.color.toString(),{border_type_switched:!0===h(this).data("border_type_switched")})},clear:function(e,t){h(this).val("").trigger("colorpickerchange"),a.borderColor("")}}),a.css_unit.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_unit)&&c.trigger("input",i)}),a.borderColor.bind(function(e,t,i){(!v.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_color)&&c.trigger("input",i)}),a.borderType.bind(function(e){try{s(e)}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}}),d.on("input",function(e){c.val(h(this).val()).trigger("input")}),c.on("input",function(e,t){var i,n=a.borderType()||"_all_",o=a.borderColor(),r=h(this).val()+u(a.css_unit()),s=h.extend(!0,{},f);(i=h.extend(!0,{},v.isObject(a())?a():s))[n]=h.extend(!0,{},i[n]||s[n]),v.isString(r)&&!v.isEmpty(r)&&(i[n].wght=r),i[n].col=o,(v.isEmpty(t)||v.isObject(t)&&!0!==t.border_type_switched)&&("_all_"===n&&v.each(a.cssBorderTypes,function(e){i=v.omit(i,e)}),a(i)),d.val(h(this).val())}),l.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),l.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",h(this).data("sek-unit")),a.css_unit(h(this).data("sek-unit"),t)}),l.on("click","[data-sek-border-type]",function(e,t){e.preventDefault(),l.find("[data-sek-border-type]").removeClass("is-selected").attr("aria-pressed",!1),h(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=h(this).data("sek-border-type")}catch(e){g.errare("borders input type => error when attaching click event",e)}a.borderType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.borderType()||"_all_",i=h.extend(!0,{},v.isObject(a())?a():{});v.isEmpty(i[t])||(i=v.omit(i,t),a(i),s(t))}),d.val(c.val()||0);try{s(a.borderType())}catch(e){g.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}h('[data-sek-unit="'+a.css_unit()+'"]',l).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(m,f,g){m.czrInputMap=m.czrInputMap||{},f.extend(m.czrInputMap,{border_radius:function(e){var a=this,l=f(".sek-borders",a.container),c=l.find('input[type="number"]'),s=l.find('input[type="range"]'),d=function(e){return g.contains(["px","em","%"],e)||(m.errare("border_radius => error : invalid unit for input "+a.id,e),e="px"),e},p=function(e){return g.isEmpty(e)||!g.isString(e)?"16":e.replace(/px|em|%/g,"")},u=function(e){return g.isEmpty(e)||!g.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=m.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),_=g.isEmpty(t)||g.isEmpty(t.default)?{}:t.default;a.cssRadiusTypes=["top_left","top_right","bottom_right","bottom_left"];var i,n,o=function(){var e=a(),t="px";return g.isObject(e)&&g.has(e,"_all_")&&(t=d(u(e._all_))),t},r=function(e){if(!g.contains(["_all_","top_left","top_right","bottom_right","bottom_left"],e))throw new Error("Error in syncWithRadiusType : the radius type must be one of those values '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left', => radius type => "+e);var t=a(),i={},n=f.extend(!0,{},_);g.isObject(t)?i=f.extend(!0,{},t):g.isString(t)&&(i={_all_:"0px"});var o,r,s=function(e,t){var i,n=f.extend(!0,{},_);if(!g.has(n,"_all_"))throw new Error("Error when firing getCurrentRadiusTypeOrAllValue : the default value of the border_radius input must be php registered as an array");return i=g.isObject(e)&&g.has(e,"_all_")?e._all_:n._all_,g.has(e,t)?e[t]:i}(i=f.extend(n,i),e);if(g.isEmpty(s)||!g.isString(s))throw new Error("Error in syncWithRadiusType : getCurrentRadiusTypeOrAllValue must return a string like 3em");o=u(s),r=p(s),f(".sek-unit-wrapper",l).find('[data-sek-unit="'+o+'"]').trigger("click",{radius_type_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+o+'"]').addClass("is-selected").attr("aria-pressed",!0),c.val(r).trigger("input",{radius_type_switched:!0})};a.css_unit=new m.Value(g.isEmpty(o())?"px":d(o())),a.radiusType=new m.Value("_all_"),c.val((i=a(),n=0,g.isObject(i)&&g.has(i,"_all_")&&(n=p(i._all_)),n=parseInt(n,10),(!g.isNumber(n)||n<0)&&(m.errare("Error in border_radius input type for module : "+a.module.module_type+" the initial radius is invalid : "+n),n=0),n)),a.css_unit.bind(function(e,t,i){(!g.isObject(i)||!0!==i.radius_type_switched&&!0!==i.initializing_the_unit)&&c.trigger("input",i)}),a.radiusType.bind(function(e){try{r(e)}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}}),s.on("input",function(e){c.val(f(this).val()).trigger("input")}),c.on("input",function(e,t){var i,n=a.radiusType()||"_all_",o=f(this).val()+d(a.css_unit()),r=f.extend(!0,{},_);(i=f.extend(!0,{},g.isObject(a())?a():r))[n]=f.extend(!0,{},i[n]||r[n]),g.isString(o)&&!g.isEmpty(o)&&(i[n]=o),(g.isEmpty(t)||g.isObject(t)&&!0!==t.radius_type_switched)&&("_all_"===n&&g.each(a.cssRadiusTypes,function(e){i=g.omit(i,e)}),a(i)),s.val(f(this).val())}),l.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),l.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",f(this).data("sek-unit")),a.css_unit(f(this).data("sek-unit"),t)}),l.on("click","[data-sek-radius-type]",function(e,t){e.preventDefault(),l.find("[data-sek-radius-type]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=f(this).data("sek-radius-type")}catch(e){m.errare("border_radius input type => error when attaching click event",e)}a.radiusType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.radiusType()||"_all_",i=f.extend(!0,{},g.isObject(a())?a():{});g.isEmpty(i[t])||(i=g.omit(i,t),a(i),r(t))}),s.val(c.val()||0);try{r(a.radiusType())}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}f('[data-sek-unit="'+a.css_unit()+'"]',l).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{buttons_choice:function(e){var n=this,o=s(".sek-button-choice-wrapper",n.container),t=o.find('input[type="number"]'),i=r.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);a.isEmpty(i)||a.isEmpty(i.default)||i.default;t.val(n()),o.on("click","[data-sek-choice]",function(e,t){var i;e.stopPropagation(),o.find("[data-sek-choice]").removeClass("is-selected").attr("aria-pressed",!1),s(this).addClass("is-selected").attr("aria-pressed",!0);try{i=s(this).data("sek-choice")}catch(e){r.errare("buttons_choice input type => error when attaching click event",e)}n(i)}),s('[data-sek-choice="'+n()+'"]',o).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(n,o,r){n.czrInputMap=n.czrInputMap||{},o.extend(n.czrInputMap,{reset_button:function(e){this.container.on("click","[data-sek-reset-scope]",function(e,t){e.stopPropagation();var i=o(this).data("sek-reset-scope");!r.isEmpty(i)&&r.contains(["local","global"],i)?n.czr_sektions.updateAPISetting({action:"sek-reset-collection",scope:i}).done(function(e){n.previewer.refresh(),n.previewer.trigger("sek-notify",{notif_id:"reset-success",type:"success",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset complete"],"</strong>","</span>"].join("")})}).fail(function(e){n.errare("reset_button input => error when firing ::updateAPISetting",e),n.previewer.trigger("sek-notify",{notif_id:"reset-failed",type:"error",duration:8e3,message:["<span>","<strong>",sektionsLocalizedData.i18n["Reset failed"],"<br/>","<i>"+e+"</i>","</strong>","</span>"].join("")})}):n.errare("reset_button input => invalid scope provided.",i)})}})}(wp.customize,jQuery,_),function(i,r,s){i.czrInputMap=i.czrInputMap||{},r.extend(i.czrInputMap,{revision_history:function(e){var o=this;_selected_found=!1;var t=function(t){!0!==o.revisionHistorySet&&(r.when(r.Deferred(function(t){s.isEmpty(o.sek_revisionHistory)?i.czr_sektions.getRevisionHistory({is_local:"local_revisions"===o.id}).done(function(e){if(!s.isObject(e))throw new Error("_getRevisionHistory => server list is not a object");o.sek_revisionHistory=e,t.resolve(o.sek_revisionHistory)}).fail(function(e){t.reject(e)}):t.resolve(o.sek_revisionHistory)})).done(function(e){!function(e){if(!(0<o.container.find(".sek-revision-history").length))if(s.isEmpty(e))o.container.append(["<i>",sektionsLocalizedData.i18n["No revision history available for the moment."],"</i>"].join(""));else{o.container.append(r("<select/>",{class:"sek-revision-history",html:['<option value="_select_">'," -",sektionsLocalizedData.i18n.Select,"- ","</option>"].join("")}));var n=[];s.each(e,function(e,t){var i={value:t,html:e};i.value==o()&&(r.extend(i,{selected:"selected"}),_selected_found=!0),n.unshift(r("<option>",i))}),n[0].html([n[0].html(),sektionsLocalizedData.i18n["(currently published version)"]].join(" ")),s.each(n,function(e){r("select.sek-revision-history",o.container).append(e)}),r("select.sek-revision-history",o.container).selecter()}}(e),t&&!0===t.open_on_init&&s.delay(function(){try{r("select[data-czrtype]",o.container).czrSelect2("open")}catch(e){}},100)}).fail(function(e){i.errare("_getRevisionHistory => fail response =>",e)}),o.revisionHistorySet=!0)};o.container.on("change",".sek-revision-history",function(){var e=r(this).val();"_select_"!==e&&i.czr_sektions.setSingleRevision({revision_post_id:e,is_local:"local_revisions"===o.id})}),s.delay(function(){t({open_on_init:!1})},1e3)}})}(wp.customize,jQuery,_),function(_,m,f){_.czrInputMap=_.czrInputMap||{},m.extend(_.czrInputMap,{nimble_tinymce_editor:function(){var t=this,e=t.container.find("textarea").first(),i=0<e.length?e.attr("id"):null,n=_.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type),o=sektionsLocalizedData.defaultToolbarBtns;if(f.isNull(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => missing textarea for module :"+t.module.id);if(tinyMCE.get(i))throw new Error("api.czrInputMap.nimble_tinymce_editor => duplicate editor id.");var r,s,a=function(){return n&&n.editor_params&&!0===n.editor_params.autop},l={tinymce:{toolbar1:function(){var e=o.split(",");if(n.editor_params&&f.isArray(n.editor_params.excludedBtns)){var t=n.editor_params.excludedBtns;e=f.filter(e,function(e){return!f.contains(t,e)})}if(n.editor_params&&f.isString(n.editor_params.includedBtns)){var i=n.editor_params.includedBtns;f.isEmpty(i)||!f.isArray(sektionsLocalizedData[i])?_.errare("nimble_tinymce_editor input => invalid set of buttons provided",i):(i=sektionsLocalizedData[i],e=f.filter(e,function(e){return f.contains(i,e)}))}return e.join(",")}(),content_css:(r=wp.editor.getDefaultSettings(),s=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],r&&r.tinymce&&r.tinymce.content_css&&(s=f.union(r.tinymce.content_css.split(","),s)),s.join(",")),min_height:40,height:n.editor_params&&f.isNumber(n.editor_params.height)?n.editor_params.height:_.czr_sektions.TINYMCE_EDITOR_HEIGHT},quicktags:{buttons:"strong,em,link,code"},mediaButtons:!n.editor_params||!1!==n.editor_params.media_button};l.tinymce.wpautop=a(),a()||(l.tinymce.forced_root_block=""),wp.editor.initialize(i,l);var c=tinyMCE.get(i);if(!c)throw new Error("setupTinyMceEditor => missing editor instance for module :"+t.module.id);_.czrActiveWPEditors=_.czrActiveWPEditors||[];var d=m.extend(!0,[],_.czrActiveWPEditors);d.push(i),_.czrActiveWPEditors=d;var p,u=function(){p=t(),_.czr_sektions.isJsonString(p)&&(p=JSON.parse(p)),e.html(p),c.setContent(p)};c.initialized?u():c.on("init",u),c.on("input change keyup",function(e){t(c.getContent())})},detached_tinymce_editor:function(){var e,t=this,i=m("textarea#"+sektionsLocalizedData.idOfDetachedTinyMceTextArea),n=_.czr_sektions.getInputRegistrationParams(t.id,t.module.module_type);if(!(0<i.length))throw new Error("api.czrInputMap::detached_tinymce_editor => missing textarea element");if(e=i.attr("id"),window.tinymce&&(mceInstance=window.tinymce.get(e),mceInstance&&mceInstance.remove()),!window.nimbleTinyMCEPreInit||!window.nimbleTinyMCEPreInit.mceInit||!window.nimbleTinyMCEPreInit.mceInit[e])throw new Error("setupDetachedTinyMceEditor => invalid nimbleTinyMCEPreInit global var");var o,r,s=nimbleTinyMCEPreInit.mceInit[e];s.content_css=(o=wp.editor.getDefaultSettings(),r=[sektionsLocalizedData.tinyMceNimbleEditorStylesheetUrl],o&&o.tinymce&&o.tinymce.content_css&&(r=f.union(o.tinymce.content_css.split(","),r)),r.join(","));var a=t.input_parent,l=function(){var e=a();return f.isUndefined(e.autop)?n&&n.editor_params&&!0===n.editor_params.autop:e.autop};s.wpautop=l(),l()||(s.forced_root_block=""),s.toolbar1=sektionsLocalizedData.defaultToolbarBtns,s.toolbar2="",window.tinymce.init(s),window.QTags.getInstance(e);var c=tinyMCE.get(e);if(!c)throw new Error("setupDetachedTinyMceEditor => missing editor instance for module :"+t.module.id);var d,p=function(){d=t(),_.czr_sektions.isJsonString(d)&&(d=JSON.parse(d)),c.setContent(d),_.sekEditorExpanded(!0),m(window).trigger("resize")};c.initialized?p():c.on("init",p),c.on("input change keyup keydown click SetContent BeforeSetContent",function(e){t(l()?c.getContent():wp.editor.removep(c.getContent()))}),_.sekCurrentDetachedTinyMceInput=t,i.data("czr-bound-for-detached-editor")||(i.on("input",function(e,t){_.sekCurrentDetachedTinyMceInput(m(this).val())}),i.data("czr-bound-for-detached-editor",!0))}})}(wp.customize,jQuery,_),function(c,d,p){c.czrInputMap=c.czrInputMap||{},d.extend(c.czrInputMap,{import_export:function(){var r=this,t=r.container.find('button[data-czr-action="sek-pre-import"]'),s=r.container.find("input[name=sek-import-file]"),e=c.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=e.scope,l="local"===e.scope?c.czr_sektions.localSectionsSettingId():c.czr_sektions.getGlobalSectionsSettingId();p.contains(["local","global"],a)||c.errare("api.czrInputMap.import_export => invalid currentScope",a),s.on("change",function(e){t.toggleClass("disabled",p.isEmpty(d(this).val()))});r.container.on("click","[data-czr-action]",function(e){var i,t;switch(e.stopPropagation(),d(this).data("czr-action")){case"sek-export":if(i=!1,t=wp.customize.dirtyValues(),p.isEmpty(t)||p.each(t,function(e,t){i||(i=-1!==t.indexOf("nimble"))}),i){alert(sektionsLocalizedData.i18n["You need to publish before exporting."]);break}var n=c(l)(),o=!0;if(p.each(n.collection,function(e){o&&(p.isEmpty(e.collection)||(o=!1))}),o){alert(sektionsLocalizedData.i18n["Nothing to export."]);break}c.czr_sektions.export_template({scope:a});break;case"sek-pre-import":if(p.isEmpty(c.czr_sektions.activeLocations())){alert(sektionsLocalizedData.i18n["The current page has no available locations to import Nimble Builder sections."]);break}c.czr_sektions.import_template_from_file({pre_import_check:!0,input:r,file_input:s}).done(function(e){c.czr_sektions.pre_checks_from_file_import(e,{pre_import_check:!1,input:r,file_input:s})}).fail(function(e){c.errare("import_export_ input => pre_checks_from_file_import failed",e),c.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s}),c.czr_sektions.import_template_from_file({input:r,file_input:s})});break;case"sek-import-as-is":c.czr_sektions.import_template_from_file({input:r,file_input:s});break;case"sek-import-assign":c.czr_sektions.import_template_from_file({assign_missing_locations:!0,input:r,file_input:s});break;case"sek-cancel-import":c.czr_sektions.doAlwaysAfterFileImportAndApiSettingUpdate({input:r,file_input:s})}})}})}(wp.customize,jQuery,_),function(l,c,d){l.czrInputMap=l.czrInputMap||{},c.extend(l.czrInputMap,{simpleselect:function(e){l.czr_sektions.setupSelectInput.call(this,e)},multiselect:function(e){l.czr_sektions.setupSelectInput.call(this,e)},simpleselectWithDeviceSwitcher:function(e){var r=this,t=(r.input_parent,r.module,l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type)),o=c("select",r.container),s=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i={params:e=d.isEmpty(e)?t.choices:e};if(r.module.trigger("nimble-set-select-input-options",i),e=i.params,!d.isEmpty(e)&&d.isObject(e)){d.each(e,function(e,t){var i={value:t,html:e};t==r()?c.extend(i,{selected:"selected"}):"px"===t&&c.extend(i,{selected:"selected"}),o.append(c("<option>",i))});var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var n=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&n<i.length?a(e,i[n+1]):c.extend(!0,{desktop:""},s).desktop};l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r),o.on("change",function(e,t){var i,n=l.previewedDevice()||"desktop",o=c(this).val();(i=c.extend(!0,{},d.isObject(r())?r():{}))[n]=c.extend(!0,{},i[n]||{}),d.isString(o)&&!d.isEmpty(o)&&(i[n]=o),(d.isEmpty(t)||d.isObject(t)&&!0!==t.previewed_device_switched)&&r(i)}),r.previewedDevice.bind(function(e){try{!function(e){var t=r(),i={};i=c.extend(!0,{},s),d.isObject(t)?i=c.extend(!0,{},t):d.isString(t)&&!d.isEmpty(t)&&(i={desktop:t});var n=a(i,e);o.val(n).trigger("change",{previewed_device_switched:!0})}(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type "+r.type+" for input id "+r.id,e)}})}else l.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+r.id+" in module "+r.module.module_type)}})}(wp.customize,jQuery,_),function(a,l,c){a.czrInputMap=a.czrInputMap||{},l.extend(a.czrInputMap,{category_picker:function(e){var n=this,o=l("select[data-czrtype]",n.container),r=function(){var e=n();return e=c.isString(e)?[e]:e,c.isArray(e)?e:[]},t=function(t){!0!==n.catCollectionSet&&(l.when(l.Deferred(function(i){c.isEmpty(a.czr_sektions.post_categories)?wp.ajax.post("sek_get_post_categories",{nonce:a.settings.nonce.save}).done(function(e){c.isArray(e)||a.errare(n.id+" => error => invalid category collection sent by server");var t={};c.each(e,function(e){c.isEmpty(e.slug)||c.isEmpty(e.name)?i.reject("missing slug or name for at least one category"):t[e.slug]=e.name}),a.czr_sektions.post_categories=t,i.resolve(a.czr_sektions.post_categories)}).fail(function(e){i.reject(e)}):i.resolve(a.czr_sektions.post_categories)})).done(function(e){i(e),t&&!0===t.open_on_init&&c.delay(function(){try{o.czrSelect2("open")}catch(e){}},100)}).fail(function(e){a.errare(n.id+" => fail response when _getCategoryCollection()",e)}),n.catCollectionSet=!0)},i=function(e){c.each(e,function(e,t){var i={value:t,html:e};c.contains(r(),t)&&l.extend(i,{selected:"selected"}),o.append(l("<option>",i))}),o.czrSelect2({closeOnSelect:!0,templateSelection:function(e){return e.text.replace(/\u2013|\u2014/g,"")}}),o.on("change",function(){0===l(this).find("option:selected").length&&n([])})},s={};c.each(r(),function(e){s[e]=(e+"").replace(/-/g," ")}),i(s),n.container.on("click",function(){!0!==n.catCollectionSet&&(o.czrSelect2("destroy"),l.when(o.find("option").remove()).done(function(){t({open_on_init:!0})}))})}})}(wp.customize,jQuery,_),function(r,s,e){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{grid_layout:function(e){var n=this,o=s(".sek-grid-layout-wrapper",n.container);o.find('input[type="hidden"]').val(n()),o.on("click","[data-sek-grid-layout]",function(e,t){var i;e.stopPropagation(),o.find("[data-sek-grid-layout]").removeClass("selected").attr("aria-pressed",!1),s(this).addClass("selected").attr("aria-pressed",!0);try{i=s(this).data("sek-grid-layout")}catch(e){r.errare(n.type+" => error when attaching click event",e)}n(i)}),s('[data-sek-grid-layout="'+n()+'"]',o).trigger("click")}})}(wp.customize,jQuery,_),function(i,e,t){i.czrInputMap=i.czrInputMap||{},e.extend(i.czrInputMap,{refresh_preview_button:function(e){this.container.on("click",".sek-refresh-button",function(e,t){e.stopPropagation(),i.previewer.refresh()})}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_content_type_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_content_type_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_module_picker_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_module_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_module_picker_module"))}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{};var n=sektionsLocalizedData.presetSectionsModules;i.isArray(n)&&!i.isEmpty(n)?i.each(n,function(e){t.czrModuleMap[e]={crud:!1,name:t.czr_sektions.getRegisteredModuleProperty(e,"name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData(e))}}):t.errare("api.czrModuleMap => error when adding section modules")}(wp.customize,jQuery,_),function(a,n,l){var e={initialize:function(e,t){this.inputConstructor=a.CZRInput.extend({initialize:function(e,t){var i=this;a.CZRInput.prototype.initialize.call(i,e,t),i.isReady.then(function(){i.renderUserSavedSections(),i.attachDomEvents()})},getUserSavedSections:function(){var t=n.Deferred();return l.isEmpty(a.czr_sektions.userSavedSections)?a.czr_sektions.getSavedSectionCollection().done(function(e){t.resolve(e)}):t.resolve(a.czr_sektions.userSavedSections),t.promise()},renderUserSavedSections:function(){var o=this,r="",s=o.container.find(".sek-content-type-wrapper"),t=function(e){if(s.find(".sek-user-section-wrapper").remove(),l.isEmpty(e)){var t=[sektionsLocalizedData.baseUrl,"/assets/admin/img/save_section_notice.png","?ver=",sektionsLocalizedData.nimbleVersion].join(""),i="https://docs.presscustomizr.com/article/417-how-to-save-and-reuse-sections-with-nimble-builder";r=['<div class="sek-user-section-wrapper">','<img src="'+t+'" />','<br/><a href="'+i+'" target="_blank" rel="noreferrer nofollow">'+i+"</a>","</div>"].join(""),s.append(r),o.module.container.find(".czr-item-content .customize-control-title").html(sektionsLocalizedData.i18n["You did not save any section yet."])}else{var n="background: url("+[sektionsLocalizedData.baseUrl,"/assets/admin/img/nb_sec_pholder.png","?ver=",sektionsLocalizedData.nimbleVersion].join("")+") 50% 50% / cover no-repeat;";l.each(e,function(e,t){l.isEmpty(e.description)?_titleAttr=[e.title,e.last_modified_date].join(" | "):_titleAttr=[e.title,e.last_modified_date,e.description].join(" | "),r=['<div class="sek-user-section-wrapper">','<div draggable="true" data-sek-is-user-section="true" data-sek-section-type="content" data-sek-content-type="preset_section" data-sek-content-id="'+t+'" style="" title="'+e.title+'">','<div class="sek-sec-thumb" style="'+n+'"></div>','<div class="sek-overlay"></div>','<div class="sek-sec-info" title="'+_titleAttr+'">','<h3 class="sec-title">'+e.title+"</h3>",'<p class="sec-date"><i>'+[sektionsLocalizedData.i18n["Last modified"]," : ",e.last_modified_date].join(" ")+"</i></p>",'<p class="sec-desc">'+e.description+"</p>",'<i class="material-icons edit-user-sec" title="'+sektionsLocalizedData.i18n["Edit this template"]+'">edit</i>','<i class="material-icons remove-user-sec" title="'+sektionsLocalizedData.i18n["Remove this template"]+'">delete_forever</i>',"</div>","</div>","</div>"].join(""),s.append(r)})}s.find(".czr-css-loader").remove(),a.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:o.container})};s.append('<div class="czr-css-loader czr-mr-loader" style="display:block"><div></div><div></div><div></div></div>'),o.getUserSavedSections().done(function(e){t(e)}),a.czr_sektions.allSavedSections.bind(function(e){t(e)})},attachDomEvents:function(){this.container.on("click",".sek-sec-info .remove-user-sec",function(e){e.preventDefault();var t=a.czr_sektions;t.saveSectionDialogVisible(!1);var i=function(e){t.saveSectionDialogMode("remove"),t.saveSectionDialogMode.unbind(i)};t.userSectionToRemove=n(this).closest("[data-sek-content-id]").data("sek-content-id"),t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)}).on("click",".sek-sec-info .edit-user-sec",function(e){e.preventDefault();var t=a.czr_sektions;t.saveSectionDialogVisible(!1);var i=function(e){t.saveSectionDialogMode("edit"),t.saveSectionDialogMode.unbind(i)};t.userSectionToEdit=n(this).closest("[data-sek-content-id]").data("sek-content-id"),t.saveSectionDialogMode.bind(i),t.saveSectionDialogVisible(!0)})}}),a.CZRDynModule.prototype.initialize.call(this,e,t)}};a.czrModuleMap=a.czrModuleMap||{},n.extend(a.czrModuleMap,{sek_my_sections_sec_picker_module:{mthds:e,crud:!1,name:a.czr_sektions.getRegisteredModuleProperty("sek_my_sections_sec_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:a.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_my_sections_sec_picker_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_mod_option_switcher_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_mod_option_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_mod_option_switcher_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_anchor_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_anchor_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_anchor_module"))}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var t=this,n=t.module;t.czr_Input.each(function(i){switch(i.id){case"bg-apply-overlay":r.each(["bg-color-overlay","bg-opacity-overlay"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return o.CZR_Helpers.isChecked(i())})}catch(e){o.errare(n.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-parallax":r.each(["bg-parallax-force","bg-scale","bg-repeat"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"bg-parallax-force":e=o.CZR_Helpers.isChecked(i());break;case"bg-repeat":case"bg-scale":e=!o.CZR_Helpers.isChecked(i())}return e})}catch(e){o.errare(n.id+" => error in setInputVisibilityDeps",e)}}),i.bind(function(e){o.CZR_Helpers.isChecked(i())&&o.CZR_Helpers.isChecked(t.czr_Input("bg-attachment")())&&t.czr_Input("bg-attachment").container.find("input[type=checkbox]").trigger("click")});break;case"bg-attachment":i.bind(function(e){o.CZR_Helpers.isChecked(i())&&o.CZR_Helpers.isChecked(t.czr_Input("bg-parallax")())&&t.czr_Input("bg-parallax").container.find("input[type=checkbox]").trigger("click")});break;case"bg-use-video":r.each(["bg-video","bg-video-loop","bg-video-delay-start","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return o.CZR_Helpers.isChecked(i())})}catch(e){o.errare(n.id+" => error in setInputVisibilityDeps",e)}})}}),n.control&&n.control.params&&n.control.params.sek_registration_params&&(r.contains(["section","column"],n.control.params.sek_registration_params.level)||r.each(["bg-use-video","bg-video","bg-video-loop","bg-video-on-mobile","bg-video-start-time","bg-video-end-time"],function(e){t.czr_Input(e).visible(!1)}))}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_bg_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_bg_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_bg_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_text_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_text_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_text_module")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_border_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_border_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_border_module"))}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":o.each(["custom-breakpoint","apply-to-all"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_breakpoint_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_breakpoint_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_breakpoint_module"))}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":o.each(["custom-height","overflow_hidden"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_height_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_height_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_height_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_visibility_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_visibility_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_visibility_module"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"width-type":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"custom-width",function(){return"custom"===e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_module"))}})}(wp.customize,jQuery,_),function(d,p,u){var e={initialize:function(e,t){var i=this;i.inputConstructor=d.CZRInput.extend(i.CZRInputConstructor||{}),i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputConstructor:{range_simple:function(e){var t,i=this,n=p(".sek-range-with-unit-picker-wrapper",i.container),o=n.find('input[type="number"]'),r=n.find('input[type="range"]');try{t=i.module.control.params.sek_registration_params}catch(e){return void d.errare("Error when getting the module registration params",e)}if(u.isUndefined(t.level_id))d.errare("Error : missing column id",er);else if(i.columnId=t.level_id,i.columnModel=p.extend(!0,{},d.czr_sektions.getLevelModel(i.columnId)),i.parentSectionModel=d.czr_sektions.getParentSectionFromColumnId(i.columnId),"no_match"!=i.columnModel)if("no_match"!=i.parentSectionModel){i.colNb=u.size(i.parentSectionModel.collection),o.attr("data-sek-width-range-column-id",i.columnId),1===i.colNb?i.container.html(["<p>",sektionsLocalizedData.i18n["This is a single-column section with a width of 100%. You can act on the internal width of the parent section, or adjust padding and margin."]].join("")):i.container.show();var s,a=d.czr_sektions.getLevelModel(i.columnId),l="_not_set_";if("no_match"!=a){var c=a.options&&a.options.width&&a.options.width["custom-width"]&&u.isNumber(+a.options.width["custom-width"]);c?l=a.options.width["custom-width"]:!c&&a.width&&u.isNumber(+a.width)&&(l=a.width),s="_not_set_"!==l?l:"_not_set_"===i()?Math.floor(100/i.colNb):i(),s=1*+parseFloat(s).toFixed(3),(!u.isNumber(s)||100<s||s<0)&&(d.errare("Error => invalid column width",s),s=50),r.on("input",function(e,t){o.val(p(this).val()).trigger("input",t)}),o.on("input",u.debounce(function(e,t){r.val(p(this).val()),t&&t.is_init||i(+parseFloat(p(this).val()).toFixed(3))},300)),o.on("input",u.debounce(function(e,t){t&&(t.is_init||t.is_resize_column_trigger)||i.sayItToApi(p(this).val())},300)),r.val(s).trigger("input",{is_init:!0})}else d.errare("sek_level_width_column module => invalid column model")}else d.errare("sek_level_width_column module => invalid parent section model");else d.errare("sek_level_width_column module => invalid column model")},sayItToApi:function(e,t){var i=this,n=u.findIndex(i.parentSectionModel.collection,{id:i.columnId}),o=n+1==i.colNb?n-1:n+1,r=u.find(i.parentSectionModel.collection,function(e,t){return o===t});"no_match"===r&&d.errare("sek_level_width_column module => invalid sister column model"),d.previewer.trigger("sek-resize-columns",{action:"sek-resize-columns",level:"column",in_sektion:i.parentSectionModel.id,id:i.columnId,resized_column:i.columnId,sister_column:r.id,resizedColumnWidthInPercent:e,col_number:i.colNb})}}};d.czrModuleMap=d.czrModuleMap||{},p.extend(d.czrModuleMap,{sek_level_width_column:{mthds:e,crud:!1,name:d.czr_sektions.getRegisteredModuleProperty("sek_level_width_column","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:u.extend({id:"",title:""},d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_column"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_width_section:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_width_section","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_section"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_spacing_module:{mthds:"",crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_spacing_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_spacing_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_cust_css_section:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_cust_css_section","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_cust_css_section"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this.module;i.trigger("nb_setup_visibility_deps_for_animation_module",{item:this,module:e})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_animation_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_animation_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_animation_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_template:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_template","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_template"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_local_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_local_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_custom_css:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_custom_css","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_custom_css"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_header_footer"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_imp_exp"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"links_underline":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"links_underline_hover",function(){return!e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_text:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_text","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_text"))}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use-custom-breakpoint":o.each(["global-custom-breakpoint","apply-to-all"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(i.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_global_breakpoint:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_global_breakpoint","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_breakpoint"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":i.czr_sektions.scheduleVisibilityOfInputId.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_performances:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_performances","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_performances"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_header_footer:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_header_footer","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_header_footer"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module;n.czr_Input.each(function(i){switch(i.id){case"enable":s.each(["public_key","private_key","badge","show_failure_message","failure_message","score"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"failure_message":e=i()&&n.czr_Input("show_failure_message")();break;default:e=i()}return e})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_failure_message":s.each(["failure_message"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&n.czr_Input("enable")()})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{sek_global_recaptcha:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("sek_global_recaptcha","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:s.extend({id:"",title:""},r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_recaptcha"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_revisions:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_revisions","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_revisions"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_reset"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_imp_exp:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_imp_exp","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_imp_exp"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_global_beta_features:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_global_beta_features","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_beta_features"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_site_tmpl_pickers:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_site_tmpl_pickers","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_site_tmpl_pickers"))}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!r.contains(["no-link","img-lightbox"],i())}return e})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"border-type":r.each(["borders"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"none"!==i()})}catch(e){o.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"use_custom_width":r.each(["custom_width"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_height":r.each(["custom_height"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"use_custom_title_attr":r.each(["heading_title"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}})}}),o.trigger("nb_setup_visibility_deps_for_img_module",{item:n,module:t})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_image_main_settings_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_image_main_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_main_settings_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_image_borders_corners_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_image_borders_corners_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_borders_corners_child")}})}(wp.customize,jQuery,_),function(n,e,t){var i={initialize:function(e,t){this.inputConstructor=n.CZRInput.extend(this.CZRTextEditorInputMths||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRTextEditorInputMths:{initialize:function(e,t){var i=this;"detached_tinymce_editor"==i.type&&i.isReady.then(function(){i.container.find('[data-czr-action="open-tinymce-editor"]').trigger("click")}),n.CZRInput.prototype.initialize.call(i,e,t)}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_tinymce_child:{mthds:i,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_tinymce_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_tinymce_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_html_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_html_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_html_module")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(i){switch(i.id){case"img-type":o.each(["img-id","img-size"],function(t){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img-id":e="custom"===i();break;default:e="none"!==i()}return e})}catch(e){n.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"content-type":o.each(["content-custom-text"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"custom"===i()})}catch(e){n.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"btn-display":o.each(["btn-custom-text"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){n.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_featured_pages_module:{mthds:t,crud:n.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","is_crud"),hasPreItem:!1,refresh_on_add_item:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_featured_pages_module")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":s.each(["link-pick-url","link-custom-url","link-target"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":r.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"use_custom_color_on_hover":s.each(["color_hover"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_icon_settings_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_icon_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_settings_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_icon_spacing_border_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_icon_spacing_border_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_spacing_border_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e=i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":case"link-target":e=i()}return e})}catch(e){o.errare("Heading module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&!0===n.czr_Input("link-to")()})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_heading_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_heading_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_heading_spacing_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_heading_spacing_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_spacing_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_divider_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_divider_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_divider_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_spacer_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_spacer_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_spacer_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_map_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_map_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_map_module")}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRButtonItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"quote_design":n.each(["border_width_css","border_color_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"border-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}}),n.each(["icon_color_css","icon_size_css"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"quote-icon-before"==t()})}catch(e){i.errare("Quote module => error in setInputVisibilityDeps",e)}})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_quote_design_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_quote_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_design_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_quote_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_quote_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_quote_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_quote_cite_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_quote_cite_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_cite_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),this.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"icon":o.czr_sektions.scheduleVisibilityOfInputId.call(i,"icon-side",function(){return!r.isEmpty(i())})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_btn_content_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_btn_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_content_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var e=this,i=e.module;e.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":o.each(["bg_color_hover"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":o.each(["push_effect"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"width-type":n.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-width",function(){return"custom"===t()}),o.each(["custom-width","h_inner_align_css"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){n.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"height-type":n.czr_sektions.scheduleVisibilityOfInputId.call(t,"custom-height",function(){return"custom"===t()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_btn_design_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_btn_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_design_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this.module;this.czr_Input.each(function(i){switch(i.id){case"layout":r.each(["columns","img_column_width","has_tablet_breakpoint","has_mobile_breakpoint"],function(t){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"columns":e="grid"===i();break;case"has_tablet_breakpoint":case"has_mobile_breakpoint":case"img_column_width":e="list"===i()}return e})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"categories":r.each(["must_have_all_cats"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){var e=i();return r.isArray(e)&&1<e.length})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"display_pagination":r.each(["posts_per_page","post_number"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return"posts_per_page"===e?i():!i()})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"custom_grid_spaces":r.each(["column_gap","row_gap"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_excerpt":r.each(["excerpt_length"],function(e){try{o.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()})}catch(e){o.errare(n.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_post_grid_main_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_post_grid_main_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_main_child")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.itemConstructor=r.CZRItem.extend(this.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module;n.czr_Input.each(function(i){switch(i.id){case"show_thumb":s.each(["img_size","img_has_custom_height","img_height","border_radius_css","use_post_thumb_placeholder"],function(t){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"img_height":e=i()&&n.czr_Input("img_has_custom_height")();break;default:e=i()}return e})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"img_has_custom_height":s.each(["img_height"],function(e){try{r.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return i()&&n.czr_Input("show_thumb")()})}catch(e){r.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_post_grid_thumb_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_post_grid_thumb_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_thumb_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_metas_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_metas_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_metas_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_post_grid_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_post_grid_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_post_grid_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_content_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_content_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_menu_mobile_options:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_menu_mobile_options","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_menu_mobile_options")}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"show_name_field":n.each(["name_field_label","name_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_subject_field":n.each(["subject_field_label","subject_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_message_field":n.each(["message_field_label","message_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_privacy_field":n.each(["privacy_field_label","privacy_field_required"],function(e){try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":try{i.czr_sektions.scheduleVisibilityOfInputId.call(t,"link-custom-url",function(){return t()})}catch(e){i.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_simple_form_fields_child:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fields_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fields_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_simple_form_design_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_simple_form_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_design_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":o.each(["bg_color_hover"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"border-type":o.each(["borders"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"none"!==t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":o.each(["push_effect"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_simple_form_button_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_simple_form_button_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_button_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_fonts_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_submission_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_submission_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_submission_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_font_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_font_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_font_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.bind("nimble-set-select-input-options",function(e){e.params=sektionsLocalizedData.registeredWidgetZones}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_widget_area_module:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_widget_area_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_widget_area_module")}})}(wp.customize,jQuery,_),function(s,a,l){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=s.CZRItem.extend(i.CZRItemConstructor||{}),s.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return s.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&a.fn.sortable){var i=this;a("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){l.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!l.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){s.errorLog("item.setInputVisibilityDeps() : "+e)}}),s.CZRItem.prototype.ready.call(t)},_buildTitle:function(e,t,i){var n=this.module;return e=e||("string"==typeof t?s.CZR_Helpers.capitalize(t.replace("fa-","")):""),e=s.CZR_Helpers.truncate(e,20),'<div><span class="'+t+'" style="color:'+(i=i||n.defaultSocialColor)+'"></span> '+e+"</div>"},writeItemViewTitle:function(e){var t=this.module,i=e||this(),n=(i.icon?i.icon:"").replace("fa-","").replace("envelope","email").replace("far","").replace("fab","").replace("fas","");a("."+t.control.css_attr.item_title,this.container).html(this._buildTitle(n,i.icon,i.color_css))},setInputVisibilityDeps:function(){this.module;this.czr_Input.each(function(t){switch(t.id){case"use_custom_color_on_hover":l.each(["social_color_hover"],function(e){try{s.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){s.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,n=l.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),n=l.without(n,l.findWhere(n,{id:t.id})),i.itemCollection.set(n),i.trigger("pre_item_api_remove",t());var o=a.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=s(i.control.id).transport||!l.has(e,"dom_event")||l.has(e.dom_event,"isTrigger")||s.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",o),i.control.trigger("item-removed",o);else{var r=function(){s.previewer.unbind("ready",r),i.trigger("item-removed",o)};s.previewer.bind("ready",r)}}}};s.czrModuleMap=s.czrModuleMap||{},a.extend(s.czrModuleMap,{czr_social_icons_settings_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:s.czr_sektions.getRegisteredModuleProperty("czr_social_icons_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_settings_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_social_icons_style_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_social_icons_style_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_social_icons_style_child")}})}(wp.customize,jQuery,_),function(g,h,v){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=g.CZRItem.extend(i.CZRItemConstructor||{}),g.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return g.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&h.fn.sortable){var i=this;h("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){v.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","starting_value"),t=h.extend(!0,{},this.preItem());if(v.isObject(e)){var i=h.extend(!0,{},e);return h.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!v.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){g.errorLog("item.setInputVisibilityDeps() : "+e)}}),g.CZRItem.prototype.ready.call(t);var i=function(){g.previewer.send("sek-item-focus",{control_id:t.module.control.id,item_id:t.id,item_value:t()})};t.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),t.callbacks.add(i),t.bind("sek-request-item-focus-in-preview",i)},writeItemViewTitle:function(e,t){var i=this,n=i.module,o=e||i(),r="",s="",a="not_set",l=!v.isUndefined(t)&&v.isObject(t);if(!l||!t.input_changed||v.contains(["img","text_content"],t.input_changed)){if(v.isEmpty(o.title)){var c=v.findIndex(n.itemCollection(),function(e){return e.id===i.id});c=v.isUndefined(c)?1:c+1}else r=o.title;r=g.CZR_Helpers.truncate(r,15),o.img&&(s=o.img,v.isString(o.img)&&(s=-1!==o.img.indexOf("http")?o.img:parseInt(o.img,10)));var d=function(){return h.Deferred(function(){var e=this;v.isUndefined(s)||v.isEmpty(""+s)?e.resolve(""):v.isString(s)&&-1!==s.indexOf("http")?e.resolve(s):wp.media.attachment(s).fetch().always(function(){if(v.isObject(this)&&v.has(this,"attributes")&&v.has(this.attributes,"sizes")){var i=this.get("sizes");i&&v.isObject(i)&&v.each(["thumbnail","medium","large","full"],function(e,t){"not_set"===a&&i[e]&&v.isObject(i[e])&&i[e].url&&(a=i[e].url)}),e.resolve(a)}})}).promise()},p=h("."+n.control.css_attr.item_title,i.container).find(".sek-slide-title"),u=h("."+n.control.css_attr.item_title,i.container).find(".sek-slide-thumb"),_=o.text_content?o.text_content:"";_=(_=h("<div>").html(_).text()).substring(0,60),p.length<1?(h("."+n.control.css_attr.item_title,i.container).html(""),h("."+n.control.css_attr.item_title,i.container).append(h("<div/>",{class:"sek-slide-title",html:_}))):p.html(_);var m=l&&t.input_changed&&"img"===t.input_changed,f=function(e){return v.isEmpty(""+e)||"not_set"===e?"":'<img src="'+e+'" width="32" alt="'+r+'" />'};h("."+n.control.css_attr.item_title,i.container).css("padding","0 4px"),u.length<1?d().done(function(e){h("."+n.control.css_attr.item_title,i.container).prepend(h("<div/>",{class:"sek-slide-thumb",html:f(e)}))}):!m&&l||d().done(function(e){u.html(f(e))})}},setInputVisibilityDeps:function(){var n=this,t=n.module;n.czr_Input.each(function(i){switch(i.id){case"link-to":v.each(["link-pick-url","link-custom-url","link-target"],function(t){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e=!v.contains(["no-link"],i())}return e})}catch(e){g.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":g.czr_sektions.scheduleVisibilityOfInputId.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"apply-overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"enable_text":v.each(["text_content","font_family_css","font_size_css","line_height_css","color_css","h_alignment_css","v_alignment","spacing_css"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"apply_overlay":v.each(["color-overlay","opacity-overlay"],function(e){try{g.czr_sektions.scheduleVisibilityOfInputId.call(i,e,function(){return g.CZR_Helpers.isChecked(i())})}catch(e){g.errare(t.id+" => error in setInputVisibilityDeps",e)}})}})},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,n=v.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),n=v.without(n,v.findWhere(n,{id:t.id})),i.itemCollection.set(n),i.trigger("pre_item_api_remove",t());var o=h.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=g(i.control.id).transport||!v.has(e,"dom_event")||v.has(e.dom_event,"isTrigger")||g.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",o),i.control.trigger("item-removed",o);else{var r=function(){g.previewer.unbind("ready",r),i.trigger("item-removed",o)};g.previewer.bind("ready",r)}}}};g.czrModuleMap=g.czrModuleMap||{},h.extend(g.czrModuleMap,{czr_img_slider_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:g.czr_sektions.getRegisteredModuleProperty("czr_img_slider_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:g.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_collection_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"height-type":o.each(["custom-height"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return"custom"===t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"autoplay":o.each(["autoplay_delay","pause_on_hover"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return n.CZR_Helpers.isChecked(t())})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_img_slider_opts_child:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_img_slider_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_img_slider_opts_child")}})}(wp.customize,jQuery,_),function(d,p,u){var e={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=d.CZRItem.extend(i.CZRItemConstructor||{}),d.CZRDynModule.prototype.initialize.call(i,e,t)},generateItemId:function(){return d.czr_sektions.guid()},_makeItemsSortable:function(e){if(!wp.media.isTouchDevice&&p.fn.sortable){var i=this;p("."+i.control.css_attr.items_wrapper,i.container).sortable({handle:"."+i.control.css_attr.item_sort_handle,start:function(){},update:function(e,t){i._getSortedDOMItemCollection().done(function(e){i.itemCollection.set(e)}).then(function(){u.has(i,"preItem")&&i.preItemExpanded.set(!1),i.closeAllItems().closeRemoveDialogs(),i.trigger("item-collection-sorted")})}})}},getPreItem:function(){var e=d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","starting_value"),t=p.extend(!0,{},this.preItem());if(u.isObject(e)){var i=p.extend(!0,{},e);return p.extend(t,i)}return this.preItem()},CZRItemConstructor:{ready:function(){var e=this;d.CZRItem.prototype.ready.call(e);var i=function(){d.previewer.send("sek-item-focus",{control_id:e.module.control.id,item_id:e.id,item_value:e()})};e.viewState.callbacks.add(function(e,t){"expanded"===e&&i()}),e.callbacks.add(i),e.bind("sek-request-item-focus-in-preview",i),e.module.bind("item-collection-sorted",function(){e.writeItemViewTitle(e(),{input_changed:"title_text"})})},writeItemViewTitle:function(e,t){var i=this,n=i.module,o=e||i(),r="";if(!(!u.isUndefined(t)&&u.isObject(t))||!t.input_changed||u.contains(["title_text"],t.input_changed)){if(u.isEmpty(o.title)){var s=u.findIndex(n.itemCollection(),function(e){return e.id===i.id});s=u.isUndefined(s)?1:s+1}else r=o.title;r=d.CZR_Helpers.truncate(r,25);var a=p("."+n.control.css_attr.item_title,i.container).find(".sek-accord-title"),l=o.title_text?o.title_text:"";l=p("<div>").html(l).text();var c=i.module.container.find(".czr-items-wrapper > li").index(i.container);l=(l=u.isEmpty(l)?sektionsLocalizedData.i18n["Accordion title"]+" #"+(+c+1):l).substring(0,60),a.length<1?(p("."+n.control.css_attr.item_title,i.container).html(""),p("."+n.control.css_attr.item_title,i.container).append(p("<div/>",{class:"sek-accord-title",html:l}))):a.html(l)}},toggleRemoveAlert:function(){this.removeItem()},removeItem:function(e){e=e||{};var t=this,i=this.module,n=u.clone(i.itemCollection());i.trigger("pre_item_dom_remove",t()),t._destroyView(),n=u.without(n,u.findWhere(n,{id:t.id})),i.itemCollection.set(n),i.trigger("pre_item_api_remove",t());var o=p.extend(!0,{},t());if(i.czr_Item.remove(t.id),"postMessage"!=d(i.control.id).transport||!u.has(e,"dom_event")||u.has(e.dom_event,"isTrigger")||d.CZR_Helpers.hasPartRefresh(i.control.id))i.trigger("item-removed",o),i.control.trigger("item-removed",o);else{var r=function(){d.previewer.unbind("ready",r),i.trigger("item-removed",o)};d.previewer.bind("ready",r)}}}};d.czrModuleMap=d.czrModuleMap||{},p.extend(d.czrModuleMap,{czr_accordion_collection_child:{mthds:e,crud:!0,hasPreItem:!1,refresh_on_add_item:!1,name:d.czr_sektions.getRegisteredModuleProperty("czr_accordion_collection_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:d.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_collection_child")}})}(wp.customize,jQuery,_),function(n,e,t){var i={initialize:function(e,t){var i=this;i.crudModulePart="nimble-crud-module-part",i.rudItemPart="nimble-rud-item-part",i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRItemConstructor:{ready:function(){n.CZRItem.prototype.ready.call(this)}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_accordion_opts_child:{mthds:i,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_accordion_opts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_accordion_opts_child")}})}(wp.customize,jQuery,_),function(n,e,o){var t={initialize:function(e,t){this.itemConstructor=n.CZRItem.extend(this.CZRButtonItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!o.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var i=this.module;this.czr_Input.each(function(t){switch(t.id){case"use_flex":o.each(["h_alignment_css"],function(e){try{n.czr_sektions.scheduleVisibilityOfInputId.call(t,e,function(){return t()})}catch(e){n.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_shortcode_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_shortcode_module","name"),has_mod_opt:!1,ready_on_section_expanded:!1,ready_on_control_event:"sek-accordion-expanded",defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_shortcode_module")}})}(wp.customize,jQuery,_);
inc/czr-skope/index.php CHANGED
@@ -329,10 +329,13 @@ function skp_get_skope_id( $level = 'local' ) {
329
  // when customizing and firing this function during ajax calls, the check for did_action('wp') will return 0.
330
  // => which will lead to skope_id set to '_skope_not_set_'
331
  // in order to prevent this, let's get the skope_id value from the customizer posted value when available.
332
- // for the moment only the local skope_is is provided by the customizer post value, in the future it might be useful to also add the group skope_id ( all_pages, all_posts, all_categories, ... )
333
  if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'local' === $level && !empty($_POST['local_skope_id']) ) {
334
  $skope_id_to_return = $_POST['local_skope_id'];
335
  }
 
 
 
 
336
 
337
  $skope_id_to_return = apply_filters( 'skp_get_skope_id', $skope_id_to_return, $level );
338
 
329
  // when customizing and firing this function during ajax calls, the check for did_action('wp') will return 0.
330
  // => which will lead to skope_id set to '_skope_not_set_'
331
  // in order to prevent this, let's get the skope_id value from the customizer posted value when available.
 
332
  if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'local' === $level && !empty($_POST['local_skope_id']) ) {
333
  $skope_id_to_return = $_POST['local_skope_id'];
334
  }
335
+ // Feb 2021 => added for https://github.com/presscustomizr/nimble-builder/issues/478
336
+ if ( skp_is_customizing() && '_skope_not_set_' === $skope_id_to_return && 'group' === $level && !empty($_POST['group_skope_id']) ) {
337
+ $skope_id_to_return = $_POST['group_skope_id'];
338
+ }
339
 
340
  $skope_id_to_return = apply_filters( 'skp_get_skope_id', $skope_id_to_return, $level );
341
 
inc/sektions/ccat-constants-and-helper-functions.php CHANGED
@@ -34,7 +34,7 @@ if ( !defined( 'NIMBLE_GLOBAL_SKOPE_ID' ) ) { define( 'NIMBLE_GLOBAL_SKOPE_ID' ,
34
 
35
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS' , '__nimble_options__' ); }
36
 
37
- if ( !defined( 'NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS' , '__site_templates__' ); }
38
 
39
  //if ( !defined( 'NIMBLE_OPT_NAME_FOR_SAVED_SEKTIONS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_SAVED_SEKTIONS' , 'nimble_saved_sektions' ); } //<= June 2020 to be removed
40
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_MOST_USED_FONTS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_MOST_USED_FONTS' , 'nimble_most_used_fonts' ); }
@@ -1841,7 +1841,6 @@ function sek_get_global_option_value( $option_name = '' ) {
1841
  }
1842
 
1843
 
1844
-
1845
  // @see _1_6_5_sektions_generate_UI_global_options.js
1846
  // @return array() $normalized_values
1847
  function sek_normalize_global_options_with_defaults( $option_name, $raw_module_values ) {
@@ -1875,6 +1874,90 @@ function sek_normalize_global_options_with_defaults( $option_name, $raw_module_v
1875
  return $normalized_values;
1876
  }
1877
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1878
  ?><?php
1879
 
1880
 
@@ -2185,7 +2268,7 @@ function sek_get_level_skope_id( $level_id = '' ) {
2185
  return $level_skope_id;
2186
  }
2187
 
2188
- $local_skope_settings = sek_get_skoped_seks( skp_get_skope_id() );
2189
  $local_collection = ( is_array( $local_skope_settings ) && !empty( $local_skope_settings['collection'] ) ) ? $local_skope_settings['collection'] : array();
2190
  // if the level id has not been found in the local sections, we know it's a global level.
2191
  // In dev mode, always make sure that the level id is found in the global locations.
@@ -2210,6 +2293,9 @@ function sek_get_level_skope_id( $level_id = '' ) {
2210
  function sek_has_global_sections() {
2211
  if ( skp_is_customizing() )
2212
  return true;
 
 
 
2213
  $maybe_global_sek_post = sek_get_seks_post( NIMBLE_GLOBAL_SKOPE_ID, 'global' );
2214
  $nb_section_created = 0;
2215
  if ( is_object($maybe_global_sek_post) ) {
@@ -2217,7 +2303,9 @@ function sek_has_global_sections() {
2217
  $seks_data = is_array( $seks_data ) ? $seks_data : array();
2218
  $nb_section_created = sek_count_not_empty_sections_in_page( $seks_data );
2219
  }
2220
- return $nb_section_created > 0;
 
 
2221
  }
2222
 
2223
 
@@ -2226,19 +2314,30 @@ function sek_has_global_sections() {
2226
  // initially used to determine if a post or a page has been customized with Nimble Builder => if so, we add an edit link in the post/page list
2227
  // when used in admin, the skope_id must be provided
2228
  // can be used to determine if we need to render Nimble Builder assets on front. See ::sek_enqueue_front_assets()
2229
- function sek_local_skope_has_nimble_sections( $skope_id = '' ) {
2230
  if ( empty( $skope_id ) ) {
2231
  sek_error_log( __FUNCTION__ . ' => missing skope id' );
2232
  return false;
2233
  }
2234
- $maybe_local_sek_post = sek_get_seks_post( $skope_id, 'local' );
 
 
2235
  $nb_section_created = 0;
2236
- if ( is_object($maybe_local_sek_post) ) {
2237
- $seks_data = maybe_unserialize($maybe_local_sek_post->post_content);
2238
- $seks_data = is_array( $seks_data ) ? $seks_data : array();
 
 
 
 
 
 
 
2239
  $nb_section_created = sek_count_not_empty_sections_in_page( $seks_data );
2240
  }
2241
- return $nb_section_created > 0;
 
 
2242
  }
2243
 
2244
 
@@ -2894,6 +2993,8 @@ add_filter('sek_get_raw_section_registration_params', function( $collection ) {
2894
 
2895
  // @return bool
2896
  function sek_is_json( $string ){
 
 
2897
  json_decode($string);
2898
  return (json_last_error() == JSON_ERROR_NONE);
2899
  }
@@ -2907,9 +3008,11 @@ function sek_maybe_decode_json( $string ){
2907
  if ( json_last_error() == JSON_ERROR_NONE ) {
2908
  // https://stackoverflow.com/questions/6465263/how-to-reverse-htmlentities
2909
  // added to fix regression https://github.com/presscustomizr/nimble-builder/issues/791
2910
- $json_decoded_candidate = html_entity_decode($json_decoded_candidate);
 
2911
  return $json_decoded_candidate;
2912
  }
 
2913
  return $string;
2914
  }
2915
 
@@ -2921,8 +3024,10 @@ function sek_maybe_json_encode( $string ){
2921
  if ( !sek_is_json($string) ) {
2922
  // https://stackoverflow.com/questions/6465263/how-to-reverse-htmlentities
2923
  // added to fix regression https://github.com/presscustomizr/nimble-builder/issues/791
2924
- $string = htmlentities($string);//reversed with html_entity_decode
2925
- $string = json_encode($string);
 
 
2926
  }
2927
  return $string;
2928
  }
@@ -2934,6 +3039,14 @@ function sek_maybe_json_encode( $string ){
2934
  function sek_is_site_tmpl_enabled() {
2935
  return defined('NIMBLE_SITE_TEMPLATES_ENABLED') && NIMBLE_SITE_TEMPLATES_ENABLED;
2936
  }
 
 
 
 
 
 
 
 
2937
  ?><?php
2938
  // /* ------------------------------------------------------------------------- *
2939
  // * NIMBLE API
@@ -3867,7 +3980,6 @@ register_post_type( NIMBLE_CPT , array(
3867
  * @return WP_Post|null The skope post or null if none exists.
3868
  */
3869
  function sek_get_seks_post( $skope_id = '', $skope_level = 'local' ) {
3870
- //sek_error_log('skope_id in sek_get_seks_post => ' . $skope_id );
3871
  if ( empty( $skope_id ) ) {
3872
  $skope_id = skp_get_skope_id( $skope_level );
3873
  }
@@ -3936,6 +4048,155 @@ function sek_get_seks_post( $skope_id = '', $skope_level = 'local' ) {
3936
  }
3937
 
3938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3939
  /**
3940
  * Fetch the saved collection of sektion for a given skope_id / location
3941
  *
@@ -3964,6 +4225,13 @@ function sek_get_skoped_seks( $skope_id = '', $location_id = '', $skope_level =
3964
  }
3965
 
3966
  if ( !$is_cached ) {
 
 
 
 
 
 
 
3967
  $seks_data = array();
3968
  $post = sek_get_seks_post( $skope_id, $is_global_skope ? 'global' : 'local' );
3969
  if ( $post ) {
@@ -3971,26 +4239,16 @@ function sek_get_skoped_seks( $skope_id = '', $location_id = '', $skope_level =
3971
  }
3972
  $seks_data = is_array( $seks_data ) ? $seks_data : array();
3973
 
 
 
 
 
3974
  // normalizes
3975
  // [ 'collection' => [], 'local_options' => [] ];
3976
  $default_collection = sek_get_default_location_model( $skope_id );
3977
  $seks_data = wp_parse_args( $seks_data, $default_collection );
3978
  // Maybe add missing registered locations
3979
  $seks_data = sek_maybe_add_incomplete_locations( $seks_data, $is_global_skope );
3980
-
3981
- // EXPERIMENTAL
3982
- // Feb 2021 : for https://github.com/presscustomizr/nimble-builder/issues/478
3983
- if ( !$is_global_skope && defined('NIMBLE_USE_GROUP_TMPL') && NIMBLE_USE_GROUP_TMPL ) {
3984
- sek_error_log('SOOO ? seks_data for skope_id => ' . $skope_id, 'is page ? '. is_page() );
3985
- $post = sek_get_saved_tmpl_post( 'nb_tmpl_nimble-template-loop-start-only' );
3986
- if ( $post ) {
3987
- $new_seks_data = maybe_unserialize( $post->post_content );
3988
- }
3989
- // sek_error_log('CURRENT SEKS DATA ?', $seks_data );
3990
- // sek_error_log('NEW SEKS DATA ?', $new_seks_data );
3991
- $seks_data = $new_seks_data['data'];
3992
- $seks_data = is_array( $seks_data ) ? $seks_data : array();
3993
- }
3994
 
3995
  // cache now
3996
  if ( $is_global_skope ) {
@@ -4012,6 +4270,10 @@ function sek_get_skoped_seks( $skope_id = '', $location_id = '', $skope_level =
4012
  // Maybe add missing registered locations when customizing
4013
  // December 2020 => needed when importing an entire template
4014
  $seks_data = sek_maybe_add_incomplete_locations( $seks_data, $is_global_skope );
 
 
 
 
4015
  }
4016
 
4017
  // if a location is specified, return specifically the sections of this location
@@ -4049,6 +4311,10 @@ function sek_maybe_add_incomplete_locations( $seks_data, $is_global_skope ) {
4049
 
4050
 
4051
 
 
 
 
 
4052
  /**
4053
  * Update the `nimble_post_type` post for a given "{$skope_id}"
4054
  * Inserts a `nimble_post_type` post when one doesn't yet exist.
@@ -4076,6 +4342,9 @@ function sek_update_sek_post( $seks_data, $args = array() ) {
4076
 
4077
  $post_title = NIMBLE_OPT_PREFIX_FOR_SEKTION_COLLECTION . $skope_id;
4078
 
 
 
 
4079
  $post_data = array(
4080
  'post_title' => $post_title,
4081
  'post_name' => sanitize_title( $post_title ),
34
 
35
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS' , '__nimble_options__' ); }
36
 
37
+ if ( !defined( 'NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS' , 'nimble_site_templates' ); }
38
 
39
  //if ( !defined( 'NIMBLE_OPT_NAME_FOR_SAVED_SEKTIONS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_SAVED_SEKTIONS' , 'nimble_saved_sektions' ); } //<= June 2020 to be removed
40
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_MOST_USED_FONTS' ) ) { define( 'NIMBLE_OPT_NAME_FOR_MOST_USED_FONTS' , 'nimble_most_used_fonts' ); }
1841
  }
1842
 
1843
 
 
1844
  // @see _1_6_5_sektions_generate_UI_global_options.js
1845
  // @return array() $normalized_values
1846
  function sek_normalize_global_options_with_defaults( $option_name, $raw_module_values ) {
1874
  return $normalized_values;
1875
  }
1876
 
1877
+
1878
+
1879
+
1880
+
1881
+
1882
+ /* ------------------------------------------------------------------------- *
1883
+ * SITE TEMPLATES OPTIONS HELPERS
1884
+ /* ------------------------------------------------------------------------- */
1885
+ // @param $option_name = string
1886
+ // 'nimble_front_classes_ready' is fired when Nimble_Manager() is instanciated
1887
+ function sek_get_site_tmpl_options( $option_name = '' ) {
1888
+ // if ( empty($option_name) ) {
1889
+ // sek_error_log( __FUNCTION__ . ' => invalid option name' );
1890
+ // return array();
1891
+ // }
1892
+ if ( !skp_is_customizing() && did_action('nimble_front_classes_ready') && '_not_cached_yet_' !== Nimble_Manager()->site_template_options ) {
1893
+ $site_template_options = Nimble_Manager()->site_template_options;
1894
+ } else {
1895
+ $site_template_options = get_option( NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS );
1896
+ //sek_error_log(' SOOO OPTIONS ?', $site_template_options );
1897
+ // cache when nimble is ready
1898
+ // this hook is fired when Nimble_Manager() is instanciated
1899
+ // never cache when doing ajax
1900
+ if ( did_action('nimble_front_classes_ready') && !defined('DOING_AJAX') ) {
1901
+ Nimble_Manager()->site_template_options = $site_template_options;
1902
+ }
1903
+ }
1904
+ return is_array( $site_template_options ) ? $site_template_options : [];
1905
+ }
1906
+
1907
+
1908
+ function sek_get_site_tmpl_for_skope( $group_skope = null ) {
1909
+ if ( is_null($group_skope) || !is_string($group_skope) || empty($group_skope) )
1910
+ return;
1911
+ $site_tmpl = null;
1912
+ $opts = sek_get_site_tmpl_options();
1913
+
1914
+ //sek_error_log('site_templates options ?', $opts );
1915
+
1916
+ if ( is_array( $opts) && !empty( $opts['site_templates']) && is_array( $opts['site_templates'] ) ) {
1917
+ if ( !empty( $opts['site_templates'][$group_skope] ) && '_no_site_tmpl_' != $opts['site_templates'][$group_skope] ) {
1918
+ $site_tmpl = $opts['site_templates'][$group_skope];
1919
+ }
1920
+ }
1921
+ return $site_tmpl;
1922
+ }
1923
+
1924
+
1925
+
1926
+
1927
+ // // @see _1_6_5_sektions_generate_UI_site_tmpl_options.js
1928
+ // // @return array() $normalized_values
1929
+ // function sek_normalize_site_tmpl_options_with_defaults( $option_name, $raw_module_values ) {
1930
+ // if ( empty($option_name) ) {
1931
+ // sek_error_log( __FUNCTION__ . ' => invalid option name' );
1932
+ // return array();
1933
+ // }
1934
+ // $normalized_values = ( !empty($raw_module_values) && is_array( $raw_module_values ) ) ? $raw_module_values : array();
1935
+ // // map the option key as saved in db ( @see _1_6_5_sektions_generate_UI_global_options.js ) and the module type
1936
+ // $site_tmpl_options_map = SEK_Front_Construct::$site_tmpl_options_map;
1937
+
1938
+ // //sek_error_log('SEK_Front_Construct::$global_options_map', SEK_Front_Construct::$global_options_map );
1939
+
1940
+ // if ( !array_key_exists($option_name, $site_tmpl_options_map) ) {
1941
+ // sek_error_log( __FUNCTION__ . ' => invalid option name', $option_name );
1942
+ // return $raw_module_values;
1943
+ // } else {
1944
+ // $module_type = $site_tmpl_options_map[$option_name];
1945
+ // }
1946
+
1947
+ // // normalize with the defaults
1948
+ // // class_exists check introduced since https://github.com/presscustomizr/nimble-builder/issues/432
1949
+ // // may not be mandatory
1950
+ // if ( class_exists('\Nimble\CZR_Fmk_Base') ) {
1951
+ // if( CZR_Fmk_Base()->czr_is_module_registered($module_type) ) {
1952
+ // $normalized_values = _sek_normalize_single_module_values( $normalized_values, $module_type );
1953
+ // }
1954
+ // } else {
1955
+ // sek_error_log( __FUNCTION__ . ' => error => CZR_Fmk_Base not loaded' );
1956
+ // }
1957
+ // return $normalized_values;
1958
+ // }
1959
+
1960
+
1961
  ?><?php
1962
 
1963
 
2268
  return $level_skope_id;
2269
  }
2270
 
2271
+ $local_skope_settings = sek_get_skoped_seks( $level_skope_id );
2272
  $local_collection = ( is_array( $local_skope_settings ) && !empty( $local_skope_settings['collection'] ) ) ? $local_skope_settings['collection'] : array();
2273
  // if the level id has not been found in the local sections, we know it's a global level.
2274
  // In dev mode, always make sure that the level id is found in the global locations.
2293
  function sek_has_global_sections() {
2294
  if ( skp_is_customizing() )
2295
  return true;
2296
+ if ( 'not_set' != Nimble_Manager()->page_has_global_sections )
2297
+ return Nimble_Manager()->page_has_global_sections;
2298
+
2299
  $maybe_global_sek_post = sek_get_seks_post( NIMBLE_GLOBAL_SKOPE_ID, 'global' );
2300
  $nb_section_created = 0;
2301
  if ( is_object($maybe_global_sek_post) ) {
2303
  $seks_data = is_array( $seks_data ) ? $seks_data : array();
2304
  $nb_section_created = sek_count_not_empty_sections_in_page( $seks_data );
2305
  }
2306
+ // cache now
2307
+ Nimble_Manager()->page_has_global_sections = $nb_section_created > 0;
2308
+ return Nimble_Manager()->page_has_global_sections;
2309
  }
2310
 
2311
 
2314
  // initially used to determine if a post or a page has been customized with Nimble Builder => if so, we add an edit link in the post/page list
2315
  // when used in admin, the skope_id must be provided
2316
  // can be used to determine if we need to render Nimble Builder assets on front. See ::sek_enqueue_front_assets()
2317
+ function sek_local_skope_has_nimble_sections( $skope_id = '', $seks_data = null ) {
2318
  if ( empty( $skope_id ) ) {
2319
  sek_error_log( __FUNCTION__ . ' => missing skope id' );
2320
  return false;
2321
  }
2322
+ if ( 'not_set' != Nimble_Manager()->page_has_local_sections )
2323
+ return Nimble_Manager()->page_has_local_sections;
2324
+
2325
  $nb_section_created = 0;
2326
+
2327
+ // When the collection is provided, use it
2328
+ if ( is_null($seks_data) || !is_array($seks_data) ) {
2329
+ $maybe_local_sek_post = sek_get_seks_post( $skope_id, 'local' );
2330
+ if ( is_object($maybe_local_sek_post) ) {
2331
+ $seks_data = maybe_unserialize($maybe_local_sek_post->post_content);
2332
+ $seks_data = is_array( $seks_data ) ? $seks_data : array();
2333
+ }
2334
+ }
2335
+ if ( is_array( $seks_data ) ) {
2336
  $nb_section_created = sek_count_not_empty_sections_in_page( $seks_data );
2337
  }
2338
+ // cache now
2339
+ Nimble_Manager()->page_has_local_sections = $nb_section_created > 0;
2340
+ return Nimble_Manager()->page_has_local_sections;
2341
  }
2342
 
2343
 
2993
 
2994
  // @return bool
2995
  function sek_is_json( $string ){
2996
+ if ( !is_string( $string ) )
2997
+ return false;
2998
  json_decode($string);
2999
  return (json_last_error() == JSON_ERROR_NONE);
3000
  }
3008
  if ( json_last_error() == JSON_ERROR_NONE ) {
3009
  // https://stackoverflow.com/questions/6465263/how-to-reverse-htmlentities
3010
  // added to fix regression https://github.com/presscustomizr/nimble-builder/issues/791
3011
+ $json_decoded_candidate = html_entity_decode($json_decoded_candidate, ENT_QUOTES, get_bloginfo( 'charset' ) );
3012
+ //sek_error_log('DECODED DECODED ?', $json_decoded_candidate );
3013
  return $json_decoded_candidate;
3014
  }
3015
+
3016
  return $string;
3017
  }
3018
 
3024
  if ( !sek_is_json($string) ) {
3025
  // https://stackoverflow.com/questions/6465263/how-to-reverse-htmlentities
3026
  // added to fix regression https://github.com/presscustomizr/nimble-builder/issues/791
3027
+ $string = htmlentities($string, ENT_COMPAT, get_bloginfo( 'charset' ) );//reversed with html_entity_decode
3028
+ //$string = wp_encode_emoji( $string );
3029
+ $string = wp_json_encode($string);
3030
+ //sek_error_log('JSON ENCODED ?', $string );
3031
  }
3032
  return $string;
3033
  }
3039
  function sek_is_site_tmpl_enabled() {
3040
  return defined('NIMBLE_SITE_TEMPLATES_ENABLED') && NIMBLE_SITE_TEMPLATES_ENABLED;
3041
  }
3042
+
3043
+ // inspired from https://stackoverflow.com/questions/1846202/php-how-to-generate-a-random-unique-alphanumeric-string-for-use-in-a-secret-l
3044
+ // equivalent of js customizer method CZRSeksPrototype::guid()
3045
+ // introduced feb 2021 for https://github.com/presscustomizr/nimble-builder/issues/478
3046
+ // used when generating id server side for a site template
3047
+ function sek_generate_level_guid() {
3048
+ return NIMBLE_PREFIX_FOR_SETTING_NOT_SAVED . substr( strval( md5( uniqid( rand(), true) ) ),0, 12 );//__nimble__4cdf8be5ce8f
3049
+ }
3050
  ?><?php
3051
  // /* ------------------------------------------------------------------------- *
3052
  // * NIMBLE API
3980
  * @return WP_Post|null The skope post or null if none exists.
3981
  */
3982
  function sek_get_seks_post( $skope_id = '', $skope_level = 'local' ) {
 
3983
  if ( empty( $skope_id ) ) {
3984
  $skope_id = skp_get_skope_id( $skope_level );
3985
  }
4048
  }
4049
 
4050
 
4051
+ function sek_set_ids( $collection ) {
4052
+ if ( is_array( $collection ) ) {
4053
+ // if ( array_key_exists('level', $collection ) && in_array( $collection['level'], ['section', 'column', 'module'] ) && array_key_exists('id', $collection ) ) {
4054
+ // $collection['id'] = sek_generate_level_guid();
4055
+ // }
4056
+ foreach( $collection as $key => $data ) {
4057
+ if ( '__rep__me__' === $data && 'id' === $key ) {
4058
+ $collection[$key] = sek_generate_level_guid();
4059
+ } else if ( is_array( $data ) ) {
4060
+ $collection[$key] = sek_set_ids($data);
4061
+ }
4062
+ }
4063
+ }
4064
+ return $collection;
4065
+ }
4066
+
4067
+
4068
+ // Feb 2021 => experimental for https://github.com/presscustomizr/nimble-builder/issues/478
4069
+ // filter declared in inc\sektions\_front_dev_php\_constants_and_helper_functions\0_9_0_sektions_functions_seks_post_set_get.php
4070
+ // add_filter('nb_set_skope_id_before_caching_local_sektions', function( $skope_id ) {
4071
+ // if ( !defined('NIMBLE_SITE_TEMPLATES_ENABLED') || !NIMBLE_SITE_TEMPLATES_ENABLED )
4072
+ // return $skope_id;
4073
+
4074
+ // $group_skope = skp_get_skope_id( 'group' );
4075
+ // sek_error_log('GROUP SKOPE ?' . skp_get_skope_id( 'group' ) );
4076
+ // if ( 'skp__all_page' === $group_skope ) {
4077
+ // $skope_id = $group_skope;
4078
+ // $tmpl_post_name = sek_get_site_tmpl_for_skope( $group_skope );
4079
+ // if ( !is_null($tmpl_post_name) && is_string($tmpl_post_name ) ) {
4080
+ // $current_tmpl_post = sek_get_saved_tmpl_post( $tmpl_post_name );
4081
+ // if ( $current_tmpl_post ) {
4082
+ // //sek_error_log( 'TEMPLATE POST ?', $current_tmpl_post );
4083
+ // $current_tmpl_data = maybe_unserialize( $current_tmpl_post->post_content );
4084
+ // if ( is_array($current_tmpl_data) && isset($current_tmpl_data['data']) && is_array($current_tmpl_data['data']) && !empty($current_tmpl_data['data']) ) {
4085
+ // $current_tmpl_data = $current_tmpl_data['data'];
4086
+ // //sek_error_log( 'current_tmpl_data ?', $current_tmpl_data );
4087
+ // $current_tmpl_data = sek_set_ids( $current_tmpl_data );
4088
+ // //sek_error_log( 'current_tmpl_data WITH IDS?', $current_tmpl_data );
4089
+ // sek_update_sek_post( $current_tmpl_data, [ 'skope_id' => $skope_id ]);
4090
+ // }
4091
+ // }
4092
+ // }
4093
+ // }
4094
+ // return $skope_id;
4095
+ // });
4096
+
4097
+ // Feb 2021 => experimental for https://github.com/presscustomizr/nimble-builder/issues/478
4098
+ // filter declared in inc\sektions\_front_dev_php\8_4_1_sektions_front_class_render_css.php
4099
+ add_filter( 'nb_set_skope_id_before_generating_local_front_css', function( $skope_id ) {
4100
+ if ( !defined('NIMBLE_SITE_TEMPLATES_ENABLED') || !NIMBLE_SITE_TEMPLATES_ENABLED )
4101
+ return $skope_id;
4102
+
4103
+ if ( !sek_local_skope_has_nimble_sections( $skope_id ) ) {
4104
+ $group_skope = skp_get_skope_id( 'group' );
4105
+ $tmpl_post_name = sek_get_site_tmpl_for_skope( $group_skope );
4106
+ sek_error_log('group skope id for CSS GENERATION ?', $group_skope );
4107
+ //sek_error_log('SITE template for skope ' . $group_skope . ' => ' . $tmpl_post_name );
4108
+
4109
+ if ( !is_null( $tmpl_post_name ) && is_string( $tmpl_post_name ) ) {
4110
+ $skope_id = $group_skope;
4111
+ }
4112
+ }
4113
+ // if ( 'skp__all_page' === $group_skope ) {
4114
+ // $skope_id = $group_skope;
4115
+ // }
4116
+
4117
+ sek_error_log('alors local skope id for CSS GENERATION ?', $skope_id );
4118
+
4119
+ return $skope_id;
4120
+ });
4121
+
4122
+
4123
+ add_filter('nb_set_local_collection_before_caching', function( $seks_data, $skope_id ) {
4124
+ if ( !defined('NIMBLE_SITE_TEMPLATES_ENABLED') || !NIMBLE_SITE_TEMPLATES_ENABLED )
4125
+ return $seks_data;
4126
+
4127
+ // sek_error_log('GROUP SKOPE ?' . skp_get_skope_id( 'group' ) );
4128
+ // sek_error_log('SOOO ? => ' . sek_local_skope_has_nimble_sections( $skope_id, $seks_data ) );
4129
+ //sek_error_log( '$seks_data ??', $seks_data );
4130
+
4131
+ if ( !sek_local_skope_has_nimble_sections( $skope_id, $seks_data ) ) {
4132
+ $seks_data = sek_maybe_get_seks_for_group_site_template();
4133
+ }
4134
+ return $seks_data;
4135
+ }, 10, 2);
4136
+
4137
+
4138
+
4139
+ function sek_maybe_get_seks_for_group_site_template( $group_skope = null ) {
4140
+ if ( !defined('NIMBLE_SITE_TEMPLATES_ENABLED') || !NIMBLE_SITE_TEMPLATES_ENABLED )
4141
+ return [];
4142
+
4143
+ $group_skope = skp_get_skope_id( 'group' );
4144
+ $seks_data = [];
4145
+
4146
+ // do we have a template assigned to this group skope ?
4147
+ // For example is skp__all_page assigned to template 'nb_tmpl_nimble-template-loop-start-only'
4148
+ $tmpl_post_name = sek_get_site_tmpl_for_skope( $group_skope );
4149
+
4150
+ sek_error_log('SITE template for skope ' . $group_skope . ' => ' . $tmpl_post_name );
4151
+
4152
+ if ( is_null( $tmpl_post_name ) || !is_string( $tmpl_post_name ) )
4153
+ return [];
4154
+
4155
+ if ( skp_is_customizing() ) {
4156
+ $current_tmpl_post = sek_get_saved_tmpl_post( $tmpl_post_name );
4157
+ if ( $current_tmpl_post ) {
4158
+ $current_tmpl_data = maybe_unserialize( $current_tmpl_post->post_content );
4159
+ if ( is_array($current_tmpl_data) && isset($current_tmpl_data['data']) && is_array($current_tmpl_data['data']) && !empty($current_tmpl_data['data']) ) {
4160
+ $current_tmpl_data = $current_tmpl_data['data'];
4161
+ $current_tmpl_data = sek_set_ids( $current_tmpl_data );
4162
+ sek_error_log( 'CUSTOMIZING SEKS DATA FROM TEMPLATE => ' . $tmpl_post_name );
4163
+ $seks_data = $current_tmpl_data;
4164
+ }
4165
+ }
4166
+ } else {
4167
+ // Is this group template already saved ?
4168
+ // For example, for pages, there should be a nimble CPT post named nimble___skp__all_page
4169
+ $post = sek_get_seks_post( $group_skope );
4170
+
4171
+ //sek_error_log('POST ??' . $tmpl_post_name, $post );
4172
+ // if not, let's insert it
4173
+ if ( !$post ) {
4174
+ $current_tmpl_post = sek_get_saved_tmpl_post( $tmpl_post_name );
4175
+ if ( $current_tmpl_post ) {
4176
+ //sek_error_log( 'TEMPLATE POST ?', $current_tmpl_post );
4177
+ $current_tmpl_data = maybe_unserialize( $current_tmpl_post->post_content );
4178
+ if ( is_array($current_tmpl_data) && isset($current_tmpl_data['data']) && is_array($current_tmpl_data['data']) && !empty($current_tmpl_data['data']) ) {
4179
+ $current_tmpl_data = $current_tmpl_data['data'];
4180
+ //sek_error_log( 'current_tmpl_data ?', $current_tmpl_data );
4181
+ $current_tmpl_data = sek_set_ids( $current_tmpl_data );
4182
+ sek_error_log( 'sek_update_sek_post => ' . $tmpl_post_name );
4183
+ $post = sek_update_sek_post( $current_tmpl_data, [ 'skope_id' => $group_skope ]);
4184
+ //sek_error_log('POST DATA ?', maybe_unserialize( $post->post_content ) );
4185
+
4186
+ }
4187
+ }
4188
+ }
4189
+
4190
+ if ( $post ) {
4191
+ $seks_data = maybe_unserialize( $post->post_content );
4192
+ }
4193
+ }
4194
+
4195
+
4196
+ return $seks_data;
4197
+ }
4198
+
4199
+
4200
  /**
4201
  * Fetch the saved collection of sektion for a given skope_id / location
4202
  *
4225
  }
4226
 
4227
  if ( !$is_cached ) {
4228
+ // Feb 2021 : filter skope id now
4229
+ // if the current context has no local sektions set and a site template set, replace the skope id by the group skope id
4230
+ // if ( !$is_global_skope ) {
4231
+ // $skope_id = apply_filters( 'nb_set_skope_id_before_caching_local_sektions', $skope_id );
4232
+ // //sek_error_log('alors local skope id for fetching local sections ?', $skope_id );
4233
+ // }
4234
+
4235
  $seks_data = array();
4236
  $post = sek_get_seks_post( $skope_id, $is_global_skope ? 'global' : 'local' );
4237
  if ( $post ) {
4239
  }
4240
  $seks_data = is_array( $seks_data ) ? $seks_data : array();
4241
 
4242
+ if ( !$is_global_skope ) {
4243
+ $seks_data = apply_filters( 'nb_set_local_collection_before_caching', $seks_data, $skope_id );
4244
+ }
4245
+
4246
  // normalizes
4247
  // [ 'collection' => [], 'local_options' => [] ];
4248
  $default_collection = sek_get_default_location_model( $skope_id );
4249
  $seks_data = wp_parse_args( $seks_data, $default_collection );
4250
  // Maybe add missing registered locations
4251
  $seks_data = sek_maybe_add_incomplete_locations( $seks_data, $is_global_skope );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4252
 
4253
  // cache now
4254
  if ( $is_global_skope ) {
4270
  // Maybe add missing registered locations when customizing
4271
  // December 2020 => needed when importing an entire template
4272
  $seks_data = sek_maybe_add_incomplete_locations( $seks_data, $is_global_skope );
4273
+
4274
+ // if ( !$is_global_skope ) {
4275
+ // $seks_data = apply_filters( 'nb_set_local_collection_before_caching', $seks_data, $skope_id );
4276
+ // }
4277
  }
4278
 
4279
  // if a location is specified, return specifically the sections of this location
4311
 
4312
 
4313
 
4314
+
4315
+
4316
+
4317
+
4318
  /**
4319
  * Update the `nimble_post_type` post for a given "{$skope_id}"
4320
  * Inserts a `nimble_post_type` post when one doesn't yet exist.
4342
 
4343
  $post_title = NIMBLE_OPT_PREFIX_FOR_SEKTION_COLLECTION . $skope_id;
4344
 
4345
+ //sek_error_log('IN UPDATE SEK_POST ?', $seks_data );
4346
+
4347
+
4348
  $post_data = array(
4349
  'post_title' => $post_title,
4350
  'post_name' => sanitize_title( $post_title ),
inc/sektions/ccat-czr-sektions.php CHANGED
@@ -135,11 +135,13 @@ function sek_enqueue_controls_js_css() {
135
 
136
  'optPrefixForSektionSetting' => NIMBLE_OPT_PREFIX_FOR_SEKTION_COLLECTION,//'nimble___'
137
  'optNameForGlobalOptions' => NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS,//'nimble___'
138
- 'optNameForSiteTmplOptions' => NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS,// __site_templates__
139
  'prefixForSettingsNotSaved' => NIMBLE_PREFIX_FOR_SETTING_NOT_SAVED,//"__nimble__"
140
 
141
  'globalOptionDBValues' => get_option( NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS ),// '__nimble_options__'
142
- 'siteTmplOptionDBValues' => get_option( NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS ),// '__site_templates__
 
 
143
 
144
  'defaultLocationModel' => Nimble_Manager()->default_location_model,
145
  'defaultLocalSektionSettingValue' => sek_get_default_location_model(),
@@ -705,10 +707,23 @@ function add_sektion_values_to_skope_export( $skopes ) {
705
  sek_error_log( __FUNCTION__ . ' error => missing skope informations' );
706
  continue;
707
  }
 
708
  if ( 'group' == $skp_data['skope'] ) {
 
 
 
 
 
 
 
 
 
 
709
  $new_skopes[] = $skp_data;
710
  continue;
711
  }
 
 
712
  if ( !is_array( $skp_data ) ) {
713
  error_log( 'skp_json_export_ready_skopes filter => the skope data must be an array.' );
714
  continue;
135
 
136
  'optPrefixForSektionSetting' => NIMBLE_OPT_PREFIX_FOR_SEKTION_COLLECTION,//'nimble___'
137
  'optNameForGlobalOptions' => NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS,//'nimble___'
138
+ 'optNameForSiteTmplOptions' => NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS,// nimble_site_templates
139
  'prefixForSettingsNotSaved' => NIMBLE_PREFIX_FOR_SETTING_NOT_SAVED,//"__nimble__"
140
 
141
  'globalOptionDBValues' => get_option( NIMBLE_OPT_NAME_FOR_GLOBAL_OPTIONS ),// '__nimble_options__'
142
+ 'siteTmplOptionDBValues' => get_option( NIMBLE_OPT_NAME_FOR_SITE_TMPL_OPTIONS ),// 'nimble_site_templates
143
+
144
+ 'isSiteTmplEnabled' => defined('NIMBLE_SITE_TEMPLATES_ENABLED') && NIMBLE_SITE_TEMPLATES_ENABLED,
145
 
146
  'defaultLocationModel' => Nimble_Manager()->default_location_model,
147
  'defaultLocalSektionSettingValue' => sek_get_default_location_model(),
707
  sek_error_log( __FUNCTION__ . ' error => missing skope informations' );
708
  continue;
709
  }
710
+
711
  if ( 'group' == $skp_data['skope'] ) {
712
+ // FEB 2021 => Group site template. #478
713
+ if ( defined('NIMBLE_SITE_TEMPLATES_ENABLED') && NIMBLE_SITE_TEMPLATES_ENABLED ) {
714
+ $group_skope_id = skp_get_skope_id( 'group' );
715
+ $seks_data = sek_maybe_get_seks_for_group_site_template($group_skope_id );
716
+ // Feb 2021 added to fix regression https://github.com/presscustomizr/nimble-builder/issues/791
717
+ $seks_data = sek_prepare_seks_data_for_customizer( $seks_data );
718
+ $skp_data[ 'group_sektions' ] = [
719
+ 'db_values' => $seks_data,
720
+ ];
721
+ }
722
  $new_skopes[] = $skp_data;
723
  continue;
724
  }
725
+
726
+
727
  if ( !is_array( $skp_data ) ) {
728
  error_log( 'skp_json_export_ready_skopes filter => the skope data must be an array.' );
729
  continue;
inc/sektions/ccat-sektions-base.php CHANGED
@@ -2132,6 +2132,7 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2132
  // store the local and global options
2133
  public $local_options = '_not_cached_yet_';
2134
  public $global_nimble_options = '_not_cached_yet_';
 
2135
 
2136
  public $img_smartload_enabled = 'not_cached';
2137
  public $video_bg_lazyload_enabled = 'not_cached';//<= for https://github.com/presscustomizr/nimble-builder/issues/287
@@ -2283,7 +2284,10 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2283
  // March 2020, for https://github.com/presscustomizr/nimble-builder/issues/649
2284
  public $nimble_content_is_printed_on_this_page = false;//<= tells if any Nimble Content has been printed.
2285
  // October 2020
2286
- public $page_has_local_or_global_sections = false;//<= set @wp_enqueue_script, used to determine if we should load css, js and fonts assets or not.
 
 
 
2287
 
2288
  // April 2020 for https://github.com/presscustomizr/nimble-builder/issues/679
2289
  public $is_content_restricted = false; //<= set at 'wp'
@@ -2315,7 +2319,6 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2315
  // janv 2021 => will populate the modules stylesheets already concatenated, so that NB doesn't concatenate a module stylesheet twice for the local css and for the global css (if any)
2316
  // see in inc\sektions\_front_dev_php\dyn_css_builder_and_google_fonts_printer\5_0_1_class-sek-dyn-css-builder.php
2317
  public $concatenated_module_stylesheets = [];
2318
-
2319
 
2320
  /////////////////////////////////////////////////////////////////
2321
  // <CONSTRUCTOR>
@@ -2935,7 +2938,9 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
2935
  // see https://github.com/presscustomizr/nimble-builder/issues/586
2936
  // we know the skope_id because 'wp' has been fired
2937
  // October 2020
2938
- Nimble_Manager()->page_has_local_or_global_sections = sek_local_skope_has_nimble_sections( skp_get_skope_id() ) || sek_has_global_sections();
 
 
2939
  }
2940
 
2941
 
@@ -2957,7 +2962,7 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
2957
 
2958
 
2959
  // Always load the base Nimble style when user logged in so we can display properly the button in the top admin bar.
2960
- if ( is_user_logged_in() || Nimble_Manager()->page_has_local_or_global_sections ) {
2961
  $rtl_suffix = is_rtl() ? '-rtl' : '';
2962
 
2963
  //wp_enqueue_style( 'google-material-icons', '//fonts.googleapis.com/icon?family=Material+Icons', array(), null, 'all' );
@@ -3471,7 +3476,13 @@ if ( !class_exists( 'SEK_Front_Assets' ) ) :
3471
  'contextuallyActiveModules' => sek_get_collection_of_contextually_active_modules(),
3472
  'fontAwesomeAlreadyEnqueued' => wp_style_is('customizr-fa', 'enqueued') || wp_style_is('hueman-font-awesome', 'enqueued'),
3473
 
3474
- 'partialFrontScripts' => Nimble_Manager()->partial_front_scripts
 
 
 
 
 
 
3475
  );
3476
  $l10n = apply_filters( 'nimble-localized-js-front', $l10n );
3477
 
@@ -4227,7 +4238,6 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
4227
  ));
4228
 
4229
  //$is_global = sek_is_global_location( $location_id );
4230
- // $skope_id = skp_get_skope_id();
4231
  // $skopeLocationCollection = array();
4232
  // $skopeSettingValue = sek_get_skoped_seks( $skope_id );
4233
  // if ( is_array( ) && array_key_exists('collection', search) ) {
@@ -4529,13 +4539,13 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
4529
  // when for columns, we always apply the custom breakpoint defined by the user
4530
  // otherwise, when generating CSS rules like alignment, the custom breakpoint is applied if user explicitely checked the 'apply_to_all' option
4531
  // 'for_responsive_columns' is set to true when sek_get_closest_section_custom_breakpoint() is invoked from Nimble_Manager()::render()
4532
- $section_custom_breakpoint = sek_get_closest_section_custom_breakpoint( array(
4533
  'searched_level_id' => $parent_model['id'],
4534
  'for_responsive_columns' => true
4535
- ));
4536
 
4537
  $grid_column_class = "sek-col-{$col_suffix}";
4538
- if ( $section_custom_breakpoint >= 1 ) {
4539
  $grid_column_class = "sek-section-custom-breakpoint-col-{$col_suffix}";
4540
  } else if ( $global_custom_breakpoint >= 1 ) {
4541
  $grid_column_class = "sek-global-custom-breakpoint-col-{$col_suffix}";
@@ -5199,7 +5209,6 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
5199
  // fired @hook 'template_include'
5200
  // @return template path
5201
  function sek_maybe_set_local_nimble_template( $template ) {
5202
- //sek_error_log(' SOO ?? sek_get_skoped_seks( skp_get_skope_id() ) ' . skp_get_skope_id(), sek_get_skoped_seks( skp_get_skope_id() ) );
5203
  $locale_template = sek_get_locale_template();
5204
  if ( !empty( $locale_template ) ) {
5205
  $template = $locale_template;
@@ -5222,7 +5231,6 @@ if ( !class_exists( 'SEK_Front_Render' ) ) :
5222
  return;
5223
  }
5224
  if ( '_not_cached_yet_' === $this->has_local_header_footer || '_not_cached_yet_' === $this->has_global_header_footer ) {
5225
- //sek_error_log(' SOO ?? sek_get_skoped_seks( skp_get_skope_id() ) ' . skp_get_skope_id(), sek_get_skoped_seks( skp_get_skope_id() ) );
5226
  $local_header_footer_data = sek_get_local_option_value('local_header_footer');
5227
  $global_header_footer_data = sek_get_global_option_value('global_header_footer');
5228
 
@@ -5615,8 +5623,10 @@ if ( !class_exists( 'SEK_Front_Render_Css' ) ) :
5615
 
5616
  // Print global option inline CSS
5617
  add_action( 'wp_head', array( $this, 'sek_print_global_css' ), 1000 );
 
5618
  }
5619
 
 
5620
  // Can be fired :
5621
  // 1) on wp_enqueue_scripts or wp_head
5622
  // 2) when ajaxing, for actions 'sek-resize-columns', 'sek-refresh-stylesheet'
@@ -5638,14 +5648,20 @@ if ( !class_exists( 'SEK_Front_Render_Css' ) ) :
5638
  return;
5639
  }
5640
  $local_skope_id = $_POST['local_skope_id'];
 
 
 
 
5641
  $css_handler_instance = $this->_instantiate_css_handler( array( 'skope_id' => $skope_id, 'is_global_stylesheet' => NIMBLE_GLOBAL_SKOPE_ID === $skope_id ) );
5642
  $this->sek_print_global_css();
5643
  }
5644
  // in a front normal context, the css is enqueued from the already written file.
5645
  else {
5646
- $local_skope_id = skp_build_skope_id();
 
 
5647
  // LOCAL SECTIONS STYLESHEET
5648
- $this->_instantiate_css_handler( array( 'skope_id' => skp_build_skope_id() ) );
5649
  // GLOBAL SECTIONS STYLESHEET
5650
  // Can hold rules for global sections and global styling
5651
  $this->_instantiate_css_handler( array( 'skope_id' => NIMBLE_GLOBAL_SKOPE_ID, 'is_global_stylesheet' => true ) );
@@ -5678,8 +5694,8 @@ if ( !class_exists( 'SEK_Front_Render_Css' ) ) :
5678
  }
5679
  }
5680
 
5681
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX && empty( $skope_id ) ) {
5682
- sek_error_log( __CLASS__ . '::' . __FUNCTION__ . ' =>the skope_id should not be empty' );
5683
  }
5684
  }//print_or_enqueue_seks_style
5685
 
@@ -5791,7 +5807,7 @@ if ( !class_exists( 'SEK_Front_Render_Css' ) ) :
5791
  if ( 'not_set' !== Nimble_Manager()->google_fonts_print_candidates )
5792
  return Nimble_Manager()->google_fonts_print_candidates;
5793
 
5794
- $local_skope_id = is_null( $local_skope_id ) ? skp_build_skope_id() : $local_skope_id;
5795
  // local sections
5796
  $local_seks = sek_get_skoped_seks( $local_skope_id );
5797
  // global sections
2132
  // store the local and global options
2133
  public $local_options = '_not_cached_yet_';
2134
  public $global_nimble_options = '_not_cached_yet_';
2135
+ public $site_template_options = '_not_cached_yet_';
2136
 
2137
  public $img_smartload_enabled = 'not_cached';
2138
  public $video_bg_lazyload_enabled = 'not_cached';//<= for https://github.com/presscustomizr/nimble-builder/issues/287
2284
  // March 2020, for https://github.com/presscustomizr/nimble-builder/issues/649
2285
  public $nimble_content_is_printed_on_this_page = false;//<= tells if any Nimble Content has been printed.
2286
  // October 2020
2287
+ public $page_has_local_or_global_sections = 'not_set';//<= set @wp_enqueue_script, used to determine if we should load css, js and fonts assets or not.
2288
+ // feb 2021, introduced for #478
2289
+ public $page_has_local_sections = 'not_set';
2290
+ public $page_has_global_sections = 'not_set';
2291
 
2292
  // April 2020 for https://github.com/presscustomizr/nimble-builder/issues/679
2293
  public $is_content_restricted = false; //<= set at 'wp'
2319
  // janv 2021 => will populate the modules stylesheets already concatenated, so that NB doesn't concatenate a module stylesheet twice for the local css and for the global css (if any)
2320
  // see in inc\sektions\_front_dev_php\dyn_css_builder_and_google_fonts_printer\5_0_1_class-sek-dyn-css-builder.php
2321
  public $concatenated_module_stylesheets = [];
 
2322
 
2323
  /////////////////////////////////////////////////////////////////
2324
  // <CONSTRUCTOR>
2938
  // see https://github.com/presscustomizr/nimble-builder/issues/586
2939
  // we know the skope_id because 'wp' has been fired
2940
  // October 2020
2941
+ if ( 'not_set' === Nimble_Manager()->page_has_local_or_global_sections ) {
2942
+ Nimble_Manager()->page_has_local_or_global_sections = sek_local_skope_has_nimble_sections( skp_get_skope_id() ) || sek_has_global_sections();
2943
+ }
2944
  }
2945
 
2946
 
2962
 
2963
 
2964
  // Always load the base Nimble style when user logged in so we can display properly the button in the top admin bar.
2965
+ if ( is_user_logged_in() || false != Nimble_Manager()->page_has_local_or_global_sections ) {
2966
  $rtl_suffix = is_rtl() ? '-rtl' : '';
2967
 
2968
  //wp_enqueue_style( 'google-material-icons', '//fonts.googleapis.com/icon?family=Material+Icons', array(), null, 'all' );
3476
  'contextuallyActiveModules' => sek_get_collection_of_contextually_active_modules(),
3477
  'fontAwesomeAlreadyEnqueued' => wp_style_is('customizr-fa', 'enqueued') || wp_style_is('hueman-font-awesome', 'enqueued'),
3478
 
3479
+ 'partialFrontScripts' => Nimble_Manager()->partial_front_scripts,
3480
+
3481
+ // Debug for https://github.com/presscustomizr/nimble-builder/issues/795
3482
+ // 'debug' => [
3483
+ // 'nb_debug_save' => get_transient('nb_debug_save'),
3484
+ // 'nb_debug_get' => get_transient('nb_debug_get')
3485
+ // ]
3486
  );
3487
  $l10n = apply_filters( 'nimble-localized-js-front', $l10n );
3488
 
4238
  ));
4239
 
4240
  //$is_global = sek_is_global_location( $location_id );
 
4241
  // $skopeLocationCollection = array();
4242
  // $skopeSettingValue = sek_get_skoped_seks( $skope_id );
4243
  // if ( is_array( ) && array_key_exists('collection', search) ) {
4539
  // when for columns, we always apply the custom breakpoint defined by the user
4540
  // otherwise, when generating CSS rules like alignment, the custom breakpoint is applied if user explicitely checked the 'apply_to_all' option
4541
  // 'for_responsive_columns' is set to true when sek_get_closest_section_custom_breakpoint() is invoked from Nimble_Manager()::render()
4542
+ $section_custom_breakpoint = intval( sek_get_closest_section_custom_breakpoint( array(
4543
  'searched_level_id' => $parent_model['id'],
4544
  'for_responsive_columns' => true
4545
+ )));
4546
 
4547
  $grid_column_class = "sek-col-{$col_suffix}";
4548
+ if ( is_int($section_custom_breakpoint) && $section_custom_breakpoint >= 1 ) {
4549
  $grid_column_class = "sek-section-custom-breakpoint-col-{$col_suffix}";
4550
  } else if ( $global_custom_breakpoint >= 1 ) {
4551
  $grid_column_class = "sek-global-custom-breakpoint-col-{$col_suffix}";
5209
  // fired @hook 'template_include'
5210
  // @return template path
5211
  function sek_maybe_set_local_nimble_template( $template ) {
 
5212
  $locale_template = sek_get_locale_template();
5213
  if ( !empty( $locale_template ) ) {
5214
  $template = $locale_template;
5231
  return;
5232
  }
5233
  if ( '_not_cached_yet_' === $this->has_local_header_footer || '_not_cached_yet_' === $this->has_global_header_footer ) {
 
5234
  $local_header_footer_data = sek_get_local_option_value('local_header_footer');
5235
  $global_header_footer_data = sek_get_global_option_value('global_header_footer');
5236
 
5623
 
5624
  // Print global option inline CSS
5625
  add_action( 'wp_head', array( $this, 'sek_print_global_css' ), 1000 );
5626
+
5627
  }
5628
 
5629
+
5630
  // Can be fired :
5631
  // 1) on wp_enqueue_scripts or wp_head
5632
  // 2) when ajaxing, for actions 'sek-resize-columns', 'sek-refresh-stylesheet'
5648
  return;
5649
  }
5650
  $local_skope_id = $_POST['local_skope_id'];
5651
+
5652
+ // Feb 2021 => for site template #478
5653
+ $local_skope_id = apply_filters( 'nb_set_skope_id_before_generating_local_front_css', $local_skope_id );
5654
+
5655
  $css_handler_instance = $this->_instantiate_css_handler( array( 'skope_id' => $skope_id, 'is_global_stylesheet' => NIMBLE_GLOBAL_SKOPE_ID === $skope_id ) );
5656
  $this->sek_print_global_css();
5657
  }
5658
  // in a front normal context, the css is enqueued from the already written file.
5659
  else {
5660
+ // Feb 2021 => for site template #478
5661
+ $local_skope_id = apply_filters( 'nb_set_skope_id_before_generating_local_front_css', skp_build_skope_id() );
5662
+
5663
  // LOCAL SECTIONS STYLESHEET
5664
+ $this->_instantiate_css_handler( array( 'skope_id' => $local_skope_id ) );
5665
  // GLOBAL SECTIONS STYLESHEET
5666
  // Can hold rules for global sections and global styling
5667
  $this->_instantiate_css_handler( array( 'skope_id' => NIMBLE_GLOBAL_SKOPE_ID, 'is_global_stylesheet' => true ) );
5694
  }
5695
  }
5696
 
5697
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX && empty( $local_skope_id ) ) {
5698
+ sek_error_log( __CLASS__ . '::' . __FUNCTION__ . ' => the skope_id should not be empty' );
5699
  }
5700
  }//print_or_enqueue_seks_style
5701
 
5807
  if ( 'not_set' !== Nimble_Manager()->google_fonts_print_candidates )
5808
  return Nimble_Manager()->google_fonts_print_candidates;
5809
 
5810
+ $local_skope_id = is_null( $local_skope_id ) ? apply_filters( 'maybe_set_skope_id_for_site_template_css', skp_build_skope_id() ) : $local_skope_id;
5811
  // local sections
5812
  $local_seks = sek_get_skoped_seks( $local_skope_id );
5813
  // global sections
inc/sektions/ccat-sektions-ui-modules.php CHANGED
@@ -3252,11 +3252,14 @@ function sek_add_css_rules_for_sections_breakpoint( $rules, $section ) {
3252
  // when for columns, we always apply the custom breakpoint defined by the user
3253
  // otherwise, when generating CSS rules like alignment, the custom breakpoint is applied if user explicitely checked the 'apply_to_all' option
3254
  // 'for_responsive_columns' is set to true when sek_get_closest_section_custom_breakpoint() is invoked from Nimble_Manager()::render()
3255
- $custom_breakpoint = sek_get_closest_section_custom_breakpoint( array(
3256
  'searched_level_id' => $section['id'],
3257
  'for_responsive_columns' => true
3258
- ));
3259
- if ( $custom_breakpoint > 0 ) {
 
 
 
3260
  $col_number = ( array_key_exists( 'collection', $section ) && is_array( $section['collection'] ) ) ? count( $section['collection'] ) : 1;
3261
  $col_number = 12 < $col_number ? 12 : $col_number;
3262
  $col_width_in_percent = 100/$col_number;
@@ -4665,26 +4668,28 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4665
  // 'validate_callback' => 'function_prefix_to_be_replaced_validate_callback__czr_social_module',
4666
  'tmpl' => array(
4667
  'item-inputs' => array(
4668
- 'home' => array(
4669
- 'input_type' => 'simpleselect',
4670
- 'title' => __('Template for home', 'nimble-builder'),
4671
- 'default' => '_no_site_tmpl_',
4672
- 'choices' => [
4673
- '_no_site_tmpl_' => 'Default theme template',
4674
- 'nb_tmpl_home-page-template' => 'Home page template',
4675
- 'nb_tmpl_nimble-template-loop-start-only' => 'Nimble Template + Loop start only'
4676
- ],
4677
- //'refresh_preview' => true,
4678
- 'notice_before_title' => '',
4679
- 'width-100' => true,
4680
- 'title_width' => 'width-100'
4681
- ),
4682
- 'pages' => array(
 
4683
  'input_type' => 'simpleselect',
4684
  'title' => __('Template for pages', 'nimble-builder'),
4685
  'default' => '_no_site_tmpl_',
4686
  'choices' => [
4687
  '_no_site_tmpl_' => 'Default theme template',
 
4688
  'nb_tmpl_home-page-template' => 'Home page template',
4689
  'nb_tmpl_nimble-template-loop-start-only' => 'Nimble Template + Loop start only'
4690
  ],
@@ -4693,7 +4698,7 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4693
  'width-100' => true,
4694
  'title_width' => 'width-100'
4695
  ),
4696
- 'posts' => array(
4697
  'input_type' => 'simpleselect',
4698
  'title' => __('Template for posts', 'nimble-builder'),
4699
  'default' => '_no_site_tmpl_',
@@ -4707,7 +4712,7 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4707
  'width-100' => true,
4708
  'title_width' => 'width-100'
4709
  ),
4710
- 'categories' => array(
4711
  'input_type' => 'simpleselect',
4712
  'title' => __('Template for categories', 'nimble-builder'),
4713
  'default' => '_no_site_tmpl_',
@@ -4721,7 +4726,7 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4721
  'width-100' => true,
4722
  'title_width' => 'width-100'
4723
  ),
4724
- 'tags' => array(
4725
  'input_type' => 'simpleselect',
4726
  'title' => __('Template for tags', 'nimble-builder'),
4727
  'default' => '_no_site_tmpl_',
@@ -4735,7 +4740,7 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4735
  'width-100' => true,
4736
  'title_width' => 'width-100'
4737
  ),
4738
- 'authors' => array(
4739
  'input_type' => 'simpleselect',
4740
  'title' => __('Template for authors', 'nimble-builder'),
4741
  'default' => '_no_site_tmpl_',
@@ -4749,7 +4754,7 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4749
  'width-100' => true,
4750
  'title_width' => 'width-100'
4751
  ),
4752
- 'search' => array(
4753
  'input_type' => 'simpleselect',
4754
  'title' => __('Template for search page', 'nimble-builder'),
4755
  'default' => '_no_site_tmpl_',
@@ -4763,7 +4768,7 @@ function sek_get_module_params_for_sek_site_tmpl_pickers() {
4763
  'width-100' => true,
4764
  'title_width' => 'width-100'
4765
  ),
4766
- '404' => array(
4767
  'input_type' => 'simpleselect',
4768
  'title' => __('Template for 404 error page', 'nimble-builder'),
4769
  'default' => '_no_site_tmpl_',
3252
  // when for columns, we always apply the custom breakpoint defined by the user
3253
  // otherwise, when generating CSS rules like alignment, the custom breakpoint is applied if user explicitely checked the 'apply_to_all' option
3254
  // 'for_responsive_columns' is set to true when sek_get_closest_section_custom_breakpoint() is invoked from Nimble_Manager()::render()
3255
+ $custom_breakpoint = intval( sek_get_closest_section_custom_breakpoint( array(
3256
  'searched_level_id' => $section['id'],
3257
  'for_responsive_columns' => true
3258
+ )));
3259
+ // sek_error_log('SECTION ??', $section );
3260
+ // sek_error_log('$custom_breakpoint??', is_int($custom_breakpoint) );
3261
+
3262
+ if ( is_int($custom_breakpoint) && $custom_breakpoint > 0 ) {
3263
  $col_number = ( array_key_exists( 'collection', $section ) && is_array( $section['collection'] ) ) ? count( $section['collection'] ) : 1;
3264
  $col_number = 12 < $col_number ? 12 : $col_number;
3265
  $col_width_in_percent = 100/$col_number;
4668
  // 'validate_callback' => 'function_prefix_to_be_replaced_validate_callback__czr_social_module',
4669
  'tmpl' => array(
4670
  'item-inputs' => array(
4671
+ // 'skp__home' => array(
4672
+ // 'input_type' => 'simpleselect',
4673
+ // 'title' => __('Template for home', 'text_doma'),
4674
+ // 'default' => '_no_site_tmpl_',
4675
+ // 'choices' => [
4676
+ // '_no_site_tmpl_' => 'Default theme template',
4677
+ // 'nb_tmpl_page-template' => 'Page template',
4678
+ // 'nb_tmpl_home-page-template' => 'Home page template',
4679
+ // 'nb_tmpl_nimble-template-loop-start-only' => 'Nimble Template + Loop start only'
4680
+ // ],
4681
+ // //'refresh_preview' => true,
4682
+ // 'notice_before_title' => '',
4683
+ // 'width-100' => true,
4684
+ // 'title_width' => 'width-100'
4685
+ // ),
4686
+ 'skp__all_page' => array(
4687
  'input_type' => 'simpleselect',
4688
  'title' => __('Template for pages', 'nimble-builder'),
4689
  'default' => '_no_site_tmpl_',
4690
  'choices' => [
4691
  '_no_site_tmpl_' => 'Default theme template',
4692
+ 'nb_tmpl_page-template' => 'Page template',
4693
  'nb_tmpl_home-page-template' => 'Home page template',
4694
  'nb_tmpl_nimble-template-loop-start-only' => 'Nimble Template + Loop start only'
4695
  ],
4698
  'width-100' => true,
4699
  'title_width' => 'width-100'
4700
  ),
4701
+ 'skp__all_post' => array(
4702
  'input_type' => 'simpleselect',
4703
  'title' => __('Template for posts', 'nimble-builder'),
4704
  'default' => '_no_site_tmpl_',
4712
  'width-100' => true,
4713
  'title_width' => 'width-100'
4714
  ),
4715
+ 'skp__all_category' => array(
4716
  'input_type' => 'simpleselect',
4717
  'title' => __('Template for categories', 'nimble-builder'),
4718
  'default' => '_no_site_tmpl_',
4726
  'width-100' => true,
4727
  'title_width' => 'width-100'
4728
  ),
4729
+ 'skp__all_post_tag' => array(
4730
  'input_type' => 'simpleselect',
4731
  'title' => __('Template for tags', 'nimble-builder'),
4732
  'default' => '_no_site_tmpl_',
4740
  'width-100' => true,
4741
  'title_width' => 'width-100'
4742
  ),
4743
+ 'skp__all_author' => array(
4744
  'input_type' => 'simpleselect',
4745
  'title' => __('Template for authors', 'nimble-builder'),
4746
  'default' => '_no_site_tmpl_',
4754
  'width-100' => true,
4755
  'title_width' => 'width-100'
4756
  ),
4757
+ 'skp__search' => array(
4758
  'input_type' => 'simpleselect',
4759
  'title' => __('Template for search page', 'nimble-builder'),
4760
  'default' => '_no_site_tmpl_',
4768
  'width-100' => true,
4769
  'title_width' => 'width-100'
4770
  ),
4771
+ 'skp__404' => array(
4772
  'input_type' => 'simpleselect',
4773
  'title' => __('Template for 404 error page', 'nimble-builder'),
4774
  'default' => '_no_site_tmpl_',
nimble-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Nimble Page Builder
4
  * Plugin URI: https://nimblebuilder.com
5
  * Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
6
- * Version: 2.2.1
7
  * Text Domain: nimble-builder
8
  * Author: Press Customizr
9
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
@@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) {
16
  /* ------------------------------------------------------------------------- *
17
  * CONSTANTS
18
  /* ------------------------------------------------------------------------- */
19
- $current_version = "2.2.1";
20
 
21
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
22
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
3
  * Plugin Name: Nimble Page Builder
4
  * Plugin URI: https://nimblebuilder.com
5
  * Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
6
+ * Version: 2.2.2
7
  * Text Domain: nimble-builder
8
  * Author: Press Customizr
9
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
16
  /* ------------------------------------------------------------------------- *
17
  * CONSTANTS
18
  /* ------------------------------------------------------------------------- */
19
+ $current_version = "2.2.2";
20
 
21
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
22
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: page builder, visual editor, customizer, drag and drop, header, footer, la
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.6
9
- Stable tag: 2.2.1
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
@@ -120,9 +120,12 @@ We have also published a detailed [troubleshooting guide for Nimble Builder](htt
120
  If you can't troubleshoot your issue, please open a new thread in [Nimble Builder support forum](https://wordpress.org/support/plugin/nimble-builder/).
121
 
122
  == Upgrade Notice ==
123
- 2.2.0 : Better support for emojis/emoticons. [image module] new option to use the current post thumbnail as source of the image. [level background] new option to use the current post thumbnail as source for the background url. [template] beta version of template saving
124
 
125
  == Changelog ==
 
 
 
126
  = 2.2.1 February 11th, 2021 =
127
  * fixed : regression introduced when fixing emoji encoding issue => json encoding html markup can break serialization
128
  * fixed : [button module] remove sanitize_text_field() action when sanitizing
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.6
9
+ Stable tag: 2.2.2
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
120
  If you can't troubleshoot your issue, please open a new thread in [Nimble Builder support forum](https://wordpress.org/support/plugin/nimble-builder/).
121
 
122
  == Upgrade Notice ==
123
+ 2.2.2 : [character encoding] fixed a problem occuring with some characters like (€ quotemarks „“, ä ü ö ß and 😘🚀) which could break rich text editor content
124
 
125
  == Changelog ==
126
+ = 2.2.2 February 18th, 2021 =
127
+ * fixed : [character encoding] some characters like (€ quotemarks „“, ä ü ö ß and € 😘🚀) can break rich text editor content
128
+
129
  = 2.2.1 February 11th, 2021 =
130
  * fixed : regression introduced when fixing emoji encoding issue => json encoding html markup can break serialization
131
  * fixed : [button module] remove sanitize_text_field() action when sanitizing