2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
8 (function ($, Drupal, drupalSettings) {
9 function bigPipeProcessPlaceholderReplacement(index, placeholderReplacement) {
10 var placeholderId = placeholderReplacement.getAttribute('data-big-pipe-replacement-for-placeholder-with-id');
11 var content = this.textContent.trim();
13 if (typeof drupalSettings.bigPipePlaceholderIds[placeholderId] !== 'undefined') {
14 var response = mapTextContentToAjaxResponse(content);
16 if (response === false) {
17 $(this).removeOnce('big-pipe');
19 var ajaxObject = Drupal.ajax({
26 ajaxObject.success(response, 'success');
31 function mapTextContentToAjaxResponse(content) {
37 return JSON.parse(content);
43 function bigPipeProcessDocument(context) {
44 if (!context.querySelector('script[data-big-pipe-event="start"]')) {
48 $(context).find('script[data-big-pipe-replacement-for-placeholder-with-id]').once('big-pipe').each(bigPipeProcessPlaceholderReplacement);
50 if (context.querySelector('script[data-big-pipe-event="stop"]')) {
52 clearTimeout(timeoutID);
60 function bigPipeProcess() {
61 timeoutID = setTimeout(function () {
62 if (!bigPipeProcessDocument(document)) {
68 var interval = drupalSettings.bigPipeInterval || 50;
70 var timeoutID = void 0;
74 $(window).on('load', function () {
76 clearTimeout(timeoutID);
78 bigPipeProcessDocument(document);
80 })(jQuery, Drupal, drupalSettings);