Файл: concrete5.7.5.6/concrete/js/app.js
Строк: 7767
<?php
function ConcretePanel(a){"use strict";this.options=a,this.isOpen=!1,this.detail=!1,this.isPinned=!1,this.pinned=function(){return this.isPinned},this.willBePinned=function(){return this.isOpen&&!this.isPinned},this.isPinable=function(){return this.options.pinable},this.getPositionClass=function(){var b;switch(a.position){case"left":b="ccm-panel-left";break;case"right":b="ccm-panel-right"}switch(a.transition){case"slide":b+=" ccm-panel-transition-slide";break;default:b+=" ccm-panel-transition-none"}return b},this.getURL=function(){return this.options.url},this.getIdentifier=function(){return this.options.identifier},this.getDOMID=function(){return"ccm-panel-"+this.options.identifier.replace("/","-")},this.onPanelLoad=function(a){var b=$("a[data-launch-panel="+this.getIdentifier()+"]");this.setupSubPanels(),this.setupPanelDetails(),b.removeClass().addClass("ccm-launch-panel-active"),Concrete.event.publish("PanelLoad",{panel:this,element:a})},this.hide=function(a){a=a||$.noop;var b=this;this.closePanelDetail(function(){var c=this,d=$("a[data-launch-panel="+this.getIdentifier()+"]");d.removeClass(),$("#"+c.getDOMID()).removeClass("ccm-panel-active"),$("#ccm-panel-overlay").queue(function(){$(this).removeClass("ccm-panel-translucent"),$(this).dequeue()}).delay(1e3).hide(0),html.removeClass(c.getPositionClass()),html.removeClass("ccm-panel-open"),c.isOpen=!1,$(this).dequeue(),a.call(b),Concrete.event.publish("PanelClose",{panel:this})})},this.toggle=function(){this.isOpen?this.options.pinable?this.isPinned?(this.isPinned=!1,this.hide()):this.isPinned=!0:this.hide():this.show()},this.setupSubPanels=function(){var a=$("#"+this.getDOMID()),b=this;a.find("[data-launch-sub-panel-url]").unbind(".sub").on("click.sub",function(){var c=$("<div />").addClass("ccm-panel-cover").appendTo($(this).closest(".ccm-panel"));b.closePanelDetailImmediately();var d=$(this).attr("data-launch-sub-panel-url");return $("<div />",{"class":"ccm-panel-content ccm-panel-content-appearing"}).appendTo(a.find(".ccm-panel-content-wrapper")).load(d+"?cID="+CCM_CID,function(){_.delay(function(){c.remove()},250),a.find(".ccm-panel-content-visible").removeClass("ccm-panel-content-visible").addClass("ccm-panel-slide-left"),$(this).removeClass("ccm-panel-content-appearing").addClass("ccm-panel-content-visible"),b.onPanelLoad(this)}),$(this).removeClass("ccm-panel-menu-item-active"),!1}),a.find("[data-panel-navigation=back]").on("click.navigate",function(){return b.goBack(),!1})},this.goBack=function(){var a=$("#"+this.getDOMID());this.closePanelDetailImmediately(),a.queue(function(){var b=a.find(".ccm-panel-content-visible").prev();a.find(".ccm-panel-content-visible").removeClass("ccm-panel-content-visible").addClass("ccm-panel-slide-right"),b.removeClass("ccm-panel-slide-left").addClass("ccm-panel-content-visible"),a.dequeue()}).delay(500).queue(function(){a.find(".ccm-panel-slide-right").remove(),a.dequeue()})},this.showPanelConfirmationMessage=function(a,b,c){var d='<div id="ccm-panel-confirmation-'+a+'" class="ccm-ui ccm-panel-confirmation-wrapper"><div class="ccm-panel-confirmation">';d+="<p>"+b+'</p><div class="ccm-panel-confirmation-buttons"></div>',d+="</div></div>",$(d).appendTo(document.body);var e=$("#ccm-panel-confirmation-"+a);e.delay(0).queue(function(){$(this).addClass("ccm-panel-confirmation-displayed"),$(this).dequeue()});for(var f=[{"class":"btn pull-left btn-link",type:"button","data-panel-confirmation-action":"cancel",text:ccmi18n.cancel}],g=0;g<c.length;g++)f.push(c[g]);$.each(f,function(a,b){e.find(".ccm-panel-confirmation-buttons").append($("<button />",b))}),e.find("button").on("click",function(){e.delay(0).queue(function(){e.removeClass("ccm-panel-confirmation-displayed"),e.addClass("ccm-panel-confirmation-disappearing"),$(this).dequeue()}).delay(350).queue(function(){e.remove()})})},this.closePanelDetail=function(a){a=a||$.noop;var b=this;if(!this.detail)return a.call(b),!1;$("a[data-launch-panel-detail="+this.detail.identifier+"]").removeClass("ccm-panel-menu-item-active");var c=this.detail.transition;return $("div.ccm-panel-detail").queue(function(){$(this).removeClass("ccm-panel-detail-transition-"+c+"-apply"),$(this).dequeue()}).delay(550).queue(function(){$(this).remove(),$(this).dequeue()}),$("div.ccm-page").queue(function(){$(this).removeClass("ccm-panel-detail-transition-"+c+"-apply"),$(this).dequeue()}).delay(550).queue(function(){html.removeClass("ccm-panel-detail-open"),$(this).addClass("ccm-panel-detail-disable-transition"),$(this).dequeue()}).delay(1).queue(function(){$(this).removeClass("ccm-panel-detail-transition-"+c),$(this).dequeue()}).delay(1).queue(function(){$(this).removeClass("ccm-panel-detail-disable-transition"),$(this).dequeue(),a.call(b)}),$("#ccm-panel-detail-form-actions-wrapper .ccm-panel-detail-form-actions").queue(function(){$(this).css("opacity",0),$(this).dequeue(0)}).delay(550).queue(function(){$(this).remove(),$(this).dequeue()}),Concrete.event.publish("PanelCloseDetail",this.detail),this.detail=!1,$(".ccm-panel-detail").length>0?550:void 0},this.closePanelDetailImmediately=function(){return this.detail?(html.removeClass("ccm-panel-detail-open"),$(".ccm-panel-detail").remove(),$(".ccm-panel-detail-form-actions").remove(),$(".ccm-page").removeClass().addClass("ccm-page"),Concrete.event.publish("PanelCloseDetail",this.detail),void(this.detail=!1)):!1},this.openPanelDetail=function(a){var b=this,c=$.extend({transition:"none",url:!1,data:""},a),d=c.identifier;b.detail&&b.closePanelDetailImmediately(),b.detail=c;var e="ccm-panel-detail-"+d,f=$("<div />",{id:e,"class":"ccm-panel-detail"}).appendTo(document.body),g=$("<div />",{"class":"ccm-panel-detail-content"}).appendTo(f);$("div.ccm-page").queue(function(){f.addClass("ccm-panel-detail-transition-"+c.transition),$(this).addClass("ccm-panel-detail-transition-"+c.transition),$(this).dequeue()}).delay(3).queue(function(){f.addClass("ccm-panel-detail-transition-"+c.transition+"-apply"),$(this).addClass("ccm-panel-detail-transition-"+c.transition+"-apply"),$(this).dequeue()}),html.addClass("ccm-panel-detail-open");var h=function(){Concrete.event.publish("PanelOpenDetail",{panel:c,panelObj:b,container:g})};c.url?g.load(c.url+"?cID="+CCM_CID+c.data,function(){jQuery.fn.dialog.hideLoader(),g.find(".launch-tooltip").tooltip({container:"#ccm-tooltip-holder"}),g.find("a[data-help-notification-toggle]").concreteHelpLauncher(),b.loadPanelDetailActions(g),_.defer(h)}):(jQuery.fn.dialog.hideLoader(),g.find(".launch-tooltip").tooltip({container:"#ccm-tooltip-holder"}),g.find("a[data-help-notification-toggle]").concreteHelpLauncher(),b.loadPanelDetailActions(g),_.defer(h))},this.loadPanelDetailActions=function(a){var b=this,c=a.find(".ccm-panel-detail-form-actions");c.length&&($(document.body).delay(500).queue(function(){var a=$("#ccm-panel-detail-form-actions-wrapper");a.length||(a=$("<div />",{id:"ccm-panel-detail-form-actions-wrapper","class":"ccm-ui"}),a.appendTo(document.body)),a.html("").append(c),$(this).dequeue()}).delay(5).queue(function(){$("#ccm-panel-detail-form-actions-wrapper .ccm-panel-detail-form-actions").css("opacity",1),$(this).dequeue()}),$("button[data-panel-detail-action=cancel]").on("click",function(){b.closePanelDetail()}),a.find("[data-panel-detail-form]").concreteAjaxForm(),$("button[data-panel-detail-action=submit]").on("click",function(){$("[data-panel-detail-form]").submit()}))},this.setupPanelDetails=function(){var a=$("#"+this.getDOMID()),b=this;a.find(".launch-tooltip").tooltip({container:"#ccm-tooltip-holder"}),a.find("[data-panel-menu=accordion]").each(function(){var c=$(this),d=$(this).find(">nav>span");d.text($(this).find("a[data-panel-accordion-tab-selected=true]").text()),d.unbind(".accordion").on("click.accordion",function(){c.toggleClass("ccm-panel-header-accordion-dropdown-visible")}),$(this).find(">nav ul a").unbind(".accordion").on("click.accordion",function(){var e=b.getURL(),f=a.find(".ccm-panel-content");c.removeClass("ccm-panel-header-accordion-dropdown-visible"),d.html($(this).text()),f.load(e+"?cID="+CCM_CID+"&tab="+$(this).attr("data-panel-accordion-tab"),function(){b.onPanelLoad(this)})})}),a.find(".dialog-launch").dialog(),a.find("[data-panel-menu=collapsible-list-group]").each(function(){var a,b=$(this),c=b.find(".list-group-item-collapse-wrapper"),d=b.attr("data-panel-menu-id"),e=b.find(".list-group-item-collapse span");b.find(".list-group-item-collapse").unbind(".clg").on("click.clg",function(){b.hasClass("ccm-panel-list-group-item-expanded")?(e.text(ccmi18n.expand),Concrete.event.publish("PanelCollapsibleListGroupCollapse",d),c.height(0)):(a=c.show().height("").outerHeight(),c.height(0),Concrete.event.publish("PanelCollapsibleListGroupExpand",d),e.text(ccmi18n.collapse),c.height(a)),b.toggleClass("ccm-panel-list-group-item-expanded")})}),a.find("[data-launch-panel-detail]").unbind(".detail").on("click.detail",function(){jQuery.fn.dialog.showLoader(),$(".ccm-panel-menu-item-active").removeClass("ccm-panel-menu-item-active"),$(this).addClass("ccm-panel-menu-item-active");var a=$(this).attr("data-launch-panel-detail"),c={identifier:a,target:$(this)};return $(this).attr("data-panel-transition")&&(c.transition=$(this).attr("data-panel-transition")),$(this).attr("data-panel-detail-url")&&(c.url=$(this).data("panel-detail-url")),b.openPanelDetail(c),!1}),b.loadPanelDetailActions(a)},this.show=function(a){a=a||$.noop;var b=$("#"+this.getDOMID()),c=this,d=function(){html.addClass("ccm-panel-open"),b.find(".ccm-panel-content-wrapper").html(""),b.addClass("ccm-panel-active ccm-panel-loading"),$("<div/>").addClass("ccm-panel-content ccm-panel-content-visible").appendTo(b.find(".ccm-panel-content-wrapper")).load(c.getURL()+"?cID="+CCM_CID,function(){var a=this;b.delay(1).queue(function(){$(this).removeClass("ccm-panel-loading").addClass("ccm-panel-loaded"),$(this).dequeue()}),c.onPanelLoad(b),c.isOpen=!0,Concrete.event.publish("PanelOpen",{panel:c,element:a}),c.options.overlay&&ConcretePanelManager.showOverlay(c.options.translucent)}),html.addClass(c.getPositionClass())};if(this.options.primary){var e=_(ConcretePanelManager.getPanels()).findWhere({isOpen:!0});e?e.hide(function(){d.call(this)}):d.call(this)}else d.call(this);$(".ccm-toolbar-mobile-menu-button").removeClass("ccm-mobile-close"),$(".ccm-mobile-menu-overlay").slideUp()}}"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[n"+gap+g.join(",n"+gap)+"n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{n"+gap+g.join(",n"+gap)+"n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[u0000u00adu0600-u0604u070fu17b4u17b5u200c-u200fu2028-u202fu2060-u206fufeffufff0-uffff]/g,escapable=/[\"x00-x1fx7f-x9fu00adu0600-u0604u070fu17b4u17b5u200c-u200fu2028-u202fu2060-u206fufeffufff0-uffff]/g,gap,indent,meta={"b":"\b"," ":"\t","n":"\n","f":"\f","r":"\r",'"':'\"',"\":"\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[],:{}s]*$/.test(text.replace(/\(?:["\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\nr]*"|true|false|null|-?d+(?:.d*)?(?:[eE][+-]?d+)?/g,"]").replace(/(?:^|:|,)(?:s*[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(a){function b(){if(a.fn.ajaxSubmit.debug){var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}}a.fn.ajaxSubmit=function(c){function d(d){function f(a){var b=a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document;return b}function g(){function c(){try{var a=f(p).readyState;b("state = "+a),"uninitialized"==a.toLowerCase()&&setTimeout(c,50)}catch(d){b("Server abort: ",d," (",d.name,")"),i(y),u&&clearTimeout(u),u=void 0}}var d=h.attr("target"),g=h.attr("action");v.setAttribute("target",n),e||v.setAttribute("method","POST"),g!=l.url&&v.setAttribute("action",l.url),l.skipEncodingOverride||e&&!/post/i.test(e)||h.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(u=setTimeout(function(){t=!0,i(x)},l.timeout));var j=[];try{if(l.extraData)for(var k in l.extraData)j.push(a('<input type="hidden" name="'+k+'" />').attr("value",l.extraData[k]).appendTo(v)[0]);l.iframeTarget||(o.appendTo("body"),p.attachEvent?p.attachEvent("onload",i):p.addEventListener("load",i,!1)),setTimeout(c,15),v.submit()}finally{v.setAttribute("action",g),d?v.setAttribute("target",d):h.removeAttr("target"),a(j).remove()}}function i(c){if(!q.aborted&&!B){try{A=f(p)}catch(d){b("cannot access response document: ",d),c=y}if(c===x&&q)return void q.abort("timeout");if(c==y&&q)return void q.abort("server abort");if(A&&A.location.href!=l.iframeSrc||t){p.detachEvent?p.detachEvent("onload",i):p.removeEventListener("load",i,!1);var e,g="success";try{if(t)throw"timeout";var h="xml"==l.dataType||A.XMLDocument||a.isXMLDoc(A);if(b("isXml="+h),!h&&window.opera&&(null==A.body||""==A.body.innerHTML)&&--C)return b("requeing onLoad callback, DOM not available"),void setTimeout(i,250);var j=A.body?A.body:A.documentElement;q.responseText=j?j.innerHTML:null,q.responseXML=A.XMLDocument?A.XMLDocument:A,h&&(l.dataType="xml"),q.getResponseHeader=function(a){var b={"content-type":l.dataType};return b[a]},j&&(q.status=Number(j.getAttribute("status"))||q.status,q.statusText=j.getAttribute("statusText")||q.statusText);var k=(l.dataType||"").toLowerCase(),n=/(json|script|text)/.test(k);if(n||l.textarea){var r=A.getElementsByTagName("textarea")[0];if(r)q.responseText=r.value,q.status=Number(r.getAttribute("status"))||q.status,q.statusText=r.getAttribute("statusText")||q.statusText;else if(n){var s=A.getElementsByTagName("pre")[0],v=A.getElementsByTagName("body")[0];s?q.responseText=s.textContent?s.textContent:s.innerText:v&&(q.responseText=v.textContent?v.textContent:v.innerText)}}else"xml"!=k||q.responseXML||null==q.responseText||(q.responseXML=D(q.responseText));try{z=F(q,k,l)}catch(c){g="parsererror",q.error=e=c||g}}catch(c){b("error caught: ",c),g="error",q.error=e=c||g}q.aborted&&(b("upload aborted"),g=null),q.status&&(g=q.status>=200&&q.status<300||304===q.status?"success":"error"),"success"===g?(l.success&&l.success.call(l.context,z,"success",q),m&&a.event.trigger("ajaxSuccess",[q,l])):g&&(void 0==e&&(e=q.statusText),l.error&&l.error.call(l.context,q,g,e),m&&a.event.trigger("ajaxError",[q,l,e])),m&&a.event.trigger("ajaxComplete",[q,l]),m&&!--a.active&&a.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,q,g),B=!0,l.timeout&&clearTimeout(u),setTimeout(function(){l.iframeTarget||o.remove(),q.responseXML=null},100)}}}var j,k,l,m,n,o,p,q,r,s,t,u,v=h[0],w=!!a.fn.prop;if(d)if(w)for(k=0;k<d.length;k++)j=a(v[d[k].name]),j.prop("disabled",!1);else for(k=0;k<d.length;k++)j=a(v[d[k].name]),j.removeAttr("disabled");if(a(":input[name=submit],:input[id=submit]",v).length)return void alert('Error: Form elements must not have name or id of "submit".');if(l=a.extend(!0,{},a.ajaxSettings,c),l.context=l.context||l,n="jqFormIO"+(new Date).getTime(),l.iframeTarget?(o=a(l.iframeTarget),s=o.attr("name"),null==s?o.attr("name",n):n=s):(o=a('<iframe name="'+n+'" src="'+l.iframeSrc+'" />'),o.css({position:"absolute",top:"-1000px",left:"-1000px"})),p=o[0],q={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(c){var d="timeout"===c?"timeout":"aborted";b("aborting upload... "+d),this.aborted=1,o.attr("src",l.iframeSrc),q.error=d,l.error&&l.error.call(l.context,q,d,c),m&&a.event.trigger("ajaxError",[q,l,d]),l.complete&&l.complete.call(l.context,q,d)}},m=l.global,m&&!a.active++&&a.event.trigger("ajaxStart"),m&&a.event.trigger("ajaxSend",[q,l]),l.beforeSend&&l.beforeSend.call(l.context,q,l)===!1)return void(l.global&&a.active--);if(!q.aborted){r=v.clk,r&&(s=r.name,s&&!r.disabled&&(l.extraData=l.extraData||{},l.extraData[s]=r.value,"image"==r.type&&(l.extraData[s+".x"]=v.clk_x,l.extraData[s+".y"]=v.clk_y)));var x=1,y=2;l.forceSync?g():setTimeout(g,10);var z,A,B,C=50,D=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&"parsererror"!=b.documentElement.nodeName?b:null},E=a.parseJSON||function(a){return window.eval("("+a+")")},F=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f="xml"===c||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&"parsererror"===g.documentElement.nodeName&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),"string"==typeof g&&("json"===c||!c&&e.indexOf("json")>=0?g=E(g):("script"===c||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g}}}if(!this.length)return b("ajaxSubmit: skipping submit process - no element selected"),this;var e,f,g,h=this;"function"==typeof c&&(c={success:c}),e=this.attr("method"),f=this.attr("action"),g="string"==typeof f?a.trim(f):"",g=g||window.location.href||"",g&&(g=(g.match(/^([^#]+)/)||[])[1]),c=a.extend(!0,{url:g,success:a.ajaxSettings.success,type:e||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);var i={};if(this.trigger("form-pre-serialize",[this,c,i]),i.veto)return b("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(c.beforeSerialize&&c.beforeSerialize(this,c)===!1)return b("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var j=c.traditional;void 0===j&&(j=a.ajaxSettings.traditional);var k,l=this.formToArray(c.semantic);if(c.data&&(c.extraData=c.data,k=a.param(c.data,j)),c.beforeSubmit&&c.beforeSubmit(l,this,c)===!1)return b("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[l,this,c,i]),i.veto)return b("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var m=a.param(l,j);k&&(m=m?m+"&"+k:k),"GET"==c.type.toUpperCase()?(c.url+=(c.url.indexOf("?")>=0?"&":"?")+m,c.data=null):c.data=m;var n=[];if(c.resetForm&&n.push(function(){h.resetForm()}),c.clearForm&&n.push(function(){h.clearForm(c.includeHidden)}),!c.dataType&&c.target){var o=c.success||function(){};n.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(o,arguments)})}else c.success&&n.push(c.success);c.success=function(a,b,d){for(var e=c.context||c,f=0,g=n.length;g>f;f++)n[f].apply(e,[a,b,d||h,h])};var p=a("input:file",this).length>0,q="multipart/form-data",r=h.attr("enctype")==q||h.attr("encoding")==q;return c.iframe!==!1&&(p||c.iframe||r)?c.closeKeepAlive?a.get(c.closeKeepAlive,function(){d(l)}):d(l):a.ajax(c),this.trigger("form-submit-notify",[this,c]),this},a.fn.ajaxForm=function(c){if(0===this.length){var d={s:this.selector,c:this.context};return!a.isReady&&d.s?(b("DOM not ready, queuing ajaxForm"),a(function(){a(d.s,d.c).ajaxForm(c)}),this):(b("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this)}return this.ajaxFormUnbind().bind("submit.form-plugin",function(b){b.isDefaultPrevented()||(b.preventDefault(),a(this).ajaxSubmit(c))}).bind("click.form-plugin",function(b){var c=b.target,d=a(c);if(!d.is(":submit,input:image")){var e=d.closest(":submit");if(0==e.length)return;c=e[0]}var f=this;if(f.clk=c,"image"==c.type)if(void 0!=b.offsetX)f.clk_x=b.offsetX,f.clk_y=b.offsetY;else if("function"==typeof a.fn.offset){var g=d.offset();f.clk_x=b.pageX-g.left,f.clk_y=b.pageY-g.top}else f.clk_x=b.pageX-c.offsetLeft,f.clk_y=b.pageY-c.offsetTop;setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)})},a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},a.fn.formToArray=function(b){var c=[];if(0===this.length)return c;var d=this[0],e=b?d.getElementsByTagName("*"):d.elements;if(!e)return c;var f,g,h,i,j,k,l;for(f=0,k=e.length;k>f;f++)if(j=e[f],h=j.name)if(b&&d.clk&&"image"==j.type)j.disabled||d.clk!=j||(c.push({name:h,value:a(j).val()}),c.push({name:h+".x",value:d.clk_x},{name:h+".y",value:d.clk_y}));else if(i=a.fieldValue(j,!0),i&&i.constructor==Array)for(g=0,l=i.length;l>g;g++)c.push({name:h,value:i[g]});else null!==i&&"undefined"!=typeof i&&c.push({name:h,value:i});if(!b&&d.clk){var m=a(d.clk),n=m[0];h=n.name,h&&!n.disabled&&"image"==n.type&&(c.push({name:h,value:m.val()}),c.push({name:h+".x",value:d.clk_x},{name:h+".y",value:d.clk_y}))}return c},a.fn.formSerialize=function(b){return a.param(this.formToArray(b))},a.fn.fieldSerialize=function(b){var c=[];return this.each(function(){var d=this.name;if(d){var e=a.fieldValue(this,b);if(e&&e.constructor==Array)for(var f=0,g=e.length;g>f;f++)c.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&c.push({name:this.name,value:e})}}),a.param(c)},a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;e>d;d++){var f=this[d],g=a.fieldValue(f,b);null===g||"undefined"==typeof g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(c,g):c.push(g))}return c},a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(void 0===c&&(c=!0),c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==f&&-1==b.selectedIndex))return null;if("select"==f){var g=b.selectedIndex;if(0>g)return null;for(var h=[],i=b.options,j="select-one"==e,k=j?g+1:i.length,l=j?g:0;k>l;l++){var m=i[l];if(m.selected){var n=m.value;if(n||(n=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),j)return n;h.push(n)}}return h}return a(b).val()},a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})},a.fn.clearFields=a.fn.clearInputs=function(a){var b=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var c=this.type,d=this.tagName.toLowerCase();b.test(c)||"textarea"==d||a&&/hidden/.test(c)?this.value="":"checkbox"==c||"radio"==c?this.checked=!1:"select"==d&&(this.selectedIndex=-1)})},a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},a.fn.enable=function(a){return void 0===a&&(a=!0),this.each(function(){this.disabled=!a})},a.fn.selected=function(b){return void 0===b&&(b=!0),this.each(function(){var c=this.type;if("checkbox"==c||"radio"==c)this.checked=b;else if("option"==this.tagName.toLowerCase()){var d=a(this).parent("select");b&&d[0]&&"select-one"==d[0].type&&d.find("option").selected(!1),this.selected=b}})},a.fn.ajaxSubmit.debug=!1}(jQuery),function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});var Concrete=function(a,b){"use strict";function c(a,b){return a[b]}function d(a,b,e){b+="";var f="get"+b.substr(0,1).toUpperCase()+b.substr(1),g="set"+b.substr(0,1).toUpperCase()+b.substr(1);return"undefined"==typeof this[f]&&(this[f]=_.partial(c,a,b)),"undefined"==typeof this[g]&&(this[g]=_.partial(d,a,b)),a[b]=e,e}var e=b("html");return{editMode:null,event:a,createGetterSetters:function(a){var b=this;return b.getAttr=_.partial(c,a),b.setAttr=_.partial(d,a),_(a).each(function(a,c){b.setAttr(c,a)}),!0},forceRefresh:function(){e.hide(0,function(){b(this).show()})},"const":{}}}(ConcreteEvent,jQuery);!function(a){var b=null;a.fn.liveUpdate=function(b,c){return this.each(function(){new a.liveUpdate(this,b,c)})},a.liveUpdate=function(b,c,d){this.field=a(b),a(b).data("liveUpdate",this),this.list=a("#"+c),this.lutype="blocktypes","undefined"!=typeof d&&(this.lutype=d),this.list.length>0&&this.init()},a.liveUpdate.prototype={init:function(){var a=this;this.setupCache(),this.field.parents("form").on("submit.liveupdate",function(){return!1}),this.field.keyup(function(){a.filter()}),a.filter()},filter:function(){if(this.field.val()!=b){if(""==a.trim(this.field.val()))return void("blocktypes"==this.lutype?(this.list.find("li").show(),this.list.find(".ccm-panel-add-block-set").show()):"attributes"==this.lutype?(this.list.find("h5").show(),this.list.find("li").show()):"stacks"==this.lutype?(this.list.children("li").addClass("ccm-stack-available"),this.list.children("li").removeClass("ccm-stack-selected")):"intelligent-search"==this.lutype?this.list.is(":visible")&&this.list.hide():this.list.children("li,div.li").show());"intelligent-search"!=this.lutype||this.field.val().length>2?this.displayResults(this.getScores(this.field.val().toLowerCase())):"intelligent-search"==this.lutype&&this.list.is(":visible")&&this.list.hide()}b=this.field.val(),""==b&&"intelligent-search"==this.lutype&&this.list.is(":visible")&&this.list.hide()},setupCache:function(){var b=this;this.cache=[],this.rows=[];var c=this.lutype;this.list.find("li,div.li").each(function(){if("blocktypes"==c)b.cache.push(a(this).find("span").html().toLowerCase());else if("attributes"==c){var d=a(this).find("a,span").html().toLowerCase();b.cache.push(d)}else if("stacks"==c){var d=a(this).find("a,span").html().toLowerCase();b.cache.push(d)}else if("fileset"==c)b.cache.push(a(this).find("span[data-label=file-set-name]").html().toLowerCase());else if("intelligent-search"==c){var e=a(this).find("span").html();e&&b.cache.push(e.toLowerCase())}b.rows.push(a(this))}),this.cache_length=this.cache.length},displayResults:function(b){var c=this;if("blocktypes"==this.lutype)this.list.find(".ccm-panel-add-block-set").hide(),this.list.find("li,div.li").hide(),a.each(b,function(a,b){c.rows[b[1]].show(),c.rows[b[1]].closest(".ccm-panel-add-block-set").show()});else if("attributes"==this.lutype)this.list.find("h5").hide(),this.list.find("li").hide(),a.each(b,function(a,b){c.rows[b[1]].show()});else if("stacks"==this.lutype)this.list.children("li").removeClass("ccm-stack-available"),this.list.children("li").removeClass("ccm-stack-selected"),this.list.children("li").removeClass("ccm-item-selected"),a.each(b,function(a,b){c.rows[b[1]].addClass("ccm-stack-available")}),this.list.children("li.item-select-list-header").removeClass("ccm-stack-available"),a(this.list.find("li.ccm-stack-available")[0]).addClass("ccm-item-selected");else if("intelligent-search"==this.lutype){this.list.is(":visible")||this.list.fadeIn(160,"easeOutExpo"),this.list.find(".ccm-intelligent-search-results-module-onsite").hide(),this.list.find("li").hide();var d=0;a.each(b,function(a,b){$li=c.rows[b[1]],b[0]>.75&&(d++,$li.parent().parent().is(":visible")||$li.parent().parent().show(),$li.show())}),this.list.find("li a").removeClass("ccm-intelligent-search-result-selected"),this.list.find("li:visible a:first").addClass("ccm-intelligent-search-result-selected")}else this.list.children("li,div.li").hide(),a.each(b,function(a,b){c.rows[b[1]].show()})},getScores:function(a){for(var b=[],c=0;c<this.cache_length;c++){var d=this.cache[c].score(a);d>0&&b.push([d,c])}return b.sort(function(a,b){return b[0]-a[0]})}}}(jQuery),function(a,b,c){"use strict";function d(b,c){this.name=e,this.el=b,this.$el=a(b),this.options=a.extend({},f,c),this.$document=a(this.$el[0].ownerDocument),this.$body=this.$document.find("body"),this.moveTrigger="MSPointerMove touchmove mousemove",this.startTrigger="MSPointerDown touchstart mousedown",this.stopTrigger="MSPointerUp touchend mouseup",this.startTriggerArray=this.startTrigger.split(" "),this.moveTriggerArray=this.moveTrigger.split(" "),this.stopTriggerArray=this.stopTrigger.split(" "),this.stopEvents=[this.stopTrigger,this.options.stopEvents].join(" "),
"window"===this.options.constrainTo?this.$container=this.$document:this.options.constrainTo&&"parent"!==this.options.constrainTo?this.$container=a(this.options.constrainTo):this.$container=this.$el.parent(),this.isPointerEventCompatible()&&this.applyMSDefaults(),this.CSSEaseHash=this.getCSSEaseHash(),this.scale=1,this.started=!1,this.disabled=!1,this.activeDropRegions=[],this.resetVelocityQueue(),this.init()}var e="pep",f={initiate:function(){},start:function(){},drag:function(){},stop:function(){},rest:function(){},moveTo:!1,callIfNotStarted:["stop","rest"],startThreshold:[0,0],grid:[1,1],debug:!1,activeClass:"pep-active",multiplier:1,velocityMultiplier:2.5,shouldPreventDefault:!0,allowDragEventPropagation:!0,stopEvents:"",hardwareAccelerate:!0,useCSSTranslation:!0,disableSelect:!0,cssEaseString:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",cssEaseDuration:1e3,shouldEase:!0,droppable:!1,droppableActiveClass:"pep-dpa",overlapFunction:!1,constrainTo:!1,removeMargins:!0,place:!0,deferPlacement:!1,axis:null,forceNonCSS3Movement:!1,elementsWithInteraction:"input",revert:!1,revertAfter:"stop",revertIf:function(){return!0},ignoreRightClick:!0};d.prototype.init=function(){this.options.debug&&this.buildDebugDiv(),this.options.disableSelect&&this.disableSelect(),this.options.place&&!this.options.deferPlacement&&(this.positionParent(),this.placeObject()),this.ev={},this.pos={},this.subscribe()},d.prototype.subscribe=function(){var a=this;this.onStartEvent=function(b){a.handleStart(b)},this.$el.on(this.startTrigger,this.onStartEvent),this.onStartEventOnElementsWithInteraction=function(a){a.stopPropagation()},this.$el.on(this.startTrigger,this.options.elementsWithInteraction,this.onStartEventOnElementsWithInteraction),this.onStopEvents=function(b){a.handleStop(b)},this.$document.on(this.stopEvents,this.onStopEvents),this.onMoveEvents=function(b){a.moveEvent=b},this.$document.on(this.moveTrigger,this.onMoveEvents)},d.prototype.unsubscribe=function(){this.$el.off(this.startTrigger,this.onStartEvent),this.$el.off(this.startTrigger,this.options.elementsWithInteraction,this.onStartEventOnElementsWithInteraction),this.$document.off(this.stopEvents,this.onStopEvents),this.$document.off(this.moveTrigger,this.onMoveEvents)},d.prototype.handleStart=function(b){var c=this;if(this.isValidMoveEvent(b)&&!this.disabled&&(!this.options.ignoreRightClick||3!==b.which)){this.isPointerEventCompatible()&&b.preventManipulation&&b.preventManipulation(),b=this.normalizeEvent(b),this.options.place&&this.options.deferPlacement&&(this.positionParent(),this.placeObject()),this.log({type:"event",event:b.type}),this.options.hardwareAccelerate&&!this.hardwareAccelerated&&(this.hardwareAccelerate(),this.hardwareAccelerated=!0);var d=this.options.initiate.call(this,b,this);if(d===!1)return;clearTimeout(this.restTimeout),this.$el.addClass(this.options.activeClass),this.removeCSSEasing(),this.startX=this.ev.x=b.pep.x,this.startY=this.ev.y=b.pep.y,this.initialPosition=this.initialPosition||this.$el.position(),this.startEvent=this.moveEvent=b,this.active=!0,this.options.shouldPreventDefault&&b.preventDefault(),this.options.allowDragEventPropagation||b.stopPropagation(),function e(){c.active&&(c.handleMove(),c.requestAnimationFrame(e))}(a,c)}},d.prototype.handleMove=function(){if("undefined"!=typeof this.moveEvent){var c=this.normalizeEvent(this.moveEvent),d=b.parseInt(c.pep.x/this.options.grid[0])*this.options.grid[0],e=b.parseInt(c.pep.y/this.options.grid[1])*this.options.grid[1];this.addToLIFO({time:c.timeStamp,x:d,y:e});var f,g;if(a.inArray(c.type,this.startTriggerArray)>-1?(f=0,g=0):(f=d-this.ev.x,g=e-this.ev.y),this.dx=f,this.dy=g,this.ev.x=d,this.ev.y=e,0===f&&0===g)return void this.log({type:"event",event:"** stopped **"});var h=Math.abs(this.startX-d),i=Math.abs(this.startY-e);!this.started&&(h>this.options.startThreshold[0]||i>this.options.startThreshold[1])&&(this.started=!0,this.$el.addClass("pep-start"),this.options.start.call(this,this.startEvent,this)),this.options.droppable&&this.calculateActiveDropRegions();var j=this.options.drag.call(this,c,this);if(j===!1)return void this.resetVelocityQueue();this.log({type:"event",event:c.type}),this.log({type:"event-coords",x:this.ev.x,y:this.ev.y}),this.log({type:"velocity"}),this.doMoveTo(f,g)}},d.prototype.doMoveTo=function(a,b){var c,d,e=this.handleConstraint(a,b);"function"==typeof this.options.moveTo?(c=a>=0?"+="+Math.abs(a/this.scale)*this.options.multiplier:"-="+Math.abs(a/this.scale)*this.options.multiplier,d=b>=0?"+="+Math.abs(b/this.scale)*this.options.multiplier:"-="+Math.abs(b/this.scale)*this.options.multiplier,this.options.constrainTo&&(c=e.x!==!1?e.x:c,d=e.y!==!1?e.y:d),"x"===this.options.axis&&(d=e.y),"y"===this.options.axis&&(c=e.x),this.options.moveTo.call(this,c,d)):this.shouldUseCSSTranslation()?(a=a/this.scale*this.options.multiplier,b=b/this.scale*this.options.multiplier,this.options.constrainTo&&(a=e.x===!1?a:0,b=e.y===!1?b:0),"x"===this.options.axis&&(b=0),"y"===this.options.axis&&(a=0),this.moveToUsingTransforms(a,b)):(c=a>=0?"+="+Math.abs(a/this.scale)*this.options.multiplier:"-="+Math.abs(a/this.scale)*this.options.multiplier,d=b>=0?"+="+Math.abs(b/this.scale)*this.options.multiplier:"-="+Math.abs(b/this.scale)*this.options.multiplier,this.options.constrainTo&&(c=e.x!==!1?e.x:c,d=e.y!==!1?e.y:d),"x"===this.options.axis&&(d=e.y),"y"===this.options.axis&&(c=e.x),this.moveTo(c,d))},d.prototype.handleStop=function(b){this.active&&(this.log({type:"event",event:b.type}),this.active=!1,this.$el.removeClass("pep-start").addClass("pep-ease"),this.options.droppable&&this.calculateActiveDropRegions(),(this.started||!this.started&&a.inArray("stop",this.options.callIfNotStarted)>-1)&&this.options.stop.call(this,b,this),this.options.shouldEase?this.ease(b,this.started):this.removeActiveClass(),this.options.revert&&("stop"===this.options.revertAfter||!this.options.shouldEase)&&this.options.revertIf&&this.options.revertIf.call(this)&&this.revert(),this.started=!1,this.resetVelocityQueue())},d.prototype.ease=function(b,c){var d=(this.$el.position(),this.velocity()),e=(this.dt,d.x/this.scale*this.options.multiplier),f=d.y/this.scale*this.options.multiplier,g=this.handleConstraint(e,f,!0);this.cssAnimationsSupported()&&this.$el.css(this.getCSSEaseHash());var h=d.x>0?"+="+e:"-="+Math.abs(e),i=d.y>0?"+="+f:"-="+Math.abs(f);this.options.constrainTo&&(h=g.x!==!1?g.x:h,i=g.y!==!1?g.y:i),"x"===this.options.axis&&(i="+=0"),"y"===this.options.axis&&(h="+=0");var j=!this.cssAnimationsSupported()||this.options.forceNonCSS3Movement;"function"==typeof this.options.moveTo?this.options.moveTo.call(this,h,i):this.moveTo(h,i,j);var k=this;this.restTimeout=setTimeout(function(){k.options.droppable&&k.calculateActiveDropRegions(),(c||!c&&a.inArray("rest",k.options.callIfNotStarted)>-1)&&k.options.rest.call(k,b,k),k.options.revert&&"ease"===k.options.revertAfter&&k.options.shouldEase&&k.options.revertIf&&k.options.revertIf.call(k)&&k.revert(),k.removeActiveClass()},this.options.cssEaseDuration)},d.prototype.normalizeEvent=function(a){return a.pep={},this.isPointerEventCompatible()||!this.isTouch(a)?(a.pageX?(a.pep.x=a.pageX,a.pep.y=a.pageY):(a.pep.x=a.originalEvent.pageX,a.pep.y=a.originalEvent.pageY),a.pep.type=a.type):(a.pep.x=a.originalEvent.touches[0].pageX,a.pep.y=a.originalEvent.touches[0].pageY,a.pep.type=a.type),a},d.prototype.resetVelocityQueue=function(){this.velocityQueue=new Array(5)},d.prototype.moveTo=function(a,b,c){this.log({type:"delta",x:a,y:b}),c?this.$el.animate({top:b,left:a},0,"easeOutQuad",{queue:!1}):this.$el.stop(!0,!1).css({top:b,left:a})},d.prototype.moveToUsingTransforms=function(a,b){var c=this.matrixToArray(this.matrixString());this.cssX||(this.cssX=this.xTranslation(c)),this.cssY||(this.cssY=this.yTranslation(c)),this.cssX=this.cssX+a,this.cssY=this.cssY+b,this.log({type:"delta",x:a,y:b}),c[4]=this.cssX,c[5]=this.cssY,this.translation=this.arrayToMatrix(c),this.transform(this.translation)},d.prototype.transform=function(a){this.$el.css({"-webkit-transform":a,"-moz-transform":a,"-ms-transform":a,"-o-transform":a,transform:a})},d.prototype.xTranslation=function(a){return a=a||this.matrixToArray(this.matrixString()),parseInt(a[4],10)},d.prototype.yTranslation=function(a){return a=a||this.matrixToArray(this.matrixString()),parseInt(a[5],10)},d.prototype.matrixString=function(){var a=function(a){return!(!a||"none"===a||a.indexOf("matrix")<0)},b="matrix(1, 0, 0, 1, 0, 0)";return a(this.$el.css("-webkit-transform"))&&(b=this.$el.css("-webkit-transform")),a(this.$el.css("-moz-transform"))&&(b=this.$el.css("-moz-transform")),a(this.$el.css("-ms-transform"))&&(b=this.$el.css("-ms-transform")),a(this.$el.css("-o-transform"))&&(b=this.$el.css("-o-transform")),a(this.$el.css("transform"))&&(b=this.$el.css("transform")),b},d.prototype.matrixToArray=function(a){return a.split("(")[1].split(")")[0].split(",")},d.prototype.arrayToMatrix=function(a){return"matrix("+a.join(",")+")"},d.prototype.addToLIFO=function(a){var b=this.velocityQueue;b=b.slice(1,b.length),b.push(a),this.velocityQueue=b},d.prototype.velocity=function(){for(var a=0,b=0,c=0;c<this.velocityQueue.length-1;c++)this.velocityQueue[c]&&(a+=this.velocityQueue[c+1].x-this.velocityQueue[c].x,b+=this.velocityQueue[c+1].y-this.velocityQueue[c].y,this.dt=this.velocityQueue[c+1].time-this.velocityQueue[c].time);return{x:a*this.options.velocityMultiplier,y:b*this.options.velocityMultiplier}},d.prototype.revert=function(){this.shouldUseCSSTranslation()&&this.moveToUsingTransforms(-this.xTranslation(),-this.yTranslation()),this.moveTo(this.initialPosition.left,this.initialPosition.top)},d.prototype.requestAnimationFrame=function(a){return b.requestAnimationFrame&&b.requestAnimationFrame(a)||b.webkitRequestAnimationFrame&&b.webkitRequestAnimationFrame(a)||b.mozRequestAnimationFrame&&b.mozRequestAnimationFrame(a)||b.oRequestAnimationFrame&&b.mozRequestAnimationFrame(a)||b.msRequestAnimationFrame&&b.msRequestAnimationFrame(a)||b.setTimeout(a,1e3/60)},d.prototype.positionParent=function(){this.options.constrainTo&&!this.parentPositioned&&(this.parentPositioned=!0,"parent"===this.options.constrainTo?this.$container.css({position:"relative"}):"window"===this.options.constrainTo&&"#document"!==this.$container.get(0).nodeName&&"static"!==this.$container.css("position")&&this.$container.css({position:"static"}))},d.prototype.placeObject=function(){this.objectPlaced||(this.objectPlaced=!0,this.offset="parent"===this.options.constrainTo||this.hasNonBodyRelative()?this.$el.position():this.$el.offset(),parseInt(this.$el.css("left"),10)&&(this.offset.left=this.$el.css("left")),parseInt(this.$el.css("top"),10)&&(this.offset.top=this.$el.css("top")),this.options.removeMargins&&this.$el.css({margin:0}),this.$el.css({position:"absolute",top:this.offset.top,left:this.offset.left}))},d.prototype.hasNonBodyRelative=function(){return this.$el.parents().filter(function(){var b=a(this);return b.is("body")||"relative"===b.css("position")}).length>1},d.prototype.setScale=function(a){this.scale=a},d.prototype.setMultiplier=function(a){this.options.multiplier=a},d.prototype.removeCSSEasing=function(){this.cssAnimationsSupported()&&this.$el.css(this.getCSSEaseHash(!0))},d.prototype.disableSelect=function(){this.$el.css({"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"})},d.prototype.removeActiveClass=function(){this.$el.removeClass([this.options.activeClass,"pep-ease"].join(" "))},d.prototype.handleConstraint=function(b,d,e){var f=this.$el.position();this.pos.x=f.left,this.pos.y=f.top;var g,h,i,j,k={x:!1,y:!1};return this.log({type:"pos-coords",x:this.pos.x,y:this.pos.y}),a.isArray(this.options.constrainTo)?(this.options.constrainTo[3]!==c&&this.options.constrainTo[1]!==c&&(h=this.options.constrainTo[1]===!1?1/0:this.options.constrainTo[1],i=this.options.constrainTo[3]===!1?-(1/0):this.options.constrainTo[3]),this.options.constrainTo[0]!==!1&&this.options.constrainTo[2]!==!1&&(g=this.options.constrainTo[2]===!1?1/0:this.options.constrainTo[2],j=this.options.constrainTo[0]===!1?-(1/0):this.options.constrainTo[0]),this.pos.x+b<i&&(k.x=i),this.pos.y+d<j&&(k.y=j)):"string"==typeof this.options.constrainTo&&(i=0,j=0,h=this.$container.width()-this.$el.outerWidth(),g=this.$container.height()-this.$el.outerHeight(),this.pos.x+b<0&&(k.x=0),this.pos.y+d<0&&(k.y=0)),this.pos.x+b>h&&(k.x=h),this.pos.y+d>g&&(k.y=g),this.shouldUseCSSTranslation()&&e&&(k.x===i&&this.xTranslation()&&(k.x=i-this.xTranslation()),k.x===h&&this.xTranslation()&&(k.x=h-this.xTranslation()),k.y===j&&this.yTranslation()&&(k.y=j-this.yTranslation()),k.y===g&&this.yTranslation()&&(k.y=g-this.yTranslation())),k},d.prototype.getCSSEaseHash=function(a){"undefined"==typeof a&&(a=!1);var b;if(a)b="";else{if(this.CSSEaseHash)return this.CSSEaseHash;b=["all",this.options.cssEaseDuration+"ms",this.options.cssEaseString].join(" ")}return{"-webkit-transition":b,"-moz-transition":b,"-ms-transition":b,"-o-transition":b,transition:b}},d.prototype.calculateActiveDropRegions=function(){var b=this;this.activeDropRegions.length=0,a.each(a(this.options.droppable),function(c,d){var e=a(d);b.isOverlapping(e,b.$el)?(e.addClass(b.options.droppableActiveClass),b.activeDropRegions.push(e)):e.removeClass(b.options.droppableActiveClass)})},d.prototype.isOverlapping=function(a,b){if(this.options.overlapFunction)return this.options.overlapFunction(a,b);var c=a[0].getBoundingClientRect(),d=b[0].getBoundingClientRect();return!(c.right<d.left||c.left>d.right||c.bottom<d.top||c.top>d.bottom)},d.prototype.isTouch=function(a){return a.type.search("touch")>-1},d.prototype.isPointerEventCompatible=function(){return"MSPointerEvent"in b},d.prototype.applyMSDefaults=function(a){this.$el.css({"-ms-touch-action":"none","touch-action":"none","-ms-scroll-chaining":"none","-ms-scroll-limit":"0 0 0 0"})},d.prototype.isValidMoveEvent=function(a){return!this.isTouch(a)||this.isTouch(a)&&a.originalEvent&&a.originalEvent.touches&&1===a.originalEvent.touches.length},d.prototype.shouldUseCSSTranslation=function(){if(this.options.forceNonCSS3Movement)return!1;if("undefined"!=typeof this.useCSSTranslation)return this.useCSSTranslation;var a=!1;return a=!this.options.useCSSTranslation||"undefined"!=typeof Modernizr&&!Modernizr.csstransforms?!1:!0,this.useCSSTranslation=a,a},d.prototype.cssAnimationsSupported=function(){if("undefined"!=typeof this.cssAnimationsSupport)return this.cssAnimationsSupport;if("undefined"!=typeof Modernizr&&Modernizr.cssanimations)return this.cssAnimationsSupport=!0,!0;var a=!1,b=document.createElement("div"),d="animation",e="",f="Webkit Moz O ms Khtml".split(" "),g="";if(b.style.animationName&&(a=!0),a===!1)for(var h=0;h<f.length;h++)if(b.style[f[h]+"AnimationName"]!==c){g=f[h],d=g+"Animation",e="-"+g.toLowerCase()+"-",a=!0;break}return this.cssAnimationsSupport=a,a},d.prototype.hardwareAccelerate=function(){this.$el.css({"-webkit-perspective":1e3,perspective:1e3,"-webkit-backface-visibility":"hidden","backface-visibility":"hidden"})},d.prototype.getMovementValues=function(){return{ev:this.ev,pos:this.pos,velocity:this.velocity()}},d.prototype.buildDebugDiv=function(){var b;0===a("#pep-debug").length&&(b=a("<div></div>"),b.attr("id","pep-debug").append("<div style='font-weight:bold; background: red; color: white;'>DEBUG MODE</div>").append("<div id='pep-debug-event'>no event</div>").append("<div id='pep-debug-ev-coords'>event coords: <span class='pep-x'>-</span>, <span class='pep-y'>-</span></div>").append("<div id='pep-debug-pos-coords'>position coords: <span class='pep-x'>-</span>, <span class='pep-y'>-</span></div>").append("<div id='pep-debug-velocity'>velocity: <span class='pep-x'>-</span>, <span class='pep-y'>-</span></div>").append("<div id='pep-debug-delta'>Δ movement: <span class='pep-x'>-</span>, <span class='pep-y'>-</span></div>").css({position:"fixed",bottom:5,right:5,zIndex:99999,textAlign:"right",fontFamily:"Arial, sans",fontSize:10,border:"1px solid #DDD",padding:"3px",background:"white",color:"#333"}));var c=this;setTimeout(function(){c.debugElements={$event:a("#pep-debug-event"),$velocityX:a("#pep-debug-velocity .pep-x"),$velocityY:a("#pep-debug-velocity .pep-y"),$dX:a("#pep-debug-delta .pep-x"),$dY:a("#pep-debug-delta .pep-y"),$evCoordsX:a("#pep-debug-ev-coords .pep-x"),$evCoordsY:a("#pep-debug-ev-coords .pep-y"),$posCoordsX:a("#pep-debug-pos-coords .pep-x"),$posCoordsY:a("#pep-debug-pos-coords .pep-y")}},0),a("body").append(b)},d.prototype.log=function(a){if(this.options.debug)switch(a.type){case"event":this.debugElements.$event.text(a.event);break;case"pos-coords":this.debugElements.$posCoordsX.text(a.x),this.debugElements.$posCoordsY.text(a.y);break;case"event-coords":this.debugElements.$evCoordsX.text(a.x),this.debugElements.$evCoordsY.text(a.y);break;case"delta":this.debugElements.$dX.text(a.x),this.debugElements.$dY.text(a.y);break;case"velocity":var b=this.velocity();this.debugElements.$velocityX.text(Math.round(b.x)),this.debugElements.$velocityY.text(Math.round(b.y))}},d.prototype.toggle=function(a){"undefined"==typeof a?this.disabled=!this.disabled:this.disabled=!a},a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeOutExpo:function(a,b,c,d,e){return b===e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c}}),a.fn[e]=function(b){return this.each(function(){if(!a.data(this,"plugin_"+e)){var c=new d(this,b);a.data(this,"plugin_"+e,c),a.pep.peps.push(c)}})},a.pep={},a.pep.peps=[],a.pep.toggleAll=function(b){a.each(this.peps,function(a,c){c.toggle(b)})},a.pep.unbind=function(a){var b=a.data("plugin_"+e);"undefined"!=typeof b&&(b.toggle(!1),b.unsubscribe(),a.removeData("plugin_"+e))}}(jQuery,window),ccm_t=function(a){return $("input[name=ccm-string-"+a+"]").val()},ccm_parseJSON=function(a,b){a.error?alert(a.message):b()},ccm_addHeaderItem=function(a,b){var c=-1!=a.indexOf("?")?"&ts=":"?ts=";if("CSS"==b)if(-1!=navigator.userAgent.indexOf("MSIE")){var d=document.createElement("link"),e=document.getElementsByTagName("head")[0];d.type="text/css",d.rel="stylesheet",d.href=a,d.media="screen",e.appendChild(d)}else $("head").children('link[href*="'+a+'"]').length||$("head").children('link[data-source~="'+a+'"]').length||$("head").append('<link rel="stylesheet" media="screen" type="text/css" href="'+a+c+(new Date).getTime()+'" />');else"JAVASCRIPT"==b?$('script[src*="'+a+'"]').length||$('script[data-source~="'+a+'"]').length||$("head").append('<script type="text/javascript" src="'+a+c+(new Date).getTime()+'"></script>'):$("head").children(a).length||$("head").append(a)};var ccm_isBlockError=!1,ccm_blockError=!1;ccm_addError=function(a){ccm_isBlockError||(ccm_blockError="",ccm_blockError+="<ul>"),ccm_isBlockError=!0,ccm_blockError+="<li>"+a+"</li>"},ccm_resetBlockErrors=function(){ccm_isBlockError=!1,ccm_blockError=""},!function(a,b){"use strict";function c(a){var c=this;a=a||{},a=b.extend({dataType:"json",type:"post",error:function(a){c.error(a,c)},complete:function(){c.complete(c)}},a),c.options=a,c.execute()}c.prototype={execute:function(){var a=this,c=a.options,d=c.success;c.success=function(b){a.success(b,a,d)},a.before(),b.ajax(c)},before:function(a){jQuery.fn.dialog.showLoader()},error:function(a,b){ConcreteAlert.dialog("Error",a.responseText)},validateResponse:function(a){return a.error?(ConcreteAlert.dialog("Error",a.errors.join("<br/>")),!1):!0},success:function(a,b,c){b.validateResponse(a)&&c(a)},complete:function(a){jQuery.fn.dialog.hideLoader()}},c.validateResponse=c.prototype.validateResponse,b.concreteAjax=function(a){new c(a)},a.ConcreteAjaxRequest=c}(this,$),!function(a,b){"use strict";function c(a,c){var d=this;return c=c||{},c=b.extend({beforeSubmit:d.before,complete:d.complete,data:{}},c),d.$form=a,ConcreteAjaxRequest.call(d,c),d.$form}c.prototype=Object.create(ConcreteAjaxRequest.prototype),c.prototype.execute=function(){var a=this,b=a.options,c=b.success,d=b.error;a.$form.ajaxForm({type:b.type,data:b.data,url:b.url,dataType:b.dataType,beforeSubmit:function(){b.beforeSubmit(a)},error:function(b){a.error(b,a,d)},success:function(b){a.success(b,a,c)},complete:function(){b.complete(a)}})},c.prototype.error=function(a,b,c){ConcreteAjaxRequest.prototype.error(a,b),c&&c(a)},c.prototype.success=function(a,b,c){b.validateResponse(a)&&(c?c(a):(ConcreteEvent.publish("AjaxFormSubmitSuccess",{response:a,form:b.$form.attr("data-dialog-form")}),a.redirectURL?window.location.href=a.redirectURL:(b.$form.attr("data-dialog-form")&&jQuery.fn.dialog.closeTop(),ConcreteAlert.notify({message:a.message,title:a.title}))))},b.fn.concreteAjaxForm=function(a){return b.each(b(this),function(d,e){new c(b(this),a)})},a.ConcreteAjaxForm=c}(this,$),!function(a,b){"use strict";function c(a,c){var d=this;return c=b.extend({iframe:!0,task:!1,dragAreaBlockID:!1,dragArea:null,bID:!1},c),d.options=c,c.dragAreaBlockID&&a.find("input[name=dragAreaBlockID]").val(c.dragAreaBlockID),ConcreteAjaxForm.call(d,a,c)}c.prototype=Object.create(ConcreteAjaxForm.prototype),c.prototype.before=function(a){ConcreteEvent.fire("EditModeBeforeBlockSubmit",{form:a})},c.prototype.success=function(a,c){if(c.validateResponse(a)){var d=a.cID?a.cID:CCM_CID,e=new Concrete.getEditMode,f=e.getAreaByID(a.aID),g=f.getEnableGridContainer()?1:0,h=CCM_DISPATCHER_FILENAME+"/ccm/system/block/render";jQuery.fn.dialog.closeTop(),b.get(h,{arHandle:f.getHandle(),cID:d,bID:a.bID,arEnableGridContainer:g,placeholder:""},function(a){var d,g=Concrete.getEditMode(),h=f.inEditMode(g);if(ConcreteToolbar.disableDirectExit(),jQuery.fn.dialog.hideLoader(),"add"==c.options.task){var i=h.getElem(),j=b(a);if(!j.hasClass("ccm-block-edit")){var k=j.find(".ccm-block-edit");k.length&&(d=new Concrete.Block(k,g),d.setArea(h))}if(d||(d=new Concrete.Block(j,g),d.setArea(h)),"core_area_layout"===c.options.btHandle)i.children(".ccm-area-block-list").append(j);else{var l=b(c.options.placeholder);l.length?l.replaceWith(j):i.children(".ccm-area-block-list").prepend(j)}ConcreteAlert.notify({message:ccmi18n.addBlockMsg,title:ccmi18n.addBlock}),jQuery.fn.dialog.closeAll(),c.options.btSupportsInlineAdd&&(e.destroyInlineEditModeToolbars(),ConcreteEvent.fire("EditModeExitInlineComplete",{block:d})),ConcreteEvent.fire("EditModeAddBlockComplete",{block:d})}else{d=h.getBlockByID(c.options.bID);var m=d.replace(a);ConcreteAlert.notify({message:ccmi18n.updateBlockMsg,title:ccmi18n.updateBlock}),c.options.btSupportsInlineEdit&&(e.destroyInlineEditModeToolbars(),ConcreteEvent.fire("EditModeExitInlineComplete",{block:m})),ConcreteEvent.fire("EditModeUpdateBlockComplete",{block:m})}})}},b.fn.concreteAjaxBlockForm=function(a){return b.each(b(this),function(d,e){new c(b(this),a)})},a.ConcreteAjaxBlockForm=c}(this,$),jQuery.cookie=function(a,b,c){if("undefined"==typeof b){var d=null;if(document.cookie&&""!=document.cookie)for(var e=document.cookie.split(";"),f=0;f<e.length;f++){var g=jQuery.trim(e[f]);if(g.substring(0,a.length+1)==a+"="){d=decodeURIComponent(g.substring(a.length+1));break}}return d}c=c||{},null===b&&(b="",c=$.extend({},c),c.expires=-1);var h="";if(c.expires&&("number"==typeof c.expires||c.expires.toUTCString)){var i;"number"==typeof c.expires?(i=new Date,i.setTime(i.getTime()+24*c.expires*60*60*1e3)):i=c.expires,h="; expires="+i.toUTCString()}var j=c.path?"; path="+c.path:"",k=c.domain?"; domain="+c.domain:"",l=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),h,j,k,l].join("")};var html=$("html"),ConcretePanelManager=function(){"use strict";var a=[];return{getPanels:function(){return a},showOverlay:function(a){$("#ccm-panel-overlay").clearQueue().show(0).delay(100).queue(function(){a?$(this).addClass("ccm-panel-translucent"):$(this).removeClass("ccm-panel-translucent"),$(this).dequeue()})},exitPanelMode:function(b){b=b||$.noop;for(var c=0,d=0;d<a.length;d++)a[d].isOpen&&(c++,a[d].hide(function(){c--,0==c&&b.call(null)}))},register:function(b){var c=$.extend({translucent:!0,overlay:!0,position:"left",primary:!0,transition:"slide"},b),d=new ConcretePanel(c);a.push(d);var e=$("#"+d.getDOMID());e.length||($("<div />",{id:d.getDOMID(),"class":"ccm-panel "+d.getPositionClass()}).appendTo($(document.body)),$("<div />",{"class":"ccm-panel-content-wrapper ccm-ui"}).appendTo($("#"+d.getDOMID())))},getByIdentifier:function(b){for(var c=0;c<a.length;c++)if(a[c].getIdentifier()==b)return a[c]}}}();$.widget("concrete.dialog",$.ui.dialog,{_allowInteraction:function(a){return!!$(a.target).closest(".ccm-interaction-dialog").length||this._super(a)}}),$.widget.bridge("jqdialog",$.concrete.dialog),jQuery.fn.dialog=function(){return arguments.length>0?void $(this).jqdialog(arguments[0],arguments[1],arguments[2]):$(this).is("div")?void $(this).jqdialog():$(this).each(function(){$(this).unbind("click.make-dialog").bind("click.make-dialog",function(a){var b=$(this).attr("href"),c=$(this).attr("dialog-width"),d=$(this).attr("dialog-height"),e=$(this).attr("dialog-title"),f=$(this).attr("dialog-on-open"),g=$(this).attr("dialog-on-destroy"),h=$(this).attr("dialog-on-close"),i=$(this).attr("dialog-on-direct-close");return obj={modal:!0,href:b,width:c,height:d,title:e,onOpen:f,onDestroy:g,onClose:h,onDirectClose:i},jQuery.fn.dialog.open(obj),!1})})},jQuery.fn.dialog.close=function(a){a++,$("#ccm-dialog-content"+a).jqdialog("close")},jQuery.fn.dialog.open=function(options){if("undefined"!=typeof ConcreteMenu){var activeMenu=ConcreteMenuManager.getActiveMenu();activeMenu&&activeMenu.hide()}"string"==typeof options.width?"auto"==options.width?w="auto":options.width.indexOf("%",0)>0?(w=options.width.replace("%",""),w=$(window).width()*(w/100),w+=50):w=parseInt(options.width)+50:options.width?w=parseInt(options.width)+50:w=550,"string"==typeof options.height?"auto"==options.height?h="auto":options.height.indexOf("%",0)>0?(h=options.height.replace("%",""),h=$(window).height()*(h/100),h+=100):h=parseInt(options.height)+100:options.height?h=parseInt(options.height)+100:h=400,"auto"!==h&&h>$(window).height()&&(h=$(window).height()),options.width=w,options.height=h;var defaults={modal:!0,escapeClose:!0,width:w,height:h,resizable:!0,create:function(){$(this).parent().addClass("animated fadeIn")},open:function(){var $dialog=$(this),nd=$(".ui-dialog").length;1==nd&&($("body").attr("data-last-overflow",$("body").css("overflow")),$("body").css("overflow","hidden"));var overlays=$(".ui-widget-overlay").length;if($(".ui-widget-overlay").each(function(a,b){overlays>a+1&&$(this).css("opacity",0)}),jQuery.fn.dialog.activateDialogContents($dialog),$dialog.jqdialog("option","resizable")){var $wrapper=$($dialog.parent()),z=parseInt($wrapper.find(".ui-dialog-buttonpane").css("z-index"));$wrapper.find(".ui-resizable-handle").css("z-index",z+1e3)}"undefined"!=typeof options.onOpen&&("function"==typeof options.onOpen?options.onOpen($dialog):eval(options.onOpen))},beforeClose:function(){var a=$(".ui-dialog").length;1==a&&$("body").css("overflow",$("body").attr("data-last-overflow"))},close:function(ev,u){options.element||$(this).jqdialog("destroy").remove(),"undefined"!=typeof options.onClose&&("function"==typeof options.onClose?options.onClose($(this)):eval(options.onClose)),"undefined"==typeof options.onDirectClose||!ev.handleObj||"keydown"!=ev.handleObj.type&&"click"!=ev.handleObj.type||("function"==typeof options.onDirectClose?options.onDirectClose():eval(options.onDirectClose)),"undefined"!=typeof options.onDestroy&&("function"==typeof options.onDestroy?options.onDestroy():eval(options.onDestroy));var overlays=$(".ui-widget-overlay").length;$(".ui-widget-overlay").each(function(a,b){overlays>a+1?$(this).css("opacity",0):$(this).css("opacity",1)})}},finalSettings={autoOpen:!1,data:{}};$.extend(finalSettings,defaults,options),finalSettings.element?($(finalSettings.element).jqdialog(finalSettings).jqdialog(),$(finalSettings.element).jqdialog("open")):(jQuery.fn.dialog.showLoader(),$.ajax({type:"GET",url:finalSettings.href,data:finalSettings.data,success:function(a){jQuery.fn.dialog.hideLoader(),$("<div />").jqdialog(finalSettings).html(a).jqdialog("open")}}))},jQuery.fn.dialog.activateDialogContents=function(a){if(a.find("button[data-dialog-action=cancel]").on("click",function(){jQuery.fn.dialog.closeTop()}),$("[data-dialog-form]").concreteAjaxForm(),a.find("button[data-dialog-action=submit]").on("click",function(){$("[data-dialog-form]").submit()}),a.find(".dialog-buttons").length>0&&(a.jqdialog("option","buttons",[{}]),a.parent().find(".ui-dialog-buttonset").remove(),a.parent().find(".ui-dialog-buttonpane").html(""),a.find(".dialog-buttons").removeClass().appendTo(a.parent().find(".ui-dialog-buttonpane").addClass("ccm-ui"))),a.find(".dialog-launch").dialog(),a.find(".ccm-dialog-close").on("click",function(){a.dialog("close")}),a.find(".launch-tooltip").tooltip({container:"#ccm-tooltip-holder"}),a.find(".dialog-help").length>0){a.find(".dialog-help").hide();var b=a.find(".dialog-help").html();if(ccmi18n.helpPopup){ccmi18n.helpPopup}else;var c=$('<button class="ui-dialog-titlebar-help ccm-menu-help-trigger"><i class="fa fa-info-circle"></i></button>'),d=$("#ccm-tooltip-holder");a.parent().find(".ui-dialog-titlebar").addClass("ccm-ui").append(c),c.popover({content:function(){return b},placement:"bottom",html:!0,container:d,trigger:"click"}),c.on("shown.bs.popover",function(){var a=function(){c.popover("hide",c),a=$.noop};c.on("hide.bs.popover",function(b){c.unbind(b),a=$.noop}),$("body").mousedown(function(b){$(b.target).closest(d).length||$(b.target).closest(c).length||($(this).unbind(b),a())})})}},jQuery.fn.dialog.getTop=function(){var a=$(".ui-dialog:visible").length;return $($(".ui-dialog:visible")[a-1]).find(".ui-dialog-content")},jQuery.fn.dialog.replaceTop=function(a){$dialog=jQuery.fn.dialog.getTop(),$dialog.html(a),jQuery.fn.dialog.activateDialogContents($dialog)},jQuery.fn.dialog.showLoader=function(a){$("body").addClass("ccm-loading")},jQuery.fn.dialog.hideLoader=function(){$("body").removeClass("ccm-loading")},jQuery.fn.dialog.closeTop=function(){$dialog=jQuery.fn.dialog.getTop(),$dialog.jqdialog("close")},jQuery.fn.dialog.closeAll=function(){$($(".ui-dialog-content").get().reverse()).jqdialog("close")},!function(a,b){"use strict";var c={dialog:function(a,c,d){b('<div id="ccm-popup-alert" class="ccm-ui"><div id="ccm-popup-alert-message" class="alert alert-danger">'+c+"</div></div>").dialog({title:a,modal:!0,onDestroy:d})},info:function(a){var c=b.extend({type:"info",icon:"question"},a);return this.notify(c)},error:function(a){var c=b.extend({type:"danger",icon:"times"},a);return this.notify(c)},notify:function(a){var c=b.extend({type:"success",icon:"check",title:!1,message:!1,appendTo:!1,delay:2e3,callback:function(){}},a),d="",e=b(c.appendTo?c.appendTo:document.body);d=c.title?"<h3>"+c.title+"</h3>"+c.message:"<h3>"+c.message+"</h3>";var f=b('<div id="ccm-notification-hud" class="ccm-ui ccm-notification ccm-notification-'+c.type+'"><i class="ccm-notification-icon fa fa-'+c.icon+'"></i><div class="ccm-notification-inner">'+d+"</div></div>").appendTo(e).delay(5).queue(function(){b(this).addClass("animated fadeIn"),b(this).dequeue()}),g=_.once(function(){f.queue(function(){b(this).css("opacity",1),b(this).dequeue()}).delay(1).queue(function(){b(this).addClass("animated bounceOutRight"),b(this).dequeue()}).delay(1e3).queue(function(){b(this).remove(),b(this).dequeue(),c.callback()})}),h=setTimeout(g,c.delay);f.click(function(){g(),clearTimeout(h)})}};a.ConcreteAlert=c}(this,$),!function(a,b){"use strict";function c(a){var c=this;a=a||{},a=b.extend({width:"800",height:"450",title:"Help",href:CCM_DISPATCHER_FILENAME+"/dashboard/home?_ccm_dashboard_external=1",dialogClass:"ccm-dialog-slim ccm-dialog-help-wrapper",onOpen:function(a){c.positionArrows(a)}},a),c.options=a}c.prototype={positionArrows:function(a){a.find(".newsflow-paging-next").addClass("newsflow-paging-appended").appendTo(a.parent()),a.find(".newsflow-paging-previous").addClass("newsflow-paging-appended").appendTo(a.parent());
},open:function(){var a=this;b.fn.dialog.open(a.options)}},c.loadEdition=function(a){var d=new c,e=CCM_TOOLS_PATH+"/newsflow?cID="+a;jQuery.fn.dialog.showLoader(),b.get(e,function(a){b(".newsflow-paging-appended").remove(),jQuery.fn.dialog.replaceTop(a),jQuery.fn.dialog.hideLoader(),$dialog=jQuery.fn.dialog.getTop(),d.positionArrows($dialog)})},a.ConcreteNewsflowDialog=c}(this,$),!function(a,b){"use strict";function c(a,c){var d=this;return c=c||{},c=b.extend({url:!1,data:{}},c),d.$element=a,d.options=c,d.initializeEditableFields(),d.initializeClearCommands(),d.$element}c.prototype={getAjaxURL:function(a){var b=this,c=b.options.url;return a.attr("data-url")&&(c=a.attr("data-url")),c},setupXeditableField:function(a){var b=this;a.editable({ajaxOptions:{dataType:"json"},emptytext:ccmi18n.none,showbuttons:!0,params:b.options.data,url:b.options.url,success:function(a,b){return ConcreteAjaxRequest.validateResponse(a)?{newValue:b}:""},pk:"_x"})},setupXeditableAttributeField:function(a){var b=this;a.editable({ajaxOptions:{dataType:"json"},mode:a.data("editablemode"),emptytext:ccmi18n.none,showbuttons:!0,savenochange:!0,autotext:"never",url:b.options.url,params:function(a){var c=[];return c.push({name:"name",value:a.name}),c.push({name:"pk",value:a.pk}),_.each(b.options.data,function(a,b){"object"==typeof a?c.push({name:a.name,value:a.value}):c.push({name:b,value:a})}),_.each(a.value,function(a){c.push({name:a.name,value:a.value})}),c},success:function(a,b){return ConcreteAjaxRequest.validateResponse(a)?{newValue:a.value}:""},pk:"_x"})},setupImageField:function(a){var b=this,c=a.find(".editable-image-wrapper img");a.find(".editable-image-wrapper input").css("width",c.width()).css("height",c.height()),a.fileupload({url:b.getAjaxURL(a),dataType:"json",formData:b.options.data,start:function(){jQuery.fn.dialog.showLoader()},success:function(c){b.updateImageField(c,a)},error:function(a){ConcreteAlert.dialog("Error",a.responseText)},complete:function(a){jQuery.fn.dialog.hideLoader()}})},updateImageField:function(a,b){var c=this;ConcreteAjaxRequest.validateResponse(a)&&(b.find(".editable-image-display").html(a.imageHTML).find("img").attr("src",function(a,b){return b+"?"+(new Date).getTime()}),c.setupImageField(b),ConcreteAlert.notify({message:a.message}))},initializeEditableFields:function(){var a=this;a.$element.find("[data-editable-field-type]").each(function(){var c=b(this),d="setup"+c.attr("data-editable-field-type").charAt(0).toUpperCase()+c.attr("data-editable-field-type").slice(1)+"Field";a[d](c)})},initializeClearCommands:function(){var a=this;a.$element.on("click","[data-editable-field-command=clear]",function(){var c=b(this),d=c.closest("[data-editable-field-type]"),e="update"+d.attr("data-editable-field-type").charAt(0).toUpperCase()+d.attr("data-editable-field-type").slice(1)+"Field",f=a.options.data;f.task="clear";var g=a.getAjaxURL(d);return new ConcreteAjaxRequest({url:g,data:f,success:function(b){a[e](b,d)}}),!1}),a.$element.on("click","[data-editable-field-command=clear_attribute]",function(){var c=a.options.data,d=a.getAjaxURL(b(this)),e=b(this).attr("data-key-id"),f=[];return _.each(c,function(a,b){"object"==typeof a?f.push({name:a.name,value:a.value}):f.push({name:b,value:a})}),f.push({name:"akID",value:e}),new ConcreteAjaxRequest({url:d,data:f,success:function(a){b("[data-key-id="+e+"][data-editable-field-type=xeditableAttribute]").editable("setValue","")}}),!1})}},b.fn.concreteEditableFieldContainer=function(a){return b.each(b(this),function(d,e){new c(b(this),a)})},a.ConcreteEditableFieldContainer=c}(this,$),ccm_doPageReindexing=function(){$.get(CCM_TOOLS_PATH+"/reindex_pending_pages?ccm_token="+CCM_SECURITY_TOKEN)},!function(a,b,c){"use strict";function d(a,c){var d=this;c=c||{},c=b.extend({handle:"this",menu:!1,highlightClassName:"ccm-menu-highlight",highlightOffset:0,menuContainerClass:!1,menuActiveClass:"ccm-menu-item-active",menuActiveParentClass:"ccm-parent-menu-item-active",menuLauncherHoverClass:"ccm-menu-item-hover",menuLauncherHoverParentClass:"ccm-parent-menu-item-hover",enabled:!0,onHide:!1},c),d.$element=a,d.options=c,"none"==c.handle?d.$launcher=!1:(d.$launcher="this"==c.handle?d.$element:b(c.handle),d.$launcher.each(function(){var a=b(this);a.on("mousemove.concreteMenu",function(a){d.hoverProxy(a,b(this))})})),d.$menu=b(c.menu),d.setup(),Concrete.event.bind("EditModeBlockDragInitialization",function(){d.hide()})}d.prototype={setup:function(){var a=this,c=(a.options,e);c.$clickProxy||(c.$clickProxy=b("<div />",{id:"ccm-menu-click-proxy"}),c.$clickProxy.on("mouseout.concreteMenuProxy",function(a){var b=c.hoverMenu;b.mouseout(a)}),c.$clickProxy.on("mouseover.concreteMenuProxy",function(a){var b=c.hoverMenu;b.mouseover(a)}),c.$clickProxy.on("click.concreteMenuProxy",function(a){var b=c.hoverMenu;b.show(a)}),b(document.body).append(c.$clickProxy)),c.$highlighter||(c.$highlighter=b("<div />",{id:"ccm-menu-highlighter"}),b(document.body).append(c.$highlighter)),c.$container||(c.$container=b("<div />",{id:"ccm-popover-menu-container","class":"ccm-ui"}),b(document.body).append(c.$container))},destroy:function(){var a=this;a.hide(),a.$launcher.each(function(){b(this).unbind("mousemove.concreteMenu")})},positionAt:function(a,b){if(!b)return!1;var c=this,d=b.offset(),e={top:d.top-c.options.highlightOffset,left:d.left-c.options.highlightOffset,width:b.outerWidth()+2*c.options.highlightOffset,height:b.outerHeight()+2*c.options.highlightOffset,"border-top-left-radius":b.css("border-top-left-radius"),"border-top-right-radius":b.css("border-top-right-radius"),"border-bottom-left-radius":b.css("border-bottom-left-radius"),"border-bottom-right-radius":b.css("border-bottom-right-radius")};a.css(e)},hoverProxy:function(a,b){a.stopPropagation();var c=this,d=e,f=c.options.menuLauncherHoverClass,g=d.$clickProxy;return!d.enabled||d.activeMenu?!1:(c.positionAt(g,b),g.removeClass().addClass(f),void(e.hoverMenu=c))},mouseover:function(a){var b=this.$launcher,c=this.options;b.addClass(c.menuLauncherHoverClass),b.parents("*").slice(0,3).addClass(c.menuLauncherHoverParentClass)},mouseout:function(a){var b=this.$launcher,c=this.options;b.removeClass(c.menuLauncherHoverClass),b.parents("*").slice(0,3).removeClass(c.menuLauncherHoverParentClass)},setupMenuOptions:function(a){a.find(".dialog-launch").dialog()},show:function(a){var d=this,f=e,g=d.options,h=d.$launcher,i=d.$element,j=f.$container,k=f.$highlighter,l=d.$menu.clone(!0,!0),m=a.pageX+2,n=a.pageY+2;a.stopPropagation(),k.removeClass(),d.positionAt(k,h),c.defer(function(){k.addClass(g.highlightClassName)}),i.addClass(g.menuActiveClass),i.parents("*").slice(0,3).addClass(g.menuActiveParentClass),d.setupMenuOptions(l),j.html(""),l.appendTo(j),g.menuContainerClass&&j.addClass(g.menuContainerClass),l.css("opacity",0).show();var o=l.width(),p=l.height(),q=b(window).height(),r=b(window).width(),s=o/2-5,t=p/2-5,u=["bottom","top","right","left"],v=u.slice(0);a.clientX<o+30&&(u=c(u).without("left")),r<a.clientX+o+30&&(u=c(u).without("right")),q<a.clientY+p+30&&(u=c(u).without("bottom")),a.clientY<p+30&&(u=c(u).without("top")),(r<a.clientX+s||a.clientX<s)&&(u=c(u).without("top","bottom")),(q<a.clientY+t||a.clientY<t)&&(u=c(u).without("left","right"));var w=u.shift();switch(l.removeClass(v).addClass(w),a.pageX-=2,a.pageY-=2,w){case"left":m=a.pageX-o,n=a.pageY-p/2;break;case"right":m=a.pageX,n=a.pageY-p/2;break;case"top":n=a.pageY-p,m=a.pageX-o/2;break;case"bottom":n=a.pageY,m=a.pageX-o/2}l.css({top:n,left:m}),c.defer(function(){l.css("opacity",1)}),l.find("a").click(function(a){d.hide(a)}),b(document).unbind(".concreteMenuDisable").on("click.concreteMenuDisable",function(a){d.hide(a)}),d.$menuPointer=l,e.activeMenu=d,ConcreteEvent.publish("ConcreteMenuShow",{menu:d})},hide:function(a){var b=this,d=e,f={"class":"",width:0,height:0,top:0,left:0};a&&a.stopPropagation(),b.$menuPointer&&(b.$menuPointer.css("opacity",0),c.defer(function(){b.$menuPointer.hide()})),c.defer(function(){b.$element.removeClass(b.options.menuActiveClass),b.$element.parents("*").slice(0,3).removeClass(b.options.menuActiveParentClass),d.$highlighter.removeClass(),d.$container.removeClass().addClass("ccm-ui").html("")}),d.$clickProxy.css(f),d.$highlighter.css(f),e.activeMenu=!1,b.options.onHide&&b.options.onHide(b)}};var e={enabled:!0,$clickProxy:!1,$highlighter:!1,$container:!1,hoverMenu:!1,activeMenu:!1,reset:function(){this.$clickProxy.css("width",0).css("height",0),this.$container.html("")},enable:function(){this.enabled=!0,this.reset()},disable:function(){this.enabled=!1,this.reset()},getActiveMenu:function(){return this.activeMenu}};b.fn.concreteMenu=function(a){return b.each(b(this),function(c,e){new d(b(this),a)})},a.ConcreteMenu=d,a.ConcreteMenuManager=e}(this,$,_),String.prototype.score=function(a,b){if(b=b||0,0==a.length)return.9;if(a.length>this.length)return 0;for(var c=a.length;c>0;c--){var d=a.substring(0,c),e=this.indexOf(d);if(!(0>e||e+a.length>this.length+b)){var f=this.substring(e+d.length),g=null;g=c>=a.length?"":a.substring(c);var h=f.score(g,b+e);if(h>0){var i=this.length-f.length;if(0!=e){var j=0,k=this.charCodeAt(e-1);if(32==k||9==k)for(var j=e-2;j>=0;j--)k=this.charCodeAt(j),i-=32==k||9==k?1:.15;else i-=e}return i+=h*f.length,i/=this.length}}}return 0},!function(a,b,c){"use strict";var d={updatesShowMore:function(a){b(a).parent().hide(),b(a).parent().parent().find(".ccm-marketplace-update-changelog").css("max-height","none")},getMoreInformation:function(a){jQuery.fn.dialog.showLoader();var c={mpID:a};b.concreteAjax({method:"get",url:CCM_DISPATCHER_FILENAME+"/ccm/system/marketplace/connect",data:c,success:function(a){jQuery.fn.dialog.hideLoader(),a.isConnected?window.location.href=a.localURL:window.location.href=CCM_DISPATCHER_FILENAME+"/dashboard/extend/connect"}})},purchaseOrDownload:function(a){var c=a.mpID,d=a.closeTop;a.onComplete||(a.onComplete=function(a,b){jQuery.fn.dialog.closeTop()}),ConcreteEvent.subscribe("MarketplaceRequestComplete",a.onComplete),d&&jQuery.fn.dialog.closeTop(),jQuery.fn.dialog.showLoader();var e={mpID:c};b.getJSON(CCM_DISPATCHER_FILENAME+"/ccm/system/marketplace/connect",e,function(a){jQuery.fn.dialog.hideLoader(),a.isConnected?a.purchaseRequired?b.fn.dialog.open({title:ccmi18n.communityCheckout,iframe:!0,href:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/marketplace/checkout?mpID="+c,width:"560px",modal:!1,height:"400px"}):b.fn.dialog.open({title:ccmi18n.communityDownload,href:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/marketplace/download?mpID="+c,width:500,appendButtons:!0,modal:!1,height:400}):window.location.href=CCM_DISPATCHER_FILENAME+"/dashboard/extend/connect"})}};a.ConcreteMarketplace=d}(window,jQuery,_),!function(a,b){"use strict";function c(a,c){c=c||{},c=b.extend({result:{},onLoad:!1,onUpdateResults:!1,bulkParameterName:"item"},c),this.$element=a,this.$results=a.find("div[data-search-element=results]"),this.$resultsTableBody=this.$results.find("tbody"),this.$resultsTableHead=this.$results.find("thead"),this.$resultsPagination=this.$results.find("div.ccm-search-results-pagination"),this.$menuTemplate=a.find("script[data-template=search-results-menu]"),this.$searchFieldRowTemplate=a.find("script[data-template=search-field-row]"),this.options=c,this._templateSearchForm=_.template(a.find("script[data-template=search-form]").html()),this._templateSearchResultsTableHead=_.template(a.find("script[data-template=search-results-table-head]").html()),this._templateSearchResultsTableBody=_.template(a.find("script[data-template=search-results-table-body]").html()),this._templateSearchResultsPagination=_.template(a.find("script[data-template=search-results-pagination]").html()),this.$menuTemplate.length&&(this._templateSearchResultsMenu=_.template(this.$menuTemplate.html())),this.$searchFieldRowTemplate.length&&(this._templateAdvancedSearchFieldRow=_.template(this.$searchFieldRowTemplate.html())),this.setupSearch(),this.setupCheckboxes(),this.setupBulkActions(),this.setupSort(),this.setupPagination(),this.setupSelect2(),this.setupAdvancedSearch(),this.setupCustomizeColumns(),this.updateResults(c.result),c.onLoad&&c.onLoad(this)}c.prototype.ajaxUpdate=function(a,c,d){var e=this;b.concreteAjax({url:a,data:c,success:function(a){d?d(a):e.updateResults(a)}})},c.prototype.setupSelect2=function(){var a=this.$element.find(".select2-select");a.length&&a.select2()},c.prototype.createMenu=function(a){a.concreteMenu({menu:b("[data-search-menu="+a.attr("data-launch-search-menu")+"]")})},c.prototype.setupMenus=function(a){var c=this;c._templateSearchResultsMenu&&(c.$element.find("[data-search-menu]").remove(),b.each(a.items,function(a,b){c.$results.append(c._templateSearchResultsMenu({item:b}))}),c.$element.find("tbody tr").each(function(){c.createMenu(b(this))}))},c.prototype.setupCustomizeColumns=function(){var a=this;a.$element.on("click","a[data-search-toggle=customize]",function(){var c=b(this).attr("data-search-column-customize-url");return b.fn.dialog.open({width:480,height:400,href:c,modal:!0,title:ccmi18n.customizeSearch,onOpen:function(){var c=b("form[data-dialog-form=search-customize]"),d=c.find("select[data-search-select-default-column]"),e=c.find("ul[data-search-column-list]");b("ul[data-search-column-list]").sortable({cursor:"move",opacity:.5}),c.on("click","input[type=checkbox]",function(){var a=b(this).parent().find("span").html(),f=b(this).attr("id");b(this).prop("checked")?0==c.find("li[data-field-order-column='"+f+"']").length&&(d.append(b("<option>",{value:f,text:a})),d.prop("disabled",!1),e.append('<li data-field-order-column="'+f+'"><input type="hidden" name="column[]" value="'+f+'" />'+a+"</li>")):(e.find("li[data-field-order-column='"+f+"']").remove(),d.find("option[value='"+f+"']").remove(),0==e.find("li").length&&d.prop("disabled",!0))}),ConcreteEvent.subscribe("AjaxFormSubmitSuccess",function(b,c){a.updateResults(c.response.result)})}}),!1})},c.prototype.updateResults=function(a){var c=this,d=c.options;c.$resultsTableHead.html(c._templateSearchResultsTableHead({columns:a.columns})),c.$resultsTableBody.html(c._templateSearchResultsTableBody({items:a.items})),c.$resultsPagination.html(c._templateSearchResultsPagination({paginationTemplate:a.paginationTemplate})),c.$advancedFields.html(""),b.each(a.fields,function(a,b){c.$advancedFields.append(c._templateAdvancedSearchFieldRow({field:b}))}),c.setupMenus(a),d.onUpdateResults&&d.onUpdateResults(this)},c.prototype.setupAdvancedSearch=function(){var a=this;a.$advancedFields=a.$element.find("div.ccm-search-fields-advanced"),a.$element.on("click","a[data-search-toggle=advanced]",function(){return a.$advancedFields.append(a._templateAdvancedSearchFieldRow()),!1}),a.$element.on("change","select[data-search-field]",function(){var c=b(this).parent().find(".ccm-search-field-content");c.html("");var d=b(this).find(":selected").attr("data-search-field-url");d&&a.ajaxUpdate(d,!1,function(a){_.each(a.assets.css,function(a){ccm_addHeaderItem(a,"CSS")}),_.each(a.assets.javascript,function(a){ccm_addHeaderItem(a,"JAVASCRIPT")}),c.html(a.html)})}),a.$element.on("click","a[data-search-remove=search-field]",function(){var a=b(this).parent();return a.remove(),!1})},c.prototype.setupSort=function(){var a=this;this.$element.on("click","thead th a",function(){return a.ajaxUpdate(b(this).attr("href")),!1})},c.prototype.refreshResults=function(){var a=this;a.$element.find("form[data-search-form]").trigger("submit")},c.prototype.setupSearch=function(){var a=this;a.$element.find("[data-search-element=wrapper]").html(a._templateSearchForm()),a.$element.on("submit","form[data-search-form]",function(){var c=b(this).serializeArray();return c.push({name:"submitSearch",value:"1"}),a.ajaxUpdate(b(this).attr("action"),c),!1})},c.prototype.handleSelectedBulkAction=function(a,c,d,e){var f=this,g=[];b.each(e,function(a,c){g.push({name:f.options.bulkParameterName+"[]",value:b(c).val()})}),"dialog"==c&&jQuery.fn.dialog.open({width:d.attr("data-bulk-action-dialog-width"),height:d.attr("data-bulk-action-dialog-height"),modal:!0,href:d.attr("data-bulk-action-url")+"?"+jQuery.param(g),title:d.attr("data-bulk-action-title")}),"ajax"==c&&b.concreteAjax({url:d.attr("data-bulk-action-url"),data:g,success:function(a){a.message&&ConcreteAlert.notify({message:a.message,title:a.title})}}),f.publish("SearchBulkActionSelect",{value:a,option:d,items:e})},c.prototype.publish=function(a,b){var c=this;ConcreteEvent.publish(a,b,c)},c.prototype.subscribe=function(a,b){var c=this;ConcreteEvent.subscribe(a,b,c)},c.prototype.setupBulkActions=function(){var a=this;a.$bulkActions=a.$element.find("select[data-bulk-action]"),a.$element.on("change","select[data-bulk-action]",function(){var c=b(this).find("option:selected"),d=c.val(),e=c.attr("data-bulk-action-type");a.handleSelectedBulkAction(d,e,c,a.$element.find("input[data-search-checkbox=individual]:checked")),a.$element.find("option").eq(0).prop("selected",!0)})},c.prototype.setupPagination=function(){var a=this;this.$element.on("click","ul.pagination a",function(){return a.ajaxUpdate(b(this).attr("href")),!1})},c.prototype.setupCheckboxes=function(){var a=this;a.$element.on("click","input[data-search-checkbox=select-all]",function(){a.$element.find("input[data-search-checkbox=individual]").prop("checked",b(this).is(":checked")).trigger("change")}),a.$element.on("change","input[data-search-checkbox=individual]",function(){a.$element.find("input[data-search-checkbox=individual]:checked").length?a.$bulkActions.prop("disabled",!1):a.$bulkActions.prop("disabled",!0)})},b.fn.concreteAjaxSearch=function(a){return new c(this,a)},a.ConcreteAjaxSearch=c}(this,$),ccm_triggerProgressiveOperation=function(a,b,c,d,e){jQuery.fn.dialog.showLoader(),$("#ccm-dialog-progress-bar").remove(),$.ajax({url:a,type:"POST",data:b,success:function(f){jQuery.fn.dialog.hideLoader(),$('<div id="ccm-dialog-progress-bar" />').appendTo(document.body).html(f).jqdialog({autoOpen:!1,height:200,width:400,modal:!0,title:c,closeOnEscape:!1,open:function(c,f){$(".ui-dialog-titlebar-close",this.parentNode).hide();var g=$("#ccm-progressive-operation-progress-bar").attr("data-total-items");ccm_doProgressiveOperation(a,b,g,d,e)}}),$("#ccm-dialog-progress-bar").jqdialog("open")}})},ccm_doProgressiveOperation=function(a,b,c,d,e){b.push({name:"process",value:"1"}),b.process=!0,$.ajax({url:a,dataType:"json",type:"POST",data:b,error:function(a,b,c){switch(b){case"timeout":var d=ccmi18n.requestTimeout;break;default:var d=a.responseText}$("#ccm-dialog-progress-bar").dialog("option","height",200),$("#ccm-dialog-progress-bar").dialog("option","closeOnEscape",!0),$("#ccm-progressive-operation-progress-bar").html('<div class="alert alert-error">'+d+"</div>"),$(".ui-dialog-titlebar-close").show()},success:function(f){if(f.error){var g=f.message;$("#ccm-dialog-progress-bar").dialog("option","height",200),$("#ccm-dialog-progress-bar").dialog("option","closeOnEscape",!0),$("#ccm-progressive-operation-progress-bar").html('<div class="alert alert-error">'+g+"</div>"),$(".ui-dialog-titlebar-close").show(),"function"==typeof e&&e(f)}else{var h=f.totalItems,i=Math.round((c-h)/c*100);$("#ccm-progressive-operation-status").html(1),c-h>0&&$("#ccm-progressive-operation-status").html(c-h),$("#ccm-progressive-operation-progress-bar div.progress-bar").width(i+"%"),h>0?setTimeout(function(){ccm_doProgressiveOperation(a,b,c,d,e)},250):setTimeout(function(){$("#ccm-progressive-operation-progress-bar div.bar").width("0%"),$("#ccm-dialog-progress-bar").dialog("close"),"function"==typeof d&&d(f)},1e3)}}})};var ccmCustomStyle={tabs:function(a,b){return $(".ccm-styleEditPane").hide(),$("#ccm-styleEditPane-"+b).show(),$(a.parentNode.parentNode).find("li").removeClass("ccm-nav-active"),$(a.parentNode).addClass("ccm-nav-active"),!1},resetAll:function(){return confirm(ccmi18n.confirmCssReset)?(jQuery.fn.dialog.showLoader(),$("#ccm-reset-style").val(1),$("#ccmCustomCssForm").get(0).submit(),!0):!1},showPresetDeleteIcon:function(){$("select[name=cspID]").val()>0?$("#ccm-style-delete-preset").show():$("#ccm-style-delete-preset").hide()},deletePreset:function(){var a=$("select[name=cspID]").val();if(a>0){if(!confirm(ccmi18n.confirmCssPresetDelete))return!1;var b=$("#ccm-custom-style-refresh-action").val()+"&deleteCspID="+a+"&subtask=delete_custom_style_preset";jQuery.fn.dialog.showLoader(),$.get(b,function(a){$("#ccm-custom-style-wrapper").html(a),jQuery.fn.dialog.hideLoader()})}},initForm:function(){$("#cspFooterPreset").length>0&&$("#ccmCustomCssFormTabs input, #ccmCustomCssFormTabs select, #ccmCustomCssFormTabs textarea").bind("change click",function(){$("#cspFooterPreset").show(),$("#cspFooterNoPreset").remove(),$("#ccmCustomCssFormTabs input, #ccmCustomCssFormTabs select").unbind("change click")}),$("input[name=cspPresetAction]").click(function(){"create_new_preset"==$(this).val()&&$(this).prop("checked")?$("input[name=cspName]").attr("disabled",!1).focus():$("input[name=cspName]").val("").attr("disabled",!0)}),ccmCustomStyle.showPresetDeleteIcon(),ccmCustomStyle.lastPresetID=parseInt($("select[name=cspID]").val()),$("select[name=cspID]").change(function(){var a=parseInt($(this).val()),b=parseInt($("input[name=selectedCsrID]").val());if(ccmCustomStyle.lastPresetID==a)return!1;if(ccmCustomStyle.lastPresetID=a,jQuery.fn.dialog.showLoader(),a>0)var c=$("#ccm-custom-style-refresh-action").val()+"&cspID="+a;else var c=$("#ccm-custom-style-refresh-action").val()+"&csrID="+b;$.get(c,function(a){$("#ccm-custom-style-wrapper").html(a),jQuery.fn.dialog.hideLoader()})}),$("#ccmCustomCssForm").submit(function(){return 1==$("input[name=cspCreateNew]").prop("checked")&&""==$("input[name=cspName]").val()?($("input[name=cspName]").focus(),alert(ccmi18n.errorCustomStylePresetNoName),!1):(jQuery.fn.dialog.showLoader(),!0)}),parseInt(ccmCustomStyle.lastPresetID)||setTimeout('$("#ccmCustomCssFormTabs input").attr("disabled", false).get(0).focus()',500)},validIdCheck:function(a,b){var c=$("#"+a.value);c&&c.get(0)&&c.get(0).id!=b?$("#ccm-styles-invalid-id").css("display","block"):$("#ccm-styles-invalid-id").css("display","none")}};ccm_activateTabBar=function(a){$("#ccm-tab-content-"+a.find("li[class=active] a").attr("data-tab")).show(),a.find("a").unbind().click(function(){a.find("li").removeClass("active"),$(this).parent().addClass("active"),a.find("a").each(function(){$("#ccm-tab-content-"+$(this).attr("data-tab")).hide()});var b=$(this).attr("data-tab");return $("#ccm-tab-content-"+b).show(),!1})};var ConcreteToolbar=function(){var a,b,c=$("#ccm-toolbar"),d=$("#ccm-nav-intelligent-search"),e=$("#ccm-intelligent-search-results");return d.length&&e.css("right",$(window).width()-d.offset().left-e.width()-1),setupHelpNotifications=function(){$(".ccm-notification .dialog-launch").dialog(),$("a[data-help-notification-toggle]").concreteHelpLauncher(),$("a[data-help-launch-dialog=main]").on("click",function(a){a.preventDefault(),(new ConcreteHelpDialog).open()});var a=ConcreteHelpGuideManager.get();if(a.getGuideToLaunchOnRefresh()){var b=ConcreteHelpGuideManager.getGuide(a.getGuideToLaunchOnRefresh());b.start()}},setupPageAlerts=function(){$(document.body).on("click","a[data-dismiss-alert=page-alert]",function(a){return a.stopPropagation(),$(".ccm-notification").queue(function(){$(this).addClass("animated fadeOut"),$(this).dequeue()}).delay(500).queue(function(){$(this).remove(),$(this).dequeue()}),!1}),$("#ccm-notification-page-alert-workflow form").ajaxForm({dataType:"json",beforeSubmit:function(){jQuery.fn.dialog.showLoader()},success:function(a){a.redirect&&(window.location.href=a.redirect)}})},setupTooltips=function(){0==$("#ccm-tooltip-holder").length&&$("<div />").attr("id","ccm-tooltip-holder").attr("class","ccm-ui").prependTo(document.body),$(".launch-tooltip").tooltip({container:"#ccm-tooltip-holder"})},setupPanels=function(){$("<div />",{id:"ccm-panel-overlay"}).appendTo($(document.body)),$("[data-launch-panel]").each(function(){$(this).prepend('<span class="spinner"><div class="double-bounce1"></div><div class="double-bounce2"></div></span>')}),$("[data-launch-panel]").unbind().on("click",function(){var a=$(this),b=a.attr("data-launch-panel"),c=ConcretePanelManager.getByIdentifier(b);if(c.willBePinned()||a.toggleClass("ccm-launch-panel-loading"),c.isPinable()){var d=$(a.parent());(c.willBePinned()||c.pinned())&&d.toggleClass("ccm-toolbar-page-edit-mode-pinned "),c.willBePinned()?(a.attr("data-original-icon-class",a.find("i").attr("class")),a.find("i").removeClass().addClass("fa fa-lock")):a.attr("data-original-icon-class")&&(a.find("i").removeClass().addClass(a.attr("data-original-icon-class")),a.removeAttr("data-original-icon-class"))}return c.toggle(),!1}),$("html").addClass("ccm-panel-ready"),ConcreteEvent.subscribe("PanelOpen",function(a,b){var c=b.panel;"page"==c.options.identifier&&$("#"+c.getDOMID()).find("[data-launch-panel-detail='page-composer']").click(),$("a[data-toolbar-action=check-in]").on("click.close-check-in",function(){return ConcretePanelManager.exitPanelMode(),!1})}),ConcreteEvent.subscribe("PanelClose",function(a){$("a[data-toolbar-action=check-in]").unbind("click.close-check-in")})},setupIntelligentSearch=function(){d.bind("keydown.ccm-intelligent-search",function(a){if(13==a.keyCode||40==a.keyCode||38==a.keyCode){if(a.preventDefault(),a.stopPropagation(),13==a.keyCode&&$("a.ccm-intelligent-search-result-selected").length>0){var b=$("a.ccm-intelligent-search-result-selected").attr("href");b&&"#"!=b&&"javascript:void(0)"!=b?window.location.href=b:$("a.ccm-intelligent-search-result-selected").click()}var c,d=$("#ccm-intelligent-search-results li:visible");(40==a.keyCode||38==a.keyCode)&&($.each(d,function(b,e){$(e).children("a").hasClass("ccm-intelligent-search-result-selected")&&(38==a.keyCode?io=d[b-1]:io=d[b+1],c=$(io).find("a"))}),c&&c.length>0&&($("a.ccm-intelligent-search-result-selected").removeClass(),$(c).addClass("ccm-intelligent-search-result-selected")))}}),d.liveUpdate("ccm-intelligent-search-results","intelligent-search"),d.bind("keyup.ccm-intelligent-search",function(a){doRemoteSearchCall($(this).val())}),d.bind("click",function(a){""==this.value&&e.hide()})},setupMobileNav=function(){$(".ccm-toolbar-mobile-menu-button").click(function(){$(this).toggleClass("ccm-mobile-close"),$(".ccm-mobile-menu-overlay").slideToggle()}),$(".ccm-mobile-menu-overlay .parent-ul a").click(function(a){$(this).parent("li").hasClass("last-li")||($(this).parent("li").siblings().children("ul").hide(),$(this).parent("li").children("ul").is(":visible")||($(this).next("ul").show(),a.preventDefault()))})},activateIntelligentSearchResults=function(){0==$("#ccm-intelligent-search-results div:visible").length&&$("#ccm-intelligent-search-results").hide(),$("#ccm-intelligent-search-results a").hover(function(){$("a.ccm-intelligent-search-result-selected").removeClass(),$(this).addClass("ccm-intelligent-search-result-selected")},function(){$(this).removeClass("ccm-intelligent-search-result-selected")})},doRemoteSearchCall=function(c){if(c=jQuery.trim(c),c&&c.length>2){if(c==a)return;b&&window.clearTimeout(b),a=c,b=window.setTimeout(function(){b=null,$("#ccm-intelligent-search-results-list-marketplace").parent().show(),$("#ccm-intelligent-search-results-list-help").parent().show(),$("#ccm-intelligent-search-results-list-your-site").parent().show(),$("#ccm-intelligent-search-results-list-marketplace").parent().removeClass("ccm-intelligent-search-results-module-loaded"),$("#ccm-intelligent-search-results-list-help").parent().removeClass("ccm-intelligent-search-results-module-loaded"),$("#ccm-intelligent-search-results-list-your-site").parent().removeClass("ccm-intelligent-search-results-module-loaded"),$.getJSON(CCM_DISPATCHER_FILENAME+"/ccm/system/marketplace/search",{q:a},function(a){for($("#ccm-intelligent-search-results-list-marketplace").parent().addClass("ccm-intelligent-search-results-module-loaded"),$("#ccm-intelligent-search-results-list-marketplace").html(""),i=0;i<a.length;i++){var b=a[i],c="ConcreteMarketplace.getMoreInformation("+b.mpID+")";$("#ccm-intelligent-search-results-list-marketplace").append('<li><a href="javascript:void(0)" onclick="'+c+'"><img src="'+b.img+'" />'+b.name+"</a></li>")}0==a.length&&$("#ccm-intelligent-search-results-list-marketplace").parent().hide(),0==$(".ccm-intelligent-search-result-selected").length&&($("#ccm-intelligent-search-results").find("li a").removeClass("ccm-intelligent-search-result-selected"),$("#ccm-intelligent-search-results li:visible a:first").addClass("ccm-intelligent-search-result-selected")),activateIntelligentSearchResults()}).error(function(){$("#ccm-intelligent-search-results-list-marketplace").parent().hide()}),$.getJSON(CCM_DISPATCHER_FILENAME+"/ccm/system/backend/get_remote_help",{q:a},function(a){for($("#ccm-intelligent-search-results-list-help").parent().addClass("ccm-intelligent-search-results-module-loaded"),$("#ccm-intelligent-search-results-list-help").html(""),i=0;i<a.length;i++){var b=a[i];$("#ccm-intelligent-search-results-list-help").append('<li><a href="'+b.href+'">'+b.name+"</a></li>")}0==a.length&&$("#ccm-intelligent-search-results-list-help").parent().hide(),0==$(".ccm-intelligent-search-result-selected").length&&($("#ccm-intelligent-search-results").find("li a").removeClass("ccm-intelligent-search-result-selected"),$("#ccm-intelligent-search-results li:visible a:first").addClass("ccm-intelligent-search-result-selected")),activateIntelligentSearchResults()}).error(function(){$("#ccm-intelligent-search-results-list-help").parent().hide()}),$.getJSON(CCM_DISPATCHER_FILENAME+"/ccm/system/backend/intelligent_search",{q:a},function(a){for($("#ccm-intelligent-search-results-list-your-site").parent().addClass("ccm-intelligent-search-results-module-loaded"),$("#ccm-intelligent-search-results-list-your-site").html(""),i=0;i<a.length;i++){var b=a[i];$("#ccm-intelligent-search-results-list-your-site").append('<li><a href="'+b.href+'">'+b.name+"</a></li>")}0==a.length&&$("#ccm-intelligent-search-results-list-your-site").parent().hide(),0==$(".ccm-intelligent-search-result-selected").length&&($("#ccm-intelligent-search-results").find("li a").removeClass("ccm-intelligent-search-result-selected"),$("#ccm-intelligent-search-results li:visible a:first").addClass("ccm-intelligent-search-result-selected")),activateIntelligentSearchResults()}).error(function(){$("#ccm-intelligent-search-results-list-your-site").parent().hide()})},500)}},{start:function(){c.length>0&&(c.find(".dialog-launch").dialog(),setupIntelligentSearch(),setupPanels(),setupTooltips(),setupPageAlerts(),setupHelpNotifications(),setupMobileNav())},disable:function(){$("#ccm-toolbar-disabled").remove(),$("<div />",{id:"ccm-toolbar-disabled"}).appendTo(document.body),setTimeout(function(){$("#ccm-toolbar-disabled").css("opacity",1)},10)},enable:function(){$("#ccm-toolbar-disabled").remove()},disableDirectExit:function(){var a=$("li.ccm-toolbar-page-edit a");"check-in"!=a.attr("data-launch-panel")&&"check-in"!=a.attr("data-disable-panel")&&a.attr("data-launch-panel","check-in").on("click",function(){$(this).toggleClass("ccm-launch-panel-active");var a=ConcretePanelManager.getByIdentifier("check-in");return a.toggle(),!1})}}}();(function(){var a,b,c,d,e={}.hasOwnProperty,f=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},g=function(a,b){return function(){return a.apply(b,arguments)}};window.Tourist=window.Tourist||{},Tourist.Model=function(b){function c(){return a=c.__super__.constructor.apply(this,arguments)}return f(c,b),c.prototype._module="Tourist",c}(Backbone.Model),window.Tourist.Tip=window.Tourist.Tip||{},Tourist.Tip.Base=function(){function a(a){this.options=null!=a?a:{},this.onClickNext=g(this.onClickNext,this),this.onClickClose=g(this.onClickClose,this),this.el=$("<div/>"),this.initialize(a),this._bindClickEvents(),Tourist.Tip.Base._cacheTip(this)}return a.prototype._module="Tourist",_.extend(a.prototype,Backbone.Events),a.prototype.skipButtonTemplate=ccmi18n_tourist.skipButton,
a.prototype.nextButtonTemplate=ccmi18n_tourist.nextButton,a.prototype.finalButtonTemplate=ccmi18n_tourist.finalButton,a.prototype.closeButtonTemplate=ccmi18n_tourist.closeButton,a.prototype.okButtonTemplate=ccmi18n_tourist.okButton,a.prototype.actionLabelTemplate=_.template('<h4 class="action-label"><%= label %></h4>'),a.prototype.actionLabels=[ccmi18n_tourist.doThis,ccmi18n_tourist.thenThis,ccmi18n_tourist.nextThis],a.prototype.highlightClass="tour-highlight",a.prototype.template=_.template('<div>n <div class="tour-container">n <%= close_button %>n <%= content %>n <p class="tour-counter <%= counter_class %>"><%= counter%></p>n </div>n <div class="tour-buttons">n <%= buttons %>n </div>n</div>'),a.prototype.destroy=function(){return this.el.remove()},a.prototype.render=function(a){return this.hide(),a&&(this._setTarget(a.target||!1,a),this._setZIndex(""),this._renderContent(a,this._buildContentElement(a)),a.target&&this.show(),a.zIndex&&this._setZIndex(a.zIndex,a)),this},a.prototype.show=function(){},a.prototype.hide=function(){},a.prototype.setTarget=function(a,b){return this._setTarget(a,b)},a.prototype.cleanupCurrentTarget=function(){return this.target&&this.target.removeClass&&this.target.removeClass(this.highlightClass),this.target=null},a.prototype.onClickClose=function(a){return this.trigger("click:close",this,a),!1},a.prototype.onClickNext=function(a){return this.trigger("click:next",this,a),!1},a.prototype._getTipElement=function(){},a.prototype._renderContent=function(a,b){},a.prototype._bindClickEvents=function(){var a;return a=this._getTipElement(),a.delegate(".tour-close","click",this.onClickClose),a.delegate(".tour-next","click",this.onClickNext)},a.prototype._setTarget=function(a,b){return this.cleanupCurrentTarget(),a&&b&&b.highlightTarget&&a.addClass(this.highlightClass),this.target=a},a.prototype._setZIndex=function(a){var b;return b=this._getTipElement(),b.css("z-index",a||"")},a.prototype._buildContentElement=function(a){var b,c;return b=this._buildButtons(a),c=$($.parseHTML(this.template({content:a.content,buttons:b,close_button:this._buildCloseButton(a),counter:a["final"]?"":ccmi18n_tourist.stepXofY.replace(/%1$d/g,a.index+1).replace(/%2$d/g,a.total),counter_class:a["final"]?"final":""}))),b||c.find(".tour-buttons").addClass("no-buttons"),this._renderActionLabels(c),c},a.prototype._buildButtons=function(a){var b;return b="",a.okButton&&(b+=this.okButtonTemplate),a.skipButton&&(b+=this.skipButtonTemplate),a.nextButton&&(b+=a["final"]?this.finalButtonTemplate:this.nextButtonTemplate),b},a.prototype._buildCloseButton=function(a){return a.closeButton?this.closeButtonTemplate:""},a.prototype._renderActionLabels=function(a){var b,c,d,e,f,g,h;for(d=a.find(".action"),c=0,h=[],f=0,g=d.length;g>f;f++)b=d[f],e=$($.parseHTML(this.actionLabelTemplate({label:this.actionLabels[c]}))),e.insertBefore(b),h.push(c++);return h},a._cacheTip=function(a){return Tourist.Tip.Base._cachedTips||(Tourist.Tip.Base._cachedTips=[]),Tourist.Tip.Base._cachedTips.push(a)},a.destroy=function(){var a,b,c,d;if(Tourist.Tip.Base._cachedTips){for(d=Tourist.Tip.Base._cachedTips,b=0,c=d.length;c>b;b++)a=d[b],a.destroy();return Tourist.Tip.Base._cachedTips=null}},a}(),Tourist.Tip.Bootstrap=function(a){function c(){return b=c.__super__.constructor.apply(this,arguments)}return f(c,a),c.prototype.initialize=function(a){var b;return b={showEffect:null,hideEffect:null},this.options=_.extend(b,a),this.tip=new Tourist.Tip.BootstrapTip(this.options)},c.prototype.destroy=function(){return this.tip.destroy(),c.__super__.destroy.call(this)},c.prototype.show=function(){var a;return this.options.showEffect?(a=Tourist.Tip.Bootstrap.effects[this.options.showEffect],a.call(this,this.tip,this.tip.el)):this.tip.show()},c.prototype.hide=function(){var a;return this.options.hideEffect?(a=Tourist.Tip.Bootstrap.effects[this.options.hideEffect],a.call(this,this.tip,this.tip.el)):this.tip.hide()},c.prototype._getTipElement=function(){return this.tip.el},c.prototype._setTarget=function(a,b){return c.__super__._setTarget.call(this,a,b),this.tip.setTarget(a)},c.prototype._renderContent=function(a,b){var c,d;return d=a.my||"left center",c=a.at||"right center",this.tip.setContainer(a.container||$("#ccm-tooltip-holder")),this.tip.setContent(b),this.tip.setPosition(a.target||!1,d,c)},c}(Tourist.Tip.Base),Tourist.Tip.Bootstrap.effects={slidein:function(a,b){var c,d,e,f,g,h,i,j,k;for(c={top:80,left:80,right:-80,bottom:-80},h=a.my.split(" ")[0],h=h||"top",g=c[h],"bottom"===h&&(h="top"),"right"===h&&(h="left"),i=parseInt(b.css(h)),b.stop(),d={},d[h]=i+g,b.css(d),b.show(),d[h]=i,f=["easeOutCubic","swing","linear"],j=0,k=f.length;k>j&&(e=f[j],!$.easing[e]);j++);return b.animate(d,300,e),null}},Tourist.Tip.BootstrapTip=function(){function a(a){var b;b={offset:10,tipOffset:10},this.options=_.extend(b,a),this.el=$($.parseHTML(this.template)),this.hide()}return a.prototype.template='<div class="popover tourist-popover">n <div class="arrow"></div>n <div class="popover-content"></div>n</div>',a.prototype.FLIP_POSITION={bottom:"top",top:"bottom",left:"right",right:"left"},a.prototype.destroy=function(){return this.el.remove()},a.prototype.show=function(){return this.el.show().addClass("visible")},a.prototype.hide=function(){return this.el.hide().removeClass("visible")},a.prototype.setTarget=function(a){return this.target=a,this._setPosition(this.target,this.my,this.at)},a.prototype.setPosition=function(a,b,c){return this.target=a,this.my=b,this.at=c,this._setPosition(this.target,this.my,this.at)},a.prototype.setContainer=function(a){return a.append(this.el)},a.prototype.setContent=function(a){return this._getContentElement().html(a)},a.prototype._getContentElement=function(){return this.el.find(".popover-content")},a.prototype._getTipElement=function(){return this.el.find(".arrow")},a.prototype._setPosition=function(a,b,c){var d,e,f,g,h,i,j,k,l,m;return null==b&&(b="left center"),null==c&&(c="right center"),a&&(m=b.split(" "),d=m[0],h=m[1],f=this.el.css("display"),this.el.css({top:0,left:0,margin:0,display:"block"}).removeClass("top").removeClass("bottom").removeClass("left").removeClass("right").addClass(this.FLIP_POSITION[d]),a)?(j=this._getTipElement().css({left:"",right:"",top:"",bottom:""}),"center"!==h&&(k={left:j[0].offsetWidth/2,right:0,top:j[0].offsetHeight/2,bottom:0},e={},e[h]=k[h]+this.options.tipOffset,e[this.FLIP_POSITION[h]]="auto",j.css(e)),i=this._caculateTargetPosition(c,a),l=this._caculateTipPosition(b,i),g=this._adjustForArrow(b,l),this.el.css(g),this.el.css({display:f})):void 0},a.prototype._caculateTargetPosition=function(a,b){var c,d;return"[object Array]"===Object.prototype.toString.call(b)?{left:b[0],top:b[1]}:(c=this._getTargetBounds(b),d=this._lookupPosition(a,c.width,c.height),{left:c.left+d[0],top:c.top+d[1]})},a.prototype._caculateTipPosition=function(a,b){var c,d,e;return e=this.el[0].offsetWidth,c=this.el[0].offsetHeight,d=this._lookupPosition(a,e,c),{left:b.left-d[0],top:b.top-d[1]}},a.prototype._adjustForArrow=function(a,b){var c,d,e,f,g,h,i;switch(i=a.split(" "),c=i[0],f=i[1],g=this._getTipElement(),h=g[0].offsetWidth,d=g[0].offsetHeight,e={top:b.top,left:b.left},c){case"top":e.top+=d+this.options.offset;break;case"bottom":e.top-=d+this.options.offset;break;case"left":e.left+=h+this.options.offset;break;case"right":e.left-=h+this.options.offset}switch(f){case"left":e.left-=h/2+this.options.tipOffset;break;case"right":e.left+=h/2+this.options.tipOffset;break;case"top":e.top-=d/2+this.options.tipOffset;break;case"bottom":e.top+=d/2+this.options.tipOffset}return e},a.prototype._lookupPosition=function(a,b,c){var d,e,f;return f=b/2,d=c/2,e={"top left":[0,0],"left top":[0,0],"top right":[b,0],"right top":[b,0],"bottom left":[0,c],"left bottom":[0,c],"bottom right":[b,c],"right bottom":[b,c],"top center":[f,0],"left center":[0,d],"right center":[b,d],"bottom center":[f,c]},e[a]},a.prototype._getTargetBounds=function(a){var b,c;return b=a[0],c="function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},$.extend({},c,a.offset())},a}(),Tourist.Tip.QTip=function(a){function b(){return this._renderTipBackground=g(this._renderTipBackground,this),c=b.__super__.constructor.apply(this,arguments)}var d,e,h,i;return f(b,a),i=6,h=14,d=10,e={top:80,left:80,right:-80,bottom:-80},b.prototype.QTIP_DEFAULTS={content:{text:" "},show:{ready:!1,delay:0,effect:function(a){var b,c,d,f,g;return c=$(this),f=a.options.position.my,f&&(f=f[f.precedance]),f=f||"top",d=e[f],"bottom"===f&&(f="top"),"right"===f&&(f="left"),g=parseInt(c.css(f)),b={},b[f]=g+d,c.css(b),c.show(),b[f]=g,c.animate(b,300,"easeOutCubic"),null},autofocus:!1},hide:{event:null,delay:0,effect:!1},position:{adjust:{method:"shift shift",scroll:!1}},style:{classes:"ui-tour-tip",tip:{height:i,width:h}},events:{},zindex:2e3},b.prototype.initialize=function(a){return a=$.extend(!0,{},this.QTIP_DEFAULTS,a),this.el.qtip(a),this.qtip=this.el.qtip("api"),this.qtip.render()},b.prototype.destroy=function(){return this.qtip&&this.qtip.destroy(),b.__super__.destroy.call(this)},b.prototype.show=function(){return this.qtip.show()},b.prototype.hide=function(){return this.qtip.hide()},b.prototype._getTipElement=function(){return $("#qtip-"+this.qtip.id)},b.prototype._setTarget=function(a,c){return b.__super__._setTarget.call(this,a,c),this.qtip.set("position.target",a||!1)},b.prototype._renderContent=function(a,b){var c,d,e=this;return d=a.my||"left center",c=a.at||"right center",this._adjustPlacement(d,c),this.qtip.set("content.text",b),this.qtip.set("position.container",a.container||$("body")),this.qtip.set("position.my",d),this.qtip.set("position.at",c),this.qtip.set("position.viewport",a.viewport||!1),this.qtip.set("position.target",a.target||!1),setTimeout(function(){return e._renderTipBackground(d.split(" ")[0])},10)},b.prototype._adjustPlacement=function(a,b){return 0===a.indexOf("top")?this._adjust(0,d):0===a.indexOf("bottom")?this._adjust(0,-d):0===a.indexOf("right")?this._adjust(-d,0):this._adjust(d,0)},b.prototype._adjust=function(a,b){return this.qtip.set("position.adjust.x",a),this.qtip.set("position.adjust.y",b)},b.prototype._renderTipBackground=function(a){var b,c;return c=$("#qtip-"+this.qtip.id+" .qtip-tip"),b=c.find(".qtip-tip-bg"),b.length||(b=$("<div/>",{"class":"icon icon-tip qtip-tip-bg"}),c.append(b)),b.removeClass("top left right bottom"),b.addClass(a)},b}(Tourist.Tip.Base),Tourist.Tip.Simple=function(a){function b(){return d=b.__super__.constructor.apply(this,arguments)}return f(b,a),b.prototype.initialize=function(a){return $("body").append(this.el)},b.prototype.show=function(){return this.el.show()},b.prototype.hide=function(){return this.el.hide()},b.prototype._getTipElement=function(){return this.el},b.prototype._renderContent=function(a,b){return this.el.html(b)},b}(Tourist.Tip.Base),Tourist.Tour=function(){function a(a){var b,c;this.options=null!=a?a:{},this.onChangeCurrentStep=g(this.onChangeCurrentStep,this),this.next=g(this.next,this),b={tipClass:"Bootstrap"},this.options=_.extend(b,this.options),this.model=new Tourist.Model({current_step:null}),c=_.extend({model:this.model},this.options.tipOptions),this.view=new Tourist.Tip[this.options.tipClass](c),this.view.bind("click:close",_.bind(this.stop,this,!0)),this.view.bind("click:next",this.next),this.model.bind("change:current_step",this.onChangeCurrentStep)}return _.extend(a.prototype,Backbone.Events),a.prototype.start=function(){return this.trigger("start",this),this.next()},a.prototype.stop=function(a){return a?this._showCancelFinalStep():this._stop()},a.prototype.showStep=function(a){var b,c;return b=this._teardownCurrentStep(),b&&(c=a),c<this.options.steps.length&&!isNaN(parseInt(c,10))&&c>=0?this._showStep(this.options.steps[c],c):c===this.options.steps.length?this._showSuccessFinalStep():this._stop()},a.prototype.next=function(){var a,b;return a=this._teardownCurrentStep(),b=0,a&&(b=a.index+1),b<this.options.steps.length?this._showStep(this.options.steps[b],b):b===this.options.steps.length?this._showSuccessFinalStep():this._stop()},a.prototype.setStepOptions=function(a){return this.options.stepOptions=a},a.prototype.onChangeCurrentStep=function(a,b){return this.view.render(b)},a.prototype._showCancelFinalStep=function(){return this._showFinalStep(!1)},a.prototype._showSuccessFinalStep=function(){return this._showFinalStep(!0)},a.prototype._teardownCurrentStep=function(){var a;return a=this.model.get("current_step"),this._teardownStep(a),a},a.prototype._stop=function(){return this._teardownCurrentStep(),this.model.set({current_step:null}),this.trigger("stop",this)},a.prototype._showFinalStep=function(a){var b,c;return b=this._teardownCurrentStep(),c=a?this.options.successStep:this.options.cancelStep,_.isFunction(c)&&(c.call(this,this,this.options.stepOptions),c=null),c?b&&b["final"]?this._stop():(c["final"]=!0,this._showStep(c,this.options.steps.length)):this._stop()},a.prototype._showStep=function(a,b){return a?(a=_.clone(a),a.index=b,a.total=this.options.steps.length,a["final"]||(a["final"]=this.options.steps.length===b+1&&!this.options.successStep),a=_.extend(a,this._setupStep(a)),this.model.set({current_step:a})):void 0},a.prototype._setupStep=function(a){var b,c,d,e;if(!a||!a.setup)return{};if(a.bind)for(e=a.bind,c=0,d=e.length;d>c;c++)b=e[c],a[b]=_.bind(a[b],a,this,this.options.stepOptions);return a.setup.call(a,this,this.options.stepOptions)||{}},a.prototype._teardownStep=function(a){return a&&a.teardown&&a.teardown.call(a,this,this.options.stepOptions),this.view.cleanupCurrentTarget()},a}()}).call(this),!function(a,b){"use strict";function c(a){var c=this;a=a||{},a=b.extend({width:800,height:400,title:"Help",dialogClass:"ccm-dialog-slim ccm-dialog-help-wrapper"},a),c.options=a}c.prototype={open:function(){var a=this;b("#ccm-dialog-help").length?a.options.element="#ccm-dialog-help":a.options.href=CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/help/introduction",b.fn.dialog.open(a.options)}},a.ConcreteHelpDialog=c}(this,$),!function(a,b,c){"use strict";function d(a,c){var e=this;c=c||{},c=b.extend({},c),e.$element=a,e.options=c;var f=e.options.element?e.options.element:b("div[data-help-notification='"+e.$element.attr("data-help-notification-toggle")+"']");f.find("a[data-launch-guide]").on("click.concreteHelp",function(a){a.preventDefault();var c=ConcreteHelpGuideManager.getGuide(b(this).attr("data-launch-guide"));c.start()}),e.$element.on("click",function(a){a.preventDefault(),b(this).addClass("animated fadeOut"),f.addClass("animated fadeIn").show(),f.on("click","a[data-dismiss=help-single]",function(a){a.preventDefault(),d.close(f)})})}d.close=function(a){if(a||(a=b("div[data-help-notification]")),!a||!a.is(":visible"))return!1;var c=b("[data-help-notification-toggle='"+a.attr("data-help-notification")+"']");a.addClass("animated fadeOut"),c.removeClass("fadeOut").addClass("fadeIn"),a.clearQueue().delay(250).queue(function(){b(this).hide(),b(this).removeClass("animated fadeOut"),b(this).dequeue()})},b.fn.concreteHelpLauncher=function(a){return b.each(b(this),function(c,e){new d(b(this),a)})},a.ConcreteHelpLauncher=d}(this,$,_),!function(a,b){"use strict";var c={guides:{},register:function(a,b){this.guides[a]=b},getGuide:function(a){return this.guides[a]},enterToolbarGuideMode:function(){ConcreteHelpLauncher.close(),b(".ccm-dialog-help-wrapper").hide(),this.showOverlay()},showOverlay:function(){if(b(".ui-widget-overlay").length<1){b('<div class="ui-widget-overlay"></div>').hide().appendTo("body")}b(".ui-widget-overlay").addClass("animated fadeIn").show(),b("#ccm-toolbar").addClass("ccm-toolbar-tour-guide")},hideOverlay:function(){b(".ui-widget-overlay").addClass("animated fadeOut"),b(".ui-widget-overlay").delay(250).queue(function(){b(this).remove(),b(this).dequeue()}),b("#ccm-toolbar").removeClass("ccm-toolbar-tour-guide")},exitToolbarGuideMode:function(){this.hideOverlay(),b(".ccm-dialog-help-wrapper").length&&b(".ccm-dialog-help-wrapper").show()},launchGuideOnRefresh:function(a){b.cookie("ConcreteHelpActiveGuide",a,{path:CCM_REL+"/"})},clearGuideToLaunchOnRefresh:function(a){b.cookie("ConcreteHelpActiveGuide",null,{path:CCM_REL+"/"})},getGuideToLaunchOnRefresh:function(){return b.cookie("ConcreteHelpActiveGuide")},get:function(){return c}};a.ConcreteHelpGuideManager=c}(this,$),!function(a,b){"use strict";var c=ccmi18n_helpGuides.toolbar,d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=edit-page]"),my:"top left",at:"bottom center"},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=page-settings]"),my:"top left",at:"bottom center"},{content:'<p><span class="h5">'+c[2].title+"</span><br/>"+c[2].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=add-content]"),my:"top left",at:"bottom center"},{content:'<p><span class="h5">'+c[3].title+"</span><br/>"+c[3].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=intelligent-search]"),my:"top center",at:"bottom center"},{content:'<p><span class="h5">'+c[4].title+"</span><br/>"+c[4].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=sitemap]"),my:"top right",at:"bottom center"},{content:'<p><span class="h5">'+c[5].title+"</span><br/>"+c[5].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=dashboard]"),my:"top right",at:"bottom center"}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){ConcreteHelpGuideManager.enterToolbarGuideMode()}),e.on("stop",function(){ConcreteHelpGuideManager.exitToolbarGuideMode()}),ConcreteHelpGuideManager.register("toolbar",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides["change-content"],d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!1,closeButton:!0,nextButton:!1,target:b("[data-guide-toolbar-action=edit-page]"),my:"top left",at:"bottom center"}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){ConcreteHelpGuideManager.enterToolbarGuideMode(),ConcreteHelpGuideManager.launchGuideOnRefresh("change-content-edit-mode")}),e.on("stop",function(){ConcreteHelpGuideManager.exitToolbarGuideMode()}),ConcreteHelpGuideManager.register("change-content",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides["change-content-edit-mode"],d=b("div.ccm-area:not(.ccm-global-area)").eq(0),e=d.find(".ccm-block-edit").eq(0),f=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=check-in]"),my:"top left",at:"bottom center",setup:function(a,b){ConcreteHelpGuideManager.clearGuideToLaunchOnRefresh()}},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!1,nextButton:!1,closeButton:!0,target:e,my:"top left",at:"bottom center",setup:function(a,b){ConcreteEvent.subscribe("ConcreteMenuShow.changeContentEditModeTour",function(b,c){a.next()})},teardown:function(a,b){ConcreteEvent.unsubscribe("ConcreteMenuShow.changeContentEditModeTour")}},{content:'<p><span class="h5">'+c[2].title+"</span><br/>"+c[2].text+"</p>",closeButton:!0,highlightTarget:!1,nextButton:!0,setup:function(a,c){var d=b("div#ccm-popover-menu-container div.ccm-edit-mode-block-menu").eq(0);return{target:d}},teardown:function(){var a=ConcreteMenuManager.getActiveMenu();a&&a.hide()},my:"left center",at:"right center"},{content:'<p><span class="h5">'+c[3].title+"</span><br/>"+c[3].text+"</p>",highlightTarget:!0,nextButton:!0,target:b("[data-guide-toolbar-action=check-in]"),my:"top left",at:"bottom center"}],g=new Tourist.Tour({steps:f,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});g.on("start",function(){}),g.on("stop",function(){b(".ccm-dialog-help-wrapper").show()}),ConcreteHelpGuideManager.register("change-content-edit-mode",g)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides["add-content"],d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!0,closeButton:!0,nextButton:!1,target:b("[data-guide-toolbar-action=add-content]"),my:"top left",at:"bottom center"}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){ConcreteHelpGuideManager.enterToolbarGuideMode(),ConcreteHelpGuideManager.launchGuideOnRefresh("add-content-edit-mode")}),e.on("stop",function(){ConcreteHelpGuideManager.exitToolbarGuideMode()}),ConcreteHelpGuideManager.register("add-content",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides["add-content-edit-mode"],d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=add-content]"),my:"top left",at:"bottom center",setup:function(a,b){ConcreteHelpGuideManager.clearGuideToLaunchOnRefresh()}},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=add-content]"),my:"top center",at:"top center",setup:function(a,c){return{target:b("#ccm-panel-add-block .ccm-panel-content-inner")}},teardown:function(a,b){}},{content:'<p><span class="h5">'+c[2].title+"</span><br/>"+c[2].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=add-content]"),my:"left center",at:"right center",setup:function(a,c){return{target:b("#ccm-panel-add-block .ccm-panel-header-accordion")}}},{content:'<p><span class="h5">'+c[3].title+"</span><br/>"+c[3].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=add-content]"),my:"left center",at:"right center",setup:function(a,c){return{target:b("#ccm-panel-add-block input[data-input=search-blocks]")}}},{content:'<p><span class="h5">'+c[4].title+"</span><br/>"+c[4].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,target:b("[data-guide-toolbar-action=add-content]"),my:"left center",at:"right center",setup:function(a,c){return{target:b("#ccm-panel-add-block .ccm-panel-add-block-draggable-block-type").eq(0)}}}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){}),e.on("stop",function(){b(".ccm-dialog-help-wrapper").length?b(".ccm-dialog-help-wrapper").show():(jQuery.fn.dialog.showLoader(),window.location.href=b("[data-toolbar-action=check-in]").attr("href"))}),ConcreteHelpGuideManager.register("add-content-edit-mode",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides["add-page"],d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!0,nextButton:!1,closeButton:!0,target:b("[data-guide-toolbar-action=sitemap]"),my:"top right",at:"bottom center",setup:function(a,c){b("a[data-launch-panel=sitemap]").on("click",function(){a.view.tip.hide(),ConcreteHelpGuideManager.hideOverlay()}),ConcreteEvent.subscribe("PanelOpen.concreteAddPageTour",function(b,c){setTimeout(function(){var b=c.panel.getIdentifier();"sitemap"==b&&a.next()},500)})}},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,my:"right center",at:"left center",setup:function(a,c){return{target:b("ul.ccm-panel-sitemap-list li a").eq(0)}}},{content:'<p><span class="h5">'+c[2].title+"</span><br/>"+c[2].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,my:"right center",at:"left center",setup:function(a,c){return{target:b("div#ccm-sitemap-panel-sitemap")}}}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){ConcreteHelpGuideManager.enterToolbarGuideMode()}),e.on("stop",function(){ConcreteHelpGuideManager.exitToolbarGuideMode(),ConcreteEvent.unsubscribe("PanelOpen.concreteAddPageTour")}),ConcreteHelpGuideManager.register("add-page",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides.personalize,d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!0,nextButton:!1,closeButton:!0,target:b("[data-guide-toolbar-action=page-settings]"),my:"top left",at:"bottom center",setup:function(a,c){b("a[data-launch-panel=page]").on("click",function(){a.view.tip.hide(),ConcreteHelpGuideManager.hideOverlay()}),ConcreteEvent.subscribe("PanelOpen.concretePersonalizeTour",function(b,c){setTimeout(function(){var b=c.panel.getIdentifier();"page"==b&&a.next()},500)})}},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!0,nextButton:!1,my:"left center",closeButton:!0,at:"right center",setup:function(a,c){return b("a[data-launch-panel-detail=page-design]").on("click",function(){a.view.tip.hide()}),ConcreteEvent.subscribe("PanelOpenDetail.concretePersonalizeTour",function(b,c){setTimeout(function(){"page-design"==c.panel.identifier&&a.next()},500)}),{target:b("a[data-launch-panel-detail=page-design]").eq(0)}}},{content:'<p><span class="h5">'+c[2].title+"</span><br/>"+c[2].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,my:"bottom center",at:"top center",setup:function(a,c){return{target:b("span.ccm-page-design-theme-customize")}}}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){ConcreteHelpGuideManager.enterToolbarGuideMode()}),e.on("stop",function(){ConcreteHelpGuideManager.exitToolbarGuideMode(),ConcreteEvent.unsubscribe("PanelOpen.concretePersonalizeTour"),ConcreteEvent.unsubscribe("PanelOpenDetail.concretePersonalizeTour")}),ConcreteHelpGuideManager.register("personalize",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides.dashboard,d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!0,nextButton:!1,closeButton:!0,target:b("[data-guide-toolbar-action=dashboard]"),my:"top right",at:"bottom center",setup:function(a,c){b("a[data-launch-panel=dashboard]").on("click",function(){a.view.tip.hide(),ConcreteHelpGuideManager.hideOverlay()}),ConcreteEvent.subscribe("PanelOpen.concreteDashboardTour",function(b,c){setTimeout(function(){var b=c.panel.getIdentifier();"dashboard"==b&&a.next()},500)})}},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!1,nextButton:!0,closeButton:!0,my:"right center",at:"left center",setup:function(a,c){return{target:b("div#ccm-panel-dashboard ul.nav a[href$=sitemap]").eq(0)}}}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});e.on("start",function(){ConcreteHelpGuideManager.enterToolbarGuideMode()}),e.on("stop",function(){ConcreteHelpGuideManager.exitToolbarGuideMode(),ConcreteEvent.unsubscribe("PanelOpen.concreteDashboardTour")}),ConcreteHelpGuideManager.register("dashboard",e)}(window,jQuery),!function(a,b){"use strict";var c=ccmi18n_helpGuides["location-panel"],d=[{content:'<p><span class="h5">'+c[0].title+"</span><br/>"+c[0].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,setup:function(a,c){return{target:b("#ccm-panel-detail-page-location button[name=location]")}},my:"left center",at:"right center"},{content:'<p><span class="h5">'+c[1].title+"</span><br/>"+c[1].text+"</p>",highlightTarget:!0,nextButton:!0,closeButton:!0,setup:function(a,c){return{target:b("#ccm-panel-detail-page-location p.lead").eq(1)}},my:"right center",at:"left center"}],e=new Tourist.Tour({steps:d,tipClass:"Bootstrap",tipOptions:{showEffect:"slidein"}});ConcreteHelpGuideManager.register("location-panel",e)}(window,jQuery),function(a,b,c,d){"use strict";var e=d.EditMode=function(a){this.init.call(this,a)};e.prototype={init:function(e){function f(a,b,d,e,h,j,k){if(g.getDragging())if(h.call()){i=!0;var l=j.call(b),m=l+d,n=c.toArray(arguments),o=a.getDraggerPosition();j.call(b,m),o[k]-=l-j.call(b),a.renderPosition(),c.defer(function(){f.apply(this,n)},e)}else i=!1}var g=this;e=e||{},e=b.extend({notify:!1},e),d.createGetterSetters.call(g,{dragging:!1,active:!0,nextBlockArea:null,areas:[],selectedCache:[],selectedThreshold:5,dragAreaBlacklist:[]}),g.bindEvent("PanelLoad",function(a,b){g.panelOpened(b.panel,b.element)}),g.bindEvent("PanelClose",function(a,b){"add-block"==b.panel.getIdentifier()&&g.setNextBlockArea(null),html.removeClass("ccm-panel-add-block")}),g.bindEvent("EditModeAddBlockComplete EditModeUpdateBlockComplete",function(a){c.defer(function(){g.scanBlocks()})}),g.bindEvent("EditModeBlockSaveInline",function(a,c){b("#ccm-block-form").submit(),ConcreteEvent.fire("EditModeExitInlineSaved"),ConcreteEvent.fire("EditModeExitInline",{action:"save_inline"})}),g.bindEvent("EditModeBlockEditInline",function(a,e){var f,h=e.block,i=h.getArea(),j=e.action?e.action:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/block/edit",k=i.getEnableGridContainer()?1:0,l=i.getCustomTemplates(),m=[{name:"cID",value:h.getCID()},{name:"arHandle",value:i.getHandle()},{name:"arGridMaximumColumns",value:e.arGridMaximumColumns},{name:"arEnableGridContainer",value:k},{name:"aID",value:i.getId()},{name:"bID",value:h.getId()}],n=(h.getId(),h.getElem());if(l)for(var o in l)m[m.length]={name:"arCustomTemplates["+o+"]",value:l[o]};if(h.getAttr("menu")&&h.getAttr("menu").destroy(),e.postData)for(f in e.postData)e.postData.hasOwnProperty(f)&&m.push({name:f,value:e.postData[f]});d.event.unbind("EditModeExitInline.editmode"),g.bindEvent("EditModeExitInline.editmode",function(a,e){d.event.unbind(a),a.stopPropagation();var f=CCM_DISPATCHER_FILENAME+"/ccm/system/block/render",j={cID:h.getCID(),arEnableGridContainer:k,bID:h.getId(),arHandle:i.getHandle()};b.fn.dialog.showLoader(),e&&e.action&&"save_inline"===e.action||b.get(f,j,function(a){var b=g.getBlockByID(h.getId());if(b){var d=b.replace(a);c.defer(function(){ConcreteEvent.fire("EditModeExitInlineComplete",{block:d}),g.destroyInlineEditModeToolbars(),c.defer(function(){g.scanBlocks()})})}})}),ConcreteToolbar.disable(),b("div.ccm-area").addClass("ccm-area-inline-edit-disabled"),h.getElem().addClass("ccm-block-edit-inline-active"),b.ajax({type:"GET",url:j,data:m,success:function(a){var c=b(a);n.empty().append(c).find(".ccm-block-edit").addClass("ccm-block-edit-inline-active"),g.loadInlineEditModeToolbars(n),b.fn.dialog.hideLoader(),d.event.fire("EditModeInlineEditLoaded",{block:h,element:c})}})}),g.bindEvent("EditModeBlockAddInline",function(a,c){var e,f,h,i=c.area,j=c.selected,k=c.btID,l=c.cID,m=i.getEnableGridContainer()?1:0,n=[{name:"btask",value:"edit"},{name:"cID",value:l},{name:"arGridMaximumColumns",value:c.arGridMaximumColumns},{name:"arEnableGridContainer",value:m},{name:"arHandle",value:i.getHandle()},{name:"btID",value:k}];j?(h=j.getElem(),e=j.getBlock()):(h=i.getBlockContainer().children().last(),e=c.dragAreaBlock);var o=i.getCustomTemplates();if(o)for(var p in o)n[n.length]={name:"arCustomTemplate["+p+"]",value:o[p]};e&&(f=e.getId()),ConcreteMenuManager.disable(),ConcreteToolbar.disable(),jQuery.fn.dialog.closeAll(),b("div.ccm-area").addClass("ccm-area-inline-edit-disabled"),b.fn.dialog.showLoader(),i.getAttr("menu")&&i.getAttr("menu").destroy();var q=!1;g.bindEvent("EditModeExitInlineSaved",function(a){d.event.unbind(a),q=!0;var b=ConcretePanelManager.getByIdentifier("add-block");b&&b.pinned()&&b.show()}),g.bindEvent("EditModeExitInline",function(a){if(d.event.unsubscribe(a),!q){b("#a"+i.getId()+"-bt"+k).remove(),g.destroyInlineEditModeToolbars(),ConcreteEvent.fire("EditModeExitInlineComplete");var c=ConcretePanelManager.getByIdentifier("add-block");c&&c.pinned()&&c.show()}}),b.ajax({type:"GET",url:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/page/add_block",data:n,success:function(a){
var c=b(a),d=b('<div class="ccm-block-edit-inline-active"></div>');d.attr("id","a"+i.getId()+"-bt"+k).append(c),i.getElem().addClass("ccm-area-edit-inline-active"),h.after(d),b(function(){d.find("#ccm-block-form").concreteAjaxBlockForm({task:"add",btSupportsInlineAdd:!0,dragAreaBlockID:f,dragArea:j,placeholder:"#a"+i.getId()+"-bt"+k})}),g.loadInlineEditModeToolbars(d.find("div[data-container=inline-toolbar]"))},complete:function(){b.fn.dialog.hideLoader()}})}),d.event.bind("EditModeBlockAddToClipboard",function(a,c){var d=c.block,e=d.getArea(),f=c.token;ConcreteToolbar.disableDirectExit(),b.ajax({type:"POST",url:CCM_TOOLS_PATH+"/pile_manager",data:"cID="+d.getCID()+"&bID="+d.getId()+"&arHandle="+encodeURIComponent(e.getHandle())+"&btask=add&scrapbookName=userScrapbook&ccm_token="+encodeURIComponent(f),success:function(a){ConcreteAlert.notify({message:ccmi18n.copyBlockToScrapbookMsg,title:ccmi18n.copyBlockToScrapbook})}})}),g.bindEvent("EditModeBlockDelete",function(a,b){var c=b.block;c["delete"](b.message),ConcreteEvent.fire("EditModeBlockDeleteComplete",{block:c})});var h=b(a.document.body),i=!1,j=100;g.bindEvent("EditModeBlockDrag",c.throttle(function(e,k){if(g.getDragging()){var l,m=k.block,n=k.pep,o=g.getAreas();m instanceof d.Layout&&(o=[c(o).find(function(a){return m.getArea()===a})]),l=c.flatten(c(o).map(function(a){var b=a.contendingDragAreas(n,m);return b}),!0),c.defer(function(){d.event.fire("EditModeContenders",l),g.selectContender(n,m,l,k.event)}),i||(f(m,h,2,10,function(){var c=m.getDraggerPosition().y-h.scrollTop();return m.getDragging()&&b(a).height()-c<=j},b.fn.scrollTop,"y"),f(m,h,-2,10,function(){var a=m.getDraggerPosition().y-h.scrollTop();return m.getDragging()&&j>=a},b.fn.scrollTop,"y"),f(m,h,2,10,function(){var c=m.getDraggerPosition().x-h.scrollLeft();return m.getDragging()&&b(a).width()-c<=j},b.fn.scrollLeft,"x"),f(m,h,-2,10,function(){var a=m.getDraggerPosition().x-h.scrollLeft();return m.getDragging()&&j>=a},b.fn.scrollLeft,"x"))}},250,{trailing:!1})),g.bindEvent("EditModeBlockDragStop",function(a,c){d.event.fire("EditModeContenders",[]),d.event.fire("EditModeSelectableContender"),b("html").removeClass("ccm-block-dragging"),c.block instanceof d.BlockType||g.scanBlocks()}),g.bindEvent("EditModeBlockMove",function(d,e){var f=e.block,g=e.targetArea,h=e.sourceArea,i={ccm_token:a.CCM_SECURITY_TOKEN,btask:"ajax_do_arrange",area:g.getId(),sourceArea:h.getId(),block:f.getId(),blocks:[]};g=g.inEditMode(g.getEditMode()),c(g.getBlocks()).each(function(a,b){i.blocks.push(a.getId())}),f.bindMenu();var j=!1,k=setTimeout(function(){j=!0,b.fn.dialog.showLoader()},150);b.concreteAjax({url:CCM_DISPATCHER_FILENAME+"/ccm/system/page/arrange_blocks?cID="+f.getCID(),data:i,success:function(a){ConcreteToolbar.disableDirectExit(),b.fn.dialog.hideLoader(),clearTimeout(k)}})}),g.bindEvent("EditModeBlockDragStart",function(){b("html").addClass("ccm-block-dragging"),g.setDragging(!0)}),g.scanBlocks(),d.getEditMode=function(){return g},e.notify&&ConcreteAlert.notify({message:ccmi18n.editModeMsg,title:ccmi18n.editMode})},bindEvent:function(a,b){return d.event.bind(a,b)},reset:function(){var a=this;c(a.getAreas()).each(function(a){a.destroy()}),a.setAttr("areas",[])},scanBlocks:function(){var a,e=this;e.reset(),b("div.ccm-area").each(function(){var c=b(this);c.parent().hasClass("ccm-block-stack")||(a=new d.Area(c,e),a.scanBlocks(),e.addArea(a))}),c.invoke(e.getAreas(),"bindMenu")},panelOpened:function(a,c){var e=this,f=e.getNextBlockArea();return"add-block"!==a.getIdentifier()?null:(html.addClass("ccm-panel-add-block"),b(c).find("input[data-input=search-blocks]").liveUpdate("ccm-panel-add-blocktypes-list","blocktypes"),b(c).find("input[data-input=search-blocks]").focus(),b(c).find("a.ccm-panel-add-block-draggable-block-type").each(function(){var a,c=b(this),g=b("<a/>").addClass("ccm-panel-add-block-draggable-block-type-dragger").appendTo(c);a=new d.BlockType(b(this),e,g,f),a.setPeper(g)}),b(c).find("div.ccm-panel-add-block-stack-item").each(function(){var a,c=b(this),g=c.find("div.stack-name");a=new d.Stack(b(this),e,g,f),a.setPeper(g),b(this).find("div.block").each(function(){var c,g=b(this),h=g.find("div.block-name");c=new d.StackBlock(b(this),a,e,h,f),c.setPeper(h)})}),b(c).find("div.ccm-panel-add-clipboard-block-item").each(function(){var a=b(this);new d.DuplicateBlock(a,e,f)}),b(c).find(".ccm-panel-content").mousewheel(function(a){if(a.deltaY&&a.deltaFactor){var c=-1*a.deltaY*a.deltaFactor,d=b(this),e=c||0,f=d.scrollTop(),g=d.get(0).scrollHeight-(d.scrollTop()+d.height())-d.css("paddingTop").replace("px","");if(e)return 0>e&&!f||e>0&&!g?!1:(d.scrollTop(d.scrollTop()+e),!1)}}),a)},getAreaByID:function(a){var b=this.getAreas();return c.findWhere(b,{id:parseInt(a)})},getBlockByID:function(a){var b=this.getAreas(),d=null;return c(b).every(function(b){return d?!1:(c(b.getBlocks()).every(function(b){return b.getId()==a?(d=b,!1):!0}),!0)}),d},selectContender:function(a,b,e,f){var g=this;if(e=c(e).filter(function(c){return c.isSelectable(a,b,f)}),e.length<2)return d.event.fire("EditModeSelectableContender",c(e).first());var h=g.getSelectedCache(),i=g.getDragAreaBlacklist();g.getSelectedThreshold()!==h.length||c(h).without(c(h).last()).length||(i.push(c(h).last()),g.setDragAreaBlacklist(i),c.delay(function(a){var b=g.getDragAreaBlacklist();g.setDragAreaBlacklist(c(b).without(a))},5e3,c(h).last())),e=c(e).difference(i);var j=c(e).min(function(a){var b=a.centerDistanceToBlock(this);return b},b);return h.push(j),g.setSelectedCache(c(h).last(g.getSelectedThreshold())),d.event.fire("EditModeSelectableContender",j),j},addArea:function(a){var b=this;b.getAreas().push(a)},getBlocks:function(){var a=[];return c(this.getAreas()).each(function(b){a.push(b.getBlocks())}),c(a).flatten()},destroyInlineEditModeToolbars:function(){ConcreteMenuManager.enable(),b("div.ccm-area-edit-inline-active").removeClass("ccm-area-edit-inline-active"),b("div.ccm-block-edit-inline-active").remove(),b("div.ccm-area").removeClass("ccm-area-inline-edit-disabled"),b("#ccm-toolbar").css("opacity",1),b("#ccm-inline-toolbar-container").remove(),b(a).unbind("scroll.inline-toolbar"),ConcreteToolbar.enable(),b.fn.dialog.hideLoader()},loadInlineEditModeToolbars:function(c,d){b("#ccm-inline-toolbar-container").remove();var e=b("<div />",{id:"ccm-inline-toolbar-container"}).appendTo(document.body);if(d){e.append(d);var f=e.find(".ccm-inline-toolbar")}else{var f=c.find(".ccm-inline-toolbar");f.appendTo(e)}var g=b(a),h=c.offset(),i=h.left,j=i+parseInt(f.width());if(g.width()>f.width())if(j>g.width()){var k=j-(i+c.width());f.css("left",i-k)}else f.css("left",i);f.css("opacity",1),f.find(".dialog-launch").dialog();var l=h.top-e.outerHeight()-5;e.css("top",l).css("opacity",1),g.scrollTop()>l&&(b("#ccm-toolbar-disabled,#ccm-toolbar").css("opacity",0),e.addClass("ccm-inline-toolbar-affixed")),g.on("scroll.inline-toolbar",function(){e.toggleClass("ccm-inline-toolbar-affixed",g.scrollTop()>l),g.scrollTop()>l?b("#ccm-toolbar-disabled,#ccm-toolbar").css("opacity",0):b("#ccm-toolbar-disabled,#ccm-toolbar").css("opacity",1)})}}}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.Block=function(a,b,d){this.init.apply(this,c(arguments).toArray())};e.prototype={init:function(a,e,f){var g=this;a.data("Concrete.block",g),a.children(".ccm-block-cover").length||b("<div/>").addClass("ccm-block-cover").appendTo(a),d.createGetterSetters.call(g,{id:a.data("block-id"),active:!0,handle:a.data("block-type-handle"),areaId:a.data("area-id"),cID:a.data("cid"),wraps:!!a.data("block-type-wraps"),area:null,elem:a,dragger:null,draggerOffset:{x:0,y:0},draggerPosition:{x:0,y:0},dragging:!1,rotationDeg:0,editMode:e,selected:null,stepIndex:0,peper:f||a.children(".ccm-edit-mode-inline-commands, .ccm-custom-style-container").find('a[data-inline-command="move-block"]'),pepSettings:{}}),g.id=g.getId(),c(g.getPepSettings()).extend({deferPlacement:!0,moveTo:function(){g.dragPosition(this)},initiate:function(a,b){g.pepInitiate.call(g,this,a,b)},drag:function(a,b){g.pepDrag.call(g,this,a,b)},start:function(a,b){g.pepStart.call(g,this,a,b)},stop:function(a,b){g.pepStop.call(g,this,a,b)},place:!1}),g.bindEvent("EditModeSelectableContender",function(a,b){g.getDragging()&&b instanceof d.DragArea?g.setSelected(b):g.getDragging()&&g.setSelected(null)}),g.getPeper().click(function(a){return a.preventDefault(),a.stopPropagation(),!1}).pep(g.getPepSettings())},destroy:function(){this.getPeper().unbind(),b.pep.unbind(this.getPeper()),this.setAttr("active",!1)},bindEvent:function(a,b){return d.EditMode.prototype.bindEvent.apply(this,c(arguments).toArray())},getContainer:function(){for(var a=this.getElem();!a.parent().hasClass("ccm-area-block-list")&&!a.parent().is("[data-area-id]")&&a.parent().length;)a=a.parent();return a},addToDragArea:function(a){var c,e,f=this,g=f.getArea(),h=a.getArea();g.removeBlock(f),f.getContainer().remove(),f.getWraps()?(e=b(h.getBlockTemplate()()),a.getElem().after(e),e.children().length?e.find("div.block").replaceWith(f.getElem()):e.append(f.getElem())):a.getElem().after(f.getElem()),c=a.getBlock(),c?a.getArea().addBlock(f,c):a.getArea().addBlockToIndex(f,0),f.getPeper().pep(f.getPepSettings()),f.getEditMode().scanBlocks(),d.event.fire("EditModeBlockMove",{block:f,sourceArea:g,targetArea:h})},handleAddResponse:function(a,e,f,g){var h=this,i=e.getEnableGridContainer()?1:0;if(!a.error)return b.get(CCM_DISPATCHER_FILENAME+"/ccm/system/block/render",{arHandle:a.arHandle,cID:a.cID,bID:a.bID,arEnableGridContainer:i},function(a){f?f.getContainer().after(a):e.getBlockContainer().prepend(a),b.fn.dialog.hideLoader(),c.defer(function(){h.getEditMode().scanBlocks(),h.showSuccessfulAdd(),d.forceRefresh(),g&&g()})}),!0},showSuccessfulAdd:function(){ConcreteAlert.notify({message:ccmi18n.addBlockMsg,title:ccmi18n.addBlock})},"delete":function(a){var c=this,d=c.getId(),e=c.getArea(),f=e.getBlockByID(d),g=c.getCID(),h=e.getHandle();ConcreteToolbar.disableDirectExit(),e.removeBlock(f),ConcreteAlert.notify({message:ccmi18n.deleteBlockMsg,title:ccmi18n.deleteBlock}),b.ajax({type:"POST",url:CCM_DISPATCHER_FILENAME,data:"cID="+g+"&ccm_token="+CCM_SECURITY_TOKEN+"&isAjax=true&btask=remove&bID="+d+"&arHandle="+encodeURIComponent(h)})},replace:function(a){var c=b(a);return this.getContainer().replaceWith(c),this.getArea().scanBlocks(),this.getArea().getBlockByID(this.getId())},getMenuElem:function(){return b("div.ccm-edit-mode-block-menu",this.getElem()).first()},bindMenu:function(){var a=this,c=a.getElem(),e=c.attr("data-block-menu-handle"),f=a.getMenuElem();if("none"!==e){var g={highlightClassName:"ccm-block-highlight",menuActiveClass:"ccm-block-highlight",menu:f};a.getArea()&&a.getArea().getElem().hasClass("ccm-global-area")&&(g.menuActiveClass+=" ccm-global-area-block-highlight",g.highlightClassName+=" ccm-global-area-block-highlight"),a.setAttr("menu",new ConcreteMenu(c,g)),f.find("a[data-menu-action=edit_inline]").unbind("click.core").on("click.core",function(b){d.event.fire("EditModeBlockEditInline",{block:a,event:b})}),f.find("a[data-menu-action=block_scrapbook]").unbind("click.core").on("click.core",function(c){d.event.fire("EditModeBlockAddToClipboard",{block:a,event:c,token:b(this).data("token")})}),f.find("a[data-menu-action=delete_block]").unbind("click.core").on("click.core",function(c){d.event.fire("EditModeBlockDelete",{message:b(this).attr("data-menu-delete-message"),block:a,event:c})}),f.find("a[data-menu-action=block_design]").unbind("click.core").on("click.core",function(b){b.preventDefault(),d.event.fire("EditModeBlockEditInline",{block:a,event:b,action:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/block/design"})})}},setArea:function(a){this.setAttr("area",a);var c=this;c.getElem().find("a[data-menu-action=block_dialog]").each(function(){var d=b(this).data("menu-href");d+=-1!==d.indexOf("?")?"&cID="+c.getCID():"?cID="+c.getCID(),d+="&arHandle="+encodeURIComponent(a.getHandle())+"&bID="+c.getId(),b(this).attr("href",d).dialog()}),c.bindMenu()},getDragger:function(){var a=this;if(!a.getAttr("dragger")){var c=b("<a />").html(a.getElem().data("dragging-avatar")||'<p><img src="/concrete/blocks/content/icon.png"><span>'+ccmi18n.content+"</span></p>").addClass("ccm-block-edit-drag ccm-panel-add-block-draggable-block-type");a.setAttr("dragger",c.css({width:a.getElem().width(),height:a.getElem().height()}))}return a.getAttr("dragger")},transform:function(a,b){var d=this,e=d.getDragger().css({"-webkit-transform":a,"-moz-transform":a,"-ms-transform":a,"-o-transform":a,transform:a}).get(0);if(e.filters&&e.filters["DXImageTransform.Microsoft.Matrix"]){var f={elements:c(b).groupBy(function(a,b){return Math.floor(b/3)})};e.filters["DXImageTransform.Microsoft.Matrix"].M11=f.elements[0][0],e.filters["DXImageTransform.Microsoft.Matrix"].M12=f.elements[0][1],e.filters["DXImageTransform.Microsoft.Matrix"].M21=f.elements[1][0],e.filters["DXImageTransform.Microsoft.Matrix"].M22=f.elements[1][1],e.style.left=-(e.offsetWidth/2)+e.clientWidth/2+"px",e.style.top=-(e.offsetHeight/2)+e.clientHeight/2+"px"}return!0},resetTransform:function(){var a="",b=this.getDragger().css({top:0,left:0,"-webkit-transform":a,"-moz-transform":a,"-ms-transform":a,"-o-transform":a,transform:a}).get(0);return b.filters&&(b.filters=[]),this.setDraggerPosition({x:0,y:0}),this.renderPosition()},multiplyMatrices:function(a,b){for(var c=[],d=0;d<a.length;d++){c[d]=[];for(var e=0;e<a[0].length;e++){for(var f=0,g=0;g<a[0].length;g++)f+=a[d][g]*b[g][e];c[d][e]=f}}return c},matrixToCss:function(a){var b=4,d=Math.pow(10,b),e=function(a){return Math.round(a*d)/d};a[0]=c(a[0]).map(e),a[1]=c(a[1]).map(e);var f=[a[0][0],a[0][1],a[1][0],a[1][1],a[0][2],a[1][2]];return"matrix("+f.join(",")+")"},endRotation:function(){var a=this,b=a.getRotationDeg();a.getDragger().animate({rotation:0},{duration:1,step:function(){}});var c=a.setStepIndex(a.getStepIndex()+1);return a.getDragger().animate({rotation:a.getRotationDeg()},{queue:!1,duration:150,step:function(d){a.getStepIndex()===c&&(a.setRotationDeg(b-d),a.renderPosition())}},"easeOutElastic"),!0},renderPosition:function(){var a,b,d=this,e=d.getDraggerPosition().x,f=d.getDraggerPosition().y,g=d.getRotationDeg()*(Math.PI/180),h=c.bind(Math.cos,Math),i=c.bind(Math.sin,Math),j=[[1,0,e],[0,1,f],[0,0,1]];return g?(a=[[h(g),i(g),0],[-i(g),h(g),0],[0,0,1]],b=d.multiplyMatrices(j,a)):b=j,this.transform(d.matrixToCss(b),b)},dragPosition:function(a){var b=this;b.setRotationDeg(Math.max(-15,Math.min(15,a.velocity().x/15))),b.endRotation();var d=c.last(a.velocityQueue),e=b.getDraggerOffset();d||(d={x:b.getDragger().offset().left,y:b.getDragger().offset().top});var f=d.x-e.x,g=d.y-e.y;return b.setDraggerPosition({x:f,y:g}),b.renderPosition(),!0},pepInitiate:function(b,e,f){var g=this;g.resetTransform(),g.setDragging(!0),g.getDragger().hide().appendTo(a.document.body).css(g.getElem().offset()),g.setDraggerOffset({x:e.clientX-g.getElem().offset().left+a.document.body.scrollLeft,y:e.clientY-g.getElem().offset().top+a.document.body.scrollTop}),g.getDragger().fadeIn(250),c.defer(function(){d.event.fire("EditModeBlockDragInitialization",{block:g,pep:f,event:e})})},pepDrag:function(a,b,e){var f=this;c.defer(function(){d.event.fire("EditModeBlockDrag",{block:f,pep:e,event:b})})},pepStart:function(a,e,f){var g=this;g.resetTransform();var h=g.getElem(),i={x:e.pageX,y:e.pageY},j={x:h.offset().left,y:h.offset().top},k={x:(j.x-i.x)/h.width(),y:(j.y-i.y)/h.height()};g.setDraggerPosition({x:j.x,y:j.y}),g.renderPosition(),g.setDraggerOffset({x:-1*(k.x*h.width()),y:-1*(k.y*h.height())}),g.getDragger().animate({width:90,height:90},{duration:250,step:function(a,c){g.setDraggerOffset({x:-1*(k.x*b(this).width()),y:-1*(k.y*b(this).height())}),g.dragPosition(f)}}),c.defer(function(){d.event.fire("EditModeBlockDragStart",{block:g,pep:f,event:e})})},pepStop:function(a,b,e){var f,g=this;g.getDragger().stop(1),g.getDragger().css({top:0,left:0}),g.dragPosition(e),(f=g.getSelected())&&g.addToDragArea(f),g.animateToElem(),c.defer(function(){d.event.fire("EditModeBlockDragStop",{block:g,pep:e,event:b})})},animateToElem:function(a){var b=this,c=a||b.getElem(),d={x:b.getDraggerPosition().x,y:b.getDragger().offset().top,width:b.getDragger().width(),height:b.getDragger().height()};b.setDragging(!1),b.getDragger().animate({ccm_perc:0},{duration:0,step:function(){}}).animate({ccm_perc:1,opacity:0},{duration:500,step:function(a,e){if("ccm_perc"===e.prop){var f={x:c.offset().left,y:c.offset().top,width:c.width(),height:c.height()},g={x:(f.x-d.x)*a,y:(f.y-d.y)*a,width:(f.width-d.width)*a,height:(f.height-d.height)*a};b.setDraggerPosition({x:d.x+g.x,y:d.y+g.y}),b.renderPosition(),b.getDragger().css({width:d.width+g.width,height:d.height+g.height})}else b.getDragger().css({opacity:a})},complete:function(){b.getDragger().remove(),b.setAttr("dragger",null)}})}}}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.StackDisplay=function(a,b){this.init.apply(this,c(arguments).toArray())};e.prototype=c.extend(Object.create(d.Block.prototype),{init:function(a,b){var e=this;a.children(".ccm-area").children(".ccm-area-block-list").find(".ccm-edit-mode-inline-commands").remove(),d.Block.prototype.init.apply(e,c(arguments).toArray())}})}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.Area=function(a,b){this.init.apply(this,c(arguments).toArray())};e.prototype={init:function(a,b){var e=this;a.data("Concrete.area",e),d.createGetterSetters.call(e,{id:a.data("area-id"),active:!0,blockTemplate:c(a.children("script[role=area-block-wrapper]").html()).template(),elem:a,totalBlocks:0,enableGridContainer:a.data("area-enable-grid-container"),customTemplates:a.data("area-custom-templates"),handle:a.data("area-handle"),dragAreas:[],blocks:[],editMode:b,maximumBlocks:parseInt(a.data("maximumBlocks"),10),blockTypes:a.data("accepts-block-types").toLowerCase().split(" "),blockContainer:a.children(".ccm-area-block-list")}),e.id=e.getId(),e.setTotalBlocks(0),e.bindEvent("EditModeBlockAddInline.area",function(a,b){b.area===e&&e.setTotalBlocks(e.getTotalBlocks()+1)})},inEditMode:function(a){return a.getAreaByID(this.getId())},destroy:function(){var a=this;a.getAttr("menu")&&a.getAttr("menu").destroy(),d.event.unbind(".ccm-area-a"+this.getId()),a.reset()},reset:function(){var a=this;c(a.getDragAreas()).each(function(a){a.destroy()}),c(a.getBlocks()).each(function(a){a.destroy()}),a.setBlocks([]),a.setDragAreas([]),a.setTotalBlocks(0)},bindEvent:function(a,b){return d.EditMode.prototype.bindEvent.call(this,a+".ccm-area-a"+this.getId(),b)},scanBlocks:function(){var a,c,e=this;e.reset(),e.addDragArea(null),b("div.ccm-block-edit[data-area-id="+e.getId()+"]",this.getElem()).each(function(){var f=b(this),g=f.data("block-type-handle");a="core_area_layout"===g?d.Layout:"core_stack_display"===g?d.StackDisplay:d.Block,c=new a(f,e.getEditMode()),c.setArea(e),e.addBlock(c)})},getBlockByID:function(a){var b=this;return c.findWhere(b.getBlocks(),{id:a})},getMenuElem:function(){var a=this;return b("[data-area-menu=area-menu-a"+a.getId()+"]")},bindMenu:function(){var a,e=this,f=e.getElem(),g=e.getTotalBlocks(),h=e.getMenuElem();a=g>0?"#area-menu-footer-"+e.getId():"div[data-area-menu-handle="+e.getId()+"]",e.getAttr("menu")&&e.getAttr("menu").destroy();var i={handle:a,highlightClassName:"ccm-area-highlight",menuActiveClass:"ccm-area-highlight",menu:b("[data-area-menu="+f.attr("data-launch-area-menu")+"]")};e.getElem().hasClass("ccm-global-area")&&(i.menuActiveClass+=" ccm-global-area-highlight",i.highlightClassName+=" ccm-global-area-highlight"),e.setAttr("menu",new ConcreteMenu(f,i)),h.find("a[data-menu-action=add-inline]").off("click.edit-mode").on("click.edit-mode",function(a){var f=!1;return c.each(e.getBlocks(),function(a){f=a}),d.event.fire("EditModeBlockAddInline",{area:e,cID:CCM_CID,btID:b(this).data("block-type-id"),arGridMaximumColumns:b(this).attr("data-area-grid-maximum-columns"),event:a,dragAreaBlock:f,btHandle:b(this).data("block-type-handle")}),!1}),h.find("a[data-menu-action=edit-container-layout]").off("click.edit-mode").on("click.edit-mode",function(a){var e=b(this),f=parseInt(b(this).attr("data-container-layout-block-id")),g=d.getEditMode(),h=c.findWhere(g.getBlocks(),{id:f});return d.event.fire("EditModeBlockEditInline",{block:h,arGridMaximumColumns:e.attr("data-area-grid-maximum-columns"),event:a}),!1}),h.find("a[data-menu-action=edit-container-layout-style]").off("click.edit-mode").on("click.edit-mode",function(a){a.preventDefault();var e=(b(this),parseInt(b(this).attr("data-container-layout-block-id"))),f=d.getEditMode(),g=c.findWhere(f.getBlocks(),{id:e});d.event.fire("EditModeBlockEditInline",{block:g,event:a,action:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/block/design"})}),h.find("a[data-menu-action=area-add-block]").off("click.edit-mode").on("click.edit-mode",function(a){var c=e.getMaximumBlocks();if(0>c||c>e.getTotalBlocks()){e.getEditMode().setNextBlockArea(e);var d=b('[data-launch-panel="add-block"]');d.click()}else ConcreteAlert.error({message:ccmi18n.fullArea});return!1}),e.bindEvent("ConcreteMenuShow",function(a,b){if(b.menu==e.getAttr("menu")){var c=e.getMaximumBlocks(),d=b.menu.$menuPointer.find("a[data-menu-action=area-add-block]").parent();0>c||c>e.getTotalBlocks()?d.show():d.hide()}}),h.find("a[data-menu-action=edit-area-design]").off("click.edit-mode").on("click.edit-mode",function(a){a.preventDefault(),ConcreteToolbar.disable(),e.getElem().addClass("ccm-area-inline-edit-disabled");var c={arHandle:e.getHandle(),cID:CCM_CID};e.bindEvent("EditModeExitInline",function(a){d.event.unsubscribe(a),e.getEditMode().destroyInlineEditModeToolbars()}),b.ajax({type:"GET",url:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/area/design",data:c,success:function(a){var c=e.getElem();e.getEditMode().loadInlineEditModeToolbars(c,a),b.fn.dialog.hideLoader()}})})},acceptsBlockType:function(a){return c(this.getBlockTypes()).contains(a.toLowerCase())},addBlock:function(a,b){var d=this;return b?this.addBlockToIndex(a,c(d.getBlocks()).indexOf(b)+1):this.addBlockToIndex(a,d.getBlocks().length)},setTotalBlocks:function(a){this.setAttr("totalBlocks",a),this.getElem().attr("data-total-blocks",a)},addBlockToIndex:function(a,b){var c=this.getTotalBlocks(),d=this.getBlocks(),e=c-b;if(a.setArea(this),this.setTotalBlocks(c+1),e>0){for(var f=[],g=0;g<d.length;g++)g>=b?f[g+1]=d[g]:f[g]=d[g];f[b]=a,this.setBlocks(f)}else this.getBlocks()[b]=a;return this.addDragArea(a),a.getElem().attr("data-area-id",this.getId()),!0},removeBlock:function(a){var b=this,d=b.getTotalBlocks();b.getElem().removeClass("ccm-parent-menu-item-active"),a.getContainer().remove(),b.setBlocks(c(b.getBlocks()).without(a)),b.setTotalBlocks(d-1);var e=c.first(c(b.getDragAreas()).filter(function(b){return b.getBlock()===a}));return e&&(e.getElem().remove(),b.setDragAreas(c(b.getDragAreas()).without(e))),b.getTotalBlocks()||b.bindMenu(),!0},addDragArea:function(a){var e,f,g=this;if(a)e=b('<div class="ccm-area-drag-area"/>'),f=new d.DragArea(e,g,a),a.getContainer().after(e);else{if(g.getDragAreas().length)throw new Error("No block supplied");e=b('<div class="ccm-area-drag-area"/>'),f=new d.DragArea(e,g,a),g.getBlockContainer().prepend(e)}return g.getElem().parent().is("#ccm-stack-container")||e.text(c(ccmi18n.emptyArea).template({area_handle:g.getElem().data("area-display-name")})),g.getDragAreas().push(f),f},contendingDragAreas:function(a,b){var e=this,f=e.getMaximumBlocks();return b instanceof d.Stack||"core_stack_display"===b.getHandle()?c(e.getDragAreas()).filter(function(c){return c.isContender(a,b)}):f>0&&e.getBlocks().length>=f||!c(e.getBlockTypes()).contains(b.getHandle())?[]:c(e.getDragAreas()).filter(function(c){return c.isContender(a,b)})}}}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.Layout=function(a,b){this.init.apply(this,c(arguments).toArray())};e.prototype=c.extend(Object.create(d.Block.prototype),{init:function(a,c){var e=this;e.bindEvent("EditModeInlineEditLoaded.editmode",function(a,b){b.block===e&&e.bindDrag()}),d.Block.prototype.init.call(e,a,c,b()),a.children(".ccm-block-cover").remove()},bindDrag:function(){var a=this,c=b('a[data-layout-command="move-block"]').parent();b.pep.unbind(c),c.pep(a.getPepSettings())},addToDragArea:function(){d.Block.prototype.addToDragArea.apply(this,c.toArray(arguments));var a=b("#ccm-inline-toolbar-container");a.css({top:this.getElem().offset().top-a.outerHeight()-5})}})}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.DragArea=function(a,b,d){this.init.apply(this,c.toArray(arguments))};e.prototype={init:function(a,b,e){var f=this;d.createGetterSetters.call(f,{block:e,active:!0,elem:a,area:b,isContender:!1,isSelectable:!1,animationLength:500}),f.bindEvent("EditModeContenders",function(a,b){f.setIsContender(c.contains(b,f))}),f.bindEvent("EditModeSelectableContender",function(a,b){f.setIsSelectable(b===f)})},destroy:function(){var a=this;a.getElem().remove()},bindEvent:function(a,b){return d.EditMode.prototype.bindEvent.apply(this,c(arguments).toArray())},getActive:function(){return this.getArea().getActive()&&this.getAttr("active")},isSelectable:function(a,b){return a.isOverlapping(b.getDragger(),this.getElem())},setIsSelectable:function(a){var b=this;return a&&!b.getIsSelectable()?(b.getArea().getElem().addClass("ccm-parent-menu-item-active"),b.getElem().addClass("ccm-area-drag-area-selectable")):!a&&b.getIsSelectable()&&(b.getArea().getElem().removeClass("ccm-parent-menu-item-active"),b.getElem().removeClass("ccm-area-drag-area-selectable")),b.setAttr("isSelectable",a),!0},isContender:function(a,b){var d=this;return c.identity(a),d.getBlock()!==b},setIsContender:function(a){var b=this;return a&&!b.getIsContender()?c.defer(function(){b.getElem().addClass("ccm-area-drag-area-contender")}):!a&&b.getIsContender()&&c.defer(function(){b.getElem().removeClass("ccm-area-drag-area-contender")}),b.setAttr("isContender",a),!0},centerDistanceToBlock:function(a){var b=this,c=a.getDragger(),d={x:c.offset().left+c.width()/2,y:c.offset().top+c.height()/2},e=b.getElem(),f={x:e.offset().left+e.width()/2,y:e.offset().top+e.height()/2};return Math.sqrt(Math.pow(Math.abs(d.x-f.x),2)+Math.pow(Math.abs(d.y-f.y),2))}}}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.BlockType=function(a,b,d,e){this.init.apply(this,c(arguments).toArray())};e.prototype=c.extend(Object.create(d.Block.prototype),{init:function(a,b,e,f){var g=this;if(d.Block.prototype.init.apply(g,c(arguments).toArray()),g.setAttr("defaultArea",f||null),f){f.getBlockTypes();f.acceptsBlockType(g.getHandle())?g.handleDefaultArea():g.removeElement()}},handleDefaultArea:function(){var a=this;b.pep.unbind(a.getPeper()),a.getPeper().click(function(b){return a.handleClick(),!1}).css({cursor:"pointer"})},removeElement:function(){var a=this.getPeper().closest(".ccm-panel-content-inner");this.getPeper().closest("li").remove(),a.children(".ccm-panel-add-block-set").each(function(){var a=b(this).children("ul");a.children().length||b(this).remove()})},handleClick:function(){var a=this,b=a.getAttr("defaultArea");ConcretePanelManager.exitPanelMode(function(){c.defer(function(){a.addToDragArea(c.last(b.getDragAreas()))})})},pepStart:function(a,b,e){var f,g=this;d.Block.prototype.pepStart.call(this,a,b,e),g.setAttr("closedPanel",c(ConcretePanelManager.getPanels()).find(function(a){return a.isOpen})),(f=g.getAttr("closedPanel"))&&f.hide()},pepStop:function(a,b,e){var f,g,h=this;(f=h.getSelected())?h.addToDragArea(f):(g=h.getAttr("closedPanel"))&&g.show(),c.defer(function(){d.event.fire("EditModeBlockDragStop",{block:h,pep:e,event:b})}),h.getDragger().remove(),h.setAttr("dragger",null)},addToDragArea:function(a){var d=this,e=d.getElem(),f=e.data("btid"),g=e.data("cid"),h=a.getArea(),i=h.getHandle(),j=h.getEnableGridContainer()?1:0,k=0,l=a.getBlock(),m=!!e.data("supports-inline-add"),n=!!e.data("has-add-template");if(l&&(k=l.getId()),jQuery.fn.dialog.closeAll(),n)if(m)ConcreteEvent.fire("EditModeBlockAddInline",{selected:a,area:a.getArea(),cID:g,arEnableGridContainer:j,btID:f,dragAreaBlockID:k});else{var o=h.getCustomTemplates(),p="";if(o)for(var q in o)p+="&arCustomTemplates["+q+"]="+o[q];b.fn.dialog.open({onOpen:function(){b(function(){var c=b('<div style="display:none" />');a.getElem().after(c),b("#ccm-block-form").concreteAjaxBlockForm({task:"add",dragAreaBlockID:k,dragArea:a,placeholder:c})})},onDestroy:function(){var a=ConcretePanelManager.getByIdentifier("add-block");a&&a.pinned()&&a.show()},width:parseInt(e.data("dialog-width"),10),height:parseInt(e.data("dialog-height"),10)+20,title:e.data("dialog-title"),href:CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/page/add_block?cID="+g+"&btID="+f+"&arHandle="+encodeURIComponent(i)+p})}else{var r={cID:g,arHandle:i,btID:f,mode:"edit",processBlock:1,add:1,ccm_token:CCM_SECURITY_TOKEN,arCustomTemplates:h.getCustomTemplates(),dragAreaBlockID:k},o=h.getCustomTemplates();if(o)for(var q in o)r[r.length]={name:"arCustomTemplates["+q+"]",value:o[q]};b.getJSON(CCM_DISPATCHER_FILENAME+"/ccm/system/dialogs/page/add_block/submit",r,function(a){b.fn.dialog.showLoader(),ConcreteToolbar.disableDirectExit(),b.get(CCM_DISPATCHER_FILENAME+"/ccm/system/block/render",{arHandle:h.getHandle(),cID:g,bID:a.bID,arEnableGridContainer:j},function(a){l?l.getContainer().after(a):h.getBlockContainer().prepend(a),b.fn.dialog.hideLoader(),c.defer(function(){d.getEditMode().scanBlocks()});var e=ConcretePanelManager.getByIdentifier("add-block");e&&e.pinned()&&e.show()})})}}})}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.Stack=function(a,b,d){this.init.apply(this,c(arguments).toArray())};e.prototype=c.extend(Object.create(d.BlockType.prototype),{removeElement:function(){this.getElem().remove()},addToDragArea:function(a){var c=this,d=c.getElem(),e=a.getArea(),f=e.getHandle(),g=0,h=a.getBlock();h&&(g=h.getId()),jQuery.fn.dialog.closeAll();var i={cID:d.data("cid"),arHandle:f,stID:d.data("sid"),atask:"add_stack",ccm_token:CCM_SECURITY_TOKEN};g&&(i.dragAreaBlockID=g),b.fn.dialog.showLoader(),b.getJSON(CCM_DISPATCHER_FILENAME,i,function(a){c.handleAddResponse(a,e,h)})},showSuccessfulAdd:function(){ConcreteAlert.notify({message:ccmi18n.addBlockStackMsg,title:ccmi18n.addBlockStack})}})}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.DuplicateBlock=function(a,b,d){this.init.apply(this,c.toArray(arguments))};e.prototype=c.extend(Object.create(d.BlockType.prototype),{init:function(a,b,c){var e=this;d.BlockType.prototype.init.call(e,a,b,a.find(".block-content"),c)},handleDefaultArea:function(){var a=this;b.pep.unbind(a.getPeper()),a.getPeper().click(function(b){return a.handleClick(),!1}).css({cursor:"pointer"}).children(".block-name").css({cursor:"pointer"})},removeElement:function(){this.getElem().remove()},addToDragArea:function(a){var c=this,d=c.getElem(),e=d.data("btid"),f=a.getArea(),g=f.getHandle(),h=0,i=d.data("cid"),j=a.getBlock(),k=d.data("pcid");j&&(h=j.getId()),ConcretePanelManager.exitPanelMode(),jQuery.fn.dialog.closeAll(),jQuery.fn.dialog.showLoader();var l={cID:i,arHandle:g,btID:e,mode:"edit",processBlock:1,add:1,btask:"alias_existing_block",pcID:[k],ccm_token:CCM_SECURITY_TOKEN};h&&(l.dragAreaBlockID=h),b.getJSON(CCM_DISPATCHER_FILENAME,l,function(a){c.handleAddResponse(a,f,j,function(){ConcreteEvent.fire("EditModeAddClipboardComplete",{block:c})})})}})}(window,jQuery,_,Concrete),function(a,b,c,d){"use strict";var e=d.StackBlock=function(a,b,d,e){this.init.apply(this,c.toArray(arguments))};e.prototype=c.extend(Object.create(d.BlockType.prototype),{init:function(a,b,c,e,f){d.BlockType.prototype.init.call(this,a,c,e,f),this.setAttr("stack",b)},removeElement:function(){b.pep.unbind(this.getPeper())},addToDragArea:function(a){var c=this,d=c.getElem(),e=d.data("btid"),f=a.getArea(),g=f.getHandle(),h=0,i=a.getBlock();i&&(h=i.getId()),ConcretePanelManager.exitPanelMode();var j={cID:CCM_CID,bID:d.data("block-id"),arHandle:g,btID:e,mode:"edit",processBlock:1,add:1,btask:"alias_existing_block",pcID:[d.data("cID")],
ccm_token:CCM_SECURITY_TOKEN};h&&(j.dragAreaBlockID=h),b.getJSON(CCM_DISPATCHER_FILENAME,j,function(a){c.handleAddResponse(a,f,i)})}})}(window,jQuery,_,Concrete);
?>