1!function(i,s,e){"use strict";function t(t,a){var n=i(a);i(e).on("resize.lists",s.debounce(function(s){n.addClass("is-horizontal");var e=n.find(".is-responsive__list"),t=0;e.find(".is-responsive__item").each(function(){t+=i(this).outerWidth(!0)}),1==e.outerWidth(!0)<=t?n.removeClass("is-horizontal").addClass("is-vertical"):n.removeClass("is-vertical").addClass("is-horizontal")},150)).trigger("resize.lists")}s.behaviors.atRL={attach:function(s){var e=i(s).find("[data-at-responsive-list]");e.length&&e.once().each(t)}}}(jQuery,Drupal,window); 2 3/** 4 * @file 5 * better_exposed_filters.js 6 * 7 * Provides some client-side functionality for the Better Exposed Filters module. 8 */ 9 10(function ($, Drupal, drupalSettings) { 11 Drupal.behaviors.betterExposedFilters = { 12 attach: function (context, settings) { 13 // Add highlight class to checked checkboxes for better theming. 14 $('.bef-tree input[type=checkbox], .bef-checkboxes input[type=checkbox]') 15 // Highlight newly selected checkboxes. 16 .change(function () { 17 _bef_highlight(this, context); 18 }) 19 .filter(':checked').closest('.form-item', context).addClass('highlight'); 20 } 21 }; 22 23 /* 24 * Helper functions 25 */ 26 27 /** 28 * Adds/Removes the highlight class from the form-item div as appropriate. 29 */ 30 function _bef_highlight(elem, context) { 31 $elem = $(elem, context); 32 $elem.attr('checked') 33 ? $elem.closest('.form-item', context).addClass('highlight') 34 : $elem.closest('.form-item', context).removeClass('highlight'); 35 } 36 37})(jQuery, Drupal, drupalSettings); 38; 39/** 40* DO NOT EDIT THIS FILE. 41* See the following change record for more information, 42* https://www.drupal.org/node/2815083 43* @preserve 44**/ 45(function ($, Drupal) { 46 Drupal.theme.progressBar = function (id) { 47 return "<div id=\"".concat(id, "\" class=\"progress\" aria-live=\"polite\">") + '<div class="progress__label"> </div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description"> </div>' + '</div>'; 48 }; 49 Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) { 50 this.id = id; 51 this.method = method || 'GET'; 52 this.updateCallback = updateCallback; 53 this.errorCallback = errorCallback; 54 this.element = $(Drupal.theme('progressBar', id)); 55 }; 56 $.extend(Drupal.ProgressBar.prototype, { 57 setProgress: function setProgress(percentage, message, label) { 58 if (percentage >= 0 && percentage <= 100) { 59 $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%")); 60 $(this.element).find('div.progress__percentage').html("".concat(percentage, "%")); 61 } 62 $('div.progress__description', this.element).html(message); 63 $('div.progress__label', this.element).html(label); 64 if (this.updateCallback) { 65 this.updateCallback(percentage, message, this); 66 } 67 }, 68 startMonitoring: function startMonitoring(uri, delay) { 69 this.delay = delay; 70 this.uri = uri; 71 this.sendPing(); 72 }, 73 stopMonitoring: function stopMonitoring() { 74 clearTimeout(this.timer); 75 this.uri = null; 76 }, 77 sendPing: function sendPing() { 78 if (this.timer) { 79 clearTimeout(this.timer); 80 } 81 if (this.uri) { 82 var pb = this; 83 var uri = this.uri; 84 if (uri.indexOf('?') === -1) { 85 uri += '?'; 86 } else { 87 uri += '&'; 88 } 89 uri += '_format=json'; 90 $.ajax({ 91 type: this.method, 92 url: uri, 93 data: '', 94 dataType: 'json', 95 success: function success(progress) { 96 if (progress.status === 0) { 97 pb.displayError(progress.data); 98 return; 99 } 100 pb.setProgress(progress.percentage, progress.message, progress.label); 101 pb.timer = setTimeout(function () { 102 pb.sendPing(); 103 }, pb.delay); 104 }, 105 error: function error(xmlhttp) { 106 var e = new Drupal.AjaxError(xmlhttp, pb.uri); 107 pb.displayError("<pre>".concat(e.message, "</pre>")); 108 } 109 }); 110 } 111 }, 112 displayError: function displayError(string) { 113 var error = $('<div class="messages messages--error"></div>').html(string); 114 $(this.element).before(error).hide(); 115 if (this.errorCallback) { 116 this.errorCallback(this); 117 } 118 } 119 }); 120})(jQuery, Drupal);; 121loadjs=function(){var h=function(){},c={},u={},f={};function o(e,n){if(e){var r=f[e];if(u[e]=n,r)for(;r.length;)r[0](e,n),r.splice(0,1)}}function l(e,n){e.call&&(e={success:e}),n.length?(e.error||h)(n):(e.success||h)(e)}function d(r,t,s,i){var c,o,e=document,n=s.async,u=(s.numRetries||0)+1,f=s.before||h,l=r.replace(/[\?|#].*$/,""),a=r.replace(/^(css|img)!/,"");i=i||0,/(^css!|\.css$)/.test(l)?((o=e.createElement("link")).rel="stylesheet",o.href=a,(c="hideFocus"in o)&&o.relList&&(c=0,o.rel="preload",o.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(l)?(o=e.createElement("img")).src=a:((o=e.createElement("script")).src=r,o.async=void 0===n||n),!(o.onload=o.onerror=o.onbeforeload=function(e){var n=e.type[0];if(c)try{o.sheet.cssText.length||(n="e")}catch(e){18!=e.code&&(n="e")}if("e"==n){if((i+=1)<u)return d(r,t,s,i)}else if("preload"==o.rel&&"style"==o.as)return o.rel="stylesheet";t(r,n,e.defaultPrevented)})!==f(r,o)&&e.head.appendChild(o)}function r(e,n,r){var t,s;if(n&&n.trim&&(t=n),s=(t?r:n)||{},t){if(t in c)throw"LoadJS";c[t]=!0}function i(n,r){!function(e,t,n){var r,s,i=(e=e.push?e:[e]).length,c=i,o=[];for(r=function(e,n,r){if("e"==n&&o.push(e),"b"==n){if(!r)return;o.push(e)}--i||t(o)},s=0;s<c;s++)d(e[s],r,n)}(e,function(e){l(s,e),n&&l({success:n,error:r},e),o(t,e)},s)}if(s.returnPromise)return new Promise(i);i()}return r.ready=function(e,n){return function(e,r){e=e.push?e:[e];var n,t,s,i=[],c=e.length,o=c;
121for(n=function(e,n){n.length&&i.push(e),--o||r(i)};c--;)t=e[c],(s=u[t])?n(t,s):(f[t]=f[t]||[]).push(n)}(e,function(e){l(n,e)}),r},r.done=function(e){o(e,[])},r.reset=function(){c={},u={},f={}},r.isDefined=function(e){return e in c},r}();; 122/** 123* DO NOT EDIT THIS FILE. 124* See the following change record for more information, 125* https://www.drupal.org/node/2815083 126* @preserve 127**/ 128(function (Drupal) { 129 Drupal.behaviors.responsiveImageAJAX = { 130 attach: function attach() { 131 if (window.picturefill) { 132 window.picturefill(); 133 } 134 } 135 }; 136})(Drupal);; 137/** 138* DO NOT EDIT THIS FILE. 139* See the following change record for more information, 140* https://www.drupal.org/node/2815083 141* @preserve 142**/ 143function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 144function _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."); } 145function _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); } 146function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 147function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 148function _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; } 149(function ($, window, Drupal, drupalSettings, loadjs, _ref) { 150 var isFocusable = _ref.isFocusable, 151 tabbable = _ref.tabbable; 152 Drupal.behaviors.AJAX = { 153 attach: function attach(context, settings) { 154 function loadAjaxBehavior(base) { 155 var elementSettings = settings.ajax[base]; 156 if (typeof elementSettings.selector === 'undefined') { 157 elementSettings.selector = "#".concat(base); 158 } 159 once('drupal-ajax', $(elementSettings.selector)).forEach(function (el) { 160 elementSettings.element = el; 161 elementSettings.base = base; 162 Drupal.ajax(elementSettings); 163 }); 164 } 165 Object.keys(settings.ajax || {}).forEach(function (base) { 166 return loadAjaxBehavior(base); 167 }); 168 Drupal.ajax.bindAjaxLinks(document.body); 169 once('ajax', '.use-ajax-submit').forEach(function (el) { 170 var elementSettings = {}; 171 elementSettings.url = $(el.form).attr('action'); 172 elementSettings.setClick = true; 173 elementSettings.event = 'click'; 174 elementSettings.progress = { 175 type: 'throbber' 176 }; 177 elementSettings.base = el.id; 178 elementSettings.element = el; 179 Drupal.ajax(elementSettings); 180 }); 181 }, 182 detach: function detach(context, settings, trigger) { 183 if (trigger === 'unload') { 184 Drupal.ajax.expired().forEach(function (instance) { 185 Drupal.ajax.instances[instance.instanceIndex] = null; 186 }); 187 } 188 } 189 }; 190 Drupal.AjaxError = function (xmlhttp, uri, customMessage) { 191 var statusCode; 192 var statusText; 193 var responseText; 194 if (xmlhttp.status) { 195 statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', { 196 '!status': xmlhttp.status 197 })); 198 } else { 199 statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.')); 200 } 201 statusCode += "\n".concat(Drupal.t('Debugging information follows.')); 202 var pathText = "\n".concat(Drupal.t('Path: !uri', { 203 '!uri': uri 204 })); 205 statusText = ''; 206 try { 207 statusText = "\n".concat(Drupal.t('StatusText: !statusText', { 208 '!statusText': xmlhttp.statusText.trim() 209 })); 210 } catch (e) {} 211 responseText = ''; 212 try { 213 responseText = "\n".concat(Drupal.t('ResponseText: !responseText', { 214 '!responseText': xmlhttp.responseText.trim() 215 })); 216 } catch (e) {} 217 responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); 218 responseText = responseText.replace(/[\n]+\s+/g, '\n'); 219 var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', { 220 '!readyState': xmlhttp.readyState 221 })) : ''; 222 customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', { 223 '!customMessage': customMessage 224 })) : ''; 225 this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; 226 this.name = 'AjaxError'; 227 }; 228 Drupal.AjaxError.prototype = new Error(); 229 Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; 230 Drupal.ajax = function (settings) { 231 if (arguments.length !== 1) { 232 throw new Error('Drupal.ajax() function must be called with one configuration object only'); 233 } 234 var base = settings.base || false; 235 var element = settings.element || false; 236 delete settings.base; 237 delete settings.element; 238 if (!settings.progress && !element) { 239 settings.progress = false;
240 } 241 var ajax = new Drupal.Ajax(base, element, settings); 242 ajax.instanceIndex = Drupal.ajax.instances.length; 243 Drupal.ajax.instances.push(ajax); 244 return ajax; 245 }; 246 Drupal.ajax.instances = []; 247 Drupal.ajax.expired = function () { 248 return Drupal.ajax.instances.filter(function (instance) { 249 return instance && instance.element !== false && !document.body.contains(instance.element); 250 }); 251 }; 252 Drupal.ajax.bindAjaxLinks = function (element) { 253 once('ajax', '.use-ajax', element).forEach(function (ajaxLink) { 254 var $linkElement = $(ajaxLink); 255 var elementSettings = { 256 progress: { 257 type: 'throbber' 258 }, 259 dialogType: $linkElement.data('dialog-type'), 260 dialog: $linkElement.data('dialog-options'), 261 dialogRenderer: $linkElement.data('dialog-renderer'), 262 base: $linkElement.attr('id'), 263 element: ajaxLink 264 }; 265 var href = $linkElement.attr('href'); 266 if (href) { 267 elementSettings.url = href; 268 elementSettings.event = 'click'; 269 } 270 Drupal.ajax(elementSettings); 271 }); 272 }; 273 Drupal.Ajax = function (base, element, elementSettings) { 274 var defaults = { 275 event: element ? 'mousedown' : null, 276 keypress: true, 277 selector: base ? "#".concat(base) : null, 278 effect: 'none', 279 speed: 'none', 280 method: 'replaceWith', 281 progress: { 282 type: 'throbber', 283 message: Drupal.t('Please wait...') 284 }, 285 submit: { 286 js: true 287 } 288 }; 289 $.extend(this, defaults, elementSettings); 290 this.commands = new Drupal.AjaxCommands(); 291 this.instanceIndex = false; 292 if (this.wrapper) { 293 this.wrapper = "#".concat(this.wrapper); 294 } 295 this.element = element; 296 this.element_settings = elementSettings; 297 this.elementSettings = elementSettings; 298 if (this.element && this.element.form) { 299 this.$form = $(this.element.form); 300 } 301 if (!this.url) { 302 var $element = $(this.element); 303 if ($element.is('a')) { 304 this.url = $element.attr('href'); 305 } else if (this.element && element.form) { 306 this.url = this.$form.attr('action'); 307 } 308 } 309 var originalUrl = this.url; 310 this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1'); 311 if (drupalSettings.ajaxTrustedUrl[originalUrl]) { 312 drupalSettings.ajaxTrustedUrl[this.url] = true; 313 } 314 var ajax = this; 315 ajax.options = { 316 url: ajax.url, 317 data: ajax.submit, 318 isInProgress: function isInProgress() { 319 return ajax.ajaxing; 320 }, 321 beforeSerialize: function beforeSerialize(elementSettings, options) { 322 return ajax.beforeSerialize(elementSettings, options); 323 }, 324 beforeSubmit: function beforeSubmit(formValues, elementSettings, options) { 325 ajax.ajaxing = true; 326 return ajax.beforeSubmit(formValues, elementSettings, options); 327 }, 328 beforeSend: function beforeSend(xmlhttprequest, options) { 329 ajax.ajaxing = true; 330 return ajax.beforeSend(xmlhttprequest, options); 331 }, 332 success: function success(response, status, xmlhttprequest) { 333 var _this = this; 334 if (typeof response === 'string') { 335 response = $.parseJSON(response); 336 } 337 if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { 338 if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { 339 var customMessage = Drupal.t('The response failed verification so will not be processed.'); 340 return ajax.error(xmlhttprequest, ajax.url, customMessage); 341 } 342 } 343 return Promise.resolve(ajax.success(response, status)).then(function () { 344 ajax.ajaxing = false; 345 $(document).trigger('ajaxSuccess', [xmlhttprequest, _this]); 346 $(document).trigger('ajaxComplete', [xmlhttprequest, _this]); 347 if (--$.active === 0) { 348 $(document).trigger('ajaxStop'); 349 } 350 }); 351 }, 352 error: function error(xmlhttprequest, status, _error) { 353 ajax.ajaxing = false; 354 }, 355 complete: function complete(xmlhttprequest, status) { 356 if (status === 'error' || status === 'parsererror') { 357 return ajax.error(xmlhttprequest, ajax.url); 358 } 359 }, 360 dataType: 'json', 361 jsonp: false, 362 type: 'POST' 363 }; 364 if (elementSettings.dialog) { 365 ajax.options.data.dialogOptions = elementSettings.dialog; 366 } 367 if (ajax.options.url.indexOf('?') === -1) { 368 ajax.options.url += '?'; 369 } else { 370 ajax.options.url += '&'; 371 } 372 var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax'); 373 if (elementSettings.dialogRenderer) { 374 wrapper += ".".concat(elementSettings.dialogRenderer); 375 } 376 ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper); 377 $(ajax.element).on(elementSettings.event, function (event) { 378 if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { 379 throw new Error(Drupal.t('The callback URL is not local and n
379ot trusted: !url', { 380 '!url': ajax.url 381 })); 382 } 383 return ajax.eventResponse(this, event); 384 }); 385 if (elementSettings.keypress) { 386 $(ajax.element).on('keypress', function (event) { 387 return ajax.keypressResponse(this, event); 388 }); 389 } 390 if (elementSettings.prevent) { 391 $(ajax.element).on(elementSettings.prevent, false); 392 } 393 }; 394 Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; 395 Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; 396 Drupal.Ajax.prototype.execute = function () { 397 if (this.ajaxing) { 398 return; 399 } 400 try { 401 this.beforeSerialize(this.element, this.options); 402 return $.ajax(this.options); 403 } catch (e) { 404 this.ajaxing = false; 405 window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message)); 406 return $.Deferred().reject(); 407 } 408 }; 409 Drupal.Ajax.prototype.keypressResponse = function (element, event) { 410 var ajax = this; 411 if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') { 412 event.preventDefault(); 413 event.stopPropagation(); 414 $(element).trigger(ajax.elementSettings.event); 415 } 416 }; 417 Drupal.Ajax.prototype.eventResponse = function (element, event) { 418 event.preventDefault(); 419 event.stopPropagation(); 420 var ajax = this; 421 if (ajax.ajaxing) { 422 return; 423 } 424 try { 425 if (ajax.$form) { 426 if (ajax.setClick) { 427 element.form.clk = element; 428 } 429 ajax.$form.ajaxSubmit(ajax.options); 430 } else { 431 ajax.beforeSerialize(ajax.element, ajax.options); 432 $.ajax(ajax.options); 433 } 434 } catch (e) { 435 ajax.ajaxing = false; 436 window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message)); 437 } 438 }; 439 Drupal.Ajax.prototype.beforeSerialize = function (element, options) { 440 if (this.$form && document.body.contains(this.$form.get(0))) { 441 var settings = this.settings || drupalSettings; 442 Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); 443 } 444 options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; 445 var pageState = drupalSettings.ajaxPageState; 446 options.data['ajax_page_state[theme]'] = pageState.theme; 447 options.data['ajax_page_state[theme_token]'] = pageState.theme_token; 448 options.data['ajax_page_state[libraries]'] = pageState.libraries; 449 }; 450 Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {}; 451 Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { 452 if (this.$form) { 453 options.extraData = options.extraData || {}; 454 options.extraData.ajax_iframe_upload = '1'; 455 var v = $.fieldValue(this.element); 456 if (v !== null) { 457 options.extraData[this.element.name] = v; 458 } 459 } 460 $(this.element).prop('disabled', true); 461 if (!this.progress || !this.progress.type) { 462 return; 463 } 464 var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase()); 465 if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { 466 this[progressIndicatorMethod].call(this); 467 } 468 }; 469 Drupal.theme.ajaxProgressThrobber = function (message) { 470 var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : ''; 471 var throbber = '<div class="throbber"> </div>'; 472 return "<div class=\"ajax-progress ajax-progress-throbber\">".concat(throbber).concat(messageMarkup, "</div>"); 473 }; 474 Drupal.theme.ajaxProgressIndicatorFullscreen = function () { 475 return '<div class="ajax-progress ajax-progress-fullscreen"> </div>'; 476 }; 477 Drupal.theme.ajaxProgressMessage = function (message) { 478 return "<div class=\"message\">".concat(message, "</div>"); 479 }; 480 Drupal.theme.ajaxProgressBar = function ($element) { 481 return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element); 482 }; 483 Drupal.Ajax.prototype.setProgressIndicatorBar = function () { 484 var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.i
484d), $.noop, this.progress.method, $.noop); 485 if (this.progress.message) { 486 progressBar.setProgress(-1, this.progress.message); 487 } 488 if (this.progress.url) { 489 progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); 490 } 491 this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element)); 492 this.progress.object = progressBar; 493 $(this.element).after(this.progress.element); 494 }; 495 Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { 496 this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message)); 497 $(this.element).after(this.progress.element); 498 }; 499 Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { 500 this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen')); 501 $('body').append(this.progress.element); 502 }; 503 Drupal.Ajax.prototype.commandExecutionQueue = function (response, status) { 504 var _this2 = this; 505 var ajaxCommands = this.commands; 506 return Object.keys(response || {}).reduce(function (executionQueue, key) { 507 return executionQueue.then(function () { 508 var command = response[key].command; 509 if (command && ajaxCommands[command]) { 510 return ajaxCommands[command](_this2, response[key], status); 511 } 512 }); 513 }, Promise.resolve()); 514 }; 515 Drupal.Ajax.prototype.success = function (response, status) { 516 var _this3 = this; 517 if (this.progress.element) { 518 $(this.progress.element).remove(); 519 } 520 if (this.progress.object) { 521 this.progress.object.stopMonitoring(); 522 } 523 $(this.element).prop('disabled', false); 524 var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); 525 var focusChanged = Object.keys(response || {}).some(function (key) { 526 var _response$key = response[key], 527 command = _response$key.command, 528 method = _response$key.method; 529 return command === 'focusFirst' || command === 'invoke' && method === 'focus'; 530 }); 531 return this.commandExecutionQueue(response, status).then(function () { 532 if (!focusChanged && _this3.element && !$(_this3.element).data('disable-refocus')) { 533 var target = false;
534 for (var n = elementParents.length - 1; !target && n >= 0; n--) { 535 target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]")); 536 } 537 if (target) { 538 $(target).trigger('focus'); 539 } 540 } 541 if (_this3.$form && document.body.contains(_this3.$form.get(0))) { 542 var settings = _this3.settings || drupalSettings; 543 Drupal.attachBehaviors(_this3.$form.get(0), settings); 544 } 545 _this3.settings = null; 546 }).catch(function (error) { 547 return console.error(Drupal.t('An error occurred during the execution of the Ajax response: !error', { 548 '!error': error 549 })); 550 }); 551 }; 552 Drupal.Ajax.prototype.getEffect = function (response) { 553 var type = response.effect || this.effect; 554 var speed = response.speed || this.speed; 555 var effect = {}; 556 if (type === 'none') { 557 effect.showEffect = 'show'; 558 effect.hideEffect = 'hide'; 559 effect.showSpeed = ''; 560 } else if (type === 'fade') { 561 effect.showEffect = 'fadeIn'; 562 effect.hideEffect = 'fadeOut'; 563 effect.showSpeed = speed; 564 } else { 565 effect.showEffect = "".concat(type, "Toggle"); 566 effect.hideEffect = "".concat(type, "Toggle"); 567 effect.showSpeed = speed; 568 } 569 return effect; 570 }; 571 Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { 572 if (this.progress.element) { 573 $(this.progress.element).remove(); 574 } 575 if (this.progress.object) { 576 this.progress.object.stopMonitoring(); 577 } 578 $(this.wrapper).show(); 579 $(this.element).prop('disabled', false); 580 if (this.$form && document.body.contains(this.$form.get(0))) { 581 var settings = this.settings || drupalSettings; 582 Drupal.attachBehaviors(this.$form.get(0), settings); 583 } 584 throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); 585 }; 586 Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) { 587 return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) { 588 return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent)); 589 }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent; 590 }; 591 Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) { 592 return $('<div></div>').append($elements); 593 }; 594 Drupal.AjaxCommands = function () {}; 595 Drupal.AjaxCommands.prototype = { 596 insert: function insert(ajax, response) { 597 var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); 598 var method = response.method || ajax.method; 599 var effect = ajax.getEffect(response); 600 var settings = response.settings || ajax.settings || drupalSettings; 601 var $newContent = $($.parseHTML(response.data, document, true)); 602 $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response); 603 switch (method) { 604 case 'html': 605 case 'replaceWith': 606 case 'replaceAll': 607 case 'empty': 608 case 'remove': 609 Drupal.detachBehaviors($wrapper.get(0), settings); 610 break; 611 default: 612 break; 613 } 614 $wrapper[method]($newContent); 615 if (effect.showEffect !== 'show') { 616 $newContent.hide(); 617 } 618 var $ajaxNewContent = $newContent.find('.ajax-new-content'); 619 if ($ajaxNewContent.length) { 620 $ajaxNewContent.hide(); 621 $newContent.show(); 622 $ajaxNewContent[effect.showEffect](effect.showSpeed); 623 } else if (effect.showEffect !== 'show') { 624 $newContent[effect.showEffect](effect.showSpeed); 625 } 626 if ($newContent.parents('html').length) { 627 $newContent.each(function (index, element) { 628 if (element.nodeType === Node.ELEMENT_NODE) { 629 Drupal.attachBehaviors(element, settings); 630 } 631 }); 632 } 633 }, 634 remove: function remove(ajax, response, status) { 635 var settings = response.settings || ajax.settings || drupalSettings; 636 $(response.selector).each(function () { 637 Drupal.detachBehaviors(this, settings); 638 }).remove(); 639 }, 640 changed: function changed(ajax, response, status) { 641 var $element = $(response.selector); 642 if (!$element.hasClass('ajax-changed')) { 643 $element.addClass('ajax-changed'); 644 if (response.asterisk) { 645 $element.find(response.asterisk).append(" <abbr class=\"ajax-changed\" title=\"".concat(Drupal.t('Changed'), "\">*</abbr> ")); 646 } 647 } 648 }, 649 alert: function alert(ajax, response, status) { 650 window.alert(response.text); 651 }, 652 announce: function announce(ajax, response) { 653 if (response.priority) { 654 Drupal.announce(response.text, response.priority); 655 } else { 656 Drupal.announce(response.text); 657 } 658 }, 659 redirect: function redirect(ajax, response, status) { 660 window.location = response.url; 661 }, 662 css: function css(ajax, response, status) { 663 $(response.selector).css(response.argument); 664 }, 665 settings: function settings(ajax, response, status) { 666 var ajaxSettings = drupalSettings.ajax; 667 if (ajaxSettings) {
668 Drupal.ajax.expired().forEach(function (instance) { 669 if (instance.selector) { 670 var selector = instance.selector.replace('#', ''); 671 if (selector in ajaxSettings) { 672 delete ajaxSettings[selector]; 673 } 674 } 675 }); 676 } 677 if (response.merge) { 678 $.extend(true, drupalSettings, response.settings); 679 } else { 680 ajax.settings = response.settings; 681 } 682 }, 683 data: function data(ajax, response, status) { 684 $(response.selector).data(response.name, response.value); 685 }, 686 focusFirst: function focusFirst(ajax, response, status) { 687 var focusChanged = false; 688 var container = document.querySelector(response.selector); 689 if (container) { 690 var tabbableElements = tabbable(container); 691 if (tabbableElements.length) { 692 tabbableElements[0].focus(); 693 focusChanged = true; 694 } else if (isFocusable(container)) { 695 container.focus(); 696 focusChanged = true; 697 } 698 } 699 if (ajax.hasOwnProperty('element') && !focusChanged) { 700 ajax.element.focus(); 701 } 702 }, 703 invoke: function invoke(ajax, response, status) { 704 var $element = $(response.selector); 705 $element[response.method].apply($element, _toConsumableArray(response.args)); 706 }, 707 restripe: function restripe(ajax, response, status) { 708 $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even'); 709 }, 710 update_build_id: function update_build_id(ajax, response, status) { 711 document.querySelectorAll("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).forEach(function (item) { 712 item.value = response.new; 713 }); 714 }, 715 add_css: function add_css(ajax, response, status) { 716 $('head').prepend(response.data); 717 }, 718 message: function message(ajax, response) { 719 var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector)); 720 if (response.clearPrevious) { 721 messages.clear(); 722 } 723 messages.add(response.message, response.messageOptions); 724 }, 725 add_js: function add_js(ajax, response, status) { 726 var parentEl = document.querySelector(response.selector || 'body'); 727 var settings = ajax.settings || drupalSettings; 728 var allUniqueBundleIds = response.data.map(function (script) { 729 var uniqueBundleId = script.src + ajax.instanceIndex; 730 loadjs(script.src, uniqueBundleId, { 731 async: false, 732 before: function before(path, scriptEl) { 733 Object.keys(script).forEach(function (attributeKey) { 734 scriptEl.setAttribute(attributeKey, script[attributeKey]); 735 }); 736 parentEl.appendChild(scriptEl); 737 return false; 738 } 739 }); 740 return uniqueBundleId; 741 }); 742 return new Promise(function (resolve, reject) { 743 loadjs.ready(allUniqueBundleIds, { 744 success: function success() { 745 Drupal.attachBehaviors(parentEl, settings); 746 resolve(); 747 }, 748 error: function error(depsNotFound) { 749 var message = Drupal.t("The following files could not be loaded: @dependencies", { 750 '@dependencies': depsNotFound.join(', ') 751 }); 752 reject(message); 753 } 754 }); 755 }); 756 } 757 }; 758 var stopEvent = function stopEvent(xhr, settings) { 759 return xhr.getResponseHeader('X-Drupal-Ajax-Token') === '1' && settings.isInProgress && settings.isInProgress(); 760 }; 761 $.extend(true, $.event.special, { 762 ajaxSuccess: { 763 trigger: function trigger(event, xhr, settings) { 764 if (stopEvent(xhr, settings)) { 765 return false; 766 } 767 } 768 }, 769 ajaxComplete: { 770 trigger: function trigger(event, xhr, settings) { 771 if (stopEvent(xhr, settings)) { 772 $.active++; 773 return false; 774 } 775 } 776 } 777 }); 778})(jQuery, window, Drupal, drupalSettings, loadjs, window.tabbable);; 779/** 780* DO NOT EDIT THIS FILE. 781* See the following change record for more information, 782* https://www.drupal.org/node/2815083 783* @preserve 784**/ 785(function (Drupal) { 786 Drupal.theme.ajaxProgressBar = function ($element) { 787 return $element.addClass('ajax-progress ajax-progress-bar'); 788 }; 789})(Drupal);; 790/** 791* DO NOT EDIT THIS FILE. 792* See the following change record for more information, 793* https://www.drupal.org/node/2815083 794* @preserve 795**/ 796(function ($, Drupal, _ref) { 797 var isTabbable = _ref.isTabbable; 798 $.extend($.expr[':'], { 799 tabbable: function tabbable(element) { 800 Drupal.deprecationError({
801 message: 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 11.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730' 802 }); 803 if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') { 804 var tabIndex = element.getAttribute('tabIndex'); 805 if (tabIndex === null || tabIndex < 0) { 806 return false; 807 } 808 } 809 return isTabbable(element); 810 } 811 }); 812})(jQuery, Drupal, window.tabbable);; 813/** 814* DO NOT EDIT THIS FILE. 815* See the following change record for more information, 816* https://www.drupal.org/node/2815083 817* @preserve 818**/ 819(function ($) { 820 var cachedScrollbarWidth = null; 821 var max = Math.max, 822 abs = Math.abs; 823 var regexHorizontal = /left|center|right/; 824 var regexVertical = /top|center|bottom/; 825 var regexOffset = /[+-]\d+(\.[\d]+)?%?/; 826 var regexPosition = /^\w+/; 827 var regexPercent = /%$/; 828 var _position = $.fn.position; 829 function getOffsets(offsets, width, height) { 830 return [parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1)]; 831 } 832 function parseCss(element, property) { 833 return parseInt($.css(element, property), 10) || 0; 834 } 835 function getDimensions(elem) { 836 var raw = elem[0]; 837 if (raw.nodeType === 9) { 838 return { 839 width: elem.width(), 840 height: elem.height(), 841 offset: { 842 top: 0, 843 left: 0 844 } 845 }; 846 } 847 if ($.isWindow(raw)) { 848 return { 849 width: elem.width(), 850 height: elem.height(), 851 offset: { 852 top: elem.scrollTop(), 853 left: elem.scrollLeft() 854 } 855 }; 856 } 857 if (raw.preventDefault) { 858 return { 859 width: 0, 860 height: 0, 861 offset: { 862 top: raw.pageY, 863 left: raw.pageX 864 } 865 }; 866 } 867 return { 868 width: elem.outerWidth(), 869 height: elem.outerHeight(), 870 offset: elem.offset() 871 }; 872 } 873 var collisions = { 874 fit: { 875 left: function left(position, data) { 876 var within = data.within; 877 var withinOffset = within.isWindow ? within.scrollLeft : within.offset.left; 878 var outerWidth = within.width; 879 var collisionPosLeft = position.left - data.collisionPosition.marginLeft; 880 var overLeft = withinOffset - collisionPosLeft; 881 var overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset; 882 var newOverRight; 883 if (data.collisionWidth > outerWidth) { 884 if (overLeft > 0 && overRight <= 0) { 885 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; 886 position.left += overLeft - newOverRight; 887 } else if (overRight > 0 && overLeft <= 0) { 888 position.left = withinOffset; 889 } else if (overLeft > overRight) { 890 position.left = withinOffset + outerWidth - data.collisionWidth; 891 } else { 892 position.left = withinOffset; 893 } 894 } else if (overLeft > 0) { 895 position.left += overLeft; 896 } else if (overRight > 0) { 897 position.left -= overRight; 898 } else { 899 position.left = max(position.left - collisionPosLeft, position.left); 900 } 901 },
902 top: function top(position, data) { 903 var within = data.within; 904 var withinOffset = within.isWindow ? within.scrollTop : within.offset.top; 905 var outerHeight = data.within.height; 906 var collisionPosTop = position.top - data.collisionPosition.marginTop; 907 var overTop = withinOffset - collisionPosTop; 908 var overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset; 909 var newOverBottom; 910 if (data.collisionHeight > outerHeight) { 911 if (overTop > 0 && overBottom <= 0) { 912 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; 913 position.top += overTop - newOverBottom; 914 } else if (overBottom > 0 && overTop <= 0) { 915 position.top = withinOffset; 916 } else if (overTop > overBottom) { 917 position.top = withinOffset + outerHeight - data.collisionHeight; 918 } else { 919 position.top = withinOffset; 920 } 921 } else if (overTop > 0) { 922 position.top += overTop; 923 } else if (overBottom > 0) { 924 position.top -= overBottom; 925 } else { 926 position.top = max(position.top - collisionPosTop, position.top); 927 } 928 } 929 }, 930 flip: { 931 left: function left(position, data) { 932 var within = data.within; 933 var withinOffset = within.offset.left + within.scrollLeft; 934 var outerWidth = within.width; 935 var offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left; 936 var collisionPosLeft = position.left - data.collisionPosition.marginLeft; 937 var overLeft = collisionPosLeft - offsetLeft; 938 var overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft; 939 var myOffset = data.my[0] === 'left' ? -data.elemWidth : data.my[0] === 'right' ? data.elemWidth : 0; 940 var atOffset = data.at[0] === 'left' ? data.targetWidth : data.at[0] === 'right' ? -data.targetWidth : 0; 941 var offset = -2 * data.offset[0]; 942 var newOverRight; 943 var newOverLeft; 944 if (overLeft < 0) { 945 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; 946 if (newOverRight < 0 || newOverRight < abs(overLeft)) { 947 position.left += myOffset + atOffset + offset; 948 } 949 } else if (overRight > 0) { 950 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; 951 if (newOverLeft > 0 || abs(newOverLeft) < overRight) { 952 position.left += myOffset + atOffset + offset; 953 } 954 } 955 },
956 top: function top(position, data) { 957 var within = data.within; 958 var withinOffset = within.offset.top + within.scrollTop; 959 var outerHeight = within.height; 960 var offsetTop = within.isWindow ? within.scrollTop : within.offset.top; 961 var collisionPosTop = position.top - data.collisionPosition.marginTop; 962 var overTop = collisionPosTop - offsetTop; 963 var overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop; 964 var top = data.my[1] === 'top'; 965 var myOffset = top ? -data.elemHeight : data.my[1] === 'bottom' ? data.elemHeight : 0; 966 var atOffset = data.at[1] === 'top' ? data.targetHeight : data.at[1] === 'bottom' ? -data.targetHeight : 0; 967 var offset = -2 * data.offset[1]; 968 var newOverTop; 969 var newOverBottom; 970 if (overTop < 0) { 971 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; 972 if (newOverBottom < 0 || newOverBottom < abs(overTop)) { 973 position.top += myOffset + atOffset + offset; 974 } 975 } else if (overBottom > 0) { 976 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; 977 if (newOverTop > 0 || abs(newOverTop) < overBottom) { 978 position.top += myOffset + atOffset + offset; 979 } 980 } 981 } 982 }, 983 flipfit: { 984 left: function left() { 985 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 986 args[_key] = arguments[_key]; 987 } 988 collisions.flip.left.apply(this, args); 989 collisions.fit.left.apply(this, args); 990 },
991 top: function top() { 992 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 993 args[_key2] = arguments[_key2]; 994 } 995 collisions.flip.top.apply(this, args); 996 collisions.fit.top.apply(this, args); 997 } 998 } 999 }; 1000 $.position = { 1001 scrollbarWidth: function scrollbarWidth() { 1002 if (cachedScrollbarWidth !== undefined) { 1003 return cachedScrollbarWidth; 1004 } 1005 var div = $('<div ' + "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + "<div style='height:100px;width:auto;'></div></div>"); 1006 var innerDiv = div.children()[0]; 1007 $('body').append(div); 1008 var w1 = innerDiv.offsetWidth; 1009 div.css('overflow', 'scroll'); 1010 var w2 = innerDiv.offsetWidth; 1011 if (w1 === w2) { 1012 w2 = div[0].clientWidth; 1013 } 1014 div.remove(); 1015 cachedScrollbarWidth = w1 - w2; 1016 return cachedScrollbarWidth; 1017 }, 1018 getScrollInfo: function getScrollInfo(within) { 1019 var overflowX = within.isWindow || within.isDocument ? '' : within.element.css('overflow-x'); 1020 var overflowY = within.isWindow || within.isDocument ? '' : within.element.css('overflow-y'); 1021 var hasOverflowX = overflowX === 'scroll' || overflowX === 'auto' && within.width < within.element[0].scrollWidth; 1022 var hasOverflowY = overflowY === 'scroll' || overflowY === 'auto' && within.height < within.element[0].scrollHeight; 1023 return { 1024 width: hasOverflowY ? $.position.scrollbarWidth() : 0, 1025 height: hasOverflowX ? $.position.scrollbarWidth() : 0 1026 }; 1027 }, 1028 getWithinInfo: function getWithinInfo(element) { 1029 var withinElement = $(element || window); 1030 var isWindow = $.isWindow(withinElement[0]); 1031 var isDocument = !!withinElement[0] && withinElement[0].nodeType === 9; 1032 var hasOffset = !isWindow && !isDocument; 1033 return { 1034 element: withinElement, 1035 isWindow: isWindow, 1036 isDocument: isDocument, 1037 offset: hasOffset ? $(element).offset() : { 1038 left: 0, 1039 top: 0 1040 }, 1041 scrollLeft: withinElement.scrollLeft(), 1042 scrollTop: withinElement.scrollTop(), 1043 width: withinElement.outerWidth(), 1044 height: withinElement.outerHeight() 1045 }; 1046 } 1047 }; 1048 $.fn.position = function (options) { 1049 if (!options || !options.of) { 1050 return _position.apply(this, arguments); 1051 } 1052 options = $.extend({}, options); 1053 var within = $.position.getWithinInfo(options.within); 1054 var scrollInfo = $.position.getScrollInfo(within); 1055 var collision = (options.collision || 'flip').split(' '); 1056 var offsets = {}; 1057 var target = typeof options.of === 'string' ? $(document).find(options.of) : $(options.of); 1058 var dimensions = getDimensions(target); 1059 var targetWidth = dimensions.width; 1060 var targetHeight = dimensions.height; 1061 var targetOffset = dimensions.offset; 1062 if (target[0].preventDefault) { 1063 options.at = 'left top'; 1064 } 1065 var basePosition = $.extend({}, targetOffset); 1066 $.each(['my', 'at'], function () { 1067 var pos = (options[this] || '').split(' '); 1068 if (pos.length === 1) { 1069 pos = regexHorizontal.test(pos[0]) ? pos.concat(['center']) : regexVertical.test(pos[0]) ? ['center'].concat(pos) : ['center', 'center']; 1070 } 1071 pos[0] = regexHorizontal.test(pos[0]) ? pos[0] : 'center'; 1072 pos[1] = regexVertical.test(pos[1]) ? pos[1] : 'center'; 1073 var horizontalOffset = regexOffset.exec(pos[0]); 1074 var verticalOffset = regexOffset.exec(pos[1]); 1075 offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0]; 1076 options[this] = [regexPosition.exec(pos[0])[0], regexPosition.exec(pos[1])[0]]; 1077 }); 1078 if (collision.length === 1) { 1079 collision[1] = collision[0]; 1080 } 1081 if (options.at[0] === 'right') { 1082 basePosition.left += targetWidth; 1083 } else if (options.at[0] === 'center') { 1084 basePosition.left += targetWidth / 2; 1085 } 1086 if (options.at[1] === 'bottom') { 1087 basePosition.top += targetHeight; 1088 } else if (options.at[1] === 'center') { 1089 basePosition.top += targetHeight / 2; 1090 } 1091 var atOffset = getOffsets(offsets.at, targetWidth, targetHeight); 1092 basePosition.left += atOffset[0]; 1093 basePosition.top += atOffset[1]; 1094 return this.each(function () { 1095 var using; 1096 var elem = $(this); 1097 var elemWidth = elem.outerWidth(); 1098 var elemHeight = elem.outerHeight(); 1099 var marginLeft = parseCss(this, 'marginLeft'); 1100 var marginTop = parseCss(this, 'marginTop'); 1101 var collisionWidth = elemWidth + marginLeft + parseCss(this, 'marginRight') + scrollInfo.width; 1102 var collisionHeight = elemHeight + marginTop + parseCss(this, 'marginBottom') + scrollInfo.height; 1103 var position = $.extend({}, basePosition); 1104 var myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight()); 1105 if (options.my[0] === 'right') { 1106 position.left -= elemWidth; 1107 } else if (options.my[0] === 'center') { 1108 position.left -= elemWidth / 2; 1109 } 1110 if (options.my[1] === 'bottom') { 1111 position.top -= elemHeight; 1112 } else if (options.my[1] === 'center') { 1113 position.top -= elemHeight / 2; 1114 } 1115 position.left += myOffset[0]; 1116 position.top += myOffset[1]; 1117 var collisionPosition = { 1118 marginLeft: marginLeft, 1119 marginTop: marginTop 1120 }; 1121 $.each(['left', 'top'], function (i, dir) { 1122 if (collisions[collision[i]]) { 1123 collisions[collision[i]][dir](position, { 1124 targetWidth: targetWidth, 1125 targetHeight: targetHeight, 1126 elemWidth: elemWidth, 1127 elemHeight: elemHeight, 1128 collisionPosition: collisionPosition, 1129 collisionWidth: collisionWidth, 1130 collisionHeight: collisionHeight, 1131 offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]], 1132 my: options.my, 1133 at: options.at, 1134 within: within, 1135 elem: elem 1136 }); 1137 } 1138 }); 1139 if (options.using) { 1140 using = function using(props) { 1141 var left = targetOffset.left - position.left; 1142 var right = left + targetWidth - elemWidth; 1143 var top = targetOffset.top - position.top; 1144 var bottom = top + targetHeight - elemHeight; 1145 var feedback = { 1146 target: { 1147 element: target, 1148 left: targetOffset.left, 1149 top: targetOffset.top, 1150 width: targetWidth, 1151 height: targetHeight 1152 }, 1153 element: { 1154 element: elem, 1155 left: position.left, 1156 top: position.top, 1157 width: elemWidth, 1158 height: elemHeight 1159 }, 1160 horizontal: right < 0 ? 'left' : left > 0 ? 'right' : 'center', 1161 vertical: bottom < 0 ? 'top' : top > 0 ? 'bottom' : 'middle' 1162 }; 1163 if (targetWidth < elemWidth && abs(left + right) < targetWidth) { 1164 feedback.horizontal = 'center'; 1165 } 1166 if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) { 1167 feedback.vertical = 'middle'; 1168 } 1169 if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) { 1170 feedback.important = 'horizontal'; 1171 } else { 1172 feedback.important = 'vertical'; 1173 } 1174 options.using.call(this, props, feedback); 1175 }; 1176 } 1177 elem.offset($.extend(position, { 1178 using: using 1179 })); 1180 }); 1181 }; 1182 if (!$.hasOwnProperty('ui')) { 1183 $.ui = {}; 1184 } 1185 $.ui.position = collisions; 1186})(jQuery);; 1187/** 1188 * @file 1189 * Expands the behaviour of the default autocompletion. 1190 */ 1191 1192(function ($, Drupal, drupalSettings, once) { 1193 1194 'use strict'; 1195 1196 // As a safety precaution, bail if the Drupal Core autocomplete framework is 1197 // not present. 1198 if (!Drupal.autocomplete) { 1199 return; 1200 } 1201 1202 var autocomplete = {}; 1203 1204 /** 1205 * Retrieves the custom settings for an autocomplete-enabled input field. 1206 * 1207 * @param {HTMLElement} input 1208 * The input field. 1209 * @param {object} globalSettings
1210 * The object containing global settings. If none is passed, drupalSettings 1211 * is used instead. 1212 * 1213 * @return {object} 1214 * The effective settings for the given input fields, with defaults set if 1215 * applicable. 1216 */ 1217 autocomplete.getSettings = function (input, globalSettings) { 1218 globalSettings = globalSettings || drupalSettings || {}; 1219 // Set defaults for all known settings. 1220 var settings = { 1221 auto_submit: false, 1222 delay: 0, 1223 min_length: 1, 1224 selector: ':submit', 1225 }; 1226 var search = $(input).data('search-api-autocomplete-search'); 1227 if (search 1228 && globalSettings.search_api_autocomplete 1229 && globalSettings.search_api_autocomplete[search]) { 1230 $.extend(settings, globalSettings.search_api_autocomplete[search]); 1231 } 1232 return settings; 1233 }; 1234 1235 /** 1236 * Attaches our custom autocomplete settings to all affected fields. 1237 * 1238 * @type {Drupal~behavior} 1239 * 1240 * @prop {Drupal~behaviorAttach} attach 1241 * Attaches the autocomplete behaviors. 1242 */ 1243 Drupal.behaviors.searchApiAutocomplete = { 1244 attach: function (context, settings) { 1245 // Find all our fields with autocomplete settings. 1246 $(once('search-api-autocomplete', 1247 '.ui-autocomplete-input[data-search-api-autocomplete-search]', 1248 context)).each(function () { 1249 var uiAutocomplete = $(this).data('ui-autocomplete'); 1250 if (!uiAutocomplete) { 1251 return; 1252 } 1253 var $element = uiAutocomplete.menu.element; 1254 $element.data('search-api-autocomplete-input-id', this.id); 1255 $element.addClass('search-api-autocomplete-search'); 1256 var elementSettings = autocomplete.getSettings(this, settings); 1257 if (elementSettings['delay']) { 1258 uiAutocomplete.options['delay'] = elementSettings['delay']; 1259 } 1260 if (elementSettings['min_length']) { 1261 uiAutocomplete.options['minLength'] = elementSettings['min_length']; 1262 } 1263 // Override the "select" callback of the jQuery UI autocomplete. 1264 var oldSelect = uiAutocomplete.options.select; 1265 uiAutocomplete.options.select = function (event, ui) { 1266 // If this is a URL suggestion, instead of autocompleting we 1267 // redirect the user to that URL. 1268 if (ui.item.url) { 1269 location.href = ui.item.url; 1270 return false; 1271 } 1272 1273 var ret = oldSelect.apply(this, arguments); 1274 1275 // If auto-submit is enabled, submit the form. 1276 if (elementSettings['auto_submit'] && elementSettings['selector']) { 1277 $(elementSettings['selector'], this.form).trigger('click'); 1278 } 1279 1280 return ret; 1281 }; 1282 }); 1283 } 1284 }; 1285 1286 Drupal.SearchApiAutocomplete = autocomplete; 1287 1288})(jQuery, Drupal, drupalSettings, once); 1289;
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.