var SekPreviewPrototype=SekPreviewPrototype||{};!function(a,n,i){n.extend(SekPreviewPrototype,{cachedElements:{$body:n("body"),$window:n(window)},initialize:function(){var t=this;try{this.skope_id=i.findWhere(_wpCustomizeSettings.czr_new_skopes,{skope:"local"}).skope_id}catch(e){return void this.errare("Preview => error when storing the skope_id",e)}this.scheduleHighlightActiveLevel(),t.setupLoader(),n(function(){t.setupSortable(),t.setupResizable(),t.setupUiHoverVisibility(),t.scheduleUiClickReactions(),t.schedulePanelMsgReactions()}),t.cachedElements.$body.on("sek-columns-refreshed sek-modules-refreshed",function(e,t){if(!i.isUndefined(t)&&!i.isUndefined(t.in_sektion)&&0 error ",e)}})})},scheduleHighlightActiveLevel:function(){var s=this;this.activeLevelUI=new a.Value(""),this.activeLevelEl=new a.Value(null),this.activeUIChangedRecently=new a.Value(!1),this.activeLevelUI.bind(function(e,t){var a=n('[data-sek-id="'+e+'"]'),i=n('[data-sek-id="'+t+'"]');0

'+sekPreviewLocalized.i18n["Insert here"]+"

")[0]},update:function(e,t){}},start:function(e,t){s.cachedElements.$body.addClass("sek-moving-section"),s.isDraggingElement=!0,$sourceLocation=t.item.closest('[data-sek-level="location"]'),a=$sourceLocation.data("sek-id"),s.printAllLevelsUi()},stop:function(e,t){s.cachedElements.$body.removeClass("sek-moving-section"),s.isDraggingElement=!1,n=[],$targetLocation=t.item.closest('[data-sek-level="location"]'),i=$targetLocation.data("sek-id"),$targetLocation.children('[data-sek-level="section"]').each(function(){n.push(p(this).data("sek-id"))}),m.preview.send("sek-move",{id:t.item.data("sek-id"),level:"section",newOrder:n,from_location:a,to_location:i})},over:function(e,t){t.placeholder.addClass("sek-sortable-section-over")},out:function(e,t){t.placeholder.removeClass("sek-sortable-section-over")}})))},makeColumnsSortableInSektion:function(e){var a,i,s,n,o=this,t=p.extend(!0,{},o.sortableDefaultParams),r=[],d=[],l=p('[data-sek-id="'+e+'"]').find(".sek-sektion-inner").first(),c=function(e){if(e=p.extend({forTarget:!0},e||{}),!h.isEmpty(p(this).data("_sortable_columns_css_classes_")))return p(this).data("_sortable_columns_css_classes_");var t,a=p(this).closest('[data-sek-level="section"]').find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length,i=Math.floor(100/a);t=!0===e.forTarget?12 startOrder should not be empty"):o.printAllLevelsUi()},stop:function(e,t){$targetSektion=t.item.closest('[data-sek-level="section"]'),to_sektion=$targetSektion.data("sek-id"),$targetSektion.find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){d.push(p(this).data("sek-id"))});var a,i=p(this).closest('[data-sek-level="section"]').find(".sek-sektion-inner").first().children('[data-sek-level="column"]');!0!==p(this).data("sek-is-sender")?(a=c.call(p(this)),h.isEmpty(a)||i.each(function(){p(this).removeClass(a.current).addClass(a.next)})):(a=c.call(p(this),{forTarget:!1}),h.isEmpty(a)||i.each(function(){p(this).addClass(a.current).removeClass(a.next)})),p('[data-sek-level="section"]').find(".sek-sektion-inner").each(function(){p(this).data("sek-is-sender",null).data("_sortable_columns_css_classes_",null)}),h.isEmpty(d)?o.errare("column sortable => newOrder should not be empty"):h.isEqual(d,r)&&to_sektion===from_sektion?sekPreviewLocalized.isDevMode&&o.errare("preview => makeModulesSortableInColumn => start and stop positions are identical"):(m.preview.send("sek-move",{id:t.item.data("sek-id"),level:"column",newOrder:d,from_sektion:from_sektion,to_sektion:to_sektion}),p('div[data-sek-id="'+from_sektion+'"]').trigger("sek-level-refreshed"),from_sektion!==to_sektion&&p('div[data-sek-id="'+to_sektion+'"]').trigger("sek-level-refreshed"))}}))},makeModulesSortableInColumn:function(e){var a,i,s,n,t,o,r,d,l,c=[],k=[],u=this;t=p.extend(!0,{},u.sortableDefaultParams),p('[data-sek-id="'+e+'"]').find(".sek-column-inner").first().sortable(h.extend(t,{handle:".sek-move-module",connectWith:".sek-column-inner",over:function(e,t){p('[data-sek-level="location"]').find(".sek-sortable-overing").each(function(){p(this).removeClass("sek-sortable-overing")}),p(e.target).addClass("sek-sortable-overing")},remove:function(e,t){d=t.item.closest('[data-sek-level="location"]'),to_location=d.data("sek-id"),l=!0===d.data("sek-is-global-location");var a=to_location!=from_location;return!(r!==l||!0===r&&!0===l&&a)||(m.preview.send("sek-notify",{message:sekPreviewLocalized.i18n["Moving elements between global and local sections is not allowed."]}),!1)},start:function(e,t){o=t.item.closest('[data-sek-level="location"]'),from_location=o.data("sek-id"),r=!0===o.data("sek-is-global-location"),c=[],k=[],u.cachedElements.$body.addClass("sek-dragging-element"),i=t.item.closest('[data-sek-level="column"]').data("sek-id"),a=t.item.closest('[data-sek-level="section"]').data("sek-id"),t.item.closest('[data-sek-level="column"]').find(".sek-column-inner").first().children('[data-sek-level="module"]').each(function(){c.push(p(this).data("sek-id"))}),h.isEmpty(c)?u.errare("makeModulesSortableInColumn => startOrder should not be empty"):u.printAllLevelsUi()},stop:function(e,t){n=t.item.closest('[data-sek-level="column"]'),s=n.data("sek-id"),n.find(".sek-column-inner").first().children("[data-sek-id]").each(function(){k.push(p(this).data("sek-id"))}),h.isEmpty(k)?u.errare("makeModulesSortableInColumn => newOrder should not be empty"):h.isEqual(k,c)&&s===i?u.errare("preview => makeModulesSortableInColumn => start and stop positions are identical"):(m.preview.send("sek-move",{id:t.item.data("sek-id"),level:"module",newOrder:k,from_column:i,to_column:s,from_sektion:a,to_sektion:t.item.closest('[data-sek-level="section"]').data("sek-id")}),u.cachedElements.$body.removeClass("sek-dragging-element"))}})),p('[data-sek-id="'+e+'"]').addClass("sek-module-sortable-setup")}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(l,c,k){c.extend(SekPreviewPrototype,{setupResizable:function(){var t=this;return c(".sektion-wrapper").find('div[data-sek-level="section"]').each(function(){t.maybeMakeColumnResizableInSektion.call(this)}),t.cachedElements.$body.on("sek-level-refreshed sek-modules-refreshed sek-columns-refreshed sek-section-added sek-location-refreshed",'[data-sek-level="location"]',function(e){c(this).find('[data-sek-level="section"]').each(function(){t.maybeMakeColumnResizableInSektion.call(this)})}),this},maybeMakeColumnResizableInSektion:function(){var a,i,s,n,o,r,d,e=c(this).find(".sek-sektion-inner").first().children('div[data-sek-level="column"]');if(!(e.length<2)){var t=c(this).find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').last();e.not(t).each(function(){c(this).resizable({resize:function(e,t){c(".sektion-wrapper").data("sek-resizing-columns",!0)},start:function(e,t){if(a=t.element.closest('div[data-sek-level="section"]'),a.data("sek-id"),i=a.find(".sek-sektion-inner")[0].getBoundingClientRect().width,!((o=a.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length)<2)){if((s=t.element.closest('div[data-sek-level="column"]')).length<1)throw new Error("ERROR => resizable => No valid level dom element found");d=s.index()+1==o,r=d?s.prev():s.next(),c(".sektion-wrapper").data("sek-resizing-columns",!0),k.delay(function(){c(".sektion-wrapper").data("sek-resizing-columns",!1)},3e3)}},stop:function(e,t){if(!(o<2)){if(s.length<1)throw new Error("ERROR => resizable => No valid level dom element found");s.css({width:"",height:""}),n=(parseFloat(t.size.width)/parseFloat(i)*100).toFixed(3),l.preview.send("sek-resize-columns",{action:"sek-resize-columns",level:s.data("sek-level"),in_sektion:a.data("sek-id"),id:s.data("sek-id"),resized_column:s.data("sek-id"),sister_column:r.data("sek-id"),resizedColumnWidthInPercent:n,col_number:o}),c(".sektion-wrapper").data("sek-resizing-columns",!1)}},helper:"ui-resizable-helper",handles:"e"});var e=c(this);k.delay(function(){e.find(".ui-resizable-handle").find(".fa-arrows-alt-h").length<1&&e.find(".ui-resizable-handle").append('')},500)})}}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(c,p,h){p.extend(SekPreviewPrototype,{printLevelUI:function(e){var t,a,i,s;if((h.isUndefined(e)||e.length<1)&&this.errare("sekPreview::printeLevelUI => invalid level element => ",e),"location"!=(a=e.data("sek-level"))&&!(0<(s=e).children(".sek-dyn-ui-wrapper").length)){var n=s[0].getBoundingClientRect(),o=s.data("sek-level");switch(s.toggleClass("sek-shrink-my-ui",n.width&&n.width<("section"===o?350:"column"===o?300:200)),i={id:s.data("sek-id"),level:o},a){case"section":var r,d,l=s.closest('div[data-sek-level="location"]'),c=s.closest('div[data-sek-level="column"]'),k=!0===s.data("sek-is-nested");k?0=t.top&&t.bottom>=n.y,s=e;switch(o){case"mayBeRemove":s.data("sek-ui-removal-scheduled",!1),a&&i||d.call(s);break;case"printOrScheduleRemoval":a&&i?(s.data("sek-ui-removal-scheduled",!1),r.printLevelUI(s)):!0!==s.data("sek-ui-removal-scheduled")&&(s.data("sek-ui-removal-scheduled",!0),s.children(".sek-dyn-ui-wrapper").find(".sek-is-expanded").length<1?l(n,s):h.delay(function(){!0===s.data("sek-ui-removal-scheduled")&&l(r.mouseMovedRecently(),s)},3500))}})};r.mouseMovedRecently=new c.Value({}),r.mouseMovedRecently.bind(function(e){var k,t,a;h.isEmpty(e)?sekPreviewLocalized.isPreviewUIDebugMode||(s(),r.cachedElements.$body.stop(!0,!0).find("[data-sek-level]").each(function(){p(this).children(".sek-dyn-ui-wrapper").find(".sek-is-expanded").length<1&&d.call(p(this))})):(r.cachedElements.$body.find('div[data-sek-level="location"]').each(function(){var e;$sectionCollection=p(this).children('div[data-sek-level="section"]'),i=r.parseTemplate("#sek-tmpl-add-content-button"),t=p(this).data("sek-id"),a=!0===p(this).data("sek-is-global-location"),$sectionCollection.each(function(){0=e.top&&e.bottom>=t;p(this).toggleClass("sek-mouse-is-close",(r||c)&&(d||l))}),l(e))});var o=function(){clearTimeout(r.cachedElements.$window.data("_scroll_move_timer_")),r.mouseMovedRecently.set({})};return r.cachedElements.$window.on("mousemove scroll",h.throttle(function(e){r.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(r.cachedElements.$window.data("_scroll_move_timer_")),r.cachedElements.$window.data("_scroll_move_timer_",setTimeout(function(){r.mouseMovedRecently.set({})},4e3))},50)),c.preview.bind("sek-drag-start",function(){o()}),r.cachedElements.$body.on("sek-section-added",'[data-sek-level="location"]',function(e,t){o()}),this}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(m,p,h){p.extend(SekPreviewPrototype,{scheduleUiClickReactions:function(){var u=this;u.cachedElements.$body.on("click",function(e){m.preview.send("sek-clean-target-drop-zone");var t,a="inactiveZone",i=p(e.target),s=i.closest('[data-sek-level="location"][data-sek-preview-level-guid="'+sekPreviewLocalized.previewLevelGuid+'"]'),n=i.closest('[data-sek-preview-level-guid="'+sekPreviewLocalized.previewLevelGuid+'"]'),o=i.closest("[data-sek-click-on]"),r=s.data("sek-id"),d=n.data("sek-level"),l=n.data("sek-id");switch(a="add-content"==i.data("sek-click-on")||0 error location id can not be empty"),a){case"addContentButton":var c=!0===i.closest("[data-sek-is-first-section]").data("sek-is-first-section");m.preview.send("sek-add-section",{location:r,level:"section",before_section:i.closest("[data-sek-before-section]").data("sek-before-section"),after_section:i.closest("[data-sek-after-section]").data("sek-after-section"),is_first_section:c,send_to_preview:!c});break;case"UIIcon":if(n.length<1)throw new Error("ERROR => sek-front-preview => No valid level dom element found");if(t=i.closest("[data-sek-click-on]").data("sek-click-on"),h.isEmpty(t))throw new Error("Invalid action");if(h.isEmpty(d)||h.isEmpty(l))throw new Error("ERROR => sek-front-preview => No valid level id found");u._send_(i,{action:t,location:r,level:d,id:l,was_triggered:!1});break;case"moduleWrapper":if(0