/*!
Colorbox 1.6.4
license: MIT
http://www.jacklmoore.com/colorbox
*/
(function($,document,window){var defaults={html:false,photo:false,iframe:false,inline:false,transition:"elastic",speed:300,fadeOut:300,width:false,initialWidth:"600",innerWidth:false,maxWidth:false,height:false,initialHeight:"450",innerHeight:false,maxHeight:false,scalePhotos:true,scrolling:true,opacity:.9,preloading:true,className:false,overlayClose:true,escKey:true,arrowKey:true,top:false,bottom:false,left:false,right:false,fixed:false,data:undefined,closeButton:true,fastIframe:true,open:false,reposition:true,loop:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:false,retinaUrl:false,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:true,trapFocus:true,onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,rel:function(){return this.rel},href:function(){return $(this).attr("href")},title:function(){return this.title},createImg:function(){var img=new Image;var attrs=$(this).data("cbox-img-attrs");if(typeof attrs==="object"){$.each(attrs,function(key,val){img[key]=val})}return img},createIframe:function(){var iframe=document.createElement("iframe");var attrs=$(this).data("cbox-iframe-attrs");if(typeof attrs==="object"){$.each(attrs,function(key,val){iframe[key]=val})}if("frameBorder"in iframe){iframe.frameBorder=0}if("allowTransparency"in iframe){iframe.allowTransparency="true"}iframe.name=(new Date).getTime();iframe.allowFullscreen=true;return iframe}},colorbox="colorbox",prefix="cbox",boxElement=prefix+"Element",event_open=prefix+"_open",event_load=prefix+"_load",event_complete=prefix+"_complete",event_cleanup=prefix+"_cleanup",event_closed=prefix+"_closed",event_purge=prefix+"_purge",$overlay,$box,$wrap,$content,$topBorder,$leftBorder,$rightBorder,$bottomBorder,$related,$window,$loaded,$loadingBay,$loadingOverlay,$title,$current,$slideshow,$next,$prev,$close,$groupControls,$events=$(""),settings,interfaceHeight,interfaceWidth,loadedHeight,loadedWidth,index,photo,open,active,closing,loadingTimer,publicMethod,div="div",requests=0,previousCSS={},init;function $tag(tag,id,css){var element=document.createElement(tag);if(id){element.id=prefix+id}if(css){element.style.cssText=css}return $(element)}function winheight(){return window.innerHeight?window.innerHeight:$(window).height()}function focusableEls($e){return $e.find('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')}function firstFocusableEl($e){return focusableEls($e).first()}function lastFocusableEl($e){return focusableEls($e).last()}function Settings(element,options){if(options!==Object(options)){options={}}this.cache={};this.el=element;this.value=function(key){var dataAttr;if(this.cache[key]===undefined){dataAttr=$(this.el).attr("data-cbox-"+key);if(dataAttr!==undefined){this.cache[key]=dataAttr}else if(options[key]!==undefined){this.cache[key]=options[key]}else if(defaults[key]!==undefined){this.cache[key]=defaults[key]}}return this.cache[key]};this.get=function(key){var value=this.value(key);return $.isFunction(value)?value.call(this.el,this):value}}function getIndex(increment){var max=$related.length,newIndex=(index+increment)%max;return newIndex<0?max+newIndex:newIndex}function setSize(size,dimension){return Math.round((/%/.test(size)?(dimension==="x"?$window.width():winheight())/100:1)*parseInt(size,10))}function isImage(settings,url){return settings.get("photo")||settings.get("photoRegex").test(url)}function retinaUrl(settings,url){return settings.get("retinaUrl")&&window.devicePixelRatio>1?url.replace(settings.get("photoRegex"),settings.get("retinaSuffix")):url}function setClass(str){if(setClass.str!==str){$box.add($overlay).removeClass(setClass.str).addClass(str);setClass.str=str}}function getRelated(rel){index=0;if(rel&&rel!==false&&rel!=="nofollow"){$related=$("."+boxElement).filter(function(){var options=$.data(this,colorbox);var settings=new Settings(this,options);return settings.get("rel")===rel});index=$related.index(settings.el);if(index===-1){$related=$related.add(settings.el);index=$related.length-1}}else{$related=$(settings.el)}}function trigger(event){$(document).trigger(event);$events.triggerHandler(event)}var slideshow=function(){var active,className=prefix+"Slideshow_",click="click."+prefix,timeOut;function clear(){clearTimeout(timeOut)}function set(){if(settings.get("loop")||$related[index+1]){clear();timeOut=setTimeout(publicMethod.next,settings.get("slideshowSpeed"))}}function start(){$slideshow.html(settings.get("slideshowStop")).attr("aria-lable",settings.get("slideshowStop")).unbind(click).one(click,stop);$events.bind(event_complete,set).bind(event_load,clear);$box.removeClass(className+"off").addClass(className+"on")}function stop(){clear();$events.unbind(event_complete,set).unbind(event_load,clear);$slideshow.html(settings.get("slideshowStart")).attr("aria-lable",settings.get("slideshowStart")).unbind(click).one(click,function(){publicMethod.next();start()});$box.removeClass(className+"on").addClass(className+"off")}function reset(){active=false;$slideshow.attr("aria-hidden","true").hide();clear();$events.unbind(event_complete,set).unbind(event_load,clear);$box.removeClass(className+"off "+className+"on")}return function(){if(active){if(!settings.get("slideshow")){$events.unbind(event_cleanup,reset);reset()}}else{if(settings.get("slideshow")&&$related[1]){active=true;$events.one(event_cleanup,reset);if(settings.get("slideshowAuto")){start()}else{stop()}$slideshow.attr("aria-hidden","false").show()}}}}();function launch(element){var options;if(!closing){options=$(element).data(colorbox);settings=new Settings(element,options);getRelated(settings.get("rel"));if(!open){open=active=true;setClass(settings.get("className"));$box.css({visibility:"hidden",display:"block",opacity:""}).attr("aria-hidden","true");$loaded=$tag(div,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden");$content.css({width:"",height:""}).append($loaded);interfaceHeight=$topBorder.height()+$bottomBorder.height()+$content.outerHeight(true)-$content.height();interfaceWidth=$leftBorder.width()+$rightBorder.width()+$content.outerWidth(true)-$content.width();loadedHeight=$loaded.outerHeight(true);loadedWidth=$loaded.outerWidth(true);var initialWidth=setSize(settings.get("initialWidth"),"x");var initialHeight=setSize(settings.get("initialHeight"),"y");var maxWidth=settings.get("maxWidth");var maxHeight=settings.get("maxHeight");settings.w=Math.max((maxWidth!==false?Math.min(initialWidth,setSize(maxWidth,"x")):initialWidth)-loadedWidth-interfaceWidth,0);settings.h=Math.max((maxHeight!==false?Math.min(initialHeight,setSize(maxHeight,"y")):initialHeight)-loadedHeight-interfaceHeight,0);$loaded.css({width:"",height:settings.h});publicMethod.position();trigger(event_open);settings.get("onOpen");$groupControls.add($title).hide();$box.attr("aria-hidden","false");if(settings.get("returnFocus")){$events.one(event_closed,function(){$(settings.el).focus()})}}var opacity=parseFloat(settings.get("opacity"));$overlay.css({opacity:opacity===opacity?opacity:"",cursor:settings.get("overlayClose")?"pointer":"",visibility:"visible"}).show();if(settings.get("closeButton")){$close.html(settings.get("close")).attr("aria-hidden","false").appendTo($content)}else{$close.appendTo("
")}load()}}function appendHTML(){if(!$box){init=false;$window=$(window);$box=$tag(div).attr({id:colorbox,"class":$.support.opacity===false?prefix+"IE":"",role:"dialog","aria-hidden":"true","aria-labelledby":"cboxTitle","aria-describedby":"cboxCurrent"}).hide();$overlay=$tag(div,"Overlay").hide();$loadingOverlay=$([$tag(div,"LoadingOverlay")[0],$tag(div,"LoadingGraphic")[0]]);$wrap=$tag(div,"Wrapper");$content=$tag(div,"Content").append($title=$tag(div,"Title").attr("aria-live","polite"),$current=$tag(div,"Current"),$prev=$('').attr({id:prefix+"Previous","aria-hidden":"true"}),$next=$('').attr({id:prefix+"Next","aria-hidden":"true"}),$slideshow=$('').attr({id:prefix+"Slideshow","aria-hidden":"true"}),$loadingOverlay);$close=$('').attr({id:prefix+"Close","aria-hidden":"true"});$wrap.append($tag(div).append($tag(div,"TopLeft"),$topBorder=$tag(div,"TopCenter"),$tag(div,"TopRight")),$tag(div,false,"clear:left").append($leftBorder=$tag(div,"MiddleLeft"),$content,$rightBorder=$tag(div,"MiddleRight")),$tag(div,false,"clear:left").append($tag(div,"BottomLeft"),$bottomBorder=$tag(div,"BottomCenter"),$tag(div,"BottomRight"))).find("div div").css({"float":"left"});$loadingBay=$tag(div,false,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;");$groupControls=$next.add($prev).add($current).add($slideshow)}if(document.body&&!$box.parent().length){$(document.body).append($overlay,$box.append($wrap,$loadingBay))}}function addBindings(){function clickHandler(e){if(!(e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey)){e.preventDefault();launch(this)}}if($box){if(!init){init=true;$next.click(function(){publicMethod.next()});$prev.click(function(){publicMethod.prev()});$close.click(function(){publicMethod.close()});$overlay.click(function(){if(settings.get("overlayClose")){publicMethod.close()}});$(document).bind("keydown."+prefix,function(e){var key=e.keyCode;if(open&&settings.get("escKey")&&key===27){e.preventDefault();publicMethod.close()}if(open&&settings.get("arrowKey")&&$related[1]&&!e.altKey){if(key===37){e.preventDefault();$prev.click()}else if(key===39){e.preventDefault();$next.click()}}if(open&&settings.get("trapFocus")&&key===9){if(focusableEls($box).length===1){e.preventDefault()}else{if(e.shiftKey){if(document.activeElement===firstFocusableEl($box)[0]){e.preventDefault();lastFocusableEl($box).focus()}}else{if(document.activeElement===lastFocusableEl($box)[0]){e.preventDefault();firstFocusableEl($box).focus()}}}}});if($.isFunction($.fn.on)){$(document).on("click."+prefix,"."+boxElement,clickHandler)}else{$("."+boxElement).live("click."+prefix,clickHandler)}}return true}return false}if($[colorbox]){return}$(appendHTML);publicMethod=$.fn[colorbox]=$[colorbox]=function(options,callback){var settings;var $obj=this;options=options||{};if($.isFunction($obj)){$obj=$("");options.open=true}if(!$obj[0]){return $obj}appendHTML();if(addBindings()){if(callback){options.onComplete=callback}$obj.each(function(){var old=$.data(this,colorbox)||{};$.data(this,colorbox,$.extend(old,options))}).addClass(boxElement);settings=new Settings($obj[0],options);if(settings.get("open")){launch($obj[0])}}return $obj};publicMethod.position=function(speed,loadedCallback){var css,top=0,left=0,offset=$box.offset(),scrollTop,scrollLeft;$window.unbind("resize."+prefix);$box.css({top:-9e4,left:-9e4});scrollTop=$window.scrollTop();scrollLeft=$window.scrollLeft();if(settings.get("fixed")){offset.top-=scrollTop;offset.left-=scrollLeft;$box.css({position:"fixed"})}else{top=scrollTop;left=scrollLeft;$box.css({position:"absolute"})}if(settings.get("right")!==false){left+=Math.max($window.width()-settings.w-loadedWidth-interfaceWidth-setSize(settings.get("right"),"x"),0)}else if(settings.get("left")!==false){left+=setSize(settings.get("left"),"x")}else{left+=Math.round(Math.max($window.width()-settings.w-loadedWidth-interfaceWidth,0)/2)}if(settings.get("bottom")!==false){top+=Math.max(winheight()-settings.h-loadedHeight-interfaceHeight-setSize(settings.get("bottom"),"y"),0)}else if(settings.get("top")!==false){top+=setSize(settings.get("top"),"y")}else{top+=Math.round(Math.max(winheight()-settings.h-loadedHeight-interfaceHeight,0)/2)}$box.css({top:offset.top,left:offset.left,visibility:"visible"}).attr("aria-hidden","false");$wrap[0].style.width=$wrap[0].style.height="9999px";function modalDimensions(){$topBorder[0].style.width=$bottomBorder[0].style.width=$content[0].style.width=parseInt($box[0].style.width,10)-interfaceWidth+"px";$content[0].style.height=$leftBorder[0].style.height=$rightBorder[0].style.height=parseInt($box[0].style.height,10)-interfaceHeight+"px"}css={width:settings.w+loadedWidth+interfaceWidth,height:settings.h+loadedHeight+interfaceHeight,top:top,left:left};if(speed){var tempSpeed=0;$.each(css,function(i){if(css[i]!==previousCSS[i]){tempSpeed=speed;return}});speed=tempSpeed}previousCSS=css;if(!speed){$box.css(css)}$box.dequeue().animate(css,{duration:speed||0,complete:function(){modalDimensions();active=false;$wrap[0].style.width=settings.w+loadedWidth+interfaceWidth+"px";$wrap[0].style.height=settings.h+loadedHeight+interfaceHeight+"px";if(settings.get("reposition")){setTimeout(function(){$window.bind("resize."+prefix,publicMethod.position)},1)}if($.isFunction(loadedCallback)){loadedCallback()}},step:modalDimensions})};publicMethod.resize=function(options){var scrolltop;if(open){options=options||{};if(options.width){settings.w=setSize(options.width,"x")-loadedWidth-interfaceWidth}if(options.innerWidth){settings.w=setSize(options.innerWidth,"x")}$loaded.css({width:settings.w});if(options.height){settings.h=setSize(options.height,"y")-loadedHeight-interfaceHeight}if(options.innerHeight){settings.h=setSize(options.innerHeight,"y")}if(!options.innerHeight&&!options.height){scrolltop=$loaded.scrollTop();$loaded.css({height:"auto"});settings.h=$loaded.height()}$loaded.css({height:settings.h});if(scrolltop){$loaded.scrollTop(scrolltop)}publicMethod.position(settings.get("transition")==="none"?0:settings.get("speed"))}};publicMethod.prep=function(object){if(!open){return}var callback,speed=settings.get("transition")==="none"?0:settings.get("speed");$loaded.remove();$loaded=$tag(div,"LoadedContent").append(object);function getWidth(){settings.w=settings.w||$loaded.width();settings.w=settings.mw&&settings.mw1){if(typeof settings.get("current")==="string"){$current.html(settings.get("current").replace("{current}",index+1).replace("{total}",total)).attr("aria-live","polite").show()}$showNext=settings.get("loop")||index").hide().insertBefore($target);$events.one(event_purge,function(){$inline.replaceWith($target)});prep($target)}else if(settings.get("iframe")){prep(" ")}else if(settings.get("html")){prep(settings.get("html"))}else if(isImage(settings,href)){href=retinaUrl(settings,href);photo=settings.get("createImg");$(photo).addClass(prefix+"Photo").bind("error."+prefix,function(){prep($tag(div,"Error").html(settings.get("imgError")))}).one("load",function(){if(request!==requests){return}setTimeout(function(){var percent;if(settings.get("retinaImage")&&window.devicePixelRatio>1){photo.height=photo.height/window.devicePixelRatio;photo.width=photo.width/window.devicePixelRatio}if(settings.get("scalePhotos")){setResize=function(){photo.height-=photo.height*percent;photo.width-=photo.width*percent};if(settings.mw&&photo.width>settings.mw){percent=(photo.width-settings.mw)/photo.width;setResize()}if(settings.mh&&photo.height>settings.mh){percent=(photo.height-settings.mh)/photo.height;setResize()}}if(settings.h){photo.style.marginTop=Math.max(settings.mh-photo.height,0)/2+"px"}if($related[1]&&(settings.get("loop")||$related[index+1])){photo.style.cursor="pointer";$(photo).bind("click."+prefix,function(){publicMethod.next()})}photo.style.width=photo.width+"px";photo.style.height=photo.height+"px";prep(photo)},1)});photo.src=href}else if(href){$loadingBay.load(href,settings.get("data"),function(data,status){if(request===requests){prep(status==="error"?$tag(div,"Error").html(settings.get("xhrError")):$(this).contents())}})}}publicMethod.next=function(){if(!active&&$related[1]&&(settings.get("loop")||$related[index+1])){index=getIndex(1);launch($related[index])}};publicMethod.prev=function(){if(!active&&$related[1]&&(settings.get("loop")||index)){index=getIndex(-1);launch($related[index])}};publicMethod.close=function(){if(open&&!closing){closing=true;open=false;trigger(event_cleanup);settings.get("onCleanup");$window.unbind("."+prefix);$overlay.fadeTo(settings.get("fadeOut")||0,0);$box.stop().fadeTo(settings.get("fadeOut")||0,0,function(){$box.hide().attr("aria-hidden","true");$overlay.hide();trigger(event_purge);$loaded.remove();setTimeout(function(){closing=false;trigger(event_closed);settings.get("onClosed")},1)})}};publicMethod.remove=function(){if(!$box){return}$box.stop();$[colorbox].close();$box.stop(false,true).remove();$overlay.remove();closing=false;$box=null;$("."+boxElement).removeData(colorbox).removeClass(boxElement);$(document).unbind("click."+prefix).unbind("keydown."+prefix)};publicMethod.element=function(){return $(settings.el)};publicMethod.settings=defaults})(jQuery,document,window);;
/**
* @file
* Colorbox JS.
*/
(function ($, Drupal) {
'use strict';
Drupal.behaviors.initColorbox = {
attach: function (context, settings) {
if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
return;
}
if (settings.colorbox.mobiledetect && window.matchMedia) {
// Disable Colorbox for small screens.
var mq = window.matchMedia('(max-device-width: ' + settings.colorbox.mobiledevicewidth + ')');
if (mq.matches) {
$.colorbox.remove();
return;
}
}
settings.colorbox.rel = function () {
return $(this).data('colorbox-gallery')
};
$('.colorbox', context)
.once('init-colorbox')
.colorbox(settings.colorbox);
}
};
})(jQuery, Drupal);
;
/**
* @file
* Colorbox Style JS.
*/
(function ($) {
Drupal.behaviors.initColorboxDefaultStyle = {
attach: function (context, settings) {
$(context).bind('cbox_complete', function () {
// Only run if there is a title.
if ($('#cboxTitle:empty', context).length == false) {
$('#cboxLoadedContent img', context).bind('mouseover', function () {
$('#cboxTitle', context).slideDown();
});
$('#cboxOverlay', context).bind('mouseover', function () {
$('#cboxTitle', context).slideUp();
});
}
else {
$('#cboxTitle', context).hide();
}
});
}
};
})(jQuery);
;
(function ($) {
"use strict";
/**
* Enable the colorbox inline functionality.
*/
Drupal.behaviors.colorboxInline = {
attach: function (context, drupalSettings) {
$('[data-colorbox-inline]', context).once('colorbox-inline').each(function () {
var $link = $(this),
data = $link.data(),
settings = $.extend({}, drupalSettings.colorbox, {
href: false,
inline: true
}, {
className: data.class,
href: data.colorboxInline,
width: data.width,
height: data.height,
rel: data.rel,
open: false
});
// Hide the colorbox source after if it was hidden before use.
if (!$(settings.href).filter(':visible')[0]) {
settings.onClosed = function($link) {
$($link.cache.href).hide();
}
}
$link.colorbox(settings);
$link.click(function () {
$($(this).data('colorboxInline')).show();
$(this).colorbox();
});
});
}
};
})(jQuery);
;
/**
* @file
* Global utilities.
*
*/
(function ($, Drupal) {
var a = 0;
$(window).scroll(function() {
if ($('#counter').length) {
var oTop = $('#counter').offset().top - window.innerHeight;
if (a == 0 && $(window).scrollTop() > oTop) {
$('.counter-value').each(function() {
var $this = $(this),
countTo = $this.attr('data-count');
duration = $this.attr('data-duration');
$({
countNum: $this.text()
}).animate({
countNum: countTo
},
{
duration: parseInt(duration),
easing: 'swing',
step: function() {
$this.text(Math.floor(this.countNum));
},
complete: function() {
$this.text(this.countNum);
}
});
});
a = 1;
}
}
});
})(jQuery, Drupal);
;
/**
* @file
* Attaches several event listener to a web page.
*/
(function ($, Drupal, drupalSettings) {
/* eslint max-nested-callbacks: ["error", 4] */
'use strict';
Drupal.google_analytics = {};
$(document).ready(function () {
// Attach mousedown, keyup, touchstart events to document only and catch
// clicks on all elements.
$(document.body).on('mousedown keyup touchstart', function (event) {
// Catch the closest surrounding link of a clicked element.
$(event.target).closest('a,area').each(function () {
// Is the clicked URL internal?
if (Drupal.google_analytics.isInternal(this.href)) {
// Skip 'click' tracking, if custom tracking events are bound.
if ($(this).is('.colorbox') && (drupalSettings.google_analytics.trackColorbox)) {
// Do nothing here. The custom event will handle all tracking.
// console.info('Click on .colorbox item has been detected.');
}
// Is download tracking activated and the file extension configured
// for download tracking?
else if (drupalSettings.google_analytics.trackDownload && Drupal.google_analytics.isDownload(this.href)) {
// Download link clicked.
gtag('event', Drupal.google_analytics.getDownloadExtension(this.href).toUpperCase(), {
event_category: 'Downloads',
event_label: Drupal.google_analytics.getPageUrl(this.href),
transport_type: 'beacon'
});
}
else if (Drupal.google_analytics.isInternalSpecial(this.href)) {
// Keep the internal URL for Google Analytics website overlay intact.
// @todo: May require tracking ID
gtag('config', drupalSettings.google_analytics.account, {
page_path: Drupal.google_analytics.getPageUrl(this.href),
transport_type: 'beacon'
});
}
}
else {
if (drupalSettings.google_analytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
// Mailto link clicked.
gtag('event', 'Click', {
event_category: 'Mails',
event_label: this.href.substring(7),
transport_type: 'beacon'
});
}
else if (drupalSettings.google_analytics.trackTel && $(this).is("a[href^='tel:'],area[href^='tel:']")) {
// Tel link clicked.
gtag('event', 'Click', {
event_category: 'Telephone calls',
event_label: this.href.substring(4),
transport_type: 'beacon'
});
}
else if (drupalSettings.google_analytics.trackOutbound && this.href.match(/^\w+:\/\//i)) {
if (drupalSettings.google_analytics.trackDomainMode !== 2 || (drupalSettings.google_analytics.trackDomainMode === 2 && !Drupal.google_analytics.isCrossDomain(this.hostname, drupalSettings.google_analytics.trackCrossDomains))) {
// External link clicked / No top-level cross domain clicked.
gtag('event', 'Click', {
event_category: 'Outbound links',
event_label: this.href,
transport_type: 'beacon'
});
}
}
}
});
});
// Track hash changes as unique pageviews, if this option has been enabled.
if (drupalSettings.google_analytics.trackUrlFragments) {
window.onhashchange = function () {
gtag('config', drupalSettings.google_analytics.account, {
page_path: location.pathname + location.search + location.hash
});
};
}
// Colorbox: This event triggers when the transition has completed and the
// newly loaded content has been revealed.
if (drupalSettings.google_analytics.trackColorbox) {
$(document).on('cbox_complete', function () {
var href = $.colorbox.element().attr('href');
if (href) {
gtag('config', drupalSettings.google_analytics.account, {
page_path: Drupal.google_analytics.getPageUrl(href)
});
}
});
}
});
/**
* Check whether the hostname is part of the cross domains or not.
*
* @param {string} hostname
* The hostname of the clicked URL.
* @param {array} crossDomains
* All cross domain hostnames as JS array.
*
* @return {boolean} isCrossDomain
*/
Drupal.google_analytics.isCrossDomain = function (hostname, crossDomains) {
return $.inArray(hostname, crossDomains) > -1 ? true : false;
};
/**
* Check whether this is a download URL or not.
*
* @param {string} url
* The web url to check.
*
* @return {boolean} isDownload
*/
Drupal.google_analytics.isDownload = function (url) {
var isDownload = new RegExp('\\.(' + drupalSettings.google_analytics.trackDownloadExtensions + ')([\?#].*)?$', 'i');
return isDownload.test(url);
};
/**
* Check whether this is an absolute internal URL or not.
*
* @param {string} url
* The web url to check.
*
* @return {boolean} isInternal
*/
Drupal.google_analytics.isInternal = function (url) {
var isInternal = new RegExp('^(https?):\/\/' + window.location.host, 'i');
return isInternal.test(url);
};
/**
* Check whether this is a special URL or not.
*
* URL types:
* - gotwo.module /go/* links.
*
* @param {string} url
* The web url to check.
*
* @return {boolean} isInternalSpecial
*/
Drupal.google_analytics.isInternalSpecial = function (url) {
var isInternalSpecial = new RegExp('(\/go\/.*)$', 'i');
return isInternalSpecial.test(url);
};
/**
* Extract the relative internal URL from an absolute internal URL.
*
* Examples:
* - https://mydomain.com/node/1 -> /node/1
* - https://example.com/foo/bar -> https://example.com/foo/bar
*
* @param {string} url
* The web url to check.
*
* @return {string} getPageUrl
* Internal website URL.
*/
Drupal.google_analytics.getPageUrl = function (url) {
var extractInternalUrl = new RegExp('^(https?):\/\/' + window.location.host, 'i');
return url.replace(extractInternalUrl, '');
};
/**
* Extract the download file extension from the URL.
*
* @param {string} url
* The web url to check.
*
* @return {string} getDownloadExtension
* The file extension of the passed url. e.g. 'zip', 'txt'
*/
Drupal.google_analytics.getDownloadExtension = function (url) {
var extractDownloadextension = new RegExp('\\.(' + drupalSettings.google_analytics.trackDownloadExtensions + ')([\?#].*)?$', 'i');
var extension = extractDownloadextension.exec(url);
return (extension === null) ? '' : extension[1];
};
})(jQuery, Drupal, drupalSettings);
;
/**
* @file
* Add functionality to be able to search though one or more kint dumps.
*/
(function ($) {
'use strict';
Drupal.behaviors.searchKintSearch = {
attach: function (context, settings) {
// Define kint root.
var kint = $('.kint-rich:not(".processed")');
// Check if there is a kint.
if ($(kint).addClass('processed').length > 0) {
// Create the search kint form.
var form = '';
form += ' ';
form += '
';
form += '';
// Insert the form before the first kint.
kint.eq(0).before(form);
}
// On submit execute the following.
$('form#search-kint').submit(function (e) {
// Remove result and classes from previous query.
$('.kint-rich-query-result').removeClass('kint-query-result');
$('.kint-rich-parent.kint-rich-show').removeClass('kint-show');
var $search_kint_result = $('.search-kint-results');
$search_kint_result.html('');
// Get query value and option value as variables.
var query = $('input[name=search-query]', this).val();
var option = $('select[name=search-option]', this).val();
// If the query is not empty, we can proceed.
if (query) {
var search_kint;
// Check if we're just trying to look through a single kint.
if (option && option !== 'all') {
search_kint = $('.kint-rich').eq(option - 1);
}
else {
// Let's search through all of them!
search_kint = $('.kint-rich');
}
// Find all elements with the query.
var count = 0;
$('dt:contains(' + query + ')', search_kint).each(function () {
count++;
// Add result class.
$(this).parent().addClass('kint-query-result');
// Expand parents until the query result is layered open before the user.
$(this).parentsUntil('.kint-rich', 'dd').prev().addClass('kint-show');
});
// Show result overview.
$search_kint_result.html(Drupal.formatPlural(count, 'Found 1 element', 'Found @count elements'));
}
else {
$search_kint_result.html(Drupal.t('Empty query'));
}
// Prevent the form from being submitted.
e.preventDefault();
});
}
};
})(jQuery);
;
/**
* @file
* Adds functionality to copy path to a specific part of the array / object.
*/
(function ($) {
'use strict';
Drupal.behaviors.searchKintTrail = {
attach: function (context, settings) {
var first = true;
$('.kint-rich dt', context).once('trail').each(function () {
if (first) {
first = false;
return true;
}
$(this).append('' + Drupal.t('Get path') + '');
});
var field_name;
$('.kint-get-path a').once().click(function (e) {
e.preventDefault();
var pathItems = [];
buildPath($(this).parents('dl').first(), pathItems);
if(typeof field_name == 'undefined') {
pathItems.reverse();
var path = '$var';
$.each(pathItems, function (index, item) {
if (item.label === '$args') {
return true;
}
var prevItem = pathItems[index - 1];
if (prevItem.type === 'array' || prevItem.type === 'protectedarray') {
path += '[' + item.label + ']';
}
else if (prevItem.type.substring(0, 7) === 'object ') {
path += '->' + item.label;
}
});
} else {
path = '$var->get(\'' + field_name + '\')->value';
}
$(this).addClass('hidden');
$(this).after('');
$('#kint-path-value').select().blur(function () {
$(this).remove();
$('.kint-get-path a.hidden').removeClass('hidden');
});
});
function buildPath($current, pathItems) {
if (!$current.length) {
return;
}
var label = $current.find('> dt dfn').text().trim();
if($current.parents('.kint-report').length) {
// We are in a kint report so return the getter for this field
if($current.parents().eq(3).hasClass('kint-report')) {
field_name = $current.parent().prev().text();
}
}
// If uppermost dl set label to $args so it gets included.
if (!$current.parents('dl').length) {
label = '$args';
}
if (label.length) {
pathItems.push({
type: $current.find('> dt var').text(),
index: $current.index(),
label: label
});
}
buildPath($current.parents('dl').first(), pathItems);
}
}
};
})(jQuery);
;
/**
* @file
* Global utilities.
*
*/
(function ($, Drupal) {
'use strict';
Drupal.behaviors.bootstrap_barrio = {
attach: function (context, settings) {
var position = $(window).scrollTop();
$(window).scroll(function () {
if ($(this).scrollTop() > 50) {
$('body').addClass("scrolled");
}
else {
$('body').removeClass("scrolled");
}
var scroll = $(window).scrollTop();
if (scroll > position) {
$('body').addClass("scrolldown");
$('body').removeClass("scrollup");
} else {
$('body').addClass("scrollup");
$('body').removeClass("scrolldown");
}
position = scroll;
});
$('.dropdown-item a.dropdown-toggle').on("click", function(e) {
$(this).next('ul').toggle();
e.stopPropagation();
e.preventDefault();
});
}
};
})(jQuery, Drupal);
;
/**
* @file
* Global utilities.
*
*/
(function ($, Drupal) {
"use strict";
Drupal.behaviors.ug_theme = {
attach: function (context, settings) { },
};
/*REGISTER ZMIAN*/
$(".toggle_record-link").click(function (event) {
event.preventDefault();
$(".toggle_record-box-two").toggleClass("toggle_record-hide");
$(".toggle_record-description").toggleClass("toggle_record-active");
});
/*SCROLL NAV*/
$(window).scroll(function () {
if (window.scrollY > 200) {
$(".ug_navbar").css({ top: "0", height: "80px" });
$(".ug_navbar .container").addClass("pos-rel");
$(".navbar-brand").addClass("m-reset");
$("#superfish-menu-glowne-toggle").attr("style", "top: -52px !important");
} else {
$(".ug_navbar").css({ top: "0", height: "auto" });
$(".ug_navbar .container").removeClass("pos-rel");
$(".navbar-brand").removeClass("m-reset");
$("#superfish-menu-glowne-toggle").attr("style", "top:");
}
/*SCROLL top*/
if ($(this).scrollTop() < 200) {
$('.top-arrow-btn').fadeOut();
} else {
$('.top-arrow-btn').fadeIn();
}
});
/* ADD COLOR TO TABLE WITHOUT THEAD */
if ($(".field--name-body table").has("thead").length > 0) {
$(".field--name-body table tbody tr").css({ color: "#141414" });
}
/*CHANGE IMAGE ON HOVER*/
$(".wheel-logo-footer").mouseover(function () {
$(this).attr('src', $(this).data("hover"));
}).mouseout(function () {
$(this).attr('src', $(this).data("src"));
});
// Accordion open / close
$('.closeall').click(function () {
$('.collapse').collapse('hide');
});
$('.openall').click(function () {
$('.collapse').collapse('show');
});
})(jQuery, Drupal);
;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal) {
Drupal.theme.progressBar = function (id) {
return "") + '
' + '
' + '
' + '
' + '
';
};
Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) {
this.id = id;
this.method = method || 'GET';
this.updateCallback = updateCallback;
this.errorCallback = errorCallback;
this.element = $(Drupal.theme('progressBar', id));
};
$.extend(Drupal.ProgressBar.prototype, {
setProgress: function setProgress(percentage, message, label) {
if (percentage >= 0 && percentage <= 100) {
$(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%"));
$(this.element).find('div.progress__percentage').html("".concat(percentage, "%"));
}
$('div.progress__description', this.element).html(message);
$('div.progress__label', this.element).html(label);
if (this.updateCallback) {
this.updateCallback(percentage, message, this);
}
},
startMonitoring: function startMonitoring(uri, delay) {
this.delay = delay;
this.uri = uri;
this.sendPing();
},
stopMonitoring: function stopMonitoring() {
clearTimeout(this.timer);
this.uri = null;
},
sendPing: function sendPing() {
if (this.timer) {
clearTimeout(this.timer);
}
if (this.uri) {
var pb = this;
var uri = this.uri;
if (uri.indexOf('?') === -1) {
uri += '?';
} else {
uri += '&';
}
uri += '_format=json';
$.ajax({
type: this.method,
url: uri,
data: '',
dataType: 'json',
success: function success(progress) {
if (progress.status === 0) {
pb.displayError(progress.data);
return;
}
pb.setProgress(progress.percentage, progress.message, progress.label);
pb.timer = setTimeout(function () {
pb.sendPing();
}, pb.delay);
},
error: function error(xmlhttp) {
var e = new Drupal.AjaxError(xmlhttp, pb.uri);
pb.displayError("".concat(e.message, "
"));
}
});
}
},
displayError: function displayError(string) {
var error = $('').html(string);
$(this.element).before(error).hide();
if (this.errorCallback) {
this.errorCallback(this);
}
}
});
})(jQuery, Drupal);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
(function ($, window, Drupal, drupalSettings, _ref) {
var isFocusable = _ref.isFocusable,
tabbable = _ref.tabbable;
Drupal.behaviors.AJAX = {
attach: function attach(context, settings) {
function loadAjaxBehavior(base) {
var elementSettings = settings.ajax[base];
if (typeof elementSettings.selector === 'undefined') {
elementSettings.selector = "#".concat(base);
}
$(elementSettings.selector).once('drupal-ajax').each(function () {
elementSettings.element = this;
elementSettings.base = base;
Drupal.ajax(elementSettings);
});
}
Object.keys(settings.ajax || {}).forEach(function (base) {
return loadAjaxBehavior(base);
});
Drupal.ajax.bindAjaxLinks(document.body);
$('.use-ajax-submit').once('ajax').each(function () {
var elementSettings = {};
elementSettings.url = $(this.form).attr('action');
elementSettings.setClick = true;
elementSettings.event = 'click';
elementSettings.progress = {
type: 'throbber'
};
elementSettings.base = $(this).attr('id');
elementSettings.element = this;
Drupal.ajax(elementSettings);
});
},
detach: function detach(context, settings, trigger) {
if (trigger === 'unload') {
Drupal.ajax.expired().forEach(function (instance) {
Drupal.ajax.instances[instance.instanceIndex] = null;
});
}
}
};
Drupal.AjaxError = function (xmlhttp, uri, customMessage) {
var statusCode;
var statusText;
var responseText;
if (xmlhttp.status) {
statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', {
'!status': xmlhttp.status
}));
} else {
statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.'));
}
statusCode += "\n".concat(Drupal.t('Debugging information follows.'));
var pathText = "\n".concat(Drupal.t('Path: !uri', {
'!uri': uri
}));
statusText = '';
try {
statusText = "\n".concat(Drupal.t('StatusText: !statusText', {
'!statusText': $.trim(xmlhttp.statusText)
}));
} catch (e) {}
responseText = '';
try {
responseText = "\n".concat(Drupal.t('ResponseText: !responseText', {
'!responseText': $.trim(xmlhttp.responseText)
}));
} catch (e) {}
responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, '');
responseText = responseText.replace(/[\n]+\s+/g, '\n');
var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', {
'!readyState': xmlhttp.readyState
})) : '';
customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', {
'!customMessage': customMessage
})) : '';
this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText;
this.name = 'AjaxError';
};
Drupal.AjaxError.prototype = new Error();
Drupal.AjaxError.prototype.constructor = Drupal.AjaxError;
Drupal.ajax = function (settings) {
if (arguments.length !== 1) {
throw new Error('Drupal.ajax() function must be called with one configuration object only');
}
var base = settings.base || false;
var element = settings.element || false;
delete settings.base;
delete settings.element;
if (!settings.progress && !element) {
settings.progress = false;
}
var ajax = new Drupal.Ajax(base, element, settings);
ajax.instanceIndex = Drupal.ajax.instances.length;
Drupal.ajax.instances.push(ajax);
return ajax;
};
Drupal.ajax.instances = [];
Drupal.ajax.expired = function () {
return Drupal.ajax.instances.filter(function (instance) {
return instance && instance.element !== false && !document.body.contains(instance.element);
});
};
Drupal.ajax.bindAjaxLinks = function (element) {
$(element).find('.use-ajax').once('ajax').each(function (i, ajaxLink) {
var $linkElement = $(ajaxLink);
var elementSettings = {
progress: {
type: 'throbber'
},
dialogType: $linkElement.data('dialog-type'),
dialog: $linkElement.data('dialog-options'),
dialogRenderer: $linkElement.data('dialog-renderer'),
base: $linkElement.attr('id'),
element: ajaxLink
};
var href = $linkElement.attr('href');
if (href) {
elementSettings.url = href;
elementSettings.event = 'click';
}
Drupal.ajax(elementSettings);
});
};
Drupal.Ajax = function (base, element, elementSettings) {
var defaults = {
event: element ? 'mousedown' : null,
keypress: true,
selector: base ? "#".concat(base) : null,
effect: 'none',
speed: 'none',
method: 'replaceWith',
progress: {
type: 'throbber',
message: Drupal.t('Please wait...')
},
submit: {
js: true
}
};
$.extend(this, defaults, elementSettings);
this.commands = new Drupal.AjaxCommands();
this.instanceIndex = false;
if (this.wrapper) {
this.wrapper = "#".concat(this.wrapper);
}
this.element = element;
this.element_settings = elementSettings;
this.elementSettings = elementSettings;
if (this.element && this.element.form) {
this.$form = $(this.element.form);
}
if (!this.url) {
var $element = $(this.element);
if ($element.is('a')) {
this.url = $element.attr('href');
} else if (this.element && element.form) {
this.url = this.$form.attr('action');
}
}
var originalUrl = this.url;
this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1');
if (drupalSettings.ajaxTrustedUrl[originalUrl]) {
drupalSettings.ajaxTrustedUrl[this.url] = true;
}
var ajax = this;
ajax.options = {
url: ajax.url,
data: ajax.submit,
beforeSerialize: function beforeSerialize(elementSettings, options) {
return ajax.beforeSerialize(elementSettings, options);
},
beforeSubmit: function beforeSubmit(formValues, elementSettings, options) {
ajax.ajaxing = true;
return ajax.beforeSubmit(formValues, elementSettings, options);
},
beforeSend: function beforeSend(xmlhttprequest, options) {
ajax.ajaxing = true;
return ajax.beforeSend(xmlhttprequest, options);
},
success: function success(response, status, xmlhttprequest) {
if (typeof response === 'string') {
response = $.parseJSON(response);
}
if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) {
if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') {
var customMessage = Drupal.t('The response failed verification so will not be processed.');
return ajax.error(xmlhttprequest, ajax.url, customMessage);
}
}
return ajax.success(response, status);
},
complete: function complete(xmlhttprequest, status) {
ajax.ajaxing = false;
if (status === 'error' || status === 'parsererror') {
return ajax.error(xmlhttprequest, ajax.url);
}
},
dataType: 'json',
jsonp: false,
type: 'POST'
};
if (elementSettings.dialog) {
ajax.options.data.dialogOptions = elementSettings.dialog;
}
if (ajax.options.url.indexOf('?') === -1) {
ajax.options.url += '?';
} else {
ajax.options.url += '&';
}
var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax');
if (elementSettings.dialogRenderer) {
wrapper += ".".concat(elementSettings.dialogRenderer);
}
ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper);
$(ajax.element).on(elementSettings.event, function (event) {
if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) {
throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {
'!url': ajax.url
}));
}
return ajax.eventResponse(this, event);
});
if (elementSettings.keypress) {
$(ajax.element).on('keypress', function (event) {
return ajax.keypressResponse(this, event);
});
}
if (elementSettings.prevent) {
$(ajax.element).on(elementSettings.prevent, false);
}
};
Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format';
Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax';
Drupal.Ajax.prototype.execute = function () {
if (this.ajaxing) {
return;
}
try {
this.beforeSerialize(this.element, this.options);
return $.ajax(this.options);
} catch (e) {
this.ajaxing = false;
window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message));
return $.Deferred().reject();
}
};
Drupal.Ajax.prototype.keypressResponse = function (element, event) {
var ajax = this;
if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') {
event.preventDefault();
event.stopPropagation();
$(element).trigger(ajax.elementSettings.event);
}
};
Drupal.Ajax.prototype.eventResponse = function (element, event) {
event.preventDefault();
event.stopPropagation();
var ajax = this;
if (ajax.ajaxing) {
return;
}
try {
if (ajax.$form) {
if (ajax.setClick) {
element.form.clk = element;
}
ajax.$form.ajaxSubmit(ajax.options);
} else {
ajax.beforeSerialize(ajax.element, ajax.options);
$.ajax(ajax.options);
}
} catch (e) {
ajax.ajaxing = false;
window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message));
}
};
Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
if (this.$form && document.body.contains(this.$form.get(0))) {
var settings = this.settings || drupalSettings;
Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize');
}
options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1;
var pageState = drupalSettings.ajaxPageState;
options.data['ajax_page_state[theme]'] = pageState.theme;
options.data['ajax_page_state[theme_token]'] = pageState.theme_token;
options.data['ajax_page_state[libraries]'] = pageState.libraries;
};
Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {};
Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) {
if (this.$form) {
options.extraData = options.extraData || {};
options.extraData.ajax_iframe_upload = '1';
var v = $.fieldValue(this.element);
if (v !== null) {
options.extraData[this.element.name] = v;
}
}
$(this.element).prop('disabled', true);
if (!this.progress || !this.progress.type) {
return;
}
var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase());
if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') {
this[progressIndicatorMethod].call(this);
}
};
Drupal.theme.ajaxProgressThrobber = function (message) {
var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : '';
var throbber = '
';
return "".concat(throbber).concat(messageMarkup, "
");
};
Drupal.theme.ajaxProgressIndicatorFullscreen = function () {
return '
';
};
Drupal.theme.ajaxProgressMessage = function (message) {
return "".concat(message, "
");
};
Drupal.theme.ajaxProgressBar = function ($element) {
return $('').append($element);
};
Drupal.Ajax.prototype.setProgressIndicatorBar = function () {
var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.id), $.noop, this.progress.method, $.noop);
if (this.progress.message) {
progressBar.setProgress(-1, this.progress.message);
}
if (this.progress.url) {
progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500);
}
this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element));
this.progress.object = progressBar;
$(this.element).after(this.progress.element);
};
Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message));
$(this.element).after(this.progress.element);
};
Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () {
this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen'));
$('body').append(this.progress.element);
};
Drupal.Ajax.prototype.success = function (response, status) {
var _this = this;
if (this.progress.element) {
$(this.progress.element).remove();
}
if (this.progress.object) {
this.progress.object.stopMonitoring();
}
$(this.element).prop('disabled', false);
var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray();
var focusChanged = false;
Object.keys(response || {}).forEach(function (i) {
if (response[i].command && _this.commands[response[i].command]) {
_this.commands[response[i].command](_this, response[i], status);
if (response[i].command === 'invoke' && response[i].method === 'focus' || response[i].command === 'focusFirst') {
focusChanged = true;
}
}
});
if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) {
var target = false;
for (var n = elementParents.length - 1; !target && n >= 0; n--) {
target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]"));
}
if (target) {
$(target).trigger('focus');
}
}
if (this.$form && document.body.contains(this.$form.get(0))) {
var settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
this.settings = null;
};
Drupal.Ajax.prototype.getEffect = function (response) {
var type = response.effect || this.effect;
var speed = response.speed || this.speed;
var effect = {};
if (type === 'none') {
effect.showEffect = 'show';
effect.hideEffect = 'hide';
effect.showSpeed = '';
} else if (type === 'fade') {
effect.showEffect = 'fadeIn';
effect.hideEffect = 'fadeOut';
effect.showSpeed = speed;
} else {
effect.showEffect = "".concat(type, "Toggle");
effect.hideEffect = "".concat(type, "Toggle");
effect.showSpeed = speed;
}
return effect;
};
Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
if (this.progress.element) {
$(this.progress.element).remove();
}
if (this.progress.object) {
this.progress.object.stopMonitoring();
}
$(this.wrapper).show();
$(this.element).prop('disabled', false);
if (this.$form && document.body.contains(this.$form.get(0))) {
var settings = this.settings || drupalSettings;
Drupal.attachBehaviors(this.$form.get(0), settings);
}
throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage);
};
Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) {
return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) {
return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent));
}).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent;
};
Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) {
return $('').append($elements);
};
Drupal.AjaxCommands = function () {};
Drupal.AjaxCommands.prototype = {
insert: function insert(ajax, response) {
var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper);
var method = response.method || ajax.method;
var effect = ajax.getEffect(response);
var settings = response.settings || ajax.settings || drupalSettings;
var $newContent = $($.parseHTML(response.data, document, true));
$newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response);
switch (method) {
case 'html':
case 'replaceWith':
case 'replaceAll':
case 'empty':
case 'remove':
Drupal.detachBehaviors($wrapper.get(0), settings);
break;
default:
break;
}
$wrapper[method]($newContent);
if (effect.showEffect !== 'show') {
$newContent.hide();
}
var $ajaxNewContent = $newContent.find('.ajax-new-content');
if ($ajaxNewContent.length) {
$ajaxNewContent.hide();
$newContent.show();
$ajaxNewContent[effect.showEffect](effect.showSpeed);
} else if (effect.showEffect !== 'show') {
$newContent[effect.showEffect](effect.showSpeed);
}
if ($newContent.parents('html').length) {
$newContent.each(function (index, element) {
if (element.nodeType === Node.ELEMENT_NODE) {
Drupal.attachBehaviors(element, settings);
}
});
}
},
remove: function remove(ajax, response, status) {
var settings = response.settings || ajax.settings || drupalSettings;
$(response.selector).each(function () {
Drupal.detachBehaviors(this, settings);
}).remove();
},
changed: function changed(ajax, response, status) {
var $element = $(response.selector);
if (!$element.hasClass('ajax-changed')) {
$element.addClass('ajax-changed');
if (response.asterisk) {
$element.find(response.asterisk).append(" * "));
}
}
},
alert: function alert(ajax, response, status) {
window.alert(response.text);
},
announce: function announce(ajax, response) {
if (response.priority) {
Drupal.announce(response.text, response.priority);
} else {
Drupal.announce(response.text);
}
},
redirect: function redirect(ajax, response, status) {
window.location = response.url;
},
css: function css(ajax, response, status) {
$(response.selector).css(response.argument);
},
settings: function settings(ajax, response, status) {
var ajaxSettings = drupalSettings.ajax;
if (ajaxSettings) {
Drupal.ajax.expired().forEach(function (instance) {
if (instance.selector) {
var selector = instance.selector.replace('#', '');
if (selector in ajaxSettings) {
delete ajaxSettings[selector];
}
}
});
}
if (response.merge) {
$.extend(true, drupalSettings, response.settings);
} else {
ajax.settings = response.settings;
}
},
data: function data(ajax, response, status) {
$(response.selector).data(response.name, response.value);
},
focusFirst: function focusFirst(ajax, response, status) {
var focusChanged = false;
var container = document.querySelector(response.selector);
if (container) {
var tabbableElements = tabbable(container);
if (tabbableElements.length) {
tabbableElements[0].focus();
focusChanged = true;
} else if (isFocusable(container)) {
container.focus();
focusChanged = true;
}
}
if (ajax.hasOwnProperty('element') && !focusChanged) {
ajax.element.focus();
}
},
invoke: function invoke(ajax, response, status) {
var $element = $(response.selector);
$element[response.method].apply($element, _toConsumableArray(response.args));
},
restripe: function restripe(ajax, response, status) {
$(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even');
},
update_build_id: function update_build_id(ajax, response, status) {
$("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).val(response.new);
},
add_css: function add_css(ajax, response, status) {
$('head').prepend(response.data);
},
message: function message(ajax, response) {
var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector));
if (response.clearPrevious) {
messages.clear();
}
messages.add(response.message, response.messageOptions);
}
};
})(jQuery, window, Drupal, drupalSettings, window.tabbable);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
Drupal.debounce = function (func, wait, immediate) {
var timeout;
var result;
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var context = this;
var later = function later() {
timeout = null;
if (!immediate) {
result = func.apply(context, args);
}
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
}
return result;
};
};;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, debounce) {
var offsets = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
function getRawOffset(el, edge) {
var $el = $(el);
var documentElement = document.documentElement;
var displacement = 0;
var horizontal = edge === 'left' || edge === 'right';
var placement = $el.offset()[horizontal ? 'left' : 'top'];
placement -= window["scroll".concat(horizontal ? 'X' : 'Y')] || document.documentElement["scroll".concat(horizontal ? 'Left' : 'Top')] || 0;
switch (edge) {
case 'top':
displacement = placement + $el.outerHeight();
break;
case 'left':
displacement = placement + $el.outerWidth();
break;
case 'bottom':
displacement = documentElement.clientHeight - placement;
break;
case 'right':
displacement = documentElement.clientWidth - placement;
break;
default:
displacement = 0;
}
return displacement;
}
function calculateOffset(edge) {
var edgeOffset = 0;
var displacingElements = document.querySelectorAll("[data-offset-".concat(edge, "]"));
var n = displacingElements.length;
for (var i = 0; i < n; i++) {
var el = displacingElements[i];
if (el.style.display === 'none') {
continue;
}
var displacement = parseInt(el.getAttribute("data-offset-".concat(edge)), 10);
if (isNaN(displacement)) {
displacement = getRawOffset(el, edge);
}
edgeOffset = Math.max(edgeOffset, displacement);
}
return edgeOffset;
}
function calculateOffsets() {
return {
top: calculateOffset('top'),
right: calculateOffset('right'),
bottom: calculateOffset('bottom'),
left: calculateOffset('left')
};
}
function displace(broadcast) {
offsets = calculateOffsets();
Drupal.displace.offsets = offsets;
if (typeof broadcast === 'undefined' || broadcast) {
$(document).trigger('drupalViewportOffsetChange', offsets);
}
return offsets;
}
Drupal.behaviors.drupalDisplace = {
attach: function attach() {
if (this.displaceProcessed) {
return;
}
this.displaceProcessed = true;
$(window).on('resize.drupalDisplace', debounce(displace, 200));
}
};
Drupal.displace = displace;
$.extend(Drupal.displace, {
offsets: offsets,
calculateOffset: calculateOffset
});
})(jQuery, Drupal, Drupal.debounce);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, _ref) {
var isTabbable = _ref.isTabbable;
$.extend($.expr[':'], {
tabbable: function tabbable(element) {
Drupal.deprecationError({
message: 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 10.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730'
});
if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') {
var tabIndex = element.getAttribute('tabIndex');
if (tabIndex === null || tabIndex < 0) {
return false;
}
}
return isTabbable(element);
}
});
})(jQuery, Drupal, window.tabbable);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($) {
var cachedScrollbarWidth = null;
var max = Math.max,
abs = Math.abs;
var regexHorizontal = /left|center|right/;
var regexVertical = /top|center|bottom/;
var regexOffset = /[+-]\d+(\.[\d]+)?%?/;
var regexPosition = /^\w+/;
var regexPercent = /%$/;
var _position = $.fn.position;
function getOffsets(offsets, width, height) {
return [parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1)];
}
function parseCss(element, property) {
return parseInt($.css(element, property), 10) || 0;
}
function getDimensions(elem) {
var raw = elem[0];
if (raw.nodeType === 9) {
return {
width: elem.width(),
height: elem.height(),
offset: {
top: 0,
left: 0
}
};
}
if ($.isWindow(raw)) {
return {
width: elem.width(),
height: elem.height(),
offset: {
top: elem.scrollTop(),
left: elem.scrollLeft()
}
};
}
if (raw.preventDefault) {
return {
width: 0,
height: 0,
offset: {
top: raw.pageY,
left: raw.pageX
}
};
}
return {
width: elem.outerWidth(),
height: elem.outerHeight(),
offset: elem.offset()
};
}
var collisions = {
fit: {
left: function left(position, data) {
var within = data.within;
var withinOffset = within.isWindow ? within.scrollLeft : within.offset.left;
var outerWidth = within.width;
var collisionPosLeft = position.left - data.collisionPosition.marginLeft;
var overLeft = withinOffset - collisionPosLeft;
var overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset;
var newOverRight;
if (data.collisionWidth > outerWidth) {
if (overLeft > 0 && overRight <= 0) {
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
position.left += overLeft - newOverRight;
} else if (overRight > 0 && overLeft <= 0) {
position.left = withinOffset;
} else if (overLeft > overRight) {
position.left = withinOffset + outerWidth - data.collisionWidth;
} else {
position.left = withinOffset;
}
} else if (overLeft > 0) {
position.left += overLeft;
} else if (overRight > 0) {
position.left -= overRight;
} else {
position.left = max(position.left - collisionPosLeft, position.left);
}
},
top: function top(position, data) {
var within = data.within;
var withinOffset = within.isWindow ? within.scrollTop : within.offset.top;
var outerHeight = data.within.height;
var collisionPosTop = position.top - data.collisionPosition.marginTop;
var overTop = withinOffset - collisionPosTop;
var overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset;
var newOverBottom;
if (data.collisionHeight > outerHeight) {
if (overTop > 0 && overBottom <= 0) {
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
position.top += overTop - newOverBottom;
} else if (overBottom > 0 && overTop <= 0) {
position.top = withinOffset;
} else if (overTop > overBottom) {
position.top = withinOffset + outerHeight - data.collisionHeight;
} else {
position.top = withinOffset;
}
} else if (overTop > 0) {
position.top += overTop;
} else if (overBottom > 0) {
position.top -= overBottom;
} else {
position.top = max(position.top - collisionPosTop, position.top);
}
}
},
flip: {
left: function left(position, data) {
var within = data.within;
var withinOffset = within.offset.left + within.scrollLeft;
var outerWidth = within.width;
var offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left;
var collisionPosLeft = position.left - data.collisionPosition.marginLeft;
var overLeft = collisionPosLeft - offsetLeft;
var overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft;
var myOffset = data.my[0] === 'left' ? -data.elemWidth : data.my[0] === 'right' ? data.elemWidth : 0;
var atOffset = data.at[0] === 'left' ? data.targetWidth : data.at[0] === 'right' ? -data.targetWidth : 0;
var offset = -2 * data.offset[0];
var newOverRight;
var newOverLeft;
if (overLeft < 0) {
newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
if (newOverRight < 0 || newOverRight < abs(overLeft)) {
position.left += myOffset + atOffset + offset;
}
} else if (overRight > 0) {
newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
position.left += myOffset + atOffset + offset;
}
}
},
top: function top(position, data) {
var within = data.within;
var withinOffset = within.offset.top + within.scrollTop;
var outerHeight = within.height;
var offsetTop = within.isWindow ? within.scrollTop : within.offset.top;
var collisionPosTop = position.top - data.collisionPosition.marginTop;
var overTop = collisionPosTop - offsetTop;
var overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop;
var top = data.my[1] === 'top';
var myOffset = top ? -data.elemHeight : data.my[1] === 'bottom' ? data.elemHeight : 0;
var atOffset = data.at[1] === 'top' ? data.targetHeight : data.at[1] === 'bottom' ? -data.targetHeight : 0;
var offset = -2 * data.offset[1];
var newOverTop;
var newOverBottom;
if (overTop < 0) {
newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
if (newOverBottom < 0 || newOverBottom < abs(overTop)) {
position.top += myOffset + atOffset + offset;
}
} else if (overBottom > 0) {
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
if (newOverTop > 0 || abs(newOverTop) < overBottom) {
position.top += myOffset + atOffset + offset;
}
}
}
},
flipfit: {
left: function left() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
collisions.flip.left.apply(this, args);
collisions.fit.left.apply(this, args);
},
top: function top() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
collisions.flip.top.apply(this, args);
collisions.fit.top.apply(this, args);
}
}
};
$.position = {
scrollbarWidth: function scrollbarWidth() {
if (cachedScrollbarWidth !== undefined) {
return cachedScrollbarWidth;
}
var div = $('");
var innerDiv = div.children()[0];
$('body').append(div);
var w1 = innerDiv.offsetWidth;
div.css('overflow', 'scroll');
var w2 = innerDiv.offsetWidth;
if (w1 === w2) {
w2 = div[0].clientWidth;
}
div.remove();
cachedScrollbarWidth = w1 - w2;
return cachedScrollbarWidth;
},
getScrollInfo: function getScrollInfo(within) {
var overflowX = within.isWindow || within.isDocument ? '' : within.element.css('overflow-x');
var overflowY = within.isWindow || within.isDocument ? '' : within.element.css('overflow-y');
var hasOverflowX = overflowX === 'scroll' || overflowX === 'auto' && within.width < within.element[0].scrollWidth;
var hasOverflowY = overflowY === 'scroll' || overflowY === 'auto' && within.height < within.element[0].scrollHeight;
return {
width: hasOverflowY ? $.position.scrollbarWidth() : 0,
height: hasOverflowX ? $.position.scrollbarWidth() : 0
};
},
getWithinInfo: function getWithinInfo(element) {
var withinElement = $(element || window);
var isWindow = $.isWindow(withinElement[0]);
var isDocument = !!withinElement[0] && withinElement[0].nodeType === 9;
var hasOffset = !isWindow && !isDocument;
return {
element: withinElement,
isWindow: isWindow,
isDocument: isDocument,
offset: hasOffset ? $(element).offset() : {
left: 0,
top: 0
},
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
width: withinElement.outerWidth(),
height: withinElement.outerHeight()
};
}
};
$.fn.position = function (options) {
if (!options || !options.of) {
return _position.apply(this, arguments);
}
options = $.extend({}, options);
var within = $.position.getWithinInfo(options.within);
var scrollInfo = $.position.getScrollInfo(within);
var collision = (options.collision || 'flip').split(' ');
var offsets = {};
var target = $(options.of);
var dimensions = getDimensions(target);
var targetWidth = dimensions.width;
var targetHeight = dimensions.height;
var targetOffset = dimensions.offset;
if (target[0].preventDefault) {
options.at = 'left top';
}
var basePosition = $.extend({}, targetOffset);
$.each(['my', 'at'], function () {
var pos = (options[this] || '').split(' ');
if (pos.length === 1) {
pos = regexHorizontal.test(pos[0]) ? pos.concat(['center']) : regexVertical.test(pos[0]) ? ['center'].concat(pos) : ['center', 'center'];
}
pos[0] = regexHorizontal.test(pos[0]) ? pos[0] : 'center';
pos[1] = regexVertical.test(pos[1]) ? pos[1] : 'center';
var horizontalOffset = regexOffset.exec(pos[0]);
var verticalOffset = regexOffset.exec(pos[1]);
offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0];
options[this] = [regexPosition.exec(pos[0])[0], regexPosition.exec(pos[1])[0]];
});
if (collision.length === 1) {
collision[1] = collision[0];
}
if (options.at[0] === 'right') {
basePosition.left += targetWidth;
} else if (options.at[0] === 'center') {
basePosition.left += targetWidth / 2;
}
if (options.at[1] === 'bottom') {
basePosition.top += targetHeight;
} else if (options.at[1] === 'center') {
basePosition.top += targetHeight / 2;
}
var atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
basePosition.left += atOffset[0];
basePosition.top += atOffset[1];
return this.each(function () {
var using;
var elem = $(this);
var elemWidth = elem.outerWidth();
var elemHeight = elem.outerHeight();
var marginLeft = parseCss(this, 'marginLeft');
var marginTop = parseCss(this, 'marginTop');
var collisionWidth = elemWidth + marginLeft + parseCss(this, 'marginRight') + scrollInfo.width;
var collisionHeight = elemHeight + marginTop + parseCss(this, 'marginBottom') + scrollInfo.height;
var position = $.extend({}, basePosition);
var myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());
if (options.my[0] === 'right') {
position.left -= elemWidth;
} else if (options.my[0] === 'center') {
position.left -= elemWidth / 2;
}
if (options.my[1] === 'bottom') {
position.top -= elemHeight;
} else if (options.my[1] === 'center') {
position.top -= elemHeight / 2;
}
position.left += myOffset[0];
position.top += myOffset[1];
var collisionPosition = {
marginLeft: marginLeft,
marginTop: marginTop
};
$.each(['left', 'top'], function (i, dir) {
if (collisions[collision[i]]) {
collisions[collision[i]][dir](position, {
targetWidth: targetWidth,
targetHeight: targetHeight,
elemWidth: elemWidth,
elemHeight: elemHeight,
collisionPosition: collisionPosition,
collisionWidth: collisionWidth,
collisionHeight: collisionHeight,
offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
my: options.my,
at: options.at,
within: within,
elem: elem
});
}
});
if (options.using) {
using = function using(props) {
var left = targetOffset.left - position.left;
var right = left + targetWidth - elemWidth;
var top = targetOffset.top - position.top;
var bottom = top + targetHeight - elemHeight;
var feedback = {
target: {
element: target,
left: targetOffset.left,
top: targetOffset.top,
width: targetWidth,
height: targetHeight
},
element: {
element: elem,
left: position.left,
top: position.top,
width: elemWidth,
height: elemHeight
},
horizontal: right < 0 ? 'left' : left > 0 ? 'right' : 'center',
vertical: bottom < 0 ? 'top' : top > 0 ? 'bottom' : 'middle'
};
if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
feedback.horizontal = 'center';
}
if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
feedback.vertical = 'middle';
}
if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
feedback.important = 'horizontal';
} else {
feedback.important = 'vertical';
}
options.using.call(this, props, feedback);
};
}
elem.offset($.extend(position, {
using: using
}));
});
};
if (!$.hasOwnProperty('ui')) {
$.ui = {};
}
$.ui.position = collisions;
})(jQuery);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings) {
drupalSettings.dialog = {
autoOpen: true,
dialogClass: '',
buttonClass: 'button',
buttonPrimaryClass: 'button--primary',
close: function close(event) {
Drupal.dialog(event.target).close();
Drupal.detachBehaviors(event.target, null, 'unload');
}
};
Drupal.dialog = function (element, options) {
var undef;
var $element = $(element);
var dialog = {
open: false,
returnValue: undef
};
function openDialog(settings) {
settings = $.extend({}, drupalSettings.dialog, options, settings);
$(window).trigger('dialog:beforecreate', [dialog, $element, settings]);
$element.dialog(settings);
dialog.open = true;
$(window).trigger('dialog:aftercreate', [dialog, $element, settings]);
}
function closeDialog(value) {
$(window).trigger('dialog:beforeclose', [dialog, $element]);
$element.dialog('close');
dialog.returnValue = value;
dialog.open = false;
$(window).trigger('dialog:afterclose', [dialog, $element]);
}
dialog.show = function () {
openDialog({
modal: false
});
};
dialog.showModal = function () {
openDialog({
modal: true
});
};
dialog.close = closeDialog;
return dialog;
};
})(jQuery, Drupal, drupalSettings);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal, drupalSettings, debounce, displace) {
drupalSettings.dialog = $.extend({
autoResize: true,
maxHeight: '95%'
}, drupalSettings.dialog);
function resetPosition(options) {
var offsets = displace.offsets;
var left = offsets.left - offsets.right;
var top = offsets.top - offsets.bottom;
var leftString = "".concat((left > 0 ? '+' : '-') + Math.abs(Math.round(left / 2)), "px");
var topString = "".concat((top > 0 ? '+' : '-') + Math.abs(Math.round(top / 2)), "px");
options.position = {
my: "center".concat(left !== 0 ? leftString : '', " center").concat(top !== 0 ? topString : ''),
of: window
};
return options;
}
function resetSize(event) {
var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position'];
var adjustedOptions = {};
var windowHeight = $(window).height();
var option;
var optionValue;
var adjustedValue;
for (var n = 0; n < positionOptions.length; n++) {
option = positionOptions[n];
optionValue = event.data.settings[option];
if (optionValue) {
if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) {
windowHeight -= displace.offsets.top + displace.offsets.bottom;
adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10);
if (option === 'height' && event.data.$element.parent().outerHeight() < adjustedValue) {
adjustedValue = 'auto';
}
adjustedOptions[option] = adjustedValue;
}
}
}
if (!event.data.settings.modal) {
adjustedOptions = resetPosition(adjustedOptions);
}
event.data.$element.dialog('option', adjustedOptions).trigger('dialogContentResize');
}
$(window).on({
'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) {
var autoResize = debounce(resetSize, 20);
var eventData = {
settings: settings,
$element: $element
};
if (settings.autoResize === true || settings.autoResize === 'true') {
$element.dialog('option', {
resizable: false,
draggable: false
}).dialog('widget').css('position', 'fixed');
$(window).on('resize.dialogResize scroll.dialogResize', eventData, autoResize).trigger('resize.dialogResize');
$(document).on('drupalViewportOffsetChange.dialogResize', eventData, autoResize);
}
},
'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) {
$(window).off('.dialogResize');
$(document).off('.dialogResize');
}
});
})(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, _ref) {
var tabbable = _ref.tabbable,
isTabbable = _ref.isTabbable;
$.widget('ui.dialog', $.ui.dialog, {
options: {
buttonClass: 'button',
buttonPrimaryClass: 'button--primary'
},
_createButtons: function _createButtons() {
var opts = this.options;
var primaryIndex;
var index;
var il = opts.buttons.length;
for (index = 0; index < il; index++) {
if (opts.buttons[index].primary && opts.buttons[index].primary === true) {
primaryIndex = index;
delete opts.buttons[index].primary;
break;
}
}
this._super();
var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass);
if (typeof primaryIndex !== 'undefined') {
$buttons.eq(index).addClass(opts.buttonPrimaryClass);
}
},
_focusTabbable: function _focusTabbable() {
var hasFocus = this._focusedElement ? this._focusedElement.get(0) : null;
if (!hasFocus) {
hasFocus = this.element.find('[autofocus]').get(0);
}
if (!hasFocus) {
var $elements = [this.element, this.uiDialogButtonPane];
for (var i = 0; i < $elements.length; i++) {
var element = $elements[i].get(0);
if (element) {
var elementTabbable = tabbable(element);
hasFocus = elementTabbable.length ? elementTabbable[0] : null;
}
if (hasFocus) {
break;
}
}
}
if (!hasFocus) {
var closeBtn = this.uiDialogTitlebarClose.get(0);
hasFocus = closeBtn && isTabbable(closeBtn) ? closeBtn : null;
}
if (!hasFocus) {
hasFocus = this.uiDialog.get(0);
}
$(hasFocus).eq(0).trigger('focus');
}
});
})(jQuery, window.tabbable);;
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function ($, Drupal) {
Drupal.behaviors.dialog = {
attach: function attach(context, settings) {
var $context = $(context);
if (!$('#drupal-modal').length) {
$('').hide().appendTo('body');
}
var $dialog = $context.closest('.ui-dialog-content');
if ($dialog.length) {
if ($dialog.dialog('option', 'drupalAutoButtons')) {
$dialog.trigger('dialogButtonsChange');
}
$dialog.dialog('widget').trigger('focus');
}
var originalClose = settings.dialog.close;
settings.dialog.close = function (event) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
originalClose.apply(settings.dialog, [event].concat(args));
$(event.target).remove();
};
},
prepareDialogButtons: function prepareDialogButtons($dialog) {
var buttons = [];
var $buttons = $dialog.find('.form-actions input[type=submit], .form-actions a.button');
$buttons.each(function () {
var $originalButton = $(this).css({
display: 'none'
});
buttons.push({
text: $originalButton.html() || $originalButton.attr('value'),
class: $originalButton.attr('class'),
click: function click(e) {
if ($originalButton.is('a')) {
$originalButton[0].click();
} else {
$originalButton.trigger('mousedown').trigger('mouseup').trigger('click');
e.preventDefault();
}
}
});
});
return buttons;
}
};
Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) {
if (!response.selector) {
return false;
}
var $dialog = $(response.selector);
if (!$dialog.length) {
$dialog = $("")).appendTo('body');
}
if (!ajax.wrapper) {
ajax.wrapper = $dialog.attr('id');
}
response.command = 'insert';
response.method = 'html';
ajax.commands.insert(ajax, response, status);
if (!response.dialogOptions.buttons) {
response.dialogOptions.drupalAutoButtons = true;
response.dialogOptions.buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
}
$dialog.on('dialogButtonsChange', function () {
var buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog);
$dialog.dialog('option', 'buttons', buttons);
});
response.dialogOptions = response.dialogOptions || {};
var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions);
if (response.dialogOptions.modal) {
dialog.showModal();
} else {
dialog.show();
}
$dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions');
};
Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
var $dialog = $(response.selector);
if ($dialog.length) {
Drupal.dialog($dialog.get(0)).close();
if (!response.persist) {
$dialog.remove();
}
}
$dialog.off('dialogButtonsChange');
};
Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) {
var $dialog = $(response.selector);
if ($dialog.length) {
$dialog.dialog('option', response.optionName, response.optionValue);
}
};
$(window).on('dialog:aftercreate', function (e, dialog, $element, settings) {
$element.on('click.dialog', '.dialog-cancel', function (e) {
dialog.close('cancel');
e.preventDefault();
e.stopPropagation();
});
});
$(window).on('dialog:beforeclose', function (e, dialog, $element) {
$element.off('.dialog');
});
})(jQuery, Drupal);;
/**
* @file
* JavaScript behaviors to fix jQuery UI dialogs.
*/
(function ($, Drupal) {
'use strict';
/**
* Ensure that ckeditor has focus when displayed inside of jquery-ui dialog widget
*
* @see http://stackoverflow.com/questions/20533487/how-to-ensure-that-ckeditor-has-focus-when-displayed-inside-of-jquery-ui-dialog
*/
if ($.ui && $.ui.dialog && $.ui.dialog.prototype._allowInteraction) {
var _allowInteraction = $.ui.dialog.prototype._allowInteraction;
$.ui.dialog.prototype._allowInteraction = function (event) {
if ($(event.target).closest('.cke_dialog').length) {
return true;
}
return _allowInteraction.apply(this, arguments);
};
}
/**
* Attaches webform dialog behaviors.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches event listeners for webform dialogs.
*/
Drupal.behaviors.webformDialogEvents = {
attach: function () {
$(window).once('webform-dialog').on({
'dialog:aftercreate': function (event, dialog, $element, settings) {
setTimeout(function () {
var hasFocus = $element.find('[autofocus]:tabbable');
if (!hasFocus.length) {
// Move focus to first input which is not a button.
hasFocus = $element.find(':input:tabbable:not(:button)');
}
if (!hasFocus.length) {
// Move focus to close dialog button.
hasFocus = $element.parent().find('.ui-dialog-titlebar-close');
}
hasFocus.eq(0).trigger('focus');
});
}
});
}
};
})(jQuery, Drupal);
;
/**
* @file
* JavaScript behaviors for webform dialogs.
*/
(function ($, Drupal, drupalSettings) {
'use strict';
// @see http://api.jqueryui.com/dialog/
Drupal.webform = Drupal.webform || {};
Drupal.webform.dialog = Drupal.webform.dialog || {};
Drupal.webform.dialog.options = Drupal.webform.dialog.options || {};
/**
* Programmatically open a webform (or page) in a dialog.
*
* @param {string} url
* Webform URL.
* @param {string} type
* Webform dialog type defined via /admin/structure/webform/config.
*/
Drupal.webformOpenDialog = function (url, type) {
// Create a div with link but don't attach it to the page.
var $div = $('');
// Init the webform dialog behavior.
Drupal.behaviors.webformDialog.attach($div);
// Trigger the link.
$div.find('a').trigger('click');
};
/**
* Open webform dialog using preset options.
*
* @type {Drupal~behavior}
*/
Drupal.behaviors.webformDialog = {
attach: function (context) {
$('a.webform-dialog', context).once('webform-dialog').each(function () {
var $a = $(this);
// Get default options.
var options = $.extend({}, Drupal.webform.dialog.options);
// Get preset dialog options.
if ($a.attr('class').match(/webform-dialog-([a-z0-9_]+)/)) {
var dialogOptionsName = RegExp.$1;
if (drupalSettings.webform.dialog.options[dialogOptionsName]) {
options = drupalSettings.webform.dialog.options[dialogOptionsName];
// Unset title.
delete options.title;
}
}
// Get custom dialog options.
if ($(this).data('dialog-options')) {
$.extend(options, $(this).data('dialog-options'));
}
var href = $a.attr('href');
// Replace ENTITY_TYPE and ENTITY_ID placeholders and update the href.
// @see webform_page_attachments()
if (href.indexOf('?source_entity_type=ENTITY_TYPE&source_entity_id=ENTITY_ID') !== -1) {
if (drupalSettings.webform.dialog.entity_type && drupalSettings.webform.dialog.entity_id) {
href = href.replace('ENTITY_TYPE', encodeURIComponent(drupalSettings.webform.dialog.entity_type));
href = href.replace('ENTITY_ID', encodeURIComponent(drupalSettings.webform.dialog.entity_id));
}
else {
href = href.replace('?source_entity_type=ENTITY_TYPE&source_entity_id=ENTITY_ID', '');
}
$a.attr('href', href);
}
// Append _webform_dialog=1 to href to trigger Ajax support.
// @see \Drupal\webform\WebformSubmissionForm::setEntity
href += (href.indexOf('?') === -1 ? '?' : '&') + '_webform_dialog=1';
var element_settings = {};
element_settings.progress = {type: 'fullscreen'};
element_settings.url = href;
element_settings.event = 'click';
element_settings.dialogType = $a.data('dialog-type') || 'modal';
element_settings.dialog = options;
element_settings.element = this;
element_settings.error = function error(xmlhttp, uri) {
if (xmlhttp.status === 403) {
window.location.replace(href.split('?')[0]);
}
};
Drupal.ajax(element_settings);
});
}
};
})(jQuery, Drupal, drupalSettings);
;
/*! js-cookie v3.0.0-rc.0 | MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var r=e.Cookies,n=e.Cookies=t();n.noConflict=function(){return e.Cookies=r,n}}())}(this,function(){"use strict";function e(e){for(var t=1;t