PageSourceSearch

https://www.thebrain.info/sites/default/files/js/js_vg_YVISgNfYzCTHOB4uicNwuQvWHsqJNaqpR5zENmC0.js

js thebrain.info collected 2026-10-06 13:45:15 UTC 56,214 bytes, 1,053 lines download raw bytes

1(function () {
2  'use strict';
3
4  var ANALYTICS_COOKIE = 'eu_analytics_consent';
5  var YOUTUBE_COOKIE = 'eu_youtube_consent';
6  var MAPS_COOKIE = 'eu_maps_consent';
7
8  function getCookie(name) {
9    var re = new RegExp('(?:^|; )' + name.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1') + '=([^;]*)');
10    var m = document.cookie.match(re);
11    return m ? decodeURIComponent(m[1]) : undefined;
12  }
13
14  function setCookie(name, value, days, domain, path) {
15    var expires = new Date();
16    expires.setDate(expires.getDate() + (days || 365));
17    var parts = [
18      name + '=' + encodeURIComponent(value),
19      'expires=' + expires.toUTCString(),
20      'path=' + (path || '/'),
21      'SameSite=Lax'
22    ];
23    if (domain) parts.push('domain=' + domain);
24    document.cookie = parts.join('; ');
25  }
26
27  // Actively delete any existing GA cookies from the browser.
28  // Tries all plausible domain variants because the cookies could have been
29  // set by analytics.js using 'auto' (→ .dasgehirn.info) or without a domain
30  // option (→ exact hostname).
31  function deleteGACookies() {
32    var expired = 'Thu, 01 Jan 1970 00:00:00 GMT';
33    var hostname = window.location.hostname;
34    var domains = [hostname, '.' + hostname];
35    var parts = hostname.split('.');
36    if (parts.length > 2) {
37      domains.push('.' + parts.slice(-2).join('.'));
38    }
39    var names = [];
40    document.cookie.split(';').forEach(function (pair) {
41      var n = pair.split('=')[0].trim();
42      if (n === '_ga' || n === '_gid' || n === '_gat' || n.indexOf('_ga_') === 0 || n.indexOf('_gat_') === 0) {
43        names.push(n);
44      }
45    });
46    names.forEach(function (n) {
47      document.cookie = n + '=; expires=' + expired + '; path=/';
48      domains.forEach(function (d) {
49        document.cookie = n + '=; expires=' + expired + '; path=/; domain=' + d;
50      });
51    });
52  }
53
54  function loadGTM(gtmId) {
55    window.dataLayer = window.dataLayer || [];
56    // Update Consent Mode v2 to 'granted' before the GTM script loads so all
57    // tags configured in GTM fire with the correct consent state.
58    if (window.gtag) {
59      window.gtag('consent', 'update', { 'analytics_storage': 'granted' });
60    }
61    window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
62    var s = document.createElement('script');
63    s.async = true;
64    s.src = 'https://www.googletagmanager.com/gtm.js?id=' + encodeURIComponent(gtmId);
65    document.head.appendChild(s);
66  }
67
68  function loadGA4(measurementId) {
69    var s = document.createElement('script');
70    s.async = true;
71    s.src = 'https://www.googletagmanager.com/gtag/js?id=' + encodeURIComponent(measurementId);
72    document.head.appendChild(s);
73    window.dataLayer = window.dataLayer || [];
74    window.gtag = function () { window.dataLayer.push(arguments); };
75    window.gtag('js', new Date());
76    window.gtag('config', measurementId);
77  }
78
79  // Expose so other components (e.g. ExternalVideo) can trigger tracking
80  // after obtaining per-element consent without reloading the page.
81  window.loadGTM = loadGTM;
82  window.loadGA4 = loadGA4;
83
84  function fireTracking(settings) {
85    if (settings.gtm_id) {
86      loadGTM(settings.gtm_id);
87    } else if (settings.ga4_id) {
88      loadGA4(settings.ga4_id);
89    }
90  }
91
92  function getSettings() {
93    return (window.drupalSettings && window.drupalSettings.eu_cookie) || {};
94  }
95
96  function saveConsentCookies(analytics, youtube, maps) {
97    var s = getSettings();
98    var days = s.expiry || 365;
99    var domain = s.domain || null;
100    var path = s.path || '/';
101    setCookie(ANALYTICS_COOKIE, analytics ? 'yes' : 'no', days, domain, path);
102    setCookie(YOUTUBE_COOKIE, youtube ? 'yes' : 'no', days, domain, path);
103    setCookie(MAPS_COOKIE, maps ? 'yes' : 'no', days, domain, path);
104  }
105
106  function removeBanner(el) {
107    if (el && el.parentNode) el.parentNode.removeChild(el);
108  }
109
110  function getToggleState(banner, category) {
111    var input = banner.querySelector('[data-cc-category="' + category + '"]');
112    return input ? input.checked : false;
113  }
114
115  function prePopulateToggles(banner) {
116    var analyticsInput = banner.querySelector('[data-cc-category="analytics"]');
117    var youtubeInput = banner.querySelector('[data-cc-category="youtube"]');
118    var mapsInput = banner.querySelector('[data-cc-category="maps"]');
119    if (analyticsInput) analyticsInput.checked = getCookie(ANALYTICS_COOKIE) === 'yes';
120    if (youtubeInput) youtubeInput.checked = getCookie(YOUTUBE_COOKIE) === 'yes';
121    if (mapsInput) mapsInput.checked = getCookie(MAPS_COOKIE) === 'yes';
122  }
123
124  function attachEvents(banner, settings) {
125    var els = banner.querySelectorAll('[data-cc-event]');
126    for (var i = 0; i < els.length; i++) {
127      (function (el) {
128        var attr = el.getAttribute('data-cc-event');
129        var evtParts = attr.split(':');
130        if (evtParts[0] !== 'click') return;
131        el.addEventListener('click', function (e) {
132          e.preventDefault();
133          var action = evtParts[1];
134
135          if (action === 'accept' || action === 'dismiss') {
136            saveConsentCookies(true, true, true);
137            removeBanner(banner);
138            fireTracking(settings);
139            if (window.initPendingMaps) window.initPendingMaps();
140
141          } else if (action === 'decline') {
142            if (window.gtag) {
143              window.gtag('consent', 'update', { 'analytics_storage': 'denied' });
144            }
145            saveConsentCookies(false, false, false);
146            deleteGACookies();
147            removeBanner(banner);
148
149          } else if (action === 'toggle-details') {
150            var layer2 = banner.querySelector('.cc-layer-2');
151            if (!layer2) return;
152            var isOpen = layer2.style.display !== 'none';
153            layer2.style.display = isOpen ? 'none' : 'flex';
154            banner.classList.toggle('cc-details-visible', !isOpen);
155            if (!isOpen) prePopulateToggles(banner);
156
157          } else if (action === 'save') {
158            var analytics = getToggleState(banner, 'analytics');
159            var youtube = getToggleState(banner, 'youtube');
160            var maps = getToggleState(banner, 'maps');
161            if (window.gtag) {
162              window.gtag('consent', 'update', {
163                'analytics_storage': analytics ? 'granted' : 'denied'
164              });
165            }
166            saveConsentCookies(analytics, youtube, maps);
167            if (!analytics) deleteGACookies();
168            if (analytics) fireTracking(settings);
169            if (maps && window.initPendingMaps) window.initPendingMaps();
170            removeBanner(banner);
171          }
172        });
173      })(els[i]);
174    }
175  }
176
177  function showBanner(settings) {
178    var wrapper = document.createElement('div');
179    wrapper.innerHTML = settings.markup || '';
180    var banner = wrapper.firstElementChild;
181    if (!banner) return;
182
183    attachEvents(banner, settings);
184
185    if (document.body.firstChild) {
186      document.body.insertBefore(banner, document.body.firstChild);
187    } else {
188      document.body.appendChild(banner);
189    }
190  }
191
192  function init() {
193    var consent = getCookie(ANALYTICS_COOKIE);
194    var settings = getSettings();
195
196    if (consent === 'yes') {
197      fireTracking(settings);
198      return;
199    }
200
201    // No consent or explicit refusal: purge any GA cookies that may have been
202    // set in the past (before this consent system was in place).
203    deleteGACookies();
204
205    if (consent === 'no') {
206      return;
207    }
208
209    // No decision yet — show the banner.
210    if (document.readyState === 'loading') {
211      document.addEventListener('DOMContentLoaded', function () { showBanner(settings); });
212    } else {
213      showBanner(settings);
214    }
215  }
216
217  init();
218})();
219;
220!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=function(){function e(){var e=this,n=function(){var n=["br-wrapper"];""!==e.options.theme&&n.push("br-theme-"+e.options.theme),e.$elem.wrap(t("<div />",{"class":n.join(" ")}))},i=function(){e.$elem.unwrap()},a=function(n){return t.isNumeric(n)&&(n=Math.floor(n)),t('option[value="'+n+'"]',e.$elem)},r=function(){var n=e.options.initialRating;return n?a(n):t("option:selected",e.$elem)},o=function(){var n=e.$elem.find('option[value="'+e.options.emptyValue+'"]');return!n.length&&e.options.allowEmpty?(n=t("<option />",{value:e.options.emptyValue}),n.prependTo(e.$elem)):n},l=function(t){var n=e.$elem.data("barrating");return"undefined"!=typeof t?n[t]:n},s=function(t,n){null!==n&&"object"==typeof n?e.$elem.data("barrating",n):e.$elem.data("barrating")[t]=n},u=function(){var t=r(),n=o(),i=t.val(),a=t.data("html")?t.data("html"):t.text(),l=null!==e.options.allowEmpty?e.options.allowEmpty:!!n.length,u=n.length?n.val():null,d=n.length?n.text():null;
vendor: 3,377 bytes, line 220
220s(null,{userOptions:e.options,ratingValue:i,ratingText:a,originalRatingValue:i,originalRatingText:a,allowEmpty:l,emptyRatingValue:u,emptyRatingText:d,readOnly:e.options.readonly,ratingMade:!1})},d=function(){e.$elem.removeData("barrating")},c=function(){return l("ratingText")},f=function(){return l("ratingValue")},g=function(){var n=t("<div />",{"class":"br-widget"});return e.$elem.find("option").each(function(){var i,a,r,o;i=t(this).val(),i!==l("emptyRatingValue")&&(a=t(this).text(),r=t(this).data("html"),r&&(a=r),o=t("<a />",{href:"#","data-rating-value":i,"data-rating-text":a,html:e.options.showValues?a:""}),n.append(o))}),e.options.showSelectedRating&&n.append(t("<div />",{text:"","class":"br-current-rating"})),e.options.reverse&&n.addClass("br-reverse"),e.options.readonly&&n.addClass("br-readonly"),n},p=function(){return l("userOptions").reverse?"nextAll":"prevAll"},h=function(t){a(t).prop("selected",!0),e.$elem.change()},m=function(){t("option",e.$elem).prop("selected",function(){return this.defaultSelected}),e.$elem.change()},v=function(t){t=t?t:c(),t==l("emptyRatingText")&&(t=""),e.options.showSelectedRating&&e.$elem.parent().find(".br-current-rating").text(t)},y=function(t){return Math.round(Math.floor(10*t)/10%1*100)},b=function(){e.$widget.find("a").removeClass(function(t,e){return(e.match(/(^|\s)br-\S+/g)||[]).join(" ")})},w=function(){var n,i,a=e.$widget.find('a[data-rating-value="'+f()+'"]'),r=l("userOptions").initialRating,o=t.isNumeric(f())?f():0,s=y(r);if(b(),a.addClass("br-selected br-current")[p()]().addClass("br-selected"),!l("ratingMade")&&t.isNumeric(r)){if(o>=r||!s)return;n=e.$widget.find("a"),i=a.length?a[l("userOptions").reverse?"prev":"next"]():n[l("userOptions").reverse?"last":"first"](),i.addClass("br-fractional"),i.addClass("br-fractional-"+s)}},$=function(t){return l("allowEmpty")&&l("userOptions").deselectable?f()==t.attr("data-rating-value"):!1},x=function(n){n.on("click.barrating",function(n){var i,a,r=t(this),o=l("userOptions");return n.preventDefault(),i=r.attr("data-rating-value"),a=r.attr("data-rating-text"),$(r)&&(i=l("emptyRatingValue"),a=l("emptyRatingText")),s("ratingValue",i),s("ratingText",a),s("ratingMade",!0),h(i),v(a),w(),o.onSelect.call(e,f(),c(),n),!1})},R=function(e){e.on("mouseenter.barrating",function(){var e=t(this);b(),e.addClass("br-active")[p()]().addClass("br-active"),v(e.attr("data-rating-text"))})},V=function(t){e.$widget.on("mouseleave.barrating blur.barrating",function(){v(),w()})},O=function(e){e.on("touchstart.barrating",function(e){e.preventDefault(),e.stopPropagation(),t(this).click()})},C=function(t){t.on("click.barrating",function(t){t.preventDefault()})},S=function(t){x(t),e.options.hoverState&&(R(t),V(t))},T=function(t){t.off(".barrating")},j=function(t){var n=e.$widget.find("a");O&&O(n),t?(T(n),C(n)):S(n)};this.show=function(){l()||(n(),u(),e.$widget=g(),e.$widget.insertAfter(e.$elem),w(),v(),j(e.options.readonly),e.$elem.hide())},this.readonly=function(t){"boolean"==typeof t&&l("readOnly")!=t&&(j(t),s("readOnly",t),e.$widget.toggleClass("br-readonly"))},this.set=function(t){var n=l("userOptions");0!==e.$elem.find('option[value="'+t+'"]').length&&(s("ratingValue",t),s("ratingText",e.$elem.find('option[value="'+t+'"]').text()),s("ratingMade",!0),h(f()),v(c()),w(),n.silent||n.onSelect.call(this,f(),c()))},this.clear=function(){var t=l("userOptions");
220s("ratingValue",l("originalRatingValue")),s("ratingText",l("originalRatingText")),s("ratingMade",!1),m(),v(c()),w(),t.onClear.call(this,f(),c())},this.destroy=function(){var t=f(),n=c(),a=l("userOptions");T(e.$widget.find("a")),e.$widget.remove(),d(),i(),e.$elem.show(),a.onDestroy.call(this,t,n)}}return e.prototype.init=function(e,n){return this.$elem=t(n),this.options=t.extend({},t.fn.barrating.defaults,e),this.options},e}();t.fn.barrating=function(n,i){return this.each(function(){var a=new e;if(t(this).is("select")||t.error("Sorry, this plugin only works with select fields."),a.hasOwnProperty(n)){if(a.init(i,this),"show"===n)return a.show(i);if(a.$elem.data("barrating"))return a.$widget=t(this).next(".br-widget"),a[n](i)}else{if("object"==typeof n||!n)return i=n,a.init(i,this),a.show();t.error("Method "+n+" does not exist on jQuery.barrating")}})},t.fn.barrating.defaults={theme:"",initialRating:null,allowEmpty:null,emptyValue:"",showValues:!1,showSelectedRating:!0,deselectable:!0,reverse:!1,readonly:!1,fastClicks:!0,hoverState:!0,silent:!1,onSelect:function(t,e,n){},onClear:function(t,e){},onDestroy:function(t,e){}},t.fn.barrating.BarRating=e});
221
222/**
223 * @file
224 * Attaches fivestar rating.
225 */
226
227(function ($, Drupal) {
228  Drupal.behaviors.fiveStarRating = {
229    attach: function (context, settings) {
230     $('body').find('.fivestar').each(function () {
231      var $this = $(this);
232      var $select = $this.find('select');
233      var value = Math.round($select.data('result-value'));
234      var vote_own_value = $select.data('vote-value');
235      var isEdit = $select.data('is-edit');
236      var show_own_vote = $select.data('show-own-vote');
237      if (isEdit) {
238        value = $select.val();
239      }
240      if (!value) {
241        value = -1;
242      }
243      var options = {
244        theme: ($select.data('style') == 'default') ? 'css-stars' : $select.data('style'),
245        initialRating: show_own_vote ? (vote_own_value ? vote_own_value : -1) : value,
246        allowEmpty: true,
247        emptyValue: '',
248        readonly: ($select.attr('disabled')) ? true : false,
249        onSelect: function (value, text) {
250          if (isEdit) {
251            return;
252          }
253          $this.find('select').barrating('readonly', true);
254          $this.find('[type=submit]').trigger('click');
255          $this.find('a').addClass('disabled');
256          $this.find('.vote-result').html();
257        },
258      };
259
260      $this.find('select').once('processed').barrating('show', options);
261      $this.find('[type=submit]').hide();
262    });
263    }
264  };
265})(jQuery, Drupal);
266;
267/*!
268 * jQuery Form Plugin
269 * version: 4.2.2
270 * Requires jQuery v1.7.2 or later
271 * Project repository: https://github.com/jquery-form/form
272
273 * Copyright 2017 Kevin Morris
274 * Copyright 2006 M. Alsup
275
276 * Dual licensed under the LGPL-2.1+ or MIT licenses
277 * https://github.com/jquery-form/form#license
278
279 * This library is free software; you can redistribute it and/or
280 * modify it under the terms of the GNU Lesser General Public
281 * License as published by the Free Software Foundation; either
282 * version 2.1 of the License, or (at your option) any later version.
283 * This library is distributed in the hope that it will be useful,
284 * but WITHOUT ANY WARRANTY; without even the implied warranty of
285 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
286 * Lesser General Public License for more details.
287 */
288!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,r){return void 0===r&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(r),r}:e(jQuery)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).closest("form").ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=r.form;if(i.clk=r,"image"===r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n=/\r?\n/g,i={};i.fileapi=void 0!==e('<input type="file">').get(0).files,i.formdata=void 0!==window.FormData;var o=!!e.fn.prop;e.fn.attr2=function(){if(!o)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t,r,n,s){function u(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;a<o;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function c(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(e){a("cannot get iframe.contentWindow document: "+e)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function i(){function t(){try{var e=n(v).readyState;a("state = "+e),e&&"uninitialized"===e.toLowerCase()&&setTimeout(t,50)}catch(e){a("Server abort: ",e," (",e.name,")"),s(L),j&&clearTimeout(j),j=void 0}}
vendor: 4,531 bytes, line 288
288var r=p.attr2("target"),i=p.attr2("action"),o=p.attr("enctype")||p.attr("encoding")||"multipart/form-data";w.setAttribute("target",m),l&&!/post/i.test(l)||w.setAttribute("method","POST"),i!==f.url&&w.setAttribute("action",f.url),f.skipEncodingOverride||l&&!/post/i.test(l)||p.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),f.timeout&&(j=setTimeout(function(){T=!0,s(A)},f.timeout));var u=[];try{if(f.extraData)for(var c in f.extraData)f.extraData.hasOwnProperty(c)&&(e.isPlainObject(f.extraData[c])&&f.extraData[c].hasOwnProperty("name")&&f.extraData[c].hasOwnProperty("value")?u.push(e('<input type="hidden" name="'+f.extraData[c].name+'">',k).val(f.extraData[c].value).appendTo(w)[0]):u.push(e('<input type="hidden" name="'+c+'">',k).val(f.extraData[c]).appendTo(w)[0]));f.iframeTarget||h.appendTo(D),v.attachEvent?v.attachEvent("onload",s):v.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(e){document.createElement("form").submit.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",o),r?w.setAttribute("target",r):p.removeAttr("target"),e(u).remove()}}function s(t){if(!x.aborted&&!X){if((O=n(v))||(a("cannot access response document"),t=L),t===A&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t===L&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(O&&O.location.href!==f.iframeSrc||T){v.detachEvent?v.detachEvent("onload",s):v.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"===f.dataType||O.XMLDocument||e.isXMLDoc(O);if(a("isXml="+o),!o&&window.opera&&(null===O.body||!O.body.innerHTML)&&--C)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=O.body?O.body:O.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=O.XMLDocument?O.XMLDocument:O,o&&(f.dataType="xml"),x.getResponseHeader=function(e){return{"content-type":f.dataType}[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(f.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||f.textarea){var p=O.getElementsByTagName("textarea")[0];if(p)x.responseText=p.value,x.status=Number(p.getAttribute("status"))||x.status,x.statusText=p.getAttribute("statusText")||x.statusText;else if(l){var m=O.getElementsByTagName("pre")[0],g=O.getElementsByTagName("body")[0];m?x.responseText=m.textContent?m.textContent:m.innerText:g&&(x.responseText=g.textContent?g.textContent:g.innerText)}}else"xml"===c&&!x.responseXML&&x.responseText&&(x.responseXML=q(x.responseText));try{M=N(x,c,f)}catch(e){i="parsererror",x.error=r=e||i}}catch(e){a("error caught: ",e),i="error",x.error=r=e||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(f.success&&f.success.call(f.context,M,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,f])):i&&(void 0===r&&(r=x.statusText),f.error&&f.error.call(f.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,f,r])),d&&e.event.trigger("ajaxComplete",[x,f]),d&&!--e.active&&e.event.trigger("ajaxStop"),f.complete&&f.complete.call(f.context,x,i),X=!0,f.timeout&&clearTimeout(j),setTimeout(function(){f.iframeTarget?h.attr("src",f.iframeSrc):h.remove(),x.responseXML=null},100)}}}var u,c,f,d,m,h,v,x,y,b,T,j,w=p[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(c=0;c<g.length;c++)u=e(g[c]),o?u.prop("disabled",!1):u.removeAttr("disabled");(f=e.extend(!0,{},e.ajaxSettings,t)).context=f.context||f,m="jqFormIO"+(new Date).getTime();var k=w.ownerDocument,D=p.closest("body");if(f.iframeTarget?(b=(h=e(f.iframeTarget,k)).attr2("name"))?m=b:h.attr2("name",m):(h=e('<iframe name="'+m+'" src="'+f.iframeSrc+'" />',k)).css({position:"absolute",top:"-1000px",left:"-1000px"}),v=h[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(e){}h.attr("src",f.iframeSrc),x.error=r,f.error&&f.error.call(f.context,x,r,t),d&&e.event.trigger("ajaxError",[x,f,r]),f.complete&&f.complete.call(f.context,x,r)}},(d=f.global)&&0==e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,f]),f.beforeSend&&!1===f.beforeSend.c
288all(f.context,x,f))return f.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;(y=w.clk)&&(b=y.name)&&!y.disabled&&(f.extraData=f.extraData||{},f.extraData[b]=y.value,"image"===y.type&&(f.extraData[b+".x"]=w.clk_x,f.extraData[b+".y"]=w.clk_y));var A=1,L=2,F=e("meta[name=csrf-token]").attr("content"),E=e("meta[name=csrf-param]").attr("content");E&&F&&(f.extraData=f.extraData||{},f.extraData[E]=F),f.forceSync?i():setTimeout(i,10);var M,O,X,C=50,q=e.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},_=e.parseJSON||function(e){return window.eval("("+e+")")},N=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i=("xml"===r||!r)&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&(("json"===r||!r)&&n.indexOf("json")>=0?o=_(o):("script"===r||!r)&&n.indexOf("javascript")>=0&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var l,f,d,p=this;"function"==typeof t?t={success:t}
288:"string"==typeof t||!1===t&&arguments.length>0?(t={url:t,data:r,dataType:n},"function"==typeof s&&(t.success=s)):void 0===t&&(t={}),l=t.method||t.type||this.attr2("method"),(d=(d="string"==typeof(f=t.url||this.attr2("action"))?e.trim(f):"")||window.location.href||"")&&(d=(d.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:d,success:e.ajaxSettings.success,type:l||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&!1===t.beforeSerialize(this,t))return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var h=t.traditional;void 0===h&&(h=e.ajaxSettings.traditional);var v,g=[],x=this.formToArray(t.semantic,g,t.filtering);if(t.data){var y=e.isFunction(t.data)?t.data(x):t.data;t.extraData=y,v=e.param(y,h)}if(t.beforeSubmit&&!1===t.beforeSubmit(x,this,t))return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[x,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var b=e.param(x,h);v&&(b=b?b+"&"+v:v),"GET"===t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+b,t.data=null):t.data=b;var T=[];
288if(t.resetForm&&T.push(function(){p.resetForm()}),t.clearForm&&T.push(function(){p.clearForm(t.includeHidden)}),!t.dataType&&t.target){var j=t.success||function(){};T.push(function(r,a,n){var i=arguments,o=t.replaceTarget?"replaceWith":"html";e(t.target)[o](r).each(function(){j.apply(this,i)})})}else t.success&&(e.isArray(t.success)?e.merge(T,t.success):T.push(t.success));if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=T.length;i<o;i++)T[i].apply(n,[e,r,a||p,p])},t.error){var w=t.error;t.error=function(e,r,a){var n=t.context||this;w.apply(n,[e,r,a,p])}}if(t.complete){var S=t.complete;t.complete=function(e,r){var a=t.context||this;S.apply(a,[e,r,p])}}var k=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}).length>0,D="multipart/form-data",A=p.attr("enctype")===D||p.attr("encoding")===D,L=i.fileapi&&i.formdata;a("fileAPI :"+L);var F,E=(k||A)&&!L;!1!==t.iframe&&(t.iframe||E)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){F=c(x)}):F=c(x):F=(k||A)&&L?function(r){for(var a=new FormData,n=0;n<r.length;n++)a.append(r[n].name,r[n].value);if(t.extraData){var i=u(t.extraData);for(n=0;n<i.length;n++)i[n]&&a.append(i[n][0],i[n][1])}t.data=null;var o=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});t.uploadProgress&&(o.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(a/n*100)),t.uploadProgress(e,a,n,r)},!1),r}),o.data=null;var s=o.beforeSend;return o.beforeSend=function(e,r){t.formData?r.data=t.formData:r.data=a,s&&s.call(this,e,r)},e.ajax(o)}(x):e.ajax(t),p.removeData("jqxhr").data("jqxhr",F);for(var M=0;M<g.length;M++)g[M]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n,i,o,s){if(("string"==typeof n||!1===n&&arguments.length>0)&&(n={url:n,data:i,dataType:o},"function"==typeof s&&(n.success=s)),n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var u={s:this.selector,c:this.context};return!e.isReady&&u.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(u.s,u.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().on("submit.form-plugin",n,t).on("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r,a){var n=[];if(0===this.length)return n;var o,s=this[0],u=this.attr("id"),c=t||void 0===s.elements?s.getElementsByTagName("*"):s.elements;if(c&&(c=e.makeArray(c)),u&&(t||/(Edge|Trident)\//.test(navigator.userAgent))&&(o=e(':input[form="'+u+'"]').get()).length&&(c=(c||[]).concat(o)),!c||!c.length)return n;e.isFunction(a)&&(c=e.map(c,a));var l,f,d,p,m,h,v;for(l=0,h=c.length;l<h;l++)if(m=c[l],(d=m.name)&&!m.disabled)if(t&&s.clk&&"image"===m.type)s.clk===m&&(n.push({name:d,value:e(m).val(),type:m.type}),n.push({name:d+".x",value:s.clk_x},{name:d+".y",value:s.clk_y}));else if((p=e.fieldValue(m,!0))&&p.constructor===Array)for(r&&r.push(m),f=0,v=p.length;f<v;f++)n.push({name:d,value:p[f]});else if(i.fileapi&&"file"===m.type){r&&r.push(m);var g=m.files;if(g.length)for(f=0;f<g.length;f++)n.push({name:d,value:g[f],type:m.type});else n.push({name:d,value:"",type:m.type})}else null!==p&&void 0!==p&&(r&&r.push(m),n.push({name:d,value:p,type:m.type,required:m.required}));if(!t&&s.clk){var x=e(s.clk),y=x[0];(d=y.name)&&!y.disabled&&"image"===y.type&&(n.push({name:d,value:x.val()}),n.push({name:d+".x",value:s.clk_x},{name:d+".y",value:s.clk_y}))}return n},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor===Array)for(var i=0,o=n.length;i<o;i++)r.push({name:a,value:n[i]});else null!==n&&void 0!==n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;a<n;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor===Array&&!o.length||(o.constructor===Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,i=t.type,o=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"===i||"button"===i||("checkbox"===i||"radio"===i)&&!t.checked||("submit"===i||"image"===i)&&t.form&&t.form.clk!==t||"select"===o&&-1===t.selectedIndex))return null;if("select"===o){var s=t.selectedIndex;if(s<0)return null;for(var u=[],c=t.options,l="select-one"===i,f=l?s+1:c.length,d=l?s:0;d<f;d++){var p=c[d];if(p.selected&&!p.disabled){var m=p.value;if(m||(m=p.attributes&&p.attributes.value&&!p.attributes.value.specified?p.text:p.value),l)return m;u.push(m)}}return u}return e(t).val().replace(n,"\r\n")},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"===n?this.value="":"checkbox"===a||"radio"===a?this.checked=!1:"select"===n?this.selectedIndex=-1:"file"===a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(!0===t&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")}
288)},e.fn.resetForm=function(){return this.each(function(){var t=e(this),r=this.tagName.toLowerCase();switch(r){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var a=t.parents("select");return a.length&&a[0].multiple?"option"===r?this.selected=this.defaultSelected:t.find("option").resetForm():a.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var n=e(t.attr("for")),i=t.find("input,select,textarea");return n[0]&&i.unshift(n[0]),i.resetForm(),!0;case"form":return("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"===r||"radio"===r)this.checked=t;else if("option"===this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"===a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1});
289
290;
291/**
292* DO NOT EDIT THIS FILE.
293* See the following change record for more information,
294* https://www.drupal.org/node/2815083
295* @preserve
296**/
297
298(function ($, Drupal) {
299  Drupal.theme.progressBar = function (id) {
300    return '<div id="' + id + '" class="progress" aria-live="polite">' + '<div class="progress__label">&nbsp;</div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description">&nbsp;</div>' + '</div>';
301  };
302
303  Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) {
304    this.id = id;
305    this.method = method || 'GET';
306    this.updateCallback = updateCallback;
307    this.errorCallback = errorCallback;
308
309    this.element = $(Drupal.theme('progressBar', id));
310  };
311
312  $.extend(Drupal.ProgressBar.prototype, {
313    setProgress: function setProgress(percentage, message, label) {
314      if (percentage >= 0 && percentage <= 100) {
315        $(this.element).find('div.progress__bar').css('width', percentage + '%');
316        $(this.element).find('div.progress__percentage').html(percentage + '%');
317      }
318      $('div.progress__description', this.element).html(message);
319      $('div.progress__label', this.element).html(label);
320      if (this.updateCallback) {
321        this.updateCallback(percentage, message, this);
322      }
323    },
324    startMonitoring: function startMonitoring(uri, delay) {
325      this.delay = delay;
326      this.uri = uri;
327      this.sendPing();
328    },
329    stopMonitoring: function stopMonitoring() {
330      clearTimeout(this.timer);
331
332      this.uri = null;
333    },
334    sendPing: function sendPing() {
335      if (this.timer) {
336        clearTimeout(this.timer);
337      }
338      if (this.uri) {
339        var pb = this;
340
341        var uri = this.uri;
342        if (uri.indexOf('?') === -1) {
343          uri += '?';
344        } else {
345          uri += '&';
346        }
347        uri += '_format=json';
348        $.ajax({
349          type: this.method,
350          url: uri,
351          data: '',
352          dataType: 'json',
353          success: function success(progress) {
354            if (progress.status === 0) {
355              pb.displayError(progress.data);
356              return;
357            }
358
359            pb.setProgress(progress.percentage, progress.message, progress.label);
360
361            pb.timer = setTimeout(function () {
362              pb.sendPing();
363            }, pb.delay);
364          },
365          error: function error(xmlhttp) {
366            var e = new Drupal.AjaxError(xmlhttp, pb.uri);
367            pb.displayError('<pre>' + e.message + '</pre>');
368          }
369        });
370      }
371    },
372    displayError: function displayError(string) {
373      var error = $('<div class="messages messages--error"></div>').html(string);
374      $(this.element).before(error).hide();
375
376      if (this.errorCallback) {
377        this.errorCallback(this);
378      }
379    }
380  });
381})(jQuery, Drupal);;
382/**
383* DO NOT EDIT THIS FILE.
384* See the following change record for more information,
385* https://www.drupal.org/node/2815083
386* @preserve
387**/
388
389(function (Drupal) {
390  Drupal.behaviors.responsiveImageAJAX = {
391    attach: function attach() {
392      if (window.picturefill) {
393        window.picturefill();
394      }
395    }
396  };
397})(Drupal);;
398/**
399* DO NOT EDIT THIS FILE.
400* See the following change record for more information,
401* https://www.drupal.org/node/2815083
402* @preserve
403**/
404function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
405
406(function ($, window, Drupal, drupalSettings) {
407  Drupal.behaviors.AJAX = {
408    attach: function attach(context, settings) {
409      function loadAjaxBehavior(base) {
410        var elementSettings = settings.ajax[base];
411        if (typeof elementSettings.selector === 'undefined') {
412          elementSettings.selector = '#' + base;
413        }
414        $(elementSettings.selector).once('drupal-ajax').each(function () {
415          elementSettings.element = this;
416          elementSettings.base = base;
417          Drupal.ajax(elementSettings);
418        });
419      }
420
421      Object.keys(settings.ajax || {}
421).forEach(function (base) {
422        return loadAjaxBehavior(base);
423      });
424
425      Drupal.ajax.bindAjaxLinks(document.body);
426
427      $('.use-ajax-submit').once('ajax').each(function () {
428        var elementSettings = {};
429
430        elementSettings.url = $(this.form).attr('action');
431
432        elementSettings.setClick = true;
433
434        elementSettings.event = 'click';
435
436        elementSettings.progress = { type: 'throbber' };
437        elementSettings.base = $(this).attr('id');
438        elementSettings.element = this;
439
440        Drupal.ajax(elementSettings);
441      });
442    },
443    detach: function detach(context, settings, trigger) {
444      if (trigger === 'unload') {
445        Drupal.ajax.expired().forEach(function (instance) {
446          Drupal.ajax.instances[instance.instanceIndex] = null;
447        });
448      }
449    }
450  };
451
452  Drupal.AjaxError = function (xmlhttp, uri, customMessage) {
453    var statusCode = void 0;
454    var statusText = void 0;
455    var responseText = void 0;
456    if (xmlhttp.status) {
457      statusCode = '\n' + Drupal.t('An AJAX HTTP error occurred.') + '\n' + Drupal.t('HTTP Result Code: !status', {
458        '!status': xmlhttp.status
459      });
460    } else {
461      statusCode = '\n' + Drupal.t('An AJAX HTTP request terminated abnormally.');
462    }
463    statusCode += '\n' + Drupal.t('Debugging information follows.');
464    var pathText = '\n' + Drupal.t('Path: !uri', { '!uri': uri });
465    statusText = '';
466
467    try {
468      statusText = '\n' + Drupal.t('StatusText: !statusText', {
469        '!statusText': $.trim(xmlhttp.statusText)
470      });
471    } catch (e) {}
472
473    responseText = '';
474
475    try {
476      responseText = '\n' + Drupal.t('ResponseText: !responseText', {
477        '!responseText': $.trim(xmlhttp.responseText)
478      });
479    } catch (e) {}
480
481    responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, '');
482    responseText = responseText.replace(/[\n]+\s+/g, '\n');
483
484    var readyStateText = xmlhttp.status === 0 ? '\n' + Drupal.t('ReadyState: !readyState', {
485      '!readyState': xmlhttp.readyState
486    }) : '';
487
488    customMessage = customMessage ? '\n' + Drupal.t('CustomMessage: !customMessage', {
489      '!customMessage': customMessage
490    }) : '';
491
492    this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText;
493
494    this.name = 'AjaxError';
495  };
496
497  Drupal.AjaxError.prototype = new Error();
498  Drupal.AjaxError.prototype.constructor = Drupal.AjaxError;
499
500  Drupal.ajax = function (settings) {
501    if (arguments.length !== 1) {
502      throw new Error('Drupal.ajax() function must be called with one configuration object only');
503    }
504
505    var base = settings.base || false;
506    var element = settings.element || false;
507    delete settings.base;
508    delete settings.element;
509
510    if (!settings.progress && !element) {
511      settings.progress = false;
512    }
513
514    var ajax = new Drupal.Ajax(base, element, settings);
515    ajax.instanceIndex = Drupal.ajax.instances.length;
516    Drupal.ajax.instances.push(ajax);
517
518    return ajax;
519  };
520
521  Drupal.ajax.instances = [];
522
523  Drupal.ajax.expired = function () {
524    return Drupal.ajax.instances.filter(function (instance) {
525      return instance && instance.element !== false && !document.body.contains(instance.element);
526    });
527  };
528
529  Drupal.ajax.bindAjaxLinks = function (element) {
530    $(element).find('.use-ajax').once('ajax').each(function (i, ajaxLink) {
531      var $linkElement = $(ajaxLink);
532
533      var elementSettings = {
534        progress: { type: 'throbber' },
535        dialogType: $linkElement.data('dialog-type'),
536        dialog: $linkElement.data('dialog-options'),
537        dialogRenderer: $linkElement.data('dialog-renderer'),
538        base: $linkElement.attr('id'),
539        element: ajaxLink
540      };
541      var href = $linkElement.attr('href');
542
543      if (href) {
544        elementSettings.url = href;
545        elementSettings.event = 'click';
546      }
547      Drupal.ajax(elementSettings);
548    });
549  };
550
551  Drupal.Ajax = function (base, element, elementSettings) {
552    var defaults = {
553      event: element ? 'mousedown' : null,
554      keypress: true,
555      selector: base ? '#' + base : null,
556      effect: 'none',
557      speed: 'none',
558      method: 'replaceWith',
559      progress: {
560        type: 'throbber',
561        message: Drupal.t('Please wait...')
562      },
563      submit: {
564        js: true
565      }
566    };
567
568    $.extend(this, defaults, elementSettings);
569
570    this.commands = new Drupal.AjaxCommands();
571
572    this.instanceIndex = false;
573
574    if (this.wrapper) {
575      this.wrapper = '#' + this.wrapper;
576    }
577
578    this.element = element;
579
580    this.element_settings = elementSettings;
581
582    this.elementSettings = elementSettings;
583
584    if (this.element && this.element.form) {
585      this.$form = $(this.element.form);
586    }
587
588    if (!this.url) {
589      var $element = $(this.element);
590      if ($element.is('a')) {
591        this.url = $element.attr('href');
592      } else if (this.element && element.form) {
593        this.url = this.$form.attr('action');
594      }
595    }
596
597    var originalUrl = this.url;
598
599    this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1');
600
601    if (drupalSettings.ajaxTrustedUrl[originalUrl]) {
602      drupalSettings.ajaxTrustedUrl[this.url] = true;
603    }
604
605    var ajax = this;
606
607    ajax.options = {
608      url: ajax.url,
609      data: ajax.submit,
610      beforeSerialize: function beforeSerialize(elementSettings, options) {
611        return ajax.beforeSerialize(elementSettings, options);
612      },
613      beforeSubmit: function beforeSubmit(formValues, elementSettings, options) {
614        ajax.ajaxing = true;
615        return ajax.beforeSubmit(formValues, elementSettings, options);
616      },
617      beforeSend: function beforeSend(xmlhttprequest, options) {
618        ajax.ajaxing = true;
619        return ajax.beforeSend(xmlhttprequest, options);
620      },
621      success: function success(response, status, xmlhttprequest) {
622        if (typeof response === 'string') {
623          response = $.parseJSON(response);
624        }
625
626        if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) {
627          if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') {
628            var customMessage = Drupal.t('The response failed verification so will not be processed.');
629            return ajax.error(xmlhttprequest, ajax.url, customMessage);
630          }
631        }
632
633        return ajax.success(response, status);
634      },
635      complete: function complete(xmlhttprequest, status) {
636        ajax.ajaxing = false;
637        if (status === 'error' || status === 'parsererror') {
638          return ajax.error(xmlhttprequest, ajax.url);
639        }
640      },
641
642      dataType: 'json',
643      jsonp: false,
644      type: 'POST'
645    };
646
647    if (elementSettings.dialog) {
648      ajax.options.data.dialogOptions = elementSettings.dialog;
649    }
650
651    if (ajax.options.url.indexOf('?') === -1) {
652      ajax.options.url += '?';
653    } else {
654      ajax.options.url += '&';
655    }
656
657    var wrapper = 'drupal_' + (elementSettings.dialogType || 'ajax');
658    if (elementSettings.dialogRenderer) {
659      wrapper += '.' + elementSettings.dialogRenderer;
660    }
661    ajax.options.url += Drupal.ajax.WRAPPER_FORMAT + '=' + wrapper;
662
663    $(ajax.element).on(elementSettings.event, function (event) {
664      if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) {
665        throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', {
666          '!url': ajax.url
667        }));
668      }
669      return ajax.eventResponse(this, event);
670    });
671
672    if (elementSettings.keypress) {
673      $(ajax.element).on('keypress', function (event) {
674        return ajax.keypressResponse(this, event);
675      });
676    }
677
678    if (elementSettings.prevent) {
679      $(ajax.element).on(elementSettings.prevent, false);
680    }
681  };
682
683  Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format';
684
685  Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax';
686
687  Drupal.Ajax.prototype.execute = function () {
688    if (this.ajaxing) {
689      return;
690    }
691
692    try {
693      this.beforeSerialize(this.element, this.options);
694
695      return $.ajax(this.options);
696    } catch (e) {
697      this.ajaxing = false;
698      window.alert('An error occurred while attempting to process ' + this.options.url + ': ' + e.message);
699
700      return $.Deferred().reject();
701    }
702  };
703
704  Drupal.Ajax.prototype.keypressResponse = function (element, event) {
705    var ajax = this;
706
707    if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') {
708      event.preventDefault();
709      event.stopPropagation();
710      $(element).trigger(ajax.elementSettings.event);
711    }
712  };
713
714  Drupal.Ajax.prototype.eventResponse = function (element, event) {
715    event.preventDefault();
716    event.stopPropagation();
717
718    var ajax = this;
719
720    if (ajax.ajaxing) {
721      return;
722    }
723
724    try {
725      if (ajax.$form) {
726        if (ajax.setClick) {
727          element.form.clk = element;
728        }
729
730        ajax.$form.ajaxSubmit(ajax.options);
731      } else {
732        ajax.beforeSerialize(ajax.element, ajax.options);
733        $.ajax(ajax.options);
734      }
735    } catch (e) {
736      ajax.ajaxing = false;
737      window.alert('An error occurred while attempting to process ' + ajax.options.url + ': ' + e.message);
738    }
739  };
740
741  Drupal.Ajax.prototype.beforeSerialize = function (element, options) {
742    if (this.$form && document.body.contains(this.$form.get(0))) {
743      var settings = this.settings || drupalSettings;
744      Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize');
745    }
746
747    options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1;
748
749    var pageState = drupalSettings.ajaxPageState;
750    options.data['ajax_page_state[theme]'] = pageState.theme;
751    options.data['ajax_page_state[theme_token]'] = pageState.theme_token;
752    options.data['ajax_page_state[libraries]'] = pageState.libraries;
753  };
754
755  Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {};
756
757  Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) {
758    if (this.$form) {
759      options.extraData = options.extraData || {};
760
761      options.extraData.ajax_iframe_upload = '1';
762
763      var v = $.fieldValue(this.element);
764      if (v !== null) {
765        options.extraData[this.element.name] = v;
766      }
767    }
768
769    $(this.element).prop('disabled', true);
770
771    if (!this.progress || !this.progress.type) {
772      return;
773    }
774
775    var progressIndicatorMethod = 'setProgressIndicator' + this.progress.type.slice(0, 1).toUpperCase() + this.progress.type.slice(1).toLowerCase();
776    if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') {
777      this[progressIndicatorMethod].call(this);
778    }
779  };
780
781  Drupal.theme.ajaxProgressThrobber = function (message) {
782    var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : '';
783    var throbber = '<div class="throbber">&nbsp;</div>';
784
785    return '<div class="ajax-progress ajax-progress-throbber">' + throbber + messageMarkup + '</div>';
786  };
787
788  Drupal.theme.ajaxProgressIndicatorFullscreen = function () {
789    return '<div class="ajax-progress ajax-progress-fullscreen">&nbsp;</div>';
790  };
791
792  Drupal.theme.ajaxProgressMessage = function (message) {
793    return '<div class="message">' + message + '</div>';
794  };
795
796  Drupal.theme.ajaxProgressBar = function ($element) {
797    return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element);
798  };
799
800  Drupal.Ajax.prototype.setProgressIndicatorBar = function () {
801    var progressBar = new Drupal.ProgressBar('ajax-progress-' + this.element.id, $.noop, this.progress.method, $.noop);
802    if (this.progress.message) {
803      progressBar.setProgress(-1, this.progress.message);
804    }
805    if (this.progress.url) {
806      progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500);
807    }
808    this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element));
809    this.progress.object = progressBar;
810    $(this.element).after(this.progress.element);
811  };
812
813  Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () {
814    this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message));
815    $(this.element).after(this.progress.element);
816  };
817
818  Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () {
819    this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen'));
820    $('body').append(this.progress.element);
821  };
822
823  Drupal.Ajax.prototype.success = function (response, status) {
824    var _this = this;
825
826    if (this.progress.element) {
827      $(this.progress.element).remove();
828    }
829    if (this.progress.object) {
830      this.progress.object.stopMonitoring();
831    }
832    $(this.element).prop('disabled', false);
833
834    var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray();
835
836    var focusChanged = false;
837    Object.keys(response || {}).forEach(function (i) {
838      if (response[i].command && _this.commands[response[i].command]) {
839        _this.commands[response[i].command](_this, response[i], status);
840        if (response[i].command === 'invoke' && response[i].method === 'focus') {
841          focusChanged = true;
842        }
843      }
844    });
845
846    if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) {
847      var target = false;
848
849      for (var n = elementParents.length - 1; !target && n >= 0; n--) {
850        target = document.querySelector('[data-drupal-selector="' + elementParents[n].getAttribute('data-drupal-selector') + '"]');
851      }
852
853      if (target) {
854        $(target).trigger('focus');
855      }
856    }
857
858    if (this.$form && document.body.contains(this.$form.get(0))) {
859      var settings = this.settings || drupalSettings;
860      Drupal.attachBehaviors(this.$form.get(0), settings);
861    }
862
863    this.settings = null;
864  };
865
866  Drupal.Ajax.prototype.getEffect = function (response) {
867    var type = response.effect || this.effect;
868    var speed = response.speed || this.speed;
869
870    var effect = {};
871    if (type === 'none') {
872      effect.showEffect = 'show';
873      effect.hideEffect = 'hide';
874      effect.showSpeed = '';
875    } else if (type === 'fade') {
876      effect.showEffect = 'fadeIn';
877      effect.hideEffect = 'fadeOut';
878      effect.showSpeed = speed;
879    } else {
880      effect.showEffect = type + 'Toggle';
881      effect.hideEffect = type + 'Toggle';
882      effect.showSpeed = speed;
883    }
884
885    return effect;
886  };
887
888  Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) {
889    if (this.progress.element) {
890      $(this.progress.element).remove();
891    }
892    if (this.progress.object) {
893      this.progress.object.stopMonitoring();
894    }
895
896    $(this.wrapper).show();
897
898    $(this.element).prop('disabled', false);
899
900    if (this.$form && document.body.contains(this.$form.get(0))) {
901      var settings = this.settings || drupalSettings;
902      Drupal.attachBehaviors(this.$form.get(0), settings);
903    }
904    throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage);
905  };
906
907  Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) {
908    return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) {
909      return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent));
910    }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent;
911  };
912
913  Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) {
914    return $('<div></div>').append($elements);
915  };
916
917  Drupal.AjaxCommands = function () {};
918  Drupal.AjaxCommands.prototype = {
919    insert: function insert(ajax, response) {
920      var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper);
921      var method = response.method || ajax.method;
922      var effect = ajax.getEffect(response);
923
924      var settings = response.settings || ajax.settings || drupalSettings;
925
926      var $newContent = $($.parseHTML(response.data, document, true));
927
928      $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response);
929
930      switch (method) {
931        case 'html':
932        case 'replaceWith':
933        case 'replaceAll':
934        case 'empty':
935        case 'remove':
936          Drupal.detachBehaviors($wrapper.get(0), settings);
937          break;
938        default:
939          break;
940      }
941
942      $wrapper[method]($newContent);
943
944      if (effect.showEffect !== 'show') {
945        $newContent.hide();
946      }
947
948      var $ajaxNewContent = $newContent.find('.ajax-new-content');
949      if ($ajaxNewContent.length) {
950        $ajaxNewContent.hide();
951        $newContent.show();
952        $ajaxNewContent[effect.showEffect](effect.showSpeed);
953      } else if (effect.showEffect !== 'show') {
954        $newContent[effect.showEffect](effect.showSpeed);
955      }
956
957      if ($newContent.parents('html').length) {
958        $newContent.each(function (index, element) {
959          if (element.nodeType === Node.ELEMENT_NODE) {
960            Drupal.attachBehaviors(element, settings);
961          }
962        });
963      }
964    },
965    remove: function remove(ajax, response, status) {
966      var settings = response.settings || ajax.settings || drupalSettings;
967      $(response.selector).each(function () {
968        Drupal.detachBehaviors(this, settings);
969      }).remove();
970    },
971    changed: function changed(ajax, response, status) {
972      var $element = $(response.selector);
973      if (!$element.hasClass('ajax-changed')) {
974        $element.addClass('ajax-changed');
975        if (response.asterisk) {
976          $element.find(response.asterisk).append(' <abbr class="ajax-changed" title="' + Drupal.t('Changed') + '">*</abbr> ');
977        }
978      }
979    },
980    alert: function alert(ajax, response, status) {
981      window.alert(response.text, response.title);
982    },
983    announce: function announce(ajax, response) {
984      if (response.priority) {
985        Drupal.announce(response.text, response.priority);
986      } else {
987        Drupal.announce(response.text);
988      }
989    },
990    redirect: function redirect(ajax, response, status) {
991      window.location = response.url;
992    },
993    css: function css(ajax, response, status) {
994      $(response.selector).css(response.argument);
995    },
996    settings: function settings(ajax, response, status) {
997      var ajaxSettings = drupalSettings.ajax;
998
999      if (ajaxSettings) {
1000        Drupal.ajax.expired().forEach(function (instance) {
1001
1002          if (instance.selector) {
1003            var selector = instance.selector.replace('#', '');
1004            if (selector in ajaxSettings) {
1005              delete ajaxSettings[selector];
1006            }
1007          }
1008        });
1009      }
1010
1011      if (response.merge) {
1012        $.extend(true, drupalSettings, response.settings);
1013      } else {
1014        ajax.settings = response.settings;
1015      }
1016    },
1017    data: function data(ajax, response, status) {
1018      $(response.selector).data(response.name, response.value);
1019    },
1020    invoke: function invoke(ajax, response, status) {
1021      var $element = $(response.selector);
1022      $element[response.method].apply($element, _toConsumableArray(response.args));
1023    },
1024    restripe: function restripe(ajax, response, status) {
1025      $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even');
1026    },
1027    update_build_id: function update_build_id(ajax, response, status) {
1028      $('input[name="form_build_id"][value="' + response.old + '"]').val(response.new);
1029    },
1030    add_css: function add_css(ajax, response, status) {
1031      $('head').prepend(response.data);
1032    },
1033    message: function message(ajax, response) {
1034      var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector));
1035      if (response.clearPrevious) {
1036        messages.clear();
1037      }
1038      messages.add(response.message, response.messageOptions);
1039    }
1040  };
1041})(jQuery, window, Drupal, drupalSettings);;
1042/**
1043* DO NOT EDIT THIS FILE.
1044* See the following change record for more information,
1045* https://www.drupal.org/node/2815083
1046* @preserve
1047**/
1048
1049(function (Drupal) {
1050  Drupal.theme.ajaxProgressBar = function ($element) {
1051    return $element.addClass('ajax-progress ajax-progress-bar');
1052  };
1053})(Drupal);;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.