var CookiesEuBanner=function(){var h=/aolbuild|baidu|bingbot|bingpreview|msnbot|duckduckgo|adsbot-google|googlebot|mediapartners-google|teoma|slurp|yandex|linkedinbot|twitterbot|facebookexternalhit|smarshbot/i,e,d=window.document;e=function(a,b,c){if(!(this instanceof e))return new e(a);this.cookieTimeout=6048E5;this.bots="undefined"===typeof c?h:RegExp(c,"i");this.cookieName="hasConsent";this.trackingCookiesNames="__utma __utmb __utmc __utmt __utmv __utmz _ga _gat".split(" ");this.launchFunction=
a;this.waitAccept=null!=b?b:!1;this.init()};e.prototype={init:function(){if(this.isBot()||!this.isToTrack()||!1===this.hasConsent())return!1;if(!0===this.hasConsent())return this.launchFunction(!1),!0;this.showBanner();this.waitAccept||this.setCookie(this.cookieName,!0)},showBanner:function(){var a=this,b=d.getElementById("cookies-eu-banner"),c=d.getElementById("cookies-eu-reject"),f=d.getElementById("cookies-eu-accept"),g=d.getElementById("cookies-eu-more");b.style.display="block";g&&this.addEventListener(g,
"click",function(){a.deleteCookie(a.cookieName)});f&&this.addEventListener(f,"click",function(){b.parentNode.removeChild(b);a.setCookie(a.cookieName,!0);a.launchFunction(!0)});c&&this.addEventListener(c,"click",function(){b.parentNode.removeChild(b);a.setCookie(a.cookieName,!1);a.deleteTrackingCookies()})},hasConsent:function(){return-1<d.cookie.indexOf(this.cookieName+"\x3dtrue")?!0:-1<d.cookie.indexOf(this.cookieName+"\x3dfalse")?!1:null},isBot:function(){return this.bots.test(navigator.userAgent)},
isToTrack:function(){var a=navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack;return null!=a?a&&"yes"!==a&&1!==a&&"1"!==a:!0},deleteTrackingCookies:function(){for(var a in this.trackingCookiesNames)a&&this.deleteCookie(a)},setCookie:function(a,b){var c=new Date;c.setTime(c.getTime()+this.cookieTimeout);d.cookie=a+"\x3d"+b+";expires\x3d"+c.toGMTString()+";path\x3d/"},deleteCookie:function(a){var b=d.location.hostname;0===b.indexOf("www.")&&(b=b.substring(4));d.cookie=a+"\x3d; domain\x3d."+
b+"; expires\x3dThu, 01-Jan-1970 00:00:01 GMT; path\x3d/";d.cookie=a+"\x3d; expires\x3dThu, 01-Jan-1970 00:00:01 GMT; path\x3d/"},addEventListener:function(a,b,c){d.addEventListener?a.addEventListener(b,c):a.attachEvent&&a.attachEvent("on"+b,c)}};return e}();
AUI.add("liferay-staging",function(b){Liferay.StagingBar={init:function(a){var c=a.namespace;this.markAsReadyForPublicationURL=a.markAsReadyForPublicationURL;this._namespace=c;this._stagingBar=b.oneNS(c,"#stagingBar");this.viewHistoryURL=a.viewHistoryURL;Liferay.publish({fireOnce:!0});Liferay.after("initStagingBar",function(d){b.getBody().addClass("staging-ready")});Liferay.fire("initStagingBar",a)}}},"",{requires:["aui-io-plugin-deprecated","aui-modal","liferay-node"]});
AUI.add("liferay-staging-branch",function(b){var d=b.Lang;b.mix(Liferay.StagingBar,{addBranch:function(a){var c=this._getBranchDialog();d.isValue(a)&&c.set("title",a);c.show()},_getBranchDialog:function(){var a=this._branchDialog;a||(this._branchDialog=a=Liferay.Util.Window.getWindow({dialog:{bodyContent:b.one("#"+this._namespace+"addBranch").show()},title:"Branch"}));return a}})},"",{requires:["liferay-staging"]});
AUI.add("liferay-staging-version",function(d){var f=Liferay.StagingBar,k={redo:"redo_layout_revision",undo:"undo_layout_revision"},l={redo:"Are you sure you want to redo your last changes?",undo:"Are you sure you want to undo your last changes?"};d.mix(f,{destructor:function(){this._cleanup()},_cleanup:function(){this._eventHandles&&d.Array.invoke(this._eventHandles,"detach")},_getNotification:function(){var b=this._notification;b||(this._notification=b=new Liferay.Notice({closeText:!1,content:"There was an unexpected error. Please refresh the current page.",
noticeClass:"hide",timeout:1E4,toggleText:!1,type:"warning",useAnimation:!0}));return b},_onInit:function(b){var a=this;a._cleanup();b=a._namespace;var c=[Liferay.on(b+"redo",a._onRevisionChange,a,"redo"),Liferay.on(b+"submit",a._onSubmit,a),Liferay.on(b+"undo",a._onRevisionChange,a,"undo"),Liferay.on(b+"viewHistory",a._onViewHistory,a)],e=d.byIdNS(b,"layoutRevisionDetails");e&&c.push(Liferay.onceAfter("updatedLayout",function(m){d.io.request(a.markAsReadyForPublicationURL,{on:{failure:function(g,
h,n){e.setContent("There was an unexpected error. Please refresh the current page.")},success:function(g,h,n){g=this.get("responseData");e.plug(d.Plugin.ParseContent);e.setContent(g)}}})}));a._eventHandles=c},_onRevisionChange:function(b,a){var c=k[a];confirm(l[a])&&this._updateRevision(c,b.layoutRevisionId,b.layoutSetBranchId)},_onSubmit:function(b){var a=this._namespace,c=d.byIdNS(a,"layoutRevisionDetails"),e=c.one(".layout-revision-info");e&&e.addClass("loading");(a=d.byIdNS(a,"submitLink"))&&
a.html("Loading...");d.io.request(b.publishURL,{after:{failure:function(){c.addClass("alert alert-danger");c.setContent("There was an unexpected error. Please refresh the current page.")},success:function(){b.incomplete?location.href=b.currentURL:Liferay.fire("updatedLayout")}}})},_onViewHistory:function(b){Liferay.Util.openWindow({dialog:{destroyOnHide:!0},title:"History",uri:f.viewHistoryURL})},_updateRevision:function(b,a,c){var e=this;d.io.request(themeDisplay.getPathMain()+"/portal/update_layout",
{data:{cmd:b,doAsUserId:themeDisplay.getDoAsUserIdEncoded(),layoutRevisionId:a,layoutSetBranchId:c,p_auth:Liferay.authToken,p_l_id:themeDisplay.getPlid(),p_v_l_s_g_id:themeDisplay.getSiteGroupId()},on:{failure:function(){e._getNotification().show()},success:function(m,g,h){window.location.reload()}}})}});Liferay.on("initStagingBar",f._onInit,f)},"",{requires:["aui-button","liferay-staging"]});
