var/cache/dev_hf4f0570ec4d597d79f3d835eecec3194/twig/a9/a9f5d212918aef72764d58a8f7aafbb5.php line 363

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @WebProfiler/Profiler/base_js.html.twig */
  14. class __TwigTemplate_16b89c84b2208a85d68c593daf9fed75 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@WebProfiler/Profiler/base_js.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@WebProfiler/Profiler/base_js.html.twig"));
  33.         echo "<!-- INCLUDE BEGIN @WebProfiler/Profiler/base_js.html.twig (vendor/symfony/web-profiler-bundle/Resources/views/Profiler/base_js.html.twig) -->";
  34.         // line 3
  35.         echo "<script";
  36.         if ((array_key_exists("csp_script_nonce"$context) && ($context["csp_script_nonce"] ?? null))) {
  37.             echo " nonce=\"";
  38.             echo twig_escape_filter($this->env, ($context["csp_script_nonce"] ?? null), "html"nulltrue);
  39.             echo "\"";
  40.         }
  41.         echo ">/*<![CDATA[*/
  42.     ";
  43.         // line 7
  44.         echo "
  45. if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') {
  46.     Sfjs = (function() {
  47.         \"use strict\";
  48.         if ('classList' in document.documentElement) {
  49.             var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
  50.             var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
  51.             var addClass = function(el, cssClass) { el.classList.add(cssClass); };
  52.             var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };
  53.         } else {
  54.             var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\\\b' + cssClass + '\\\\b')); };
  55.             var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\\\b' + cssClass + '\\\\b'), ' '); };
  56.             var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += \" \" + cssClass; } };
  57.             var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };
  58.         }
  59.         var noop = function() {};
  60.         var profilerStorageKey = 'symfony/profiler/';
  61.         var addEventListener;
  62.         var el = document.createElement('div');
  63.         if (!('addEventListener' in el)) {
  64.             addEventListener = function (element, eventName, callback) {
  65.                 element.attachEvent('on' + eventName, callback);
  66.             };
  67.         } else {
  68.             addEventListener = function (element, eventName, callback) {
  69.                 element.addEventListener(eventName, callback, false);
  70.             };
  71.         }
  72.         if (navigator.clipboard) {
  73.             document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
  74.                 removeClass(element, 'hidden');
  75.                 element.addEventListener('click', function() {
  76.                     navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
  77.                 })
  78.             });
  79.         }
  80.         var request = function(url, onSuccess, onError, payload, options, tries) {
  81.             var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
  82.             options = options || {};
  83.             options.retry = options.retry || false;
  84.             tries = tries || 1;
  85.             /* this delays for 125, 375, 625, 875, and 1000, ... */
  86.             var delay = tries < 5 ? (tries - 0.5) * 250 : 1000;
  87.             xhr.open(options.method || 'GET', url, true);
  88.             xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
  89.             xhr.onreadystatechange = function(state) {
  90.                 if (4 !== xhr.readyState) {
  91.                     return null;
  92.                 }
  93.                 if (xhr.status == 404 && options.retry && !options.stop) {
  94.                     setTimeout(function() {
  95.                         if (options.stop) {
  96.                             return;
  97.                         }
  98.                         request(url, onSuccess, onError, payload, options, tries + 1);
  99.                     }, delay);
  100.                     return null;
  101.                 }
  102.                 if (200 === xhr.status) {
  103.                     (onSuccess || noop)(xhr);
  104.                 } else {
  105.                     (onError || noop)(xhr);
  106.                 }
  107.             };
  108.             if (options.onSend) {
  109.                 options.onSend(tries);
  110.             }
  111.             xhr.send(payload || '');
  112.         };
  113.         var getPreference = function(name) {
  114.             if (!window.localStorage) {
  115.                 return null;
  116.             }
  117.             return localStorage.getItem(profilerStorageKey + name);
  118.         };
  119.         var setPreference = function(name, value) {
  120.             if (!window.localStorage) {
  121.                 return null;
  122.             }
  123.             localStorage.setItem(profilerStorageKey + name, value);
  124.         };
  125.         var requestStack = [];
  126.         var extractHeaders = function(xhr, stackElement) {
  127.             /* Here we avoid to call xhr.getResponseHeader in order to */
  128.             /* prevent polluting the console with CORS security errors */
  129.             var allHeaders = xhr.getAllResponseHeaders();
  130.             var ret;
  131.             if (ret = allHeaders.match(/^x-debug-token:\\s+(.*)\$/im)) {
  132.                 stackElement.profile = ret[1];
  133.             }
  134.             if (ret = allHeaders.match(/^x-debug-token-link:\\s+(.*)\$/im)) {
  135.                 stackElement.profilerUrl = ret[1];
  136.             }
  137.             if (ret = allHeaders.match(/^Symfony-Debug-Toolbar-Replace:\\s+(.*)\$/im)) {
  138.                 stackElement.toolbarReplaceFinished = false;
  139.                 stackElement.toolbarReplace = '1' === ret[1];
  140.             }
  141.         };
  142.         var successStreak = 4;
  143.         var pendingRequests = 0;
  144.         var renderAjaxRequests = function() {
  145.             var requestCounter = document.querySelector('.sf-toolbar-ajax-request-counter');
  146.             if (!requestCounter) {
  147.                 return;
  148.             }
  149.             requestCounter.textContent = requestStack.length;
  150.             var infoSpan = document.querySelector(\".sf-toolbar-ajax-info\");
  151.             if (infoSpan) {
  152.                 infoSpan.textContent = requestStack.length + ' AJAX request' + (requestStack.length !== 1 ? 's' : '');
  153.             }
  154.             var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
  155.             if (requestStack.length) {
  156.                 ajaxToolbarPanel.style.display = 'block';
  157.             } else {
  158.                 ajaxToolbarPanel.style.display = 'none';
  159.             }
  160.             if (pendingRequests > 0) {
  161.                 addClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
  162.             } else if (successStreak < 4) {
  163.                 addClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
  164.                 removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
  165.             } else {
  166.                 removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
  167.                 removeClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
  168.             }
  169.         };
  170.         var startAjaxRequest = function(index) {
  171.             var tbody = document.querySelector('.sf-toolbar-ajax-request-list');
  172.             if (!tbody) {
  173.                 return;
  174.             }
  175.             var nbOfAjaxRequest = tbody.rows.length;
  176.             if (nbOfAjaxRequest >= 100) {
  177.                 tbody.deleteRow(0);
  178.             }
  179.             var request = requestStack[index];
  180.             pendingRequests++;
  181.             var row = document.createElement('tr');
  182.             request.DOMNode = row;
  183.             var requestNumberCell = document.createElement('td');
  184.             requestNumberCell.textContent = index + 1;
  185.             row.appendChild(requestNumberCell);
  186.             var profilerCell = document.createElement('td');
  187.             profilerCell.textContent = 'n/a';
  188.             row.appendChild(profilerCell);
  189.             var methodCell = document.createElement('td');
  190.             methodCell.textContent = request.method;
  191.             row.appendChild(methodCell);
  192.             var typeCell = document.createElement('td');
  193.             typeCell.textContent = request.type;
  194.             row.appendChild(typeCell);
  195.             var statusCodeCell = document.createElement('td');
  196.             var statusCode = document.createElement('span');
  197.             statusCode.textContent = 'n/a';
  198.             statusCodeCell.appendChild(statusCode);
  199.             row.appendChild(statusCodeCell);
  200.             var pathCell = document.createElement('td');
  201.             pathCell.className = 'sf-ajax-request-url';
  202.             if ('GET' === request.method) {
  203.                 var pathLink = document.createElement('a');
  204.                 pathLink.setAttribute('href', request.url);
  205.                 pathLink.textContent = request.url;
  206.                 pathCell.appendChild(pathLink);
  207.             } else {
  208.                 pathCell.textContent = request.url;
  209.             }
  210.             pathCell.setAttribute('title', request.url);
  211.             row.appendChild(pathCell);
  212.             var durationCell = document.createElement('td');
  213.             durationCell.className = 'sf-ajax-request-duration';
  214.             durationCell.textContent = 'n/a';
  215.             row.appendChild(durationCell);
  216.             request.liveDurationHandle = setInterval(function() {
  217.                 durationCell.textContent = (new Date() - request.start) + ' ms';
  218.             }, 100);
  219.             row.className = 'sf-ajax-request sf-ajax-request-loading';
  220.             tbody.insertBefore(row, null);
  221.             var toolbarInfo = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
  222.             toolbarInfo.scrollTop = toolbarInfo.scrollHeight;
  223.             renderAjaxRequests();
  224.         };
  225.         var finishAjaxRequest = function(index) {
  226.             var request = requestStack[index];
  227.             clearInterval(request.liveDurationHandle);
  228.             if (!request.DOMNode) {
  229.                 return;
  230.             }
  231.             if (request.toolbarReplace && !request.toolbarReplaceFinished && request.profile) {
  232.                 /* Flag as complete because finishAjaxRequest can be called multiple times. */
  233.                 request.toolbarReplaceFinished = true;
  234.                 /* Search up through the DOM to find the toolbar's container ID. */
  235.                 for (var elem = request.DOMNode; elem && elem !== document; elem = elem.parentNode) {
  236.                     if (elem.id.match(/^sfwdt/)) {
  237.                         Sfjs.loadToolbar(elem.id.replace(/^sfwdt/, ''), request.profile);
  238.                         break;
  239.                     }
  240.                 }
  241.             }
  242.             pendingRequests--;
  243.             var row = request.DOMNode;
  244.             /* Unpack the children from the row */
  245.             var profilerCell = row.children[1];
  246.             var methodCell = row.children[2];
  247.             var statusCodeCell = row.children[4];
  248.             var statusCodeElem = statusCodeCell.children[0];
  249.             var durationCell = row.children[6];
  250.             if (request.error) {
  251.                 row.className = 'sf-ajax-request sf-ajax-request-error';
  252.                 methodCell.className = 'sf-ajax-request-error';
  253.                 successStreak = 0;
  254.             } else {
  255.                 row.className = 'sf-ajax-request sf-ajax-request-ok';
  256.                 successStreak++;
  257.             }
  258.             if (request.statusCode) {
  259.                 if (request.statusCode < 300) {
  260.                     statusCodeElem.setAttribute('class', 'sf-toolbar-status');
  261.                 } else if (request.statusCode < 400) {
  262.                     statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow');
  263.                 } else {
  264.                     statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
  265.                 }
  266.                 statusCodeElem.textContent = request.statusCode;
  267.             } else {
  268.                 statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
  269.             }
  270.             if (request.duration) {
  271.                 durationCell.textContent = request.duration + ' ms';
  272.             }
  273.             if (request.profilerUrl) {
  274.                 profilerCell.textContent = '';
  275.                 var profilerLink = document.createElement('a');
  276.                 profilerLink.setAttribute('href', request.profilerUrl);
  277.                 profilerLink.textContent = request.profile;
  278.                 profilerCell.appendChild(profilerLink);
  279.             }
  280.             renderAjaxRequests();
  281.         };
  282.         ";
  283.         // line 292
  284.         if (array_key_exists("excluded_ajax_paths"$context)) {
  285.             // line 293
  286.             echo "            if (window.fetch && window.fetch.polyfill === undefined) {
  287.                 var oldFetch = window.fetch;
  288.                 window.fetch = function () {
  289.                     var promise = oldFetch.apply(this, arguments);
  290.                     var url = arguments[0];
  291.                     var params = arguments[1];
  292.                     var paramType = Object.prototype.toString.call(arguments[0]);
  293.                     if (paramType === '[object Request]') {
  294.                         url = arguments[0].url;
  295.                         params = {
  296.                             method: arguments[0].method,
  297.                             credentials: arguments[0].credentials,
  298.                             headers: arguments[0].headers,
  299.                             mode: arguments[0].mode,
  300.                             redirect: arguments[0].redirect
  301.                         };
  302.                     } else {
  303.                         url = String(url);
  304.                     }
  305.                     if (!url.match(new RegExp(";
  306.             // line 312
  307.             echo $this->env->getFilter('json_encode')->getCallable()(($context["excluded_ajax_paths"] ?? null));
  308.             echo "))) {
  309.                         var method = 'GET';
  310.                         if (params && params.method !== undefined) {
  311.                             method = params.method;
  312.                         }
  313.                         var stackElement = {
  314.                             error: false,
  315.                             url: url,
  316.                             method: method,
  317.                             type: 'fetch',
  318.                             start: new Date()
  319.                         };
  320.                         var idx = requestStack.push(stackElement) - 1;
  321.                         promise.then(function (r) {
  322.                             stackElement.duration = new Date() - stackElement.start;
  323.                             stackElement.error = r.status < 200 || r.status >= 400;
  324.                             stackElement.statusCode = r.status;
  325.                             stackElement.profile = r.headers.get('x-debug-token');
  326.                             stackElement.profilerUrl = r.headers.get('x-debug-token-link');
  327.                             stackElement.toolbarReplaceFinished = false;
  328.                             stackElement.toolbarReplace = '1' === r.headers.get('Symfony-Debug-Toolbar-Replace');
  329.                             finishAjaxRequest(idx);
  330.                         }, function (e){
  331.                             stackElement.error = true;
  332.                             finishAjaxRequest(idx);
  333.                         });
  334.                         startAjaxRequest(idx);
  335.                     }
  336.                     return promise;
  337.                 };
  338.             }
  339.             if (window.XMLHttpRequest && XMLHttpRequest.prototype.addEventListener) {
  340.                 var proxied = XMLHttpRequest.prototype.open;
  341.                 XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
  342.                     var self = this;
  343.                     /* prevent logging AJAX calls to static and inline files, like templates */
  344.                     var path = url;
  345.                     if (url.slice(0, 1) === '/') {
  346.                         if (0 === url.indexOf('";
  347.             // line 355
  348.             echo twig_escape_filter($this->envtwig_escape_filter($this->envtwig_get_attribute($this->env$this->source, ($context["request"] ?? null), "basePath", [], "any"falsefalsefalse355), "js"), "html"nulltrue);
  349.             echo "')) {
  350.                             path = url.slice(";
  351.             // line 356
  352.             echo twig_escape_filter($this->envtwig_length_filter($this->envtwig_get_attribute($this->env$this->source, ($context["request"] ?? null), "basePath", [], "any"falsefalsefalse356)), "html"nulltrue);
  353.             echo ");
  354.                         }
  355.                     }
  356.                     else if (0 === url.indexOf('";
  357.             // line 359
  358.             echo twig_escape_filter($this->envtwig_escape_filter($this->env, (twig_get_attribute($this->env$this->source, ($context["request"] ?? null), "schemeAndHttpHost", [], "any"falsefalsefalse359) . twig_get_attribute($this->env$this->source, ($context["request"] ?? null), "basePath", [], "any"falsefalsefalse359)), "js"), "html"nulltrue);
  359.             echo "')) {
  360.                         path = url.slice(";
  361.             // line 360
  362.             echo twig_escape_filter($this->envtwig_length_filter($this->env, (twig_get_attribute($this->env$this->source, ($context["request"] ?? null), "schemeAndHttpHost", [], "any"falsefalsefalse360) . twig_get_attribute($this->env$this->source, ($context["request"] ?? null), "basePath", [], "any"falsefalsefalse360))), "html"nulltrue);
  363.             echo ");
  364.                     }
  365.                     if (!path.match(new RegExp(";
  366.             // line 363
  367.             echo $this->env->getFilter('json_encode')->getCallable()(($context["excluded_ajax_paths"] ?? null));
  368.             echo "))) {
  369.                         var stackElement = {
  370.                             error: false,
  371.                             url: url,
  372.                             method: method,
  373.                             type: 'xhr',
  374.                             start: new Date()
  375.                         };
  376.                         var idx = requestStack.push(stackElement) - 1;
  377.                         this.addEventListener('readystatechange', function() {
  378.                             if (self.readyState == 4) {
  379.                                 stackElement.duration = new Date() - stackElement.start;
  380.                                 stackElement.error = self.status < 200 || self.status >= 400;
  381.                                 stackElement.statusCode = self.status;
  382.                                 extractHeaders(self, stackElement);
  383.                                 finishAjaxRequest(idx);
  384.                             }
  385.                         }, false);
  386.                         startAjaxRequest(idx);
  387.                     }
  388.                     proxied.apply(this, Array.prototype.slice.call(arguments));
  389.                 };
  390.             }
  391.         ";
  392.         }
  393.         // line 392
  394.         echo "
  395.         return {
  396.             hasClass: hasClass,
  397.             removeClass: removeClass,
  398.             addClass: addClass,
  399.             toggleClass: toggleClass,
  400.             getPreference: getPreference,
  401.             setPreference: setPreference,
  402.             addEventListener: addEventListener,
  403.             request: request,
  404.             renderAjaxRequests: renderAjaxRequests,
  405.             getSfwdt: function(token) {
  406.                 if (!this.sfwdt) {
  407.                     this.sfwdt = document.getElementById('sfwdt' + token);
  408.                 }
  409.                 return this.sfwdt;
  410.             },
  411.             load: function(selector, url, onSuccess, onError, options) {
  412.                 var el = document.getElementById(selector);
  413.                 if (el && el.getAttribute('data-sfurl') !== url) {
  414.                     request(
  415.                         url,
  416.                         function(xhr) {
  417.                             el.innerHTML = xhr.responseText;
  418.                             el.setAttribute('data-sfurl', url);
  419.                             removeClass(el, 'loading');
  420.                             var pending = pendingRequests;
  421.                             for (var i = 0; i < requestStack.length; i++) {
  422.                                 startAjaxRequest(i);
  423.                                 if (requestStack[i].duration) {
  424.                                     finishAjaxRequest(i);
  425.                                 }
  426.                             }
  427.                             /* Revert the pending state in case there was a start called without a finish above. */
  428.                             pendingRequests = pending;
  429.                             (onSuccess || noop)(xhr, el);
  430.                         },
  431.                         function(xhr) { (onError || noop)(xhr, el); },
  432.                         '',
  433.                         options
  434.                     );
  435.                 }
  436.                 return this;
  437.             },
  438.             showToolbar: function(token) {
  439.                 var sfwdt = this.getSfwdt(token);
  440.                 removeClass(sfwdt, 'sf-display-none');
  441.                 if (getPreference('toolbar/displayState') == 'none') {
  442.                     document.getElementById('sfToolbarMainContent-' + token).style.display = 'none';
  443.                     document.getElementById('sfToolbarClearer-' + token).style.display = 'none';
  444.                     document.getElementById('sfMiniToolbar-' + token).style.display = 'block';
  445.                 } else {
  446.                     document.getElementById('sfToolbarMainContent-' + token).style.display = 'block';
  447.                     document.getElementById('sfToolbarClearer-' + token).style.display = 'block';
  448.                     document.getElementById('sfMiniToolbar-' + token).style.display = 'none';
  449.                 }
  450.             },
  451.             hideToolbar: function(token) {
  452.                 var sfwdt = this.getSfwdt(token);
  453.                 addClass(sfwdt, 'sf-display-none');
  454.             },
  455.             initToolbar: function(token) {
  456.                 this.showToolbar(token);
  457.                 var hideButton = document.getElementById('sfToolbarHideButton-' + token);
  458.                 var hideButtonSvg = hideButton.querySelector('svg');
  459.                 hideButtonSvg.setAttribute('aria-hidden', 'true');
  460.                 hideButtonSvg.setAttribute('focusable', 'false');
  461.                 addEventListener(hideButton, 'click', function (event) {
  462.                     event.preventDefault();
  463.                     var p = this.parentNode;
  464.                     p.style.display = 'none';
  465.                     (p.previousElementSibling || p.previousSibling).style.display = 'none';
  466.                     document.getElementById('sfMiniToolbar-' + token).style.display = 'block';
  467.                     setPreference('toolbar/displayState', 'none');
  468.                 });
  469.                 var showButton = document.getElementById('sfToolbarMiniToggler-' + token);
  470.                 var showButtonSvg = showButton.querySelector('svg');
  471.                 showButtonSvg.setAttribute('aria-hidden', 'true');
  472.                 showButtonSvg.setAttribute('focusable', 'false');
  473.                 addEventListener(showButton, 'click', function (event) {
  474.                     event.preventDefault();
  475.                     var elem = this.parentNode;
  476.                     if (elem.style.display == 'none') {
  477.                         document.getElementById('sfToolbarMainContent-' + token).style.display = 'none';
  478.                         document.getElementById('sfToolbarClearer-' + token).style.display = 'none';
  479.                         elem.style.display = 'block';
  480.                     } else {
  481.                         document.getElementById('sfToolbarMainContent-' + token).style.display = 'block';
  482.                         document.getElementById('sfToolbarClearer-' + token).style.display = 'block';
  483.                         elem.style.display = 'none'
  484.                     }
  485.                     setPreference('toolbar/displayState', 'block');
  486.                 });
  487.             },
  488.             loadToolbar: function(token, newToken) {
  489.                 var that = this;
  490.                 var triesCounter = document.getElementById('sfLoadCounter-' + token);
  491.                 var options = {
  492.                     retry: true,
  493.                     onSend: function (count) {
  494.                         if (count === 3) {
  495.                             that.initToolbar(token);
  496.                         }
  497.                         if (triesCounter) {
  498.                             triesCounter.textContent = count;
  499.                         }
  500.                     },
  501.                 };
  502.                 var cancelButton = document.getElementById('sfLoadCancel-' + token);
  503.                 if (cancelButton) {
  504.                     addEventListener(cancelButton, 'click', function (event) {
  505.                         event.preventDefault();
  506.                         options.stop = true;
  507.                         that.hideToolbar(token);
  508.                     });
  509.                 }
  510.                 newToken = (newToken || token);
  511.                 this.load(
  512.                     'sfwdt' + token,
  513.                     '";
  514.         // line 540
  515.         echo twig_escape_filter($this->envtwig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("_wdt", ["token" => "xxxxxx"]), "js"), "html"nulltrue);
  516.         echo "'.replace(/xxxxxx/, newToken),
  517.                     function(xhr, el) {
  518.                         /* Do nothing in the edge case where the toolbar has already been replaced with a new one */
  519.                         if (!document.getElementById('sfToolbarMainContent-' + newToken)) {
  520.                             return;
  521.                         }
  522.                         /* Evaluate in global scope scripts embedded inside the toolbar */
  523.                         var i, scripts = [].slice.call(el.querySelectorAll('script'));
  524.                         for (i = 0; i < scripts.length; ++i) {
  525.                             if (scripts[i].firstChild) {
  526.                                 eval.call({}, scripts[i].firstChild.nodeValue);
  527.                             }
  528.                         }
  529.                         el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
  530.                         if (el.style.display == 'none') {
  531.                             return;
  532.                         }
  533.                         that.initToolbar(newToken);
  534.                         /* Handle toolbar-info position */
  535.                         var toolbarBlocks = [].slice.call(el.querySelectorAll('.sf-toolbar-block'));
  536.                         for (i = 0; i < toolbarBlocks.length; ++i) {
  537.                             toolbarBlocks[i].onmouseover = function () {
  538.                                 var toolbarInfo = this.querySelectorAll('.sf-toolbar-info')[0];
  539.                                 var pageWidth = document.body.clientWidth;
  540.                                 var elementWidth = toolbarInfo.offsetWidth;
  541.                                 var leftValue = (elementWidth + this.offsetLeft) - pageWidth;
  542.                                 var rightValue = (elementWidth + (pageWidth - this.offsetLeft)) - pageWidth;
  543.                                 /* Reset right and left value, useful on window resize */
  544.                                 toolbarInfo.style.right = '';
  545.                                 toolbarInfo.style.left = '';
  546.                                 if (elementWidth > pageWidth) {
  547.                                     toolbarInfo.style.left = 0;
  548.                                 }
  549.                                 else if (leftValue > 0 && rightValue > 0) {
  550.                                     toolbarInfo.style.right = (rightValue * -1) + 'px';
  551.                                 } else if (leftValue < 0) {
  552.                                     toolbarInfo.style.left = 0;
  553.                                 } else {
  554.                                     toolbarInfo.style.right = '0px';
  555.                                 }
  556.                             };
  557.                         }
  558.                         renderAjaxRequests();
  559.                         addEventListener(document.querySelector('.sf-toolbar-ajax-clear'), 'click', function() {
  560.                             requestStack = [];
  561.                             renderAjaxRequests();
  562.                             successStreak = 4;
  563.                             document.querySelector('.sf-toolbar-ajax-request-list').innerHTML = '';
  564.                         });
  565.                         addEventListener(document.querySelector('.sf-toolbar-block-ajax'), 'mouseenter', function (event) {
  566.                             var elem = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
  567.                             elem.scrollTop = elem.scrollHeight;
  568.                         });
  569.                         addEventListener(document.querySelector('.sf-toolbar-block-ajax > .sf-toolbar-icon'), 'click', function (event) {
  570.                             event.preventDefault();
  571.                             toggleClass(this.parentNode, 'hover');
  572.                         });
  573.                         var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
  574.                         if (null !== dumpInfo) {
  575.                             addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
  576.                                 dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
  577.                             });
  578.                             addEventListener(dumpInfo, 'mouseleave', function () {
  579.                                 dumpInfo.style.minHeight = '';
  580.                             });
  581.                         }
  582.                     },
  583.                     function(xhr) {
  584.                         if (xhr.status !== 0 && !options.stop) {
  585.                             var sfwdt = that.getSfwdt(token);
  586.                             sfwdt.innerHTML = '\\
  587.                                 <div class=\"sf-toolbarreset\">\\
  588.                                     <div class=\"sf-toolbar-icon\"><svg width=\"26\" height=\"28\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 26 28\" enable-background=\"new 0 0 26 28\" xml:space=\"preserve\"><path fill=\"#FFFFFF\" d=\"M13 0C5.8 0 0 5.8 0 13c0 7.2 5.8 13 13 13c7.2 0 13-5.8 13-13C26 5.8 20.2 0 13 0z M20 7.5 c-0.6 0-1-0.3-1-0.9c0-0.2 0-0.4 0.2-0.6c0.1-0.3 0.2-0.3 0.2-0.4c0-0.3-0.5-0.4-0.7-0.4c-2 0.1-2.5 2.7-2.9 4.8l-0.2 1.1 c1.1 0.2 1.9 0 2.4-0.3c0.6-0.4-0.2-0.8-0.1-1.3C18 9.2 18.4 9 18.7 8.9c0.5 0 0.8 0.5 0.8 1c0 0.8-1.1 2-3.3 1.9 c-0.3 0-0.5 0-0.7-0.1L15 14.1c-0.4 1.7-0.9 4.1-2.6 6.2c-1.5 1.8-3.1 2.1-3.8 2.1c-1.3 0-2.1-0.6-2.2-1.6c0-0.9 0.8-1.4 1.3-1.4 c0.7 0 1.2 0.5 1.2 1.1c0 0.5-0.2 0.6-0.4 0.7c-0.1 0.1-0.3 0.2-0.3 0.4c0 0.1 0.1 0.3 0.4 0.3c0.5 0 0.9-0.3 1.2-0.5 c1.3-1 1.7-2.9 2.4-6.2l0.1-0.8c0.2-1.1 0.5-2.3 0.8-3.5c-0.9-0.7-1.4-1.5-2.6-1.8c-0.8-0.2-1.3 0-1.7 0.4C8.4 10 8.6 10.7 9 11.1 l0.7 0.7c0.8 0.9 1.3 1.7 1.1 2.7c-0.3 1.6-2.1 2.8-4.3 2.1c-1.9-0.6-2.2-1.9-2-2.7c0.2-0.6 0.7-0.8 1.2-0.6 c0.5 0.2 0.7 0.8 0.6 1.3c0 0.1 0 0.1-0.1 0.3C6 15 5.9 15.2 5.9 15.3c-0.1 0.4 0.4 0.7 0.8 0.8c0.8 0.3 1.7-0.2 1.9-0.9 c0.2-0.6-0.2-1.1-0.4-1.2l-0.8-0.9c-0.4-0.4-1.2-1.5-0.8-2.8c0.2-0.5 0.5-1 0.9-1.4c1-0.7 2-0.8 3-0.6c1.3 0.4 1.9 1.2 2.8 1.9 c0.5-1.3 1.1-2.6 2-3.8c0.9-1 2-1.7 3.3-1.8C20 4.8 21 5.4 21 6.3C21 6.7 20.8 7.5 20 7.5z\"/></svg></div>\\
  589.                                     An error occurred while loading the web debug toolbar. <a href=\"";
  590.         // line 623
  591.         echo twig_escape_filter($this->envtwig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("_profiler_home"), "js"), "html"nulltrue);
  592.         echo "' + newToken + '\">Open the web profiler.</a>\\
  593.                                 </div>\\
  594.                             ';
  595.                             sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');
  596.                         }
  597.                     },
  598.                     options
  599.                 );
  600.                 return this;
  601.             },
  602.             toggle: function(selector, elOn, elOff) {
  603.                 var tmp = elOn.style.display,
  604.                     el = document.getElementById(selector);
  605.                 elOn.style.display = elOff.style.display;
  606.                 elOff.style.display = tmp;
  607.                 if (el) {
  608.                     el.style.display = 'none' === tmp ? 'none' : 'block';
  609.                 }
  610.                 return this;
  611.             },
  612.             createTabs: function() {
  613.                 var tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])');
  614.                 /* create the tab navigation for each group of tabs */
  615.                 for (var i = 0; i < tabGroups.length; i++) {
  616.                     var tabs = tabGroups[i].querySelectorAll(':scope > .tab');
  617.                     var tabNavigation = document.createElement('ul');
  618.                     tabNavigation.className = 'tab-navigation';
  619.                     var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
  620.                     for (var j = 0; j < tabs.length; j++) {
  621.                         var tabId = 'tab-' + i + '-' + j;
  622.                         var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
  623.                         var tabNavigationItem = document.createElement('li');
  624.                         tabNavigationItem.setAttribute('data-tab-id', tabId);
  625.                         if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
  626.                         if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
  627.                         tabNavigationItem.innerHTML = tabTitle;
  628.                         tabNavigation.appendChild(tabNavigationItem);
  629.                         var tabContent = tabs[j].querySelector('.tab-content');
  630.                         tabContent.parentElement.setAttribute('id', tabId);
  631.                     }
  632.                     tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
  633.                     addClass(document.querySelector('[data-tab-id=\"' + selectedTabId + '\"]'), 'active');
  634.                 }
  635.                 /* display the active tab and add the 'click' event listeners */
  636.                 for (i = 0; i < tabGroups.length; i++) {
  637.                     tabNavigation = tabGroups[i].querySelectorAll(':scope > .tab-navigation li');
  638.                     for (j = 0; j < tabNavigation.length; j++) {
  639.                         tabId = tabNavigation[j].getAttribute('data-tab-id');
  640.                         document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';
  641.                         if (hasClass(tabNavigation[j], 'active')) {
  642.                             document.getElementById(tabId).className = 'block';
  643.                         } else {
  644.                             document.getElementById(tabId).className = 'hidden';
  645.                         }
  646.                         tabNavigation[j].addEventListener('click', function(e) {
  647.                             var activeTab = e.target || e.srcElement;
  648.                             /* needed because when the tab contains HTML contents, user can click */
  649.                             /* on any of those elements instead of their parent '<li>' element */
  650.                             while (activeTab.tagName.toLowerCase() !== 'li') {
  651.                                 activeTab = activeTab.parentNode;
  652.                             }
  653.                             /* get the full list of tabs through the parent of the active tab element */
  654.                             var tabNavigation = activeTab.parentNode.children;
  655.                             for (var k = 0; k < tabNavigation.length; k++) {
  656.                                 var tabId = tabNavigation[k].getAttribute('data-tab-id');
  657.                                 document.getElementById(tabId).className = 'hidden';
  658.                                 removeClass(tabNavigation[k], 'active');
  659.                             }
  660.                             addClass(activeTab, 'active');
  661.                             var activeTabId = activeTab.getAttribute('data-tab-id');
  662.                             document.getElementById(activeTabId).className = 'block';
  663.                         });
  664.                     }
  665.                     tabGroups[i].setAttribute('data-processed', 'true');
  666.                 }
  667.             },
  668.             createToggles: function() {
  669.                 var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])');
  670.                 for (var i = 0; i < toggles.length; i++) {
  671.                     var elementSelector = toggles[i].getAttribute('data-toggle-selector');
  672.                     var element = document.querySelector(elementSelector);
  673.                     addClass(element, 'sf-toggle-content');
  674.                     if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') {
  675.                         addClass(toggles[i], 'sf-toggle-on');
  676.                         addClass(element, 'sf-toggle-visible');
  677.                     } else {
  678.                         addClass(toggles[i], 'sf-toggle-off');
  679.                         addClass(element, 'sf-toggle-hidden');
  680.                     }
  681.                     addEventListener(toggles[i], 'click', function(e) {
  682.                         e.preventDefault();
  683.                         if ('' !== window.getSelection().toString()) {
  684.                             /* Don't do anything on text selection */
  685.                             return;
  686.                         }
  687.                         var toggle = e.target || e.srcElement;
  688.                         /* needed because when the toggle contains HTML contents, user can click */
  689.                         /* on any of those elements instead of their parent '.sf-toggle' element */
  690.                         while (!hasClass(toggle, 'sf-toggle')) {
  691.                             toggle = toggle.parentNode;
  692.                         }
  693.                         var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
  694.                         toggleClass(toggle, 'sf-toggle-on');
  695.                         toggleClass(toggle, 'sf-toggle-off');
  696.                         toggleClass(element, 'sf-toggle-hidden');
  697.                         toggleClass(element, 'sf-toggle-visible');
  698.                         /* the toggle doesn't change its contents when clicking on it */
  699.                         if (!toggle.hasAttribute('data-toggle-alt-content')) {
  700.                             return;
  701.                         }
  702.                         if (!toggle.hasAttribute('data-toggle-original-content')) {
  703.                             toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);
  704.                         }
  705.                         var currentContent = toggle.innerHTML;
  706.                         var originalContent = toggle.getAttribute('data-toggle-original-content');
  707.                         var altContent = toggle.getAttribute('data-toggle-alt-content');
  708.                         toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
  709.                     });
  710.                     /* Prevents from disallowing clicks on links inside toggles */
  711.                     var toggleLinks = toggles[i].querySelectorAll('a');
  712.                     for (var j = 0; j < toggleLinks.length; j++) {
  713.                         addEventListener(toggleLinks[j], 'click', function(e) {
  714.                             e.stopPropagation();
  715.                         });
  716.                     }
  717.                     /* Prevents from disallowing clicks on \"copy to clipboard\" elements inside toggles */
  718.                     var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]');
  719.                     for (var k = 0; k < copyToClipboardElements.length; k++) {
  720.                         addEventListener(copyToClipboardElements[k], 'click', function(e) {
  721.                             e.stopPropagation();
  722.                         });
  723.                     }
  724.                     toggles[i].setAttribute('data-processed', 'true');
  725.                 }
  726.             },
  727.             initializeLogsTable: function() {
  728.                 Sfjs.updateLogsTable();
  729.                 document.querySelectorAll('.log-filter input').forEach((input) => {
  730.                     input.addEventListener('change', () => { Sfjs.updateLogsTable(); });
  731.                 });
  732.                 document.querySelectorAll('.filter-select-all-or-none button').forEach((link) => {
  733.                     link.addEventListener('click', () => {
  734.                         const selectAll = link.classList.contains('select-all');
  735.                         link.closest('.log-filter-content').querySelectorAll('input').forEach((input) => {
  736.                             input.checked = selectAll;
  737.                         });
  738.                         Sfjs.updateLogsTable();
  739.                     });
  740.                 });
  741.                 document.body.addEventListener('click', (event) => {
  742.                     document.querySelectorAll('details.log-filter').forEach((filterElement) => {
  743.                         if (!filterElement.contains(event.target) && filterElement.open) {
  744.                             filterElement.open = false;
  745.                         }
  746.                     });
  747.                 });
  748.             },
  749.             updateLogsTable: function() {
  750.                 const selectedType = document.querySelector('#log-filter-type input:checked').value;
  751.                 const priorities = document.querySelectorAll('#log-filter-priority input');
  752.                 const allPriorities = Array.from(priorities).map((input) => input.value);
  753.                 const selectedPriorities = Array.from(priorities).filter((input) => input.checked).map((input) => input.value);
  754.                 const channels = document.querySelectorAll('#log-filter-channel input');
  755.                 const selectedChannels = Array.from(channels).filter((input) => input.checked).map((input) => input.value);
  756.                 const logs = document.querySelector('table.logs');
  757.                 if (null === logs) {
  758.                     return;
  759.                 }
  760.                 /* hide rows that don't match the current filters */
  761.                 let numVisibleRows = 0;
  762.                 logs.querySelectorAll('tbody tr').forEach((row) => {
  763.                     if ('all' !== selectedType && selectedType !== row.getAttribute('data-type')) {
  764.                         row.style.display = 'none';
  765.                         return;
  766.                     }
  767.                     const priority = row.getAttribute('data-priority');
  768.                     if (false === selectedPriorities.includes(priority) && true === allPriorities.includes(priority)) {
  769.                         row.style.display = 'none';
  770.                         return;
  771.                     }
  772.                     if ('' !== row.getAttribute('data-channel') && false === selectedChannels.includes(row.getAttribute('data-channel'))) {
  773.                         row.style.display = 'none';
  774.                         return;
  775.                     }
  776.                     row.style.display = 'table-row';
  777.                     numVisibleRows++;
  778.                 });
  779.                 document.querySelector('table.logs').style.display = 0 === numVisibleRows ? 'none' : 'table';
  780.                 document.querySelector('.no-logs-message').style.display = 0 === numVisibleRows ? 'block' : 'none';
  781.                 /* update the selected totals of all filters */
  782.                 document.querySelector('#log-filter-priority .filter-active-num').innerText = (priorities.length === selectedPriorities.length) ? 'All' : selectedPriorities.length;
  783.                 document.querySelector('#log-filter-channel .filter-active-num').innerText = (channels.length === selectedChannels.length) ? 'All' : selectedChannels.length;
  784.                 /* update the currently selected \"log type\" tab */
  785.                 document.querySelectorAll('#log-filter-type li').forEach((tab) => tab.classList.remove('active'));
  786.                 document.querySelector(`#log-filter-type input[value=\"\${selectedType}\"]`).parentElement.classList.add('active');
  787.             },
  788.         };
  789.     })();
  790.     Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
  791.         Sfjs.createTabs();
  792.         Sfjs.createToggles();
  793.     });
  794. }
  795. /*]]>*/</script>
  796. ";
  797.         // line 0
  798.         echo "<!-- INCLUDE END @WebProfiler/Profiler/base_js.html.twig -->";
  799.         
  800.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  801.         
  802.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  803.     }
  804.     public function getTemplateName()
  805.     {
  806.         return "@WebProfiler/Profiler/base_js.html.twig";
  807.     }
  808.     public function getDebugInfo()
  809.     {
  810.         return array (  954 => 0,  697 => 623,  611 => 540,  461 => 392,  429 => 363,  423 => 360,  419 => 359,  413 => 356,  409 => 355,  363 => 312,  342 => 293,  340 => 292,  53 => 7,  44 => 3,);
  811.     }
  812.     public function getSourceContext()
  813.     {
  814.         return new Source("{# This file is partially duplicated in src/Symfony/Component/ErrorHandler/Resources/assets/js/exception.js.
  815.    If you make any change in this file, verify the same change is needed in the other file. #}
  816. <script{% if csp_script_nonce is defined and csp_script_nonce %} nonce=\"{{ csp_script_nonce }}\"{% endif %}>/*<![CDATA[*/
  817.     {# Caution: the contents of this file are processed by Twig before loading
  818.                 them as JavaScript source code. Always use '/*' comments instead
  819.                 of '//' comments to avoid impossible-to-debug side-effects #}
  820. if (typeof Sfjs === 'undefined' || typeof Sfjs.loadToolbar === 'undefined') {
  821.     Sfjs = (function() {
  822.         \"use strict\";
  823.         if ('classList' in document.documentElement) {
  824.             var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
  825.             var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
  826.             var addClass = function(el, cssClass) { el.classList.add(cssClass); };
  827.             var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };
  828.         } else {
  829.             var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\\\b' + cssClass + '\\\\b')); };
  830.             var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\\\b' + cssClass + '\\\\b'), ' '); };
  831.             var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += \" \" + cssClass; } };
  832.             var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };
  833.         }
  834.         var noop = function() {};
  835.         var profilerStorageKey = 'symfony/profiler/';
  836.         var addEventListener;
  837.         var el = document.createElement('div');
  838.         if (!('addEventListener' in el)) {
  839.             addEventListener = function (element, eventName, callback) {
  840.                 element.attachEvent('on' + eventName, callback);
  841.             };
  842.         } else {
  843.             addEventListener = function (element, eventName, callback) {
  844.                 element.addEventListener(eventName, callback, false);
  845.             };
  846.         }
  847.         if (navigator.clipboard) {
  848.             document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
  849.                 removeClass(element, 'hidden');
  850.                 element.addEventListener('click', function() {
  851.                     navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
  852.                 })
  853.             });
  854.         }
  855.         var request = function(url, onSuccess, onError, payload, options, tries) {
  856.             var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
  857.             options = options || {};
  858.             options.retry = options.retry || false;
  859.             tries = tries || 1;
  860.             /* this delays for 125, 375, 625, 875, and 1000, ... */
  861.             var delay = tries < 5 ? (tries - 0.5) * 250 : 1000;
  862.             xhr.open(options.method || 'GET', url, true);
  863.             xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
  864.             xhr.onreadystatechange = function(state) {
  865.                 if (4 !== xhr.readyState) {
  866.                     return null;
  867.                 }
  868.                 if (xhr.status == 404 && options.retry && !options.stop) {
  869.                     setTimeout(function() {
  870.                         if (options.stop) {
  871.                             return;
  872.                         }
  873.                         request(url, onSuccess, onError, payload, options, tries + 1);
  874.                     }, delay);
  875.                     return null;
  876.                 }
  877.                 if (200 === xhr.status) {
  878.                     (onSuccess || noop)(xhr);
  879.                 } else {
  880.                     (onError || noop)(xhr);
  881.                 }
  882.             };
  883.             if (options.onSend) {
  884.                 options.onSend(tries);
  885.             }
  886.             xhr.send(payload || '');
  887.         };
  888.         var getPreference = function(name) {
  889.             if (!window.localStorage) {
  890.                 return null;
  891.             }
  892.             return localStorage.getItem(profilerStorageKey + name);
  893.         };
  894.         var setPreference = function(name, value) {
  895.             if (!window.localStorage) {
  896.                 return null;
  897.             }
  898.             localStorage.setItem(profilerStorageKey + name, value);
  899.         };
  900.         var requestStack = [];
  901.         var extractHeaders = function(xhr, stackElement) {
  902.             /* Here we avoid to call xhr.getResponseHeader in order to */
  903.             /* prevent polluting the console with CORS security errors */
  904.             var allHeaders = xhr.getAllResponseHeaders();
  905.             var ret;
  906.             if (ret = allHeaders.match(/^x-debug-token:\\s+(.*)\$/im)) {
  907.                 stackElement.profile = ret[1];
  908.             }
  909.             if (ret = allHeaders.match(/^x-debug-token-link:\\s+(.*)\$/im)) {
  910.                 stackElement.profilerUrl = ret[1];
  911.             }
  912.             if (ret = allHeaders.match(/^Symfony-Debug-Toolbar-Replace:\\s+(.*)\$/im)) {
  913.                 stackElement.toolbarReplaceFinished = false;
  914.                 stackElement.toolbarReplace = '1' === ret[1];
  915.             }
  916.         };
  917.         var successStreak = 4;
  918.         var pendingRequests = 0;
  919.         var renderAjaxRequests = function() {
  920.             var requestCounter = document.querySelector('.sf-toolbar-ajax-request-counter');
  921.             if (!requestCounter) {
  922.                 return;
  923.             }
  924.             requestCounter.textContent = requestStack.length;
  925.             var infoSpan = document.querySelector(\".sf-toolbar-ajax-info\");
  926.             if (infoSpan) {
  927.                 infoSpan.textContent = requestStack.length + ' AJAX request' + (requestStack.length !== 1 ? 's' : '');
  928.             }
  929.             var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
  930.             if (requestStack.length) {
  931.                 ajaxToolbarPanel.style.display = 'block';
  932.             } else {
  933.                 ajaxToolbarPanel.style.display = 'none';
  934.             }
  935.             if (pendingRequests > 0) {
  936.                 addClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
  937.             } else if (successStreak < 4) {
  938.                 addClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
  939.                 removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
  940.             } else {
  941.                 removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
  942.                 removeClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
  943.             }
  944.         };
  945.         var startAjaxRequest = function(index) {
  946.             var tbody = document.querySelector('.sf-toolbar-ajax-request-list');
  947.             if (!tbody) {
  948.                 return;
  949.             }
  950.             var nbOfAjaxRequest = tbody.rows.length;
  951.             if (nbOfAjaxRequest >= 100) {
  952.                 tbody.deleteRow(0);
  953.             }
  954.             var request = requestStack[index];
  955.             pendingRequests++;
  956.             var row = document.createElement('tr');
  957.             request.DOMNode = row;
  958.             var requestNumberCell = document.createElement('td');
  959.             requestNumberCell.textContent = index + 1;
  960.             row.appendChild(requestNumberCell);
  961.             var profilerCell = document.createElement('td');
  962.             profilerCell.textContent = 'n/a';
  963.             row.appendChild(profilerCell);
  964.             var methodCell = document.createElement('td');
  965.             methodCell.textContent = request.method;
  966.             row.appendChild(methodCell);
  967.             var typeCell = document.createElement('td');
  968.             typeCell.textContent = request.type;
  969.             row.appendChild(typeCell);
  970.             var statusCodeCell = document.createElement('td');
  971.             var statusCode = document.createElement('span');
  972.             statusCode.textContent = 'n/a';
  973.             statusCodeCell.appendChild(statusCode);
  974.             row.appendChild(statusCodeCell);
  975.             var pathCell = document.createElement('td');
  976.             pathCell.className = 'sf-ajax-request-url';
  977.             if ('GET' === request.method) {
  978.                 var pathLink = document.createElement('a');
  979.                 pathLink.setAttribute('href', request.url);
  980.                 pathLink.textContent = request.url;
  981.                 pathCell.appendChild(pathLink);
  982.             } else {
  983.                 pathCell.textContent = request.url;
  984.             }
  985.             pathCell.setAttribute('title', request.url);
  986.             row.appendChild(pathCell);
  987.             var durationCell = document.createElement('td');
  988.             durationCell.className = 'sf-ajax-request-duration';
  989.             durationCell.textContent = 'n/a';
  990.             row.appendChild(durationCell);
  991.             request.liveDurationHandle = setInterval(function() {
  992.                 durationCell.textContent = (new Date() - request.start) + ' ms';
  993.             }, 100);
  994.             row.className = 'sf-ajax-request sf-ajax-request-loading';
  995.             tbody.insertBefore(row, null);
  996.             var toolbarInfo = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
  997.             toolbarInfo.scrollTop = toolbarInfo.scrollHeight;
  998.             renderAjaxRequests();
  999.         };
  1000.         var finishAjaxRequest = function(index) {
  1001.             var request = requestStack[index];
  1002.             clearInterval(request.liveDurationHandle);
  1003.             if (!request.DOMNode) {
  1004.                 return;
  1005.             }
  1006.             if (request.toolbarReplace && !request.toolbarReplaceFinished && request.profile) {
  1007.                 /* Flag as complete because finishAjaxRequest can be called multiple times. */
  1008.                 request.toolbarReplaceFinished = true;
  1009.                 /* Search up through the DOM to find the toolbar's container ID. */
  1010.                 for (var elem = request.DOMNode; elem && elem !== document; elem = elem.parentNode) {
  1011.                     if (elem.id.match(/^sfwdt/)) {
  1012.                         Sfjs.loadToolbar(elem.id.replace(/^sfwdt/, ''), request.profile);
  1013.                         break;
  1014.                     }
  1015.                 }
  1016.             }
  1017.             pendingRequests--;
  1018.             var row = request.DOMNode;
  1019.             /* Unpack the children from the row */
  1020.             var profilerCell = row.children[1];
  1021.             var methodCell = row.children[2];
  1022.             var statusCodeCell = row.children[4];
  1023.             var statusCodeElem = statusCodeCell.children[0];
  1024.             var durationCell = row.children[6];
  1025.             if (request.error) {
  1026.                 row.className = 'sf-ajax-request sf-ajax-request-error';
  1027.                 methodCell.className = 'sf-ajax-request-error';
  1028.                 successStreak = 0;
  1029.             } else {
  1030.                 row.className = 'sf-ajax-request sf-ajax-request-ok';
  1031.                 successStreak++;
  1032.             }
  1033.             if (request.statusCode) {
  1034.                 if (request.statusCode < 300) {
  1035.                     statusCodeElem.setAttribute('class', 'sf-toolbar-status');
  1036.                 } else if (request.statusCode < 400) {
  1037.                     statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-yellow');
  1038.                 } else {
  1039.                     statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
  1040.                 }
  1041.                 statusCodeElem.textContent = request.statusCode;
  1042.             } else {
  1043.                 statusCodeElem.setAttribute('class', 'sf-toolbar-status sf-toolbar-status-red');
  1044.             }
  1045.             if (request.duration) {
  1046.                 durationCell.textContent = request.duration + ' ms';
  1047.             }
  1048.             if (request.profilerUrl) {
  1049.                 profilerCell.textContent = '';
  1050.                 var profilerLink = document.createElement('a');
  1051.                 profilerLink.setAttribute('href', request.profilerUrl);
  1052.                 profilerLink.textContent = request.profile;
  1053.                 profilerCell.appendChild(profilerLink);
  1054.             }
  1055.             renderAjaxRequests();
  1056.         };
  1057.         {% if excluded_ajax_paths is defined %}
  1058.             if (window.fetch && window.fetch.polyfill === undefined) {
  1059.                 var oldFetch = window.fetch;
  1060.                 window.fetch = function () {
  1061.                     var promise = oldFetch.apply(this, arguments);
  1062.                     var url = arguments[0];
  1063.                     var params = arguments[1];
  1064.                     var paramType = Object.prototype.toString.call(arguments[0]);
  1065.                     if (paramType === '[object Request]') {
  1066.                         url = arguments[0].url;
  1067.                         params = {
  1068.                             method: arguments[0].method,
  1069.                             credentials: arguments[0].credentials,
  1070.                             headers: arguments[0].headers,
  1071.                             mode: arguments[0].mode,
  1072.                             redirect: arguments[0].redirect
  1073.                         };
  1074.                     } else {
  1075.                         url = String(url);
  1076.                     }
  1077.                     if (!url.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
  1078.                         var method = 'GET';
  1079.                         if (params && params.method !== undefined) {
  1080.                             method = params.method;
  1081.                         }
  1082.                         var stackElement = {
  1083.                             error: false,
  1084.                             url: url,
  1085.                             method: method,
  1086.                             type: 'fetch',
  1087.                             start: new Date()
  1088.                         };
  1089.                         var idx = requestStack.push(stackElement) - 1;
  1090.                         promise.then(function (r) {
  1091.                             stackElement.duration = new Date() - stackElement.start;
  1092.                             stackElement.error = r.status < 200 || r.status >= 400;
  1093.                             stackElement.statusCode = r.status;
  1094.                             stackElement.profile = r.headers.get('x-debug-token');
  1095.                             stackElement.profilerUrl = r.headers.get('x-debug-token-link');
  1096.                             stackElement.toolbarReplaceFinished = false;
  1097.                             stackElement.toolbarReplace = '1' === r.headers.get('Symfony-Debug-Toolbar-Replace');
  1098.                             finishAjaxRequest(idx);
  1099.                         }, function (e){
  1100.                             stackElement.error = true;
  1101.                             finishAjaxRequest(idx);
  1102.                         });
  1103.                         startAjaxRequest(idx);
  1104.                     }
  1105.                     return promise;
  1106.                 };
  1107.             }
  1108.             if (window.XMLHttpRequest && XMLHttpRequest.prototype.addEventListener) {
  1109.                 var proxied = XMLHttpRequest.prototype.open;
  1110.                 XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
  1111.                     var self = this;
  1112.                     /* prevent logging AJAX calls to static and inline files, like templates */
  1113.                     var path = url;
  1114.                     if (url.slice(0, 1) === '/') {
  1115.                         if (0 === url.indexOf('{{ request.basePath|e('js') }}')) {
  1116.                             path = url.slice({{ request.basePath|length }});
  1117.                         }
  1118.                     }
  1119.                     else if (0 === url.indexOf('{{ (request.schemeAndHttpHost ~ request.basePath)|e('js') }}')) {
  1120.                         path = url.slice({{ (request.schemeAndHttpHost ~ request.basePath)|length }});
  1121.                     }
  1122.                     if (!path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
  1123.                         var stackElement = {
  1124.                             error: false,
  1125.                             url: url,
  1126.                             method: method,
  1127.                             type: 'xhr',
  1128.                             start: new Date()
  1129.                         };
  1130.                         var idx = requestStack.push(stackElement) - 1;
  1131.                         this.addEventListener('readystatechange', function() {
  1132.                             if (self.readyState == 4) {
  1133.                                 stackElement.duration = new Date() - stackElement.start;
  1134.                                 stackElement.error = self.status < 200 || self.status >= 400;
  1135.                                 stackElement.statusCode = self.status;
  1136.                                 extractHeaders(self, stackElement);
  1137.                                 finishAjaxRequest(idx);
  1138.                             }
  1139.                         }, false);
  1140.                         startAjaxRequest(idx);
  1141.                     }
  1142.                     proxied.apply(this, Array.prototype.slice.call(arguments));
  1143.                 };
  1144.             }
  1145.         {% endif %}
  1146.         return {
  1147.             hasClass: hasClass,
  1148.             removeClass: removeClass,
  1149.             addClass: addClass,
  1150.             toggleClass: toggleClass,
  1151.             getPreference: getPreference,
  1152.             setPreference: setPreference,
  1153.             addEventListener: addEventListener,
  1154.             request: request,
  1155.             renderAjaxRequests: renderAjaxRequests,
  1156.             getSfwdt: function(token) {
  1157.                 if (!this.sfwdt) {
  1158.                     this.sfwdt = document.getElementById('sfwdt' + token);
  1159.                 }
  1160.                 return this.sfwdt;
  1161.             },
  1162.             load: function(selector, url, onSuccess, onError, options) {
  1163.                 var el = document.getElementById(selector);
  1164.                 if (el && el.getAttribute('data-sfurl') !== url) {
  1165.                     request(
  1166.                         url,
  1167.                         function(xhr) {
  1168.                             el.innerHTML = xhr.responseText;
  1169.                             el.setAttribute('data-sfurl', url);
  1170.                             removeClass(el, 'loading');
  1171.                             var pending = pendingRequests;
  1172.                             for (var i = 0; i < requestStack.length; i++) {
  1173.                                 startAjaxRequest(i);
  1174.                                 if (requestStack[i].duration) {
  1175.                                     finishAjaxRequest(i);
  1176.                                 }
  1177.                             }
  1178.                             /* Revert the pending state in case there was a start called without a finish above. */
  1179.                             pendingRequests = pending;
  1180.                             (onSuccess || noop)(xhr, el);
  1181.                         },
  1182.                         function(xhr) { (onError || noop)(xhr, el); },
  1183.                         '',
  1184.                         options
  1185.                     );
  1186.                 }
  1187.                 return this;
  1188.             },
  1189.             showToolbar: function(token) {
  1190.                 var sfwdt = this.getSfwdt(token);
  1191.                 removeClass(sfwdt, 'sf-display-none');
  1192.                 if (getPreference('toolbar/displayState') == 'none') {
  1193.                     document.getElementById('sfToolbarMainContent-' + token).style.display = 'none';
  1194.                     document.getElementById('sfToolbarClearer-' + token).style.display = 'none';
  1195.                     document.getElementById('sfMiniToolbar-' + token).style.display = 'block';
  1196.                 } else {
  1197.                     document.getElementById('sfToolbarMainContent-' + token).style.display = 'block';
  1198.                     document.getElementById('sfToolbarClearer-' + token).style.display = 'block';
  1199.                     document.getElementById('sfMiniToolbar-' + token).style.display = 'none';
  1200.                 }
  1201.             },
  1202.             hideToolbar: function(token) {
  1203.                 var sfwdt = this.getSfwdt(token);
  1204.                 addClass(sfwdt, 'sf-display-none');
  1205.             },
  1206.             initToolbar: function(token) {
  1207.                 this.showToolbar(token);
  1208.                 var hideButton = document.getElementById('sfToolbarHideButton-' + token);
  1209.                 var hideButtonSvg = hideButton.querySelector('svg');
  1210.                 hideButtonSvg.setAttribute('aria-hidden', 'true');
  1211.                 hideButtonSvg.setAttribute('focusable', 'false');
  1212.                 addEventListener(hideButton, 'click', function (event) {
  1213.                     event.preventDefault();
  1214.                     var p = this.parentNode;
  1215.                     p.style.display = 'none';
  1216.                     (p.previousElementSibling || p.previousSibling).style.display = 'none';
  1217.                     document.getElementById('sfMiniToolbar-' + token).style.display = 'block';
  1218.                     setPreference('toolbar/displayState', 'none');
  1219.                 });
  1220.                 var showButton = document.getElementById('sfToolbarMiniToggler-' + token);
  1221.                 var showButtonSvg = showButton.querySelector('svg');
  1222.                 showButtonSvg.setAttribute('aria-hidden', 'true');
  1223.                 showButtonSvg.setAttribute('focusable', 'false');
  1224.                 addEventListener(showButton, 'click', function (event) {
  1225.                     event.preventDefault();
  1226.                     var elem = this.parentNode;
  1227.                     if (elem.style.display == 'none') {
  1228.                         document.getElementById('sfToolbarMainContent-' + token).style.display = 'none';
  1229.                         document.getElementById('sfToolbarClearer-' + token).style.display = 'none';
  1230.                         elem.style.display = 'block';
  1231.                     } else {
  1232.                         document.getElementById('sfToolbarMainContent-' + token).style.display = 'block';
  1233.                         document.getElementById('sfToolbarClearer-' + token).style.display = 'block';
  1234.                         elem.style.display = 'none'
  1235.                     }
  1236.                     setPreference('toolbar/displayState', 'block');
  1237.                 });
  1238.             },
  1239.             loadToolbar: function(token, newToken) {
  1240.                 var that = this;
  1241.                 var triesCounter = document.getElementById('sfLoadCounter-' + token);
  1242.                 var options = {
  1243.                     retry: true,
  1244.                     onSend: function (count) {
  1245.                         if (count === 3) {
  1246.                             that.initToolbar(token);
  1247.                         }
  1248.                         if (triesCounter) {
  1249.                             triesCounter.textContent = count;
  1250.                         }
  1251.                     },
  1252.                 };
  1253.                 var cancelButton = document.getElementById('sfLoadCancel-' + token);
  1254.                 if (cancelButton) {
  1255.                     addEventListener(cancelButton, 'click', function (event) {
  1256.                         event.preventDefault();
  1257.                         options.stop = true;
  1258.                         that.hideToolbar(token);
  1259.                     });
  1260.                 }
  1261.                 newToken = (newToken || token);
  1262.                 this.load(
  1263.                     'sfwdt' + token,
  1264.                     '{{ url(\"_wdt\", { \"token\": \"xxxxxx\" })|escape('js') }}'.replace(/xxxxxx/, newToken),
  1265.                     function(xhr, el) {
  1266.                         /* Do nothing in the edge case where the toolbar has already been replaced with a new one */
  1267.                         if (!document.getElementById('sfToolbarMainContent-' + newToken)) {
  1268.                             return;
  1269.                         }
  1270.                         /* Evaluate in global scope scripts embedded inside the toolbar */
  1271.                         var i, scripts = [].slice.call(el.querySelectorAll('script'));
  1272.                         for (i = 0; i < scripts.length; ++i) {
  1273.                             if (scripts[i].firstChild) {
  1274.                                 eval.call({}, scripts[i].firstChild.nodeValue);
  1275.                             }
  1276.                         }
  1277.                         el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
  1278.                         if (el.style.display == 'none') {
  1279.                             return;
  1280.                         }
  1281.                         that.initToolbar(newToken);
  1282.                         /* Handle toolbar-info position */
  1283.                         var toolbarBlocks = [].slice.call(el.querySelectorAll('.sf-toolbar-block'));
  1284.                         for (i = 0; i < toolbarBlocks.length; ++i) {
  1285.                             toolbarBlocks[i].onmouseover = function () {
  1286.                                 var toolbarInfo = this.querySelectorAll('.sf-toolbar-info')[0];
  1287.                                 var pageWidth = document.body.clientWidth;
  1288.                                 var elementWidth = toolbarInfo.offsetWidth;
  1289.                                 var leftValue = (elementWidth + this.offsetLeft) - pageWidth;
  1290.                                 var rightValue = (elementWidth + (pageWidth - this.offsetLeft)) - pageWidth;
  1291.                                 /* Reset right and left value, useful on window resize */
  1292.                                 toolbarInfo.style.right = '';
  1293.                                 toolbarInfo.style.left = '';
  1294.                                 if (elementWidth > pageWidth) {
  1295.                                     toolbarInfo.style.left = 0;
  1296.                                 }
  1297.                                 else if (leftValue > 0 && rightValue > 0) {
  1298.                                     toolbarInfo.style.right = (rightValue * -1) + 'px';
  1299.                                 } else if (leftValue < 0) {
  1300.                                     toolbarInfo.style.left = 0;
  1301.                                 } else {
  1302.                                     toolbarInfo.style.right = '0px';
  1303.                                 }
  1304.                             };
  1305.                         }
  1306.                         renderAjaxRequests();
  1307.                         addEventListener(document.querySelector('.sf-toolbar-ajax-clear'), 'click', function() {
  1308.                             requestStack = [];
  1309.                             renderAjaxRequests();
  1310.                             successStreak = 4;
  1311.                             document.querySelector('.sf-toolbar-ajax-request-list').innerHTML = '';
  1312.                         });
  1313.                         addEventListener(document.querySelector('.sf-toolbar-block-ajax'), 'mouseenter', function (event) {
  1314.                             var elem = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
  1315.                             elem.scrollTop = elem.scrollHeight;
  1316.                         });
  1317.                         addEventListener(document.querySelector('.sf-toolbar-block-ajax > .sf-toolbar-icon'), 'click', function (event) {
  1318.                             event.preventDefault();
  1319.                             toggleClass(this.parentNode, 'hover');
  1320.                         });
  1321.                         var dumpInfo = document.querySelector('.sf-toolbar-block-dump .sf-toolbar-info');
  1322.                         if (null !== dumpInfo) {
  1323.                             addEventListener(dumpInfo, 'sfbeforedumpcollapse', function () {
  1324.                                 dumpInfo.style.minHeight = dumpInfo.getBoundingClientRect().height+'px';
  1325.                             });
  1326.                             addEventListener(dumpInfo, 'mouseleave', function () {
  1327.                                 dumpInfo.style.minHeight = '';
  1328.                             });
  1329.                         }
  1330.                     },
  1331.                     function(xhr) {
  1332.                         if (xhr.status !== 0 && !options.stop) {
  1333.                             var sfwdt = that.getSfwdt(token);
  1334.                             sfwdt.innerHTML = '\\
  1335.                                 <div class=\"sf-toolbarreset\">\\
  1336.                                     <div class=\"sf-toolbar-icon\"><svg width=\"26\" height=\"28\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" x=\"0px\" y=\"0px\" viewBox=\"0 0 26 28\" enable-background=\"new 0 0 26 28\" xml:space=\"preserve\"><path fill=\"#FFFFFF\" d=\"M13 0C5.8 0 0 5.8 0 13c0 7.2 5.8 13 13 13c7.2 0 13-5.8 13-13C26 5.8 20.2 0 13 0z M20 7.5 c-0.6 0-1-0.3-1-0.9c0-0.2 0-0.4 0.2-0.6c0.1-0.3 0.2-0.3 0.2-0.4c0-0.3-0.5-0.4-0.7-0.4c-2 0.1-2.5 2.7-2.9 4.8l-0.2 1.1 c1.1 0.2 1.9 0 2.4-0.3c0.6-0.4-0.2-0.8-0.1-1.3C18 9.2 18.4 9 18.7 8.9c0.5 0 0.8 0.5 0.8 1c0 0.8-1.1 2-3.3 1.9 c-0.3 0-0.5 0-0.7-0.1L15 14.1c-0.4 1.7-0.9 4.1-2.6 6.2c-1.5 1.8-3.1 2.1-3.8 2.1c-1.3 0-2.1-0.6-2.2-1.6c0-0.9 0.8-1.4 1.3-1.4 c0.7 0 1.2 0.5 1.2 1.1c0 0.5-0.2 0.6-0.4 0.7c-0.1 0.1-0.3 0.2-0.3 0.4c0 0.1 0.1 0.3 0.4 0.3c0.5 0 0.9-0.3 1.2-0.5 c1.3-1 1.7-2.9 2.4-6.2l0.1-0.8c0.2-1.1 0.5-2.3 0.8-3.5c-0.9-0.7-1.4-1.5-2.6-1.8c-0.8-0.2-1.3 0-1.7 0.4C8.4 10 8.6 10.7 9 11.1 l0.7 0.7c0.8 0.9 1.3 1.7 1.1 2.7c-0.3 1.6-2.1 2.8-4.3 2.1c-1.9-0.6-2.2-1.9-2-2.7c0.2-0.6 0.7-0.8 1.2-0.6 c0.5 0.2 0.7 0.8 0.6 1.3c0 0.1 0 0.1-0.1 0.3C6 15 5.9 15.2 5.9 15.3c-0.1 0.4 0.4 0.7 0.8 0.8c0.8 0.3 1.7-0.2 1.9-0.9 c0.2-0.6-0.2-1.1-0.4-1.2l-0.8-0.9c-0.4-0.4-1.2-1.5-0.8-2.8c0.2-0.5 0.5-1 0.9-1.4c1-0.7 2-0.8 3-0.6c1.3 0.4 1.9 1.2 2.8 1.9 c0.5-1.3 1.1-2.6 2-3.8c0.9-1 2-1.7 3.3-1.8C20 4.8 21 5.4 21 6.3C21 6.7 20.8 7.5 20 7.5z\"/></svg></div>\\
  1337.                                     An error occurred while loading the web debug toolbar. <a href=\"{{ url(\"_profiler_home\")|escape('js') }}' + newToken + '\">Open the web profiler.</a>\\
  1338.                                 </div>\\
  1339.                             ';
  1340.                             sfwdt.setAttribute('class', 'sf-toolbar sf-error-toolbar');
  1341.                         }
  1342.                     },
  1343.                     options
  1344.                 );
  1345.                 return this;
  1346.             },
  1347.             toggle: function(selector, elOn, elOff) {
  1348.                 var tmp = elOn.style.display,
  1349.                     el = document.getElementById(selector);
  1350.                 elOn.style.display = elOff.style.display;
  1351.                 elOff.style.display = tmp;
  1352.                 if (el) {
  1353.                     el.style.display = 'none' === tmp ? 'none' : 'block';
  1354.                 }
  1355.                 return this;
  1356.             },
  1357.             createTabs: function() {
  1358.                 var tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])');
  1359.                 /* create the tab navigation for each group of tabs */
  1360.                 for (var i = 0; i < tabGroups.length; i++) {
  1361.                     var tabs = tabGroups[i].querySelectorAll(':scope > .tab');
  1362.                     var tabNavigation = document.createElement('ul');
  1363.                     tabNavigation.className = 'tab-navigation';
  1364.                     var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
  1365.                     for (var j = 0; j < tabs.length; j++) {
  1366.                         var tabId = 'tab-' + i + '-' + j;
  1367.                         var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
  1368.                         var tabNavigationItem = document.createElement('li');
  1369.                         tabNavigationItem.setAttribute('data-tab-id', tabId);
  1370.                         if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
  1371.                         if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
  1372.                         tabNavigationItem.innerHTML = tabTitle;
  1373.                         tabNavigation.appendChild(tabNavigationItem);
  1374.                         var tabContent = tabs[j].querySelector('.tab-content');
  1375.                         tabContent.parentElement.setAttribute('id', tabId);
  1376.                     }
  1377.                     tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
  1378.                     addClass(document.querySelector('[data-tab-id=\"' + selectedTabId + '\"]'), 'active');
  1379.                 }
  1380.                 /* display the active tab and add the 'click' event listeners */
  1381.                 for (i = 0; i < tabGroups.length; i++) {
  1382.                     tabNavigation = tabGroups[i].querySelectorAll(':scope > .tab-navigation li');
  1383.                     for (j = 0; j < tabNavigation.length; j++) {
  1384.                         tabId = tabNavigation[j].getAttribute('data-tab-id');
  1385.                         document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';
  1386.                         if (hasClass(tabNavigation[j], 'active')) {
  1387.                             document.getElementById(tabId).className = 'block';
  1388.                         } else {
  1389.                             document.getElementById(tabId).className = 'hidden';
  1390.                         }
  1391.                         tabNavigation[j].addEventListener('click', function(e) {
  1392.                             var activeTab = e.target || e.srcElement;
  1393.                             /* needed because when the tab contains HTML contents, user can click */
  1394.                             /* on any of those elements instead of their parent '<li>' element */
  1395.                             while (activeTab.tagName.toLowerCase() !== 'li') {
  1396.                                 activeTab = activeTab.parentNode;
  1397.                             }
  1398.                             /* get the full list of tabs through the parent of the active tab element */
  1399.                             var tabNavigation = activeTab.parentNode.children;
  1400.                             for (var k = 0; k < tabNavigation.length; k++) {
  1401.                                 var tabId = tabNavigation[k].getAttribute('data-tab-id');
  1402.                                 document.getElementById(tabId).className = 'hidden';
  1403.                                 removeClass(tabNavigation[k], 'active');
  1404.                             }
  1405.                             addClass(activeTab, 'active');
  1406.                             var activeTabId = activeTab.getAttribute('data-tab-id');
  1407.                             document.getElementById(activeTabId).className = 'block';
  1408.                         });
  1409.                     }
  1410.                     tabGroups[i].setAttribute('data-processed', 'true');
  1411.                 }
  1412.             },
  1413.             createToggles: function() {
  1414.                 var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])');
  1415.                 for (var i = 0; i < toggles.length; i++) {
  1416.                     var elementSelector = toggles[i].getAttribute('data-toggle-selector');
  1417.                     var element = document.querySelector(elementSelector);
  1418.                     addClass(element, 'sf-toggle-content');
  1419.                     if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') {
  1420.                         addClass(toggles[i], 'sf-toggle-on');
  1421.                         addClass(element, 'sf-toggle-visible');
  1422.                     } else {
  1423.                         addClass(toggles[i], 'sf-toggle-off');
  1424.                         addClass(element, 'sf-toggle-hidden');
  1425.                     }
  1426.                     addEventListener(toggles[i], 'click', function(e) {
  1427.                         e.preventDefault();
  1428.                         if ('' !== window.getSelection().toString()) {
  1429.                             /* Don't do anything on text selection */
  1430.                             return;
  1431.                         }
  1432.                         var toggle = e.target || e.srcElement;
  1433.                         /* needed because when the toggle contains HTML contents, user can click */
  1434.                         /* on any of those elements instead of their parent '.sf-toggle' element */
  1435.                         while (!hasClass(toggle, 'sf-toggle')) {
  1436.                             toggle = toggle.parentNode;
  1437.                         }
  1438.                         var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
  1439.                         toggleClass(toggle, 'sf-toggle-on');
  1440.                         toggleClass(toggle, 'sf-toggle-off');
  1441.                         toggleClass(element, 'sf-toggle-hidden');
  1442.                         toggleClass(element, 'sf-toggle-visible');
  1443.                         /* the toggle doesn't change its contents when clicking on it */
  1444.                         if (!toggle.hasAttribute('data-toggle-alt-content')) {
  1445.                             return;
  1446.                         }
  1447.                         if (!toggle.hasAttribute('data-toggle-original-content')) {
  1448.                             toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);
  1449.                         }
  1450.                         var currentContent = toggle.innerHTML;
  1451.                         var originalContent = toggle.getAttribute('data-toggle-original-content');
  1452.                         var altContent = toggle.getAttribute('data-toggle-alt-content');
  1453.                         toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
  1454.                     });
  1455.                     /* Prevents from disallowing clicks on links inside toggles */
  1456.                     var toggleLinks = toggles[i].querySelectorAll('a');
  1457.                     for (var j = 0; j < toggleLinks.length; j++) {
  1458.                         addEventListener(toggleLinks[j], 'click', function(e) {
  1459.                             e.stopPropagation();
  1460.                         });
  1461.                     }
  1462.                     /* Prevents from disallowing clicks on \"copy to clipboard\" elements inside toggles */
  1463.                     var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]');
  1464.                     for (var k = 0; k < copyToClipboardElements.length; k++) {
  1465.                         addEventListener(copyToClipboardElements[k], 'click', function(e) {
  1466.                             e.stopPropagation();
  1467.                         });
  1468.                     }
  1469.                     toggles[i].setAttribute('data-processed', 'true');
  1470.                 }
  1471.             },
  1472.             initializeLogsTable: function() {
  1473.                 Sfjs.updateLogsTable();
  1474.                 document.querySelectorAll('.log-filter input').forEach((input) => {
  1475.                     input.addEventListener('change', () => { Sfjs.updateLogsTable(); });
  1476.                 });
  1477.                 document.querySelectorAll('.filter-select-all-or-none button').forEach((link) => {
  1478.                     link.addEventListener('click', () => {
  1479.                         const selectAll = link.classList.contains('select-all');
  1480.                         link.closest('.log-filter-content').querySelectorAll('input').forEach((input) => {
  1481.                             input.checked = selectAll;
  1482.                         });
  1483.                         Sfjs.updateLogsTable();
  1484.                     });
  1485.                 });
  1486.                 document.body.addEventListener('click', (event) => {
  1487.                     document.querySelectorAll('details.log-filter').forEach((filterElement) => {
  1488.                         if (!filterElement.contains(event.target) && filterElement.open) {
  1489.                             filterElement.open = false;
  1490.                         }
  1491.                     });
  1492.                 });
  1493.             },
  1494.             updateLogsTable: function() {
  1495.                 const selectedType = document.querySelector('#log-filter-type input:checked').value;
  1496.                 const priorities = document.querySelectorAll('#log-filter-priority input');
  1497.                 const allPriorities = Array.from(priorities).map((input) => input.value);
  1498.                 const selectedPriorities = Array.from(priorities).filter((input) => input.checked).map((input) => input.value);
  1499.                 const channels = document.querySelectorAll('#log-filter-channel input');
  1500.                 const selectedChannels = Array.from(channels).filter((input) => input.checked).map((input) => input.value);
  1501.                 const logs = document.querySelector('table.logs');
  1502.                 if (null === logs) {
  1503.                     return;
  1504.                 }
  1505.                 /* hide rows that don't match the current filters */
  1506.                 let numVisibleRows = 0;
  1507.                 logs.querySelectorAll('tbody tr').forEach((row) => {
  1508.                     if ('all' !== selectedType && selectedType !== row.getAttribute('data-type')) {
  1509.                         row.style.display = 'none';
  1510.                         return;
  1511.                     }
  1512.                     const priority = row.getAttribute('data-priority');
  1513.                     if (false === selectedPriorities.includes(priority) && true === allPriorities.includes(priority)) {
  1514.                         row.style.display = 'none';
  1515.                         return;
  1516.                     }
  1517.                     if ('' !== row.getAttribute('data-channel') && false === selectedChannels.includes(row.getAttribute('data-channel'))) {
  1518.                         row.style.display = 'none';
  1519.                         return;
  1520.                     }
  1521.                     row.style.display = 'table-row';
  1522.                     numVisibleRows++;
  1523.                 });
  1524.                 document.querySelector('table.logs').style.display = 0 === numVisibleRows ? 'none' : 'table';
  1525.                 document.querySelector('.no-logs-message').style.display = 0 === numVisibleRows ? 'block' : 'none';
  1526.                 /* update the selected totals of all filters */
  1527.                 document.querySelector('#log-filter-priority .filter-active-num').innerText = (priorities.length === selectedPriorities.length) ? 'All' : selectedPriorities.length;
  1528.                 document.querySelector('#log-filter-channel .filter-active-num').innerText = (channels.length === selectedChannels.length) ? 'All' : selectedChannels.length;
  1529.                 /* update the currently selected \"log type\" tab */
  1530.                 document.querySelectorAll('#log-filter-type li').forEach((tab) => tab.classList.remove('active'));
  1531.                 document.querySelector(`#log-filter-type input[value=\"\${selectedType}\"]`).parentElement.classList.add('active');
  1532.             },
  1533.         };
  1534.     })();
  1535.     Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
  1536.         Sfjs.createTabs();
  1537.         Sfjs.createToggles();
  1538.     });
  1539. }
  1540. /*]]>*/</script>
  1541. ""@WebProfiler/Profiler/base_js.html.twig""/home/p-a6iu1i/html/hbc-shopware-stage-qcsct/dev/vendor/symfony/web-profiler-bundle/Resources/views/Profiler/base_js.html.twig");
  1542.     }
  1543. }